2013-07-24 07:32:01 +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
|
2014-04-25 00:44:43 +00:00
|
|
|
#include <functional>
|
2013-09-13 10:35:29 +00:00
|
|
|
#include "kernel/expr.h"
|
2013-07-24 07:32:01 +00:00
|
|
|
|
|
|
|
namespace lean {
|
2014-01-28 00:44:43 +00:00
|
|
|
class ro_metavar_env;
|
2014-02-22 19:44:57 +00:00
|
|
|
/** \brief Replace the free variables with indices 0, ..., n-1 with s[0], ..., s[n-1] in e. */
|
2013-12-13 01:47:11 +00:00
|
|
|
expr instantiate(expr const & e, unsigned n, expr const * s);
|
|
|
|
expr instantiate(expr const & e, std::initializer_list<expr> const & l);
|
2014-02-17 23:21:48 +00:00
|
|
|
/** \brief Replace free variable \c i with \c s in \c e. */
|
2013-12-13 01:47:11 +00:00
|
|
|
expr instantiate(expr const & e, unsigned i, expr const & s);
|
2014-02-17 23:21:48 +00:00
|
|
|
/** \brief Replace free variable \c 0 with \c s in \c e. */
|
2013-12-13 01:47:11 +00:00
|
|
|
expr instantiate(expr const & e, expr const & s);
|
|
|
|
|
2014-06-15 17:40:18 +00:00
|
|
|
/** \brief Replace the free variables with indices 0, ..., n-1 with s[n-1], ..., s[0] in e. */
|
|
|
|
expr instantiate_rev(expr const & e, unsigned n, expr const * s);
|
|
|
|
|
2013-12-13 01:47:11 +00:00
|
|
|
expr apply_beta(expr f, unsigned num_args, expr const * args);
|
2013-10-23 22:44:26 +00:00
|
|
|
bool is_head_beta(expr const & t);
|
2013-12-13 01:47:11 +00:00
|
|
|
expr head_beta_reduce(expr const & t);
|
2014-02-25 02:31:38 +00:00
|
|
|
|
2014-08-12 14:38:43 +00:00
|
|
|
/** \brief Instantiate the universe level parameters \c ps occurring in \c e with the levels \c ls.
|
2014-02-25 02:31:38 +00:00
|
|
|
\pre length(ps) == length(ls)
|
|
|
|
*/
|
2014-06-29 19:09:55 +00:00
|
|
|
expr instantiate_univ_params(expr const & e, level_param_names const & ps, levels const & ls);
|
2014-08-12 14:38:43 +00:00
|
|
|
|
|
|
|
class declaration;
|
|
|
|
/** \brief Instantiate the universe level parameters of the type of the given declaration.
|
2015-01-29 01:22:18 +00:00
|
|
|
\pre d.get_num_univ_params() == length(ls)
|
2014-08-12 14:38:43 +00:00
|
|
|
*/
|
|
|
|
expr instantiate_type_univ_params(declaration const & d, levels const & ls);
|
|
|
|
/** \brief Instantiate the universe level parameters of the value of the given declaration.
|
2015-01-29 01:22:18 +00:00
|
|
|
\pre d.get_num_univ_params() == length(ls)
|
2014-08-12 14:38:43 +00:00
|
|
|
*/
|
|
|
|
expr instantiate_value_univ_params(declaration const & d, levels const & ls);
|
2013-07-24 07:32:01 +00:00
|
|
|
}
|