2013-12-03 20:21:21 +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 "util/lua.h"
|
|
|
|
#include "util/splay_map.h"
|
|
|
|
#include "util/name.h"
|
|
|
|
#include "kernel/expr.h"
|
2013-12-13 01:47:11 +00:00
|
|
|
#include "kernel/metavar.h"
|
2013-12-03 20:21:21 +00:00
|
|
|
|
|
|
|
namespace lean {
|
|
|
|
/**
|
|
|
|
\brief Simpler version of metavar_env.
|
|
|
|
It is used in fo_unify
|
|
|
|
*/
|
|
|
|
typedef splay_map<name, expr, name_quick_cmp> substitution;
|
|
|
|
/**
|
|
|
|
\brief Apply substitution \c s to \c e
|
|
|
|
*/
|
2013-12-13 01:47:11 +00:00
|
|
|
expr apply(substitution & s, expr const & e, optional<metavar_env> const & menv = none_menv());
|
|
|
|
inline expr apply(substitution & s, expr const & e, metavar_env const & menv) { return apply(s, e, some_menv(menv)); }
|
|
|
|
|
2013-12-03 20:21:21 +00:00
|
|
|
expr find(substitution & s, expr e);
|
|
|
|
UDATA_DEFS_CORE(substitution)
|
|
|
|
void open_substitution(lua_State * L);
|
|
|
|
}
|