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-05-16 18:52:43 +00:00
|
|
|
/** \brief Replace free variable \c i with \c s in the telescope t. */
|
|
|
|
telescope instantiate(telescope const & t, unsigned i, expr const & s);
|
|
|
|
/** \brief Replace free variable \c 0 with \c s in the telescope t. */
|
|
|
|
telescope instantiate(telescope const & t, 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);
|
|
|
|
expr beta_reduce(expr t);
|
2014-02-25 02:31:38 +00:00
|
|
|
|
|
|
|
/**
|
|
|
|
\brief Instantiate the universe level parameters \c ps occurring in \c e with the levels \c ls.
|
|
|
|
|
|
|
|
\pre length(ps) == length(ls)
|
|
|
|
*/
|
2014-05-16 18:13:50 +00:00
|
|
|
expr instantiate_params(expr const & e, level_param_names const & ps, levels const & ls);
|
2013-07-24 07:32:01 +00:00
|
|
|
}
|