Use consistent names for import functions, and library files.
Signed-off-by: Leonardo de Moura <leonardo@microsoft.com>
This commit is contained in:
parent
070c87bef0
commit
0c09e4524a
9 changed files with 13 additions and 13 deletions
|
@ -7,7 +7,7 @@ Author: Leonardo de Moura
|
||||||
#include "kernel/builtin.h"
|
#include "kernel/builtin.h"
|
||||||
#include "library/basic_thms.h"
|
#include "library/basic_thms.h"
|
||||||
#include "library/arith/arith.h"
|
#include "library/arith/arith.h"
|
||||||
#include "library/cast/castlib.h"
|
#include "library/cast/cast.h"
|
||||||
#include "frontends/lean/frontend.h"
|
#include "frontends/lean/frontend.h"
|
||||||
|
|
||||||
namespace lean {
|
namespace lean {
|
||||||
|
|
|
@ -159,7 +159,7 @@ MK_CONSTANT(subst_fn, name("Subst"));
|
||||||
MK_CONSTANT(eta_fn, name("Eta"));
|
MK_CONSTANT(eta_fn, name("Eta"));
|
||||||
MK_CONSTANT(imp_antisym_fn, name("ImpAntisym"));
|
MK_CONSTANT(imp_antisym_fn, name("ImpAntisym"));
|
||||||
|
|
||||||
void import_basiclib(environment & env) {
|
void import_basic(environment & env) {
|
||||||
env.add_uvar(uvar_name(m_lvl), level() + LEAN_DEFAULT_LEVEL_SEPARATION);
|
env.add_uvar(uvar_name(m_lvl), level() + LEAN_DEFAULT_LEVEL_SEPARATION);
|
||||||
env.add_uvar(uvar_name(u_lvl), m_lvl + LEAN_DEFAULT_LEVEL_SEPARATION);
|
env.add_uvar(uvar_name(u_lvl), m_lvl + LEAN_DEFAULT_LEVEL_SEPARATION);
|
||||||
|
|
||||||
|
|
|
@ -150,7 +150,7 @@ inline expr ImpAntisym(expr const & a, expr const & b, expr const & H1, expr con
|
||||||
|
|
||||||
class environment;
|
class environment;
|
||||||
/** \brief Initialize the environment with basic builtin declarations and axioms */
|
/** \brief Initialize the environment with basic builtin declarations and axioms */
|
||||||
void import_basiclib(environment & env);
|
void import_basic(environment & env);
|
||||||
|
|
||||||
/**
|
/**
|
||||||
\brief Helper macro for defining constants such as bool_type, int_type, int_add, etc.
|
\brief Helper macro for defining constants such as bool_type, int_type, int_add, etc.
|
||||||
|
|
|
@ -47,7 +47,7 @@ MK_CONSTANT(domain_inj_fn, name("domain_inj"));
|
||||||
MK_CONSTANT(range_inj_fn, name("range_inj"));
|
MK_CONSTANT(range_inj_fn, name("range_inj"));
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
void import_basicthms(environment & env) {
|
void import_basic_thms(environment & env) {
|
||||||
expr A = Const("A");
|
expr A = Const("A");
|
||||||
expr a = Const("a");
|
expr a = Const("a");
|
||||||
expr b = Const("b");
|
expr b = Const("b");
|
||||||
|
|
|
@ -121,7 +121,7 @@ expr mk_forall_elim_fn();
|
||||||
inline expr ForallElim(expr const & A, expr const & P, expr const & H, expr const & a) { return mk_app(mk_forall_elim_fn(), A, P, H, a); }
|
inline expr ForallElim(expr const & A, expr const & P, expr const & H, expr const & a) { return mk_app(mk_forall_elim_fn(), A, P, H, a); }
|
||||||
|
|
||||||
/** \brief Add basic theorems to Environment */
|
/** \brief Add basic theorems to Environment */
|
||||||
void import_basicthms(environment & env);
|
void import_basic_thms(environment & env);
|
||||||
|
|
||||||
#if 0
|
#if 0
|
||||||
expr mk_ext_fn();
|
expr mk_ext_fn();
|
||||||
|
|
|
@ -1,2 +1,2 @@
|
||||||
add_library(castlib castlib.cpp)
|
add_library(castlib cast.cpp)
|
||||||
target_link_libraries(castlib ${LEAN_LIBS})
|
target_link_libraries(castlib ${LEAN_LIBS})
|
||||||
|
|
|
@ -8,7 +8,7 @@ Author: Leonardo de Moura
|
||||||
#include "kernel/abstract.h"
|
#include "kernel/abstract.h"
|
||||||
#include "kernel/builtin.h"
|
#include "kernel/builtin.h"
|
||||||
#include "library/basic_thms.h"
|
#include "library/basic_thms.h"
|
||||||
#include "library/cast/castlib.h"
|
#include "library/cast/cast.h"
|
||||||
|
|
||||||
namespace lean {
|
namespace lean {
|
||||||
// Cast builtin operator
|
// Cast builtin operator
|
||||||
|
@ -104,7 +104,7 @@ MK_CONSTANT(cast_fn, name("cast"));
|
||||||
MK_CONSTANT(dom_inj_fn, name("DomInj"));
|
MK_CONSTANT(dom_inj_fn, name("DomInj"));
|
||||||
MK_CONSTANT(ran_inj_fn, name("RanInj"));
|
MK_CONSTANT(ran_inj_fn, name("RanInj"));
|
||||||
|
|
||||||
void import_castlib(environment & env) {
|
void import_cast(environment & env) {
|
||||||
if (env.find_object(to_value(mk_Cast_fn()).get_name()))
|
if (env.find_object(to_value(mk_Cast_fn()).get_name()))
|
||||||
return;
|
return;
|
||||||
expr x = Const("x");
|
expr x = Const("x");
|
|
@ -41,5 +41,5 @@ inline expr RanInj(expr const & A, expr const & Ap, expr const & B, expr const &
|
||||||
|
|
||||||
class environment;
|
class environment;
|
||||||
/** \brief Import type "casting" library */
|
/** \brief Import type "casting" library */
|
||||||
void import_castlib(environment & env);
|
void import_cast(environment & env);
|
||||||
}
|
}
|
|
@ -7,14 +7,14 @@ Author: Leonardo de Moura
|
||||||
#include "kernel/builtin.h"
|
#include "kernel/builtin.h"
|
||||||
#include "library/basic_thms.h"
|
#include "library/basic_thms.h"
|
||||||
#include "library/arith/arith.h"
|
#include "library/arith/arith.h"
|
||||||
#include "library/cast/castlib.h"
|
#include "library/cast/cast.h"
|
||||||
#include "library/import_all/import_all.h"
|
#include "library/import_all/import_all.h"
|
||||||
|
|
||||||
namespace lean {
|
namespace lean {
|
||||||
void import_all(environment & env) {
|
void import_all(environment & env) {
|
||||||
import_basiclib(env);
|
import_basic(env);
|
||||||
import_basicthms(env);
|
import_basic_thms(env);
|
||||||
import_castlib(env);
|
import_cast(env);
|
||||||
import_arith(env);
|
import_arith(env);
|
||||||
}
|
}
|
||||||
environment mk_toplevel() {
|
environment mk_toplevel() {
|
||||||
|
|
Loading…
Reference in a new issue