2013-09-13 01:25:38 +00:00
|
|
|
/*
|
|
|
|
Copyright (c) 2013 Microsoft Corporation. All rights reserved.
|
|
|
|
Released under Apache 2.0 license as described in the file LICENSE.
|
|
|
|
|
|
|
|
Author: Leonardo de Moura
|
|
|
|
*/
|
|
|
|
#pragma once
|
|
|
|
#include "kernel/expr.h"
|
2013-09-17 18:09:59 +00:00
|
|
|
#include "kernel/expr_maps.h"
|
2013-09-13 01:25:38 +00:00
|
|
|
|
|
|
|
namespace lean {
|
2013-10-02 00:25:17 +00:00
|
|
|
class metavar_env;
|
2013-09-13 01:25:38 +00:00
|
|
|
/**
|
|
|
|
\brief Return a new placeholder expression. To be able to track location,
|
|
|
|
a new constant for each placeholder.
|
|
|
|
*/
|
2013-12-02 16:46:47 +00:00
|
|
|
expr mk_placeholder();
|
2013-09-13 01:25:38 +00:00
|
|
|
|
|
|
|
/**
|
|
|
|
\brief Return true iff the given expression is a placeholder.
|
|
|
|
*/
|
|
|
|
bool is_placeholder(expr const & e);
|
|
|
|
|
|
|
|
/**
|
|
|
|
\brief Return true iff the given expression contains placeholders.
|
|
|
|
*/
|
|
|
|
bool has_placeholder(expr const & e);
|
2013-09-17 18:09:59 +00:00
|
|
|
|
|
|
|
/**
|
2013-10-02 00:25:17 +00:00
|
|
|
\brief Replace the placeholders in \c e with fresh metavariables from \c menv.
|
|
|
|
if \c new2old is not nullptr, then for each new expression \c t created based on
|
|
|
|
\c s, we store <tt>(*new2old)[t] = s</tt>.
|
2013-09-17 18:09:59 +00:00
|
|
|
*/
|
2013-10-02 00:25:17 +00:00
|
|
|
expr replace_placeholders_with_metavars(expr const & e, metavar_env & menv, expr_map<expr> * new2old = nullptr);
|
2013-09-13 01:25:38 +00:00
|
|
|
}
|