refactor(kernel): add error msg formatters, remove unnecessary files, add new type_checker interface
Signed-off-by: Leonardo de Moura <leonardo@microsoft.com>
This commit is contained in:
parent
916301bdfb
commit
ddbb3a7944
8 changed files with 151 additions and 1078 deletions
|
@ -3,9 +3,7 @@ for_each_fn.cpp occurs.cpp replace_fn.cpp free_vars.cpp abstract.cpp
|
|||
instantiate.cpp context.cpp formatter.cpp max_sharing.cpp kernel_exception.cpp
|
||||
object.cpp environment.cpp replace_visitor.cpp io_state.cpp
|
||||
normalizer.cpp justification.cpp pos_info_provider.cpp metavar.cpp
|
||||
constraint.cpp
|
||||
# type_checker.cpp
|
||||
# type_checker_justification.cpp
|
||||
constraint.cpp type_checker.cpp error_msgs.cpp
|
||||
)
|
||||
|
||||
target_link_libraries(kernel ${LEAN_LIBS})
|
||||
|
|
58
src/kernel/error_msgs.cpp
Normal file
58
src/kernel/error_msgs.cpp
Normal file
|
@ -0,0 +1,58 @@
|
|||
/*
|
||||
Copyright (c) 2014 Microsoft Corporation. All rights reserved.
|
||||
Released under Apache 2.0 license as described in the file LICENSE.
|
||||
|
||||
Author: Leonardo de Moura
|
||||
*/
|
||||
#include "kernel/error_msgs.h"
|
||||
|
||||
namespace lean {
|
||||
static format pp_indent_expr(formatter const & fmt, options const & opts, expr const & e) {
|
||||
return nest(get_pp_indent(opts), compose(line(), fmt(e, opts)));
|
||||
}
|
||||
|
||||
format pp_type_expected(formatter const & fmt, options const & opts, expr const & e) {
|
||||
return compose(format("type expected at"), pp_indent_expr(fmt, opts, e));
|
||||
}
|
||||
|
||||
format pp_function_expected(formatter const & fmt, options const & opts, expr const & e) {
|
||||
return compose(format("function expected at"), pp_indent_expr(fmt, opts, e));
|
||||
}
|
||||
|
||||
format pp_pair_expected(formatter const & fmt, options const & opts, expr const & e) {
|
||||
return compose(format("pair expected at"), pp_indent_expr(fmt, opts, e));
|
||||
}
|
||||
|
||||
format pp_app_type_mismatch(formatter const & fmt, options const & opts, expr const & app,
|
||||
expr const & expected_type, expr const & given_type) {
|
||||
format r;
|
||||
r += format("type mismatch at application");
|
||||
r += pp_indent_expr(fmt, opts, app);
|
||||
r += format("expected type:");
|
||||
r += pp_indent_expr(fmt, opts, expected_type);
|
||||
r += format("given type:");
|
||||
r += pp_indent_expr(fmt, opts, given_type);
|
||||
return r;
|
||||
}
|
||||
|
||||
format pp_proj_type_mismatch(formatter const & fmt, options const & opts, expr const & proj,
|
||||
expr const & arg_type) {
|
||||
format r;
|
||||
r += format("type mismatch at projection");
|
||||
r += pp_indent_expr(fmt, opts, proj);
|
||||
r += format("pair expected, given type:");
|
||||
r += pp_indent_expr(fmt, opts, arg_type);
|
||||
return r;
|
||||
}
|
||||
|
||||
format pp_def_type_mismatch(formatter const & fmt, options const & opts, name const & n,
|
||||
expr const & expected_type, expr const & given_type) {
|
||||
format r("type mismatch at definition '");
|
||||
r += format(n);
|
||||
r += format("', expected type");
|
||||
r += pp_indent_expr(fmt, opts, expected_type);
|
||||
r += compose(line(), format("given type:"));
|
||||
r += pp_indent_expr(fmt, opts, given_type);
|
||||
return r;
|
||||
}
|
||||
}
|
20
src/kernel/error_msgs.h
Normal file
20
src/kernel/error_msgs.h
Normal file
|
@ -0,0 +1,20 @@
|
|||
/*
|
||||
Copyright (c) 2014 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"
|
||||
#include "kernel/formatter.h"
|
||||
namespace lean {
|
||||
format pp_type_expected(formatter const & fmt, options const & opts, expr const & e);
|
||||
format pp_function_expected(formatter const & fmt, options const & opts, expr const & e);
|
||||
format pp_pair_expected(formatter const & fmt, options const & opts, expr const & e);
|
||||
format pp_app_type_mismatch(formatter const & fmt, options const & opts, expr const & app,
|
||||
expr const & expected_type, expr const & given_type);
|
||||
format pp_proj_type_mismatch(formatter const & fmt, options const & opts, expr const & proj,
|
||||
expr const & arg_type);
|
||||
format pp_def_type_mismatch(formatter const & fmt, options const & opts, name const & n,
|
||||
expr const & expected_type, expr const & given_type);
|
||||
}
|
|
@ -1,222 +0,0 @@
|
|||
/*
|
||||
Copyright (c) 2013 Microsoft Corporation. All rights reserved.
|
||||
Released under Apache 2.0 license as described in the file LICENSE.
|
||||
*/
|
||||
// Automatically generated file, DO NOT EDIT
|
||||
#include "kernel/environment.h"
|
||||
#include "kernel/decl_macros.h"
|
||||
namespace lean {
|
||||
MK_CONSTANT(TypeU, name("TypeU"));
|
||||
MK_CONSTANT(Bool, name("Bool"));
|
||||
MK_CONSTANT(hrefl_fn, name("hrefl"));
|
||||
MK_CONSTANT(eq_fn, name("eq"));
|
||||
MK_CONSTANT(refl_fn, name("refl"));
|
||||
MK_CONSTANT(heq_eq_fn, name("heq_eq"));
|
||||
MK_CONSTANT(true, name("true"));
|
||||
MK_CONSTANT(trivial, name("trivial"));
|
||||
MK_CONSTANT(false, name("false"));
|
||||
MK_CONSTANT(not_fn, name("not"));
|
||||
MK_CONSTANT(or_fn, name("or"));
|
||||
MK_CONSTANT(and_fn, name("and"));
|
||||
MK_CONSTANT(implies_fn, name("implies"));
|
||||
MK_CONSTANT(neq_fn, name("neq"));
|
||||
MK_CONSTANT(a_neq_a_elim_fn, name("a_neq_a_elim"));
|
||||
MK_CONSTANT(iff_fn, name("iff"));
|
||||
MK_CONSTANT(not_intro_fn, name("not_intro"));
|
||||
MK_CONSTANT(absurd_fn, name("absurd"));
|
||||
MK_CONSTANT(exists_fn, name("exists"));
|
||||
MK_CONSTANT(exists_unique_fn, name("exists_unique"));
|
||||
MK_CONSTANT(false_elim_fn, name("false_elim"));
|
||||
MK_CONSTANT(mt_fn, name("mt"));
|
||||
MK_CONSTANT(contrapos_fn, name("contrapos"));
|
||||
MK_CONSTANT(absurd_elim_fn, name("absurd_elim"));
|
||||
MK_CONSTANT(or_introl_fn, name("or_introl"));
|
||||
MK_CONSTANT(or_intror_fn, name("or_intror"));
|
||||
MK_CONSTANT(or_elim_fn, name("or_elim"));
|
||||
MK_CONSTANT(resolve1_fn, name("resolve1"));
|
||||
MK_CONSTANT(resolve2_fn, name("resolve2"));
|
||||
MK_CONSTANT(or_flip_fn, name("or_flip"));
|
||||
MK_CONSTANT(and_intro_fn, name("and_intro"));
|
||||
MK_CONSTANT(and_eliml_fn, name("and_eliml"));
|
||||
MK_CONSTANT(and_elimr_fn, name("and_elimr"));
|
||||
MK_CONSTANT(subst_fn, name("subst"));
|
||||
MK_CONSTANT(substp_fn, name("substp"));
|
||||
MK_CONSTANT(symm_fn, name("symm"));
|
||||
MK_CONSTANT(trans_fn, name("trans"));
|
||||
MK_CONSTANT(hcongr1_fn, name("hcongr1"));
|
||||
MK_CONSTANT(congr1_fn, name("congr1"));
|
||||
MK_CONSTANT(congr2_fn, name("congr2"));
|
||||
MK_CONSTANT(congr_fn, name("congr"));
|
||||
MK_CONSTANT(true_ne_false, name("true_ne_false"));
|
||||
MK_CONSTANT(absurd_not_true_fn, name("absurd_not_true"));
|
||||
MK_CONSTANT(not_false_trivial, name("not_false_trivial"));
|
||||
MK_CONSTANT(eqmp_fn, name("eqmp"));
|
||||
MK_CONSTANT(eqmpr_fn, name("eqmpr"));
|
||||
MK_CONSTANT(imp_trans_fn, name("imp_trans"));
|
||||
MK_CONSTANT(imp_eq_trans_fn, name("imp_eq_trans"));
|
||||
MK_CONSTANT(eq_imp_trans_fn, name("eq_imp_trans"));
|
||||
MK_CONSTANT(to_eq_fn, name("to_eq"));
|
||||
MK_CONSTANT(to_heq_fn, name("to_heq"));
|
||||
MK_CONSTANT(iff_eliml_fn, name("iff_eliml"));
|
||||
MK_CONSTANT(iff_elimr_fn, name("iff_elimr"));
|
||||
MK_CONSTANT(ne_symm_fn, name("ne_symm"));
|
||||
MK_CONSTANT(eq_ne_trans_fn, name("eq_ne_trans"));
|
||||
MK_CONSTANT(ne_eq_trans_fn, name("ne_eq_trans"));
|
||||
MK_CONSTANT(eqt_elim_fn, name("eqt_elim"));
|
||||
MK_CONSTANT(eqf_elim_fn, name("eqf_elim"));
|
||||
MK_CONSTANT(heqt_elim_fn, name("heqt_elim"));
|
||||
MK_CONSTANT(boolcomplete_fn, name("boolcomplete"));
|
||||
MK_CONSTANT(case_fn, name("case"));
|
||||
MK_CONSTANT(em_fn, name("em"));
|
||||
MK_CONSTANT(boolcomplete_swapped_fn, name("boolcomplete_swapped"));
|
||||
MK_CONSTANT(not_true, name("not_true"));
|
||||
MK_CONSTANT(not_false, name("not_false"));
|
||||
MK_CONSTANT(not_not_eq_fn, name("not_not_eq"));
|
||||
MK_CONSTANT(not_neq_fn, name("not_neq"));
|
||||
MK_CONSTANT(not_neq_elim_fn, name("not_neq_elim"));
|
||||
MK_CONSTANT(not_not_elim_fn, name("not_not_elim"));
|
||||
MK_CONSTANT(not_imp_eliml_fn, name("not_imp_eliml"));
|
||||
MK_CONSTANT(not_imp_elimr_fn, name("not_imp_elimr"));
|
||||
MK_CONSTANT(boolext_fn, name("boolext"));
|
||||
MK_CONSTANT(iff_intro_fn, name("iff_intro"));
|
||||
MK_CONSTANT(eqt_intro_fn, name("eqt_intro"));
|
||||
MK_CONSTANT(eqf_intro_fn, name("eqf_intro"));
|
||||
MK_CONSTANT(by_contradiction_fn, name("by_contradiction"));
|
||||
MK_CONSTANT(a_neq_a_fn, name("a_neq_a"));
|
||||
MK_CONSTANT(eq_id_fn, name("eq_id"));
|
||||
MK_CONSTANT(iff_id_fn, name("iff_id"));
|
||||
MK_CONSTANT(heq_id_fn, name("heq_id"));
|
||||
MK_CONSTANT(neq_elim_fn, name("neq_elim"));
|
||||
MK_CONSTANT(neq_to_not_eq_fn, name("neq_to_not_eq"));
|
||||
MK_CONSTANT(left_comm_fn, name("left_comm"));
|
||||
MK_CONSTANT(or_comm_fn, name("or_comm"));
|
||||
MK_CONSTANT(or_assoc_fn, name("or_assoc"));
|
||||
MK_CONSTANT(or_id_fn, name("or_id"));
|
||||
MK_CONSTANT(or_falsel_fn, name("or_falsel"));
|
||||
MK_CONSTANT(or_falser_fn, name("or_falser"));
|
||||
MK_CONSTANT(or_truel_fn, name("or_truel"));
|
||||
MK_CONSTANT(or_truer_fn, name("or_truer"));
|
||||
MK_CONSTANT(or_tauto_fn, name("or_tauto"));
|
||||
MK_CONSTANT(or_left_comm_fn, name("or_left_comm"));
|
||||
MK_CONSTANT(and_comm_fn, name("and_comm"));
|
||||
MK_CONSTANT(and_id_fn, name("and_id"));
|
||||
MK_CONSTANT(and_assoc_fn, name("and_assoc"));
|
||||
MK_CONSTANT(and_truer_fn, name("and_truer"));
|
||||
MK_CONSTANT(and_truel_fn, name("and_truel"));
|
||||
MK_CONSTANT(and_falsel_fn, name("and_falsel"));
|
||||
MK_CONSTANT(and_falser_fn, name("and_falser"));
|
||||
MK_CONSTANT(and_absurd_fn, name("and_absurd"));
|
||||
MK_CONSTANT(and_left_comm_fn, name("and_left_comm"));
|
||||
MK_CONSTANT(imp_truer_fn, name("imp_truer"));
|
||||
MK_CONSTANT(imp_truel_fn, name("imp_truel"));
|
||||
MK_CONSTANT(imp_falser_fn, name("imp_falser"));
|
||||
MK_CONSTANT(imp_falsel_fn, name("imp_falsel"));
|
||||
MK_CONSTANT(imp_id_fn, name("imp_id"));
|
||||
MK_CONSTANT(imp_or_fn, name("imp_or"));
|
||||
MK_CONSTANT(or_imp_fn, name("or_imp"));
|
||||
MK_CONSTANT(not_congr_fn, name("not_congr"));
|
||||
MK_CONSTANT(exists_elim_fn, name("exists_elim"));
|
||||
MK_CONSTANT(exists_intro_fn, name("exists_intro"));
|
||||
MK_CONSTANT(not_exists_fn, name("not_exists"));
|
||||
MK_CONSTANT(not_exists_elim_fn, name("not_exists_elim"));
|
||||
MK_CONSTANT(exists_unfold1_fn, name("exists_unfold1"));
|
||||
MK_CONSTANT(exists_unfold2_fn, name("exists_unfold2"));
|
||||
MK_CONSTANT(exists_unfold_fn, name("exists_unfold"));
|
||||
MK_CONSTANT(inhabited_fn, name("inhabited"));
|
||||
MK_CONSTANT(inhabited_intro_fn, name("inhabited_intro"));
|
||||
MK_CONSTANT(inhabited_elim_fn, name("inhabited_elim"));
|
||||
MK_CONSTANT(inhabited_ex_intro_fn, name("inhabited_ex_intro"));
|
||||
MK_CONSTANT(inhabited_range_fn, name("inhabited_range"));
|
||||
MK_CONSTANT(exists_rem_fn, name("exists_rem"));
|
||||
MK_CONSTANT(forall_rem_fn, name("forall_rem"));
|
||||
MK_CONSTANT(not_and_fn, name("not_and"));
|
||||
MK_CONSTANT(not_and_elim_fn, name("not_and_elim"));
|
||||
MK_CONSTANT(not_or_fn, name("not_or"));
|
||||
MK_CONSTANT(not_or_elim_fn, name("not_or_elim"));
|
||||
MK_CONSTANT(not_implies_fn, name("not_implies"));
|
||||
MK_CONSTANT(and_imp_fn, name("and_imp"));
|
||||
MK_CONSTANT(not_implies_elim_fn, name("not_implies_elim"));
|
||||
MK_CONSTANT(a_eq_not_a_fn, name("a_eq_not_a"));
|
||||
MK_CONSTANT(a_iff_not_a_fn, name("a_iff_not_a"));
|
||||
MK_CONSTANT(true_eq_false, name("true_eq_false"));
|
||||
MK_CONSTANT(true_iff_false, name("true_iff_false"));
|
||||
MK_CONSTANT(false_eq_true, name("false_eq_true"));
|
||||
MK_CONSTANT(false_iff_true, name("false_iff_true"));
|
||||
MK_CONSTANT(a_iff_true_fn, name("a_iff_true"));
|
||||
MK_CONSTANT(a_iff_false_fn, name("a_iff_false"));
|
||||
MK_CONSTANT(not_iff_fn, name("not_iff"));
|
||||
MK_CONSTANT(not_iff_elim_fn, name("not_iff_elim"));
|
||||
MK_CONSTANT(imp_congrr_fn, name("imp_congrr"));
|
||||
MK_CONSTANT(imp_congrl_fn, name("imp_congrl"));
|
||||
MK_CONSTANT(imp_congr_fn, name("imp_congr"));
|
||||
MK_CONSTANT(or_congrr_fn, name("or_congrr"));
|
||||
MK_CONSTANT(or_congrl_fn, name("or_congrl"));
|
||||
MK_CONSTANT(or_congr_fn, name("or_congr"));
|
||||
MK_CONSTANT(and_congrr_fn, name("and_congrr"));
|
||||
MK_CONSTANT(and_congrl_fn, name("and_congrl"));
|
||||
MK_CONSTANT(and_congr_fn, name("and_congr"));
|
||||
MK_CONSTANT(forall_or_distributer_fn, name("forall_or_distributer"));
|
||||
MK_CONSTANT(forall_or_distributel_fn, name("forall_or_distributel"));
|
||||
MK_CONSTANT(forall_and_distribute_fn, name("forall_and_distribute"));
|
||||
MK_CONSTANT(exists_and_distributer_fn, name("exists_and_distributer"));
|
||||
MK_CONSTANT(exists_or_distribute_fn, name("exists_or_distribute"));
|
||||
MK_CONSTANT(eq_exists_intro_fn, name("eq_exists_intro"));
|
||||
MK_CONSTANT(not_forall_fn, name("not_forall"));
|
||||
MK_CONSTANT(not_forall_elim_fn, name("not_forall_elim"));
|
||||
MK_CONSTANT(exists_and_distributel_fn, name("exists_and_distributel"));
|
||||
MK_CONSTANT(exists_imp_distribute_fn, name("exists_imp_distribute"));
|
||||
MK_CONSTANT(forall_uninhabited_fn, name("forall_uninhabited"));
|
||||
MK_CONSTANT(allext_fn, name("allext"));
|
||||
MK_CONSTANT(proj1_congr_fn, name("proj1_congr"));
|
||||
MK_CONSTANT(proj2_congr_fn, name("proj2_congr"));
|
||||
MK_CONSTANT(hproj2_congr_fn, name("hproj2_congr"));
|
||||
MK_CONSTANT(funext_fn, name("funext"));
|
||||
MK_CONSTANT(eta_fn, name("eta"));
|
||||
MK_CONSTANT(eps_fn, name("eps"));
|
||||
MK_CONSTANT(eps_ax_fn, name("eps_ax"));
|
||||
MK_CONSTANT(eps_th_fn, name("eps_th"));
|
||||
MK_CONSTANT(eps_singleton_fn, name("eps_singleton"));
|
||||
MK_CONSTANT(inhabited_dfun_fn, name("inhabited_dfun"));
|
||||
MK_CONSTANT(inhabited_fun_fn, name("inhabited_fun"));
|
||||
MK_CONSTANT(exists_to_eps_fn, name("exists_to_eps"));
|
||||
MK_CONSTANT(axiom_of_choice_fn, name("axiom_of_choice"));
|
||||
MK_CONSTANT(skolem_th_fn, name("skolem_th"));
|
||||
MK_CONSTANT(ite_fn, name("ite"));
|
||||
MK_CONSTANT(if_true_fn, name("if_true"));
|
||||
MK_CONSTANT(if_false_fn, name("if_false"));
|
||||
MK_CONSTANT(if_a_a_fn, name("if_a_a"));
|
||||
MK_CONSTANT(if_congr_fn, name("if_congr"));
|
||||
MK_CONSTANT(if_imp_then_fn, name("if_imp_then"));
|
||||
MK_CONSTANT(if_imp_else_fn, name("if_imp_else"));
|
||||
MK_CONSTANT(app_if_distribute_fn, name("app_if_distribute"));
|
||||
MK_CONSTANT(eq_if_distributer_fn, name("eq_if_distributer"));
|
||||
MK_CONSTANT(eq_if_distributel_fn, name("eq_if_distributel"));
|
||||
MK_CONSTANT(injective_fn, name("injective"));
|
||||
MK_CONSTANT(non_surjective_fn, name("non_surjective"));
|
||||
MK_CONSTANT(ind, name("ind"));
|
||||
MK_CONSTANT(infinity, name("infinity"));
|
||||
MK_CONSTANT(pairext_fn, name("pairext"));
|
||||
MK_CONSTANT(pair_proj_eq_fn, name("pair_proj_eq"));
|
||||
MK_CONSTANT(pair_congr_fn, name("pair_congr"));
|
||||
MK_CONSTANT(pairext_proj_fn, name("pairext_proj"));
|
||||
MK_CONSTANT(hpairext_proj_fn, name("hpairext_proj"));
|
||||
MK_CONSTANT(cast_fn, name("cast"));
|
||||
MK_CONSTANT(cast_heq_fn, name("cast_heq"));
|
||||
MK_CONSTANT(hsubst_fn, name("hsubst"));
|
||||
MK_CONSTANT(hsymm_fn, name("hsymm"));
|
||||
MK_CONSTANT(htrans_fn, name("htrans"));
|
||||
MK_CONSTANT(hcongr_fn, name("hcongr"));
|
||||
MK_CONSTANT(hfunext_fn, name("hfunext"));
|
||||
MK_CONSTANT(hpiext_fn, name("hpiext"));
|
||||
MK_CONSTANT(hsigext_fn, name("hsigext"));
|
||||
MK_CONSTANT(hallext_fn, name("hallext"));
|
||||
MK_CONSTANT(hsfunext_fn, name("hsfunext"));
|
||||
MK_CONSTANT(heq_congr_fn, name("heq_congr"));
|
||||
MK_CONSTANT(hheq_congr_fn, name("hheq_congr"));
|
||||
MK_CONSTANT(type_eq_fn, name("type_eq"));
|
||||
MK_CONSTANT(cast_eq_fn, name("cast_eq"));
|
||||
MK_CONSTANT(cast_trans_fn, name("cast_trans"));
|
||||
MK_CONSTANT(cast_pull_fn, name("cast_pull"));
|
||||
MK_CONSTANT(proof_irrel_fn, name("proof_irrel"));
|
||||
MK_CONSTANT(hproof_irrel_fn, name("hproof_irrel"));
|
||||
}
|
|
@ -1,647 +0,0 @@
|
|||
/*
|
||||
Copyright (c) 2013 Microsoft Corporation. All rights reserved.
|
||||
Released under Apache 2.0 license as described in the file LICENSE.
|
||||
*/
|
||||
// Automatically generated file, DO NOT EDIT
|
||||
#include "kernel/expr.h"
|
||||
namespace lean {
|
||||
expr mk_TypeU();
|
||||
bool is_TypeU(expr const & e);
|
||||
expr mk_Bool();
|
||||
bool is_Bool(expr const & e);
|
||||
expr mk_hrefl_fn();
|
||||
bool is_hrefl_fn(expr const & e);
|
||||
inline expr mk_hrefl_th(expr const & e1, expr const & e2) { return mk_app({mk_hrefl_fn(), e1, e2}); }
|
||||
expr mk_eq_fn();
|
||||
bool is_eq_fn(expr const & e);
|
||||
inline bool is_eq(expr const & e) { return is_app(e) && is_eq_fn(arg(e, 0)) && num_args(e) == 4; }
|
||||
inline expr mk_eq(expr const & e1, expr const & e2, expr const & e3) { return mk_app({mk_eq_fn(), e1, e2, e3}); }
|
||||
expr mk_refl_fn();
|
||||
bool is_refl_fn(expr const & e);
|
||||
inline expr mk_refl_th(expr const & e1, expr const & e2) { return mk_app({mk_refl_fn(), e1, e2}); }
|
||||
expr mk_heq_eq_fn();
|
||||
bool is_heq_eq_fn(expr const & e);
|
||||
inline expr mk_heq_eq_th(expr const & e1, expr const & e2, expr const & e3) { return mk_app({mk_heq_eq_fn(), e1, e2, e3}); }
|
||||
expr mk_true();
|
||||
bool is_true(expr const & e);
|
||||
expr mk_trivial();
|
||||
bool is_trivial(expr const & e);
|
||||
expr mk_false();
|
||||
bool is_false(expr const & e);
|
||||
expr mk_not_fn();
|
||||
bool is_not_fn(expr const & e);
|
||||
inline bool is_not(expr const & e) { return is_app(e) && is_not_fn(arg(e, 0)) && num_args(e) == 2; }
|
||||
inline expr mk_not(expr const & e1) { return mk_app({mk_not_fn(), e1}); }
|
||||
expr mk_or_fn();
|
||||
bool is_or_fn(expr const & e);
|
||||
inline bool is_or(expr const & e) { return is_app(e) && is_or_fn(arg(e, 0)) && num_args(e) == 3; }
|
||||
inline expr mk_or(expr const & e1, expr const & e2) { return mk_app({mk_or_fn(), e1, e2}); }
|
||||
expr mk_and_fn();
|
||||
bool is_and_fn(expr const & e);
|
||||
inline bool is_and(expr const & e) { return is_app(e) && is_and_fn(arg(e, 0)) && num_args(e) == 3; }
|
||||
inline expr mk_and(expr const & e1, expr const & e2) { return mk_app({mk_and_fn(), e1, e2}); }
|
||||
expr mk_implies_fn();
|
||||
bool is_implies_fn(expr const & e);
|
||||
inline bool is_implies(expr const & e) { return is_app(e) && is_implies_fn(arg(e, 0)) && num_args(e) == 3; }
|
||||
inline expr mk_implies(expr const & e1, expr const & e2) { return mk_app({mk_implies_fn(), e1, e2}); }
|
||||
expr mk_neq_fn();
|
||||
bool is_neq_fn(expr const & e);
|
||||
inline bool is_neq(expr const & e) { return is_app(e) && is_neq_fn(arg(e, 0)) && num_args(e) == 4; }
|
||||
inline expr mk_neq(expr const & e1, expr const & e2, expr const & e3) { return mk_app({mk_neq_fn(), e1, e2, e3}); }
|
||||
expr mk_a_neq_a_elim_fn();
|
||||
bool is_a_neq_a_elim_fn(expr const & e);
|
||||
inline expr mk_a_neq_a_elim_th(expr const & e1, expr const & e2, expr const & e3) { return mk_app({mk_a_neq_a_elim_fn(), e1, e2, e3}); }
|
||||
expr mk_iff_fn();
|
||||
bool is_iff_fn(expr const & e);
|
||||
inline bool is_iff(expr const & e) { return is_app(e) && is_iff_fn(arg(e, 0)) && num_args(e) == 3; }
|
||||
inline expr mk_iff(expr const & e1, expr const & e2) { return mk_app({mk_iff_fn(), e1, e2}); }
|
||||
expr mk_not_intro_fn();
|
||||
bool is_not_intro_fn(expr const & e);
|
||||
inline expr mk_not_intro_th(expr const & e1, expr const & e2) { return mk_app({mk_not_intro_fn(), e1, e2}); }
|
||||
expr mk_absurd_fn();
|
||||
bool is_absurd_fn(expr const & e);
|
||||
inline expr mk_absurd_th(expr const & e1, expr const & e2, expr const & e3) { return mk_app({mk_absurd_fn(), e1, e2, e3}); }
|
||||
expr mk_exists_fn();
|
||||
bool is_exists_fn(expr const & e);
|
||||
inline bool is_exists(expr const & e) { return is_app(e) && is_exists_fn(arg(e, 0)) && num_args(e) == 3; }
|
||||
inline expr mk_exists(expr const & e1, expr const & e2) { return mk_app({mk_exists_fn(), e1, e2}); }
|
||||
expr mk_exists_unique_fn();
|
||||
bool is_exists_unique_fn(expr const & e);
|
||||
inline bool is_exists_unique(expr const & e) { return is_app(e) && is_exists_unique_fn(arg(e, 0)) && num_args(e) == 3; }
|
||||
inline expr mk_exists_unique(expr const & e1, expr const & e2) { return mk_app({mk_exists_unique_fn(), e1, e2}); }
|
||||
expr mk_false_elim_fn();
|
||||
bool is_false_elim_fn(expr const & e);
|
||||
inline expr mk_false_elim_th(expr const & e1, expr const & e2) { return mk_app({mk_false_elim_fn(), e1, e2}); }
|
||||
expr mk_mt_fn();
|
||||
bool is_mt_fn(expr const & e);
|
||||
inline expr mk_mt_th(expr const & e1, expr const & e2, expr const & e3, expr const & e4) { return mk_app({mk_mt_fn(), e1, e2, e3, e4}); }
|
||||
expr mk_contrapos_fn();
|
||||
bool is_contrapos_fn(expr const & e);
|
||||
inline expr mk_contrapos_th(expr const & e1, expr const & e2, expr const & e3, expr const & e4) { return mk_app({mk_contrapos_fn(), e1, e2, e3, e4}); }
|
||||
expr mk_absurd_elim_fn();
|
||||
bool is_absurd_elim_fn(expr const & e);
|
||||
inline expr mk_absurd_elim_th(expr const & e1, expr const & e2, expr const & e3, expr const & e4) { return mk_app({mk_absurd_elim_fn(), e1, e2, e3, e4}); }
|
||||
expr mk_or_introl_fn();
|
||||
bool is_or_introl_fn(expr const & e);
|
||||
inline expr mk_or_introl_th(expr const & e1, expr const & e2, expr const & e3) { return mk_app({mk_or_introl_fn(), e1, e2, e3}); }
|
||||
expr mk_or_intror_fn();
|
||||
bool is_or_intror_fn(expr const & e);
|
||||
inline expr mk_or_intror_th(expr const & e1, expr const & e2, expr const & e3) { return mk_app({mk_or_intror_fn(), e1, e2, e3}); }
|
||||
expr mk_or_elim_fn();
|
||||
bool is_or_elim_fn(expr const & e);
|
||||
inline expr mk_or_elim_th(expr const & e1, expr const & e2, expr const & e3, expr const & e4, expr const & e5, expr const & e6) { return mk_app({mk_or_elim_fn(), e1, e2, e3, e4, e5, e6}); }
|
||||
expr mk_resolve1_fn();
|
||||
bool is_resolve1_fn(expr const & e);
|
||||
inline expr mk_resolve1_th(expr const & e1, expr const & e2, expr const & e3, expr const & e4) { return mk_app({mk_resolve1_fn(), e1, e2, e3, e4}); }
|
||||
expr mk_resolve2_fn();
|
||||
bool is_resolve2_fn(expr const & e);
|
||||
inline expr mk_resolve2_th(expr const & e1, expr const & e2, expr const & e3, expr const & e4) { return mk_app({mk_resolve2_fn(), e1, e2, e3, e4}); }
|
||||
expr mk_or_flip_fn();
|
||||
bool is_or_flip_fn(expr const & e);
|
||||
inline expr mk_or_flip_th(expr const & e1, expr const & e2, expr const & e3) { return mk_app({mk_or_flip_fn(), e1, e2, e3}); }
|
||||
expr mk_and_intro_fn();
|
||||
bool is_and_intro_fn(expr const & e);
|
||||
inline expr mk_and_intro_th(expr const & e1, expr const & e2, expr const & e3, expr const & e4) { return mk_app({mk_and_intro_fn(), e1, e2, e3, e4}); }
|
||||
expr mk_and_eliml_fn();
|
||||
bool is_and_eliml_fn(expr const & e);
|
||||
inline expr mk_and_eliml_th(expr const & e1, expr const & e2, expr const & e3) { return mk_app({mk_and_eliml_fn(), e1, e2, e3}); }
|
||||
expr mk_and_elimr_fn();
|
||||
bool is_and_elimr_fn(expr const & e);
|
||||
inline expr mk_and_elimr_th(expr const & e1, expr const & e2, expr const & e3) { return mk_app({mk_and_elimr_fn(), e1, e2, e3}); }
|
||||
expr mk_subst_fn();
|
||||
bool is_subst_fn(expr const & e);
|
||||
inline expr mk_subst_th(expr const & e1, expr const & e2, expr const & e3, expr const & e4, expr const & e5, expr const & e6) { return mk_app({mk_subst_fn(), e1, e2, e3, e4, e5, e6}); }
|
||||
expr mk_substp_fn();
|
||||
bool is_substp_fn(expr const & e);
|
||||
inline expr mk_substp_th(expr const & e1, expr const & e2, expr const & e3, expr const & e4, expr const & e5, expr const & e6) { return mk_app({mk_substp_fn(), e1, e2, e3, e4, e5, e6}); }
|
||||
expr mk_symm_fn();
|
||||
bool is_symm_fn(expr const & e);
|
||||
inline expr mk_symm_th(expr const & e1, expr const & e2, expr const & e3, expr const & e4) { return mk_app({mk_symm_fn(), e1, e2, e3, e4}); }
|
||||
expr mk_trans_fn();
|
||||
bool is_trans_fn(expr const & e);
|
||||
inline expr mk_trans_th(expr const & e1, expr const & e2, expr const & e3, expr const & e4, expr const & e5, expr const & e6) { return mk_app({mk_trans_fn(), e1, e2, e3, e4, e5, e6}); }
|
||||
expr mk_hcongr1_fn();
|
||||
bool is_hcongr1_fn(expr const & e);
|
||||
inline expr mk_hcongr1_th(expr const & e1, expr const & e2, expr const & e3, expr const & e4, expr const & e5, expr const & e6) { return mk_app({mk_hcongr1_fn(), e1, e2, e3, e4, e5, e6}); }
|
||||
expr mk_congr1_fn();
|
||||
bool is_congr1_fn(expr const & e);
|
||||
inline expr mk_congr1_th(expr const & e1, expr const & e2, expr const & e3, expr const & e4, expr const & e5, expr const & e6) { return mk_app({mk_congr1_fn(), e1, e2, e3, e4, e5, e6}); }
|
||||
expr mk_congr2_fn();
|
||||
bool is_congr2_fn(expr const & e);
|
||||
inline expr mk_congr2_th(expr const & e1, expr const & e2, expr const & e3, expr const & e4, expr const & e5, expr const & e6) { return mk_app({mk_congr2_fn(), e1, e2, e3, e4, e5, e6}); }
|
||||
expr mk_congr_fn();
|
||||
bool is_congr_fn(expr const & e);
|
||||
inline expr mk_congr_th(expr const & e1, expr const & e2, expr const & e3, expr const & e4, expr const & e5, expr const & e6, expr const & e7, expr const & e8) { return mk_app({mk_congr_fn(), e1, e2, e3, e4, e5, e6, e7, e8}); }
|
||||
expr mk_true_ne_false();
|
||||
bool is_true_ne_false(expr const & e);
|
||||
expr mk_absurd_not_true_fn();
|
||||
bool is_absurd_not_true_fn(expr const & e);
|
||||
inline expr mk_absurd_not_true_th(expr const & e1) { return mk_app({mk_absurd_not_true_fn(), e1}); }
|
||||
expr mk_not_false_trivial();
|
||||
bool is_not_false_trivial(expr const & e);
|
||||
expr mk_eqmp_fn();
|
||||
bool is_eqmp_fn(expr const & e);
|
||||
inline expr mk_eqmp_th(expr const & e1, expr const & e2, expr const & e3, expr const & e4) { return mk_app({mk_eqmp_fn(), e1, e2, e3, e4}); }
|
||||
expr mk_eqmpr_fn();
|
||||
bool is_eqmpr_fn(expr const & e);
|
||||
inline expr mk_eqmpr_th(expr const & e1, expr const & e2, expr const & e3, expr const & e4) { return mk_app({mk_eqmpr_fn(), e1, e2, e3, e4}); }
|
||||
expr mk_imp_trans_fn();
|
||||
bool is_imp_trans_fn(expr const & e);
|
||||
inline expr mk_imp_trans_th(expr const & e1, expr const & e2, expr const & e3, expr const & e4, expr const & e5, expr const & e6) { return mk_app({mk_imp_trans_fn(), e1, e2, e3, e4, e5, e6}); }
|
||||
expr mk_imp_eq_trans_fn();
|
||||
bool is_imp_eq_trans_fn(expr const & e);
|
||||
inline expr mk_imp_eq_trans_th(expr const & e1, expr const & e2, expr const & e3, expr const & e4, expr const & e5, expr const & e6) { return mk_app({mk_imp_eq_trans_fn(), e1, e2, e3, e4, e5, e6}); }
|
||||
expr mk_eq_imp_trans_fn();
|
||||
bool is_eq_imp_trans_fn(expr const & e);
|
||||
inline expr mk_eq_imp_trans_th(expr const & e1, expr const & e2, expr const & e3, expr const & e4, expr const & e5, expr const & e6) { return mk_app({mk_eq_imp_trans_fn(), e1, e2, e3, e4, e5, e6}); }
|
||||
expr mk_to_eq_fn();
|
||||
bool is_to_eq_fn(expr const & e);
|
||||
inline expr mk_to_eq_th(expr const & e1, expr const & e2, expr const & e3, expr const & e4) { return mk_app({mk_to_eq_fn(), e1, e2, e3, e4}); }
|
||||
expr mk_to_heq_fn();
|
||||
bool is_to_heq_fn(expr const & e);
|
||||
inline expr mk_to_heq_th(expr const & e1, expr const & e2, expr const & e3, expr const & e4) { return mk_app({mk_to_heq_fn(), e1, e2, e3, e4}); }
|
||||
expr mk_iff_eliml_fn();
|
||||
bool is_iff_eliml_fn(expr const & e);
|
||||
inline expr mk_iff_eliml_th(expr const & e1, expr const & e2, expr const & e3, expr const & e4) { return mk_app({mk_iff_eliml_fn(), e1, e2, e3, e4}); }
|
||||
expr mk_iff_elimr_fn();
|
||||
bool is_iff_elimr_fn(expr const & e);
|
||||
inline expr mk_iff_elimr_th(expr const & e1, expr const & e2, expr const & e3, expr const & e4) { return mk_app({mk_iff_elimr_fn(), e1, e2, e3, e4}); }
|
||||
expr mk_ne_symm_fn();
|
||||
bool is_ne_symm_fn(expr const & e);
|
||||
inline expr mk_ne_symm_th(expr const & e1, expr const & e2, expr const & e3, expr const & e4) { return mk_app({mk_ne_symm_fn(), e1, e2, e3, e4}); }
|
||||
expr mk_eq_ne_trans_fn();
|
||||
bool is_eq_ne_trans_fn(expr const & e);
|
||||
inline expr mk_eq_ne_trans_th(expr const & e1, expr const & e2, expr const & e3, expr const & e4, expr const & e5, expr const & e6) { return mk_app({mk_eq_ne_trans_fn(), e1, e2, e3, e4, e5, e6}); }
|
||||
expr mk_ne_eq_trans_fn();
|
||||
bool is_ne_eq_trans_fn(expr const & e);
|
||||
inline expr mk_ne_eq_trans_th(expr const & e1, expr const & e2, expr const & e3, expr const & e4, expr const & e5, expr const & e6) { return mk_app({mk_ne_eq_trans_fn(), e1, e2, e3, e4, e5, e6}); }
|
||||
expr mk_eqt_elim_fn();
|
||||
bool is_eqt_elim_fn(expr const & e);
|
||||
inline expr mk_eqt_elim_th(expr const & e1, expr const & e2) { return mk_app({mk_eqt_elim_fn(), e1, e2}); }
|
||||
expr mk_eqf_elim_fn();
|
||||
bool is_eqf_elim_fn(expr const & e);
|
||||
inline expr mk_eqf_elim_th(expr const & e1, expr const & e2) { return mk_app({mk_eqf_elim_fn(), e1, e2}); }
|
||||
expr mk_heqt_elim_fn();
|
||||
bool is_heqt_elim_fn(expr const & e);
|
||||
inline expr mk_heqt_elim_th(expr const & e1, expr const & e2) { return mk_app({mk_heqt_elim_fn(), e1, e2}); }
|
||||
expr mk_boolcomplete_fn();
|
||||
bool is_boolcomplete_fn(expr const & e);
|
||||
inline expr mk_boolcomplete_th(expr const & e1) { return mk_app({mk_boolcomplete_fn(), e1}); }
|
||||
expr mk_case_fn();
|
||||
bool is_case_fn(expr const & e);
|
||||
inline expr mk_case_th(expr const & e1, expr const & e2, expr const & e3, expr const & e4) { return mk_app({mk_case_fn(), e1, e2, e3, e4}); }
|
||||
expr mk_em_fn();
|
||||
bool is_em_fn(expr const & e);
|
||||
inline expr mk_em_th(expr const & e1) { return mk_app({mk_em_fn(), e1}); }
|
||||
expr mk_boolcomplete_swapped_fn();
|
||||
bool is_boolcomplete_swapped_fn(expr const & e);
|
||||
inline expr mk_boolcomplete_swapped_th(expr const & e1) { return mk_app({mk_boolcomplete_swapped_fn(), e1}); }
|
||||
expr mk_not_true();
|
||||
bool is_not_true(expr const & e);
|
||||
expr mk_not_false();
|
||||
bool is_not_false(expr const & e);
|
||||
expr mk_not_not_eq_fn();
|
||||
bool is_not_not_eq_fn(expr const & e);
|
||||
inline expr mk_not_not_eq_th(expr const & e1) { return mk_app({mk_not_not_eq_fn(), e1}); }
|
||||
expr mk_not_neq_fn();
|
||||
bool is_not_neq_fn(expr const & e);
|
||||
inline expr mk_not_neq_th(expr const & e1, expr const & e2, expr const & e3) { return mk_app({mk_not_neq_fn(), e1, e2, e3}); }
|
||||
expr mk_not_neq_elim_fn();
|
||||
bool is_not_neq_elim_fn(expr const & e);
|
||||
inline expr mk_not_neq_elim_th(expr const & e1, expr const & e2, expr const & e3, expr const & e4) { return mk_app({mk_not_neq_elim_fn(), e1, e2, e3, e4}); }
|
||||
expr mk_not_not_elim_fn();
|
||||
bool is_not_not_elim_fn(expr const & e);
|
||||
inline expr mk_not_not_elim_th(expr const & e1, expr const & e2) { return mk_app({mk_not_not_elim_fn(), e1, e2}); }
|
||||
expr mk_not_imp_eliml_fn();
|
||||
bool is_not_imp_eliml_fn(expr const & e);
|
||||
inline expr mk_not_imp_eliml_th(expr const & e1, expr const & e2, expr const & e3) { return mk_app({mk_not_imp_eliml_fn(), e1, e2, e3}); }
|
||||
expr mk_not_imp_elimr_fn();
|
||||
bool is_not_imp_elimr_fn(expr const & e);
|
||||
inline expr mk_not_imp_elimr_th(expr const & e1, expr const & e2, expr const & e3) { return mk_app({mk_not_imp_elimr_fn(), e1, e2, e3}); }
|
||||
expr mk_boolext_fn();
|
||||
bool is_boolext_fn(expr const & e);
|
||||
inline expr mk_boolext_th(expr const & e1, expr const & e2, expr const & e3, expr const & e4) { return mk_app({mk_boolext_fn(), e1, e2, e3, e4}); }
|
||||
expr mk_iff_intro_fn();
|
||||
bool is_iff_intro_fn(expr const & e);
|
||||
inline expr mk_iff_intro_th(expr const & e1, expr const & e2, expr const & e3, expr const & e4) { return mk_app({mk_iff_intro_fn(), e1, e2, e3, e4}); }
|
||||
expr mk_eqt_intro_fn();
|
||||
bool is_eqt_intro_fn(expr const & e);
|
||||
inline expr mk_eqt_intro_th(expr const & e1, expr const & e2) { return mk_app({mk_eqt_intro_fn(), e1, e2}); }
|
||||
expr mk_eqf_intro_fn();
|
||||
bool is_eqf_intro_fn(expr const & e);
|
||||
inline expr mk_eqf_intro_th(expr const & e1, expr const & e2) { return mk_app({mk_eqf_intro_fn(), e1, e2}); }
|
||||
expr mk_by_contradiction_fn();
|
||||
bool is_by_contradiction_fn(expr const & e);
|
||||
inline expr mk_by_contradiction_th(expr const & e1, expr const & e2) { return mk_app({mk_by_contradiction_fn(), e1, e2}); }
|
||||
expr mk_a_neq_a_fn();
|
||||
bool is_a_neq_a_fn(expr const & e);
|
||||
inline expr mk_a_neq_a_th(expr const & e1, expr const & e2) { return mk_app({mk_a_neq_a_fn(), e1, e2}); }
|
||||
expr mk_eq_id_fn();
|
||||
bool is_eq_id_fn(expr const & e);
|
||||
inline expr mk_eq_id_th(expr const & e1, expr const & e2) { return mk_app({mk_eq_id_fn(), e1, e2}); }
|
||||
expr mk_iff_id_fn();
|
||||
bool is_iff_id_fn(expr const & e);
|
||||
inline expr mk_iff_id_th(expr const & e1) { return mk_app({mk_iff_id_fn(), e1}); }
|
||||
expr mk_heq_id_fn();
|
||||
bool is_heq_id_fn(expr const & e);
|
||||
inline expr mk_heq_id_th(expr const & e1, expr const & e2) { return mk_app({mk_heq_id_fn(), e1, e2}); }
|
||||
expr mk_neq_elim_fn();
|
||||
bool is_neq_elim_fn(expr const & e);
|
||||
inline expr mk_neq_elim_th(expr const & e1, expr const & e2, expr const & e3, expr const & e4) { return mk_app({mk_neq_elim_fn(), e1, e2, e3, e4}); }
|
||||
expr mk_neq_to_not_eq_fn();
|
||||
bool is_neq_to_not_eq_fn(expr const & e);
|
||||
inline expr mk_neq_to_not_eq_th(expr const & e1, expr const & e2, expr const & e3) { return mk_app({mk_neq_to_not_eq_fn(), e1, e2, e3}); }
|
||||
expr mk_left_comm_fn();
|
||||
bool is_left_comm_fn(expr const & e);
|
||||
inline expr mk_left_comm_th(expr const & e1, expr const & e2, expr const & e3, expr const & e4, expr const & e5, expr const & e6, expr const & e7) { return mk_app({mk_left_comm_fn(), e1, e2, e3, e4, e5, e6, e7}); }
|
||||
expr mk_or_comm_fn();
|
||||
bool is_or_comm_fn(expr const & e);
|
||||
inline expr mk_or_comm_th(expr const & e1, expr const & e2) { return mk_app({mk_or_comm_fn(), e1, e2}); }
|
||||
expr mk_or_assoc_fn();
|
||||
bool is_or_assoc_fn(expr const & e);
|
||||
inline expr mk_or_assoc_th(expr const & e1, expr const & e2, expr const & e3) { return mk_app({mk_or_assoc_fn(), e1, e2, e3}); }
|
||||
expr mk_or_id_fn();
|
||||
bool is_or_id_fn(expr const & e);
|
||||
inline expr mk_or_id_th(expr const & e1) { return mk_app({mk_or_id_fn(), e1}); }
|
||||
expr mk_or_falsel_fn();
|
||||
bool is_or_falsel_fn(expr const & e);
|
||||
inline expr mk_or_falsel_th(expr const & e1) { return mk_app({mk_or_falsel_fn(), e1}); }
|
||||
expr mk_or_falser_fn();
|
||||
bool is_or_falser_fn(expr const & e);
|
||||
inline expr mk_or_falser_th(expr const & e1) { return mk_app({mk_or_falser_fn(), e1}); }
|
||||
expr mk_or_truel_fn();
|
||||
bool is_or_truel_fn(expr const & e);
|
||||
inline expr mk_or_truel_th(expr const & e1) { return mk_app({mk_or_truel_fn(), e1}); }
|
||||
expr mk_or_truer_fn();
|
||||
bool is_or_truer_fn(expr const & e);
|
||||
inline expr mk_or_truer_th(expr const & e1) { return mk_app({mk_or_truer_fn(), e1}); }
|
||||
expr mk_or_tauto_fn();
|
||||
bool is_or_tauto_fn(expr const & e);
|
||||
inline expr mk_or_tauto_th(expr const & e1) { return mk_app({mk_or_tauto_fn(), e1}); }
|
||||
expr mk_or_left_comm_fn();
|
||||
bool is_or_left_comm_fn(expr const & e);
|
||||
inline expr mk_or_left_comm_th(expr const & e1, expr const & e2, expr const & e3) { return mk_app({mk_or_left_comm_fn(), e1, e2, e3}); }
|
||||
expr mk_and_comm_fn();
|
||||
bool is_and_comm_fn(expr const & e);
|
||||
inline expr mk_and_comm_th(expr const & e1, expr const & e2) { return mk_app({mk_and_comm_fn(), e1, e2}); }
|
||||
expr mk_and_id_fn();
|
||||
bool is_and_id_fn(expr const & e);
|
||||
inline expr mk_and_id_th(expr const & e1) { return mk_app({mk_and_id_fn(), e1}); }
|
||||
expr mk_and_assoc_fn();
|
||||
bool is_and_assoc_fn(expr const & e);
|
||||
inline expr mk_and_assoc_th(expr const & e1, expr const & e2, expr const & e3) { return mk_app({mk_and_assoc_fn(), e1, e2, e3}); }
|
||||
expr mk_and_truer_fn();
|
||||
bool is_and_truer_fn(expr const & e);
|
||||
inline expr mk_and_truer_th(expr const & e1) { return mk_app({mk_and_truer_fn(), e1}); }
|
||||
expr mk_and_truel_fn();
|
||||
bool is_and_truel_fn(expr const & e);
|
||||
inline expr mk_and_truel_th(expr const & e1) { return mk_app({mk_and_truel_fn(), e1}); }
|
||||
expr mk_and_falsel_fn();
|
||||
bool is_and_falsel_fn(expr const & e);
|
||||
inline expr mk_and_falsel_th(expr const & e1) { return mk_app({mk_and_falsel_fn(), e1}); }
|
||||
expr mk_and_falser_fn();
|
||||
bool is_and_falser_fn(expr const & e);
|
||||
inline expr mk_and_falser_th(expr const & e1) { return mk_app({mk_and_falser_fn(), e1}); }
|
||||
expr mk_and_absurd_fn();
|
||||
bool is_and_absurd_fn(expr const & e);
|
||||
inline expr mk_and_absurd_th(expr const & e1) { return mk_app({mk_and_absurd_fn(), e1}); }
|
||||
expr mk_and_left_comm_fn();
|
||||
bool is_and_left_comm_fn(expr const & e);
|
||||
inline expr mk_and_left_comm_th(expr const & e1, expr const & e2, expr const & e3) { return mk_app({mk_and_left_comm_fn(), e1, e2, e3}); }
|
||||
expr mk_imp_truer_fn();
|
||||
bool is_imp_truer_fn(expr const & e);
|
||||
inline expr mk_imp_truer_th(expr const & e1) { return mk_app({mk_imp_truer_fn(), e1}); }
|
||||
expr mk_imp_truel_fn();
|
||||
bool is_imp_truel_fn(expr const & e);
|
||||
inline expr mk_imp_truel_th(expr const & e1) { return mk_app({mk_imp_truel_fn(), e1}); }
|
||||
expr mk_imp_falser_fn();
|
||||
bool is_imp_falser_fn(expr const & e);
|
||||
inline expr mk_imp_falser_th(expr const & e1) { return mk_app({mk_imp_falser_fn(), e1}); }
|
||||
expr mk_imp_falsel_fn();
|
||||
bool is_imp_falsel_fn(expr const & e);
|
||||
inline expr mk_imp_falsel_th(expr const & e1) { return mk_app({mk_imp_falsel_fn(), e1}); }
|
||||
expr mk_imp_id_fn();
|
||||
bool is_imp_id_fn(expr const & e);
|
||||
inline expr mk_imp_id_th(expr const & e1) { return mk_app({mk_imp_id_fn(), e1}); }
|
||||
expr mk_imp_or_fn();
|
||||
bool is_imp_or_fn(expr const & e);
|
||||
inline expr mk_imp_or_th(expr const & e1, expr const & e2) { return mk_app({mk_imp_or_fn(), e1, e2}); }
|
||||
expr mk_or_imp_fn();
|
||||
bool is_or_imp_fn(expr const & e);
|
||||
inline expr mk_or_imp_th(expr const & e1, expr const & e2) { return mk_app({mk_or_imp_fn(), e1, e2}); }
|
||||
expr mk_not_congr_fn();
|
||||
bool is_not_congr_fn(expr const & e);
|
||||
inline expr mk_not_congr_th(expr const & e1, expr const & e2, expr const & e3) { return mk_app({mk_not_congr_fn(), e1, e2, e3}); }
|
||||
expr mk_exists_elim_fn();
|
||||
bool is_exists_elim_fn(expr const & e);
|
||||
inline expr mk_exists_elim_th(expr const & e1, expr const & e2, expr const & e3, expr const & e4, expr const & e5) { return mk_app({mk_exists_elim_fn(), e1, e2, e3, e4, e5}); }
|
||||
expr mk_exists_intro_fn();
|
||||
bool is_exists_intro_fn(expr const & e);
|
||||
inline expr mk_exists_intro_th(expr const & e1, expr const & e2, expr const & e3, expr const & e4) { return mk_app({mk_exists_intro_fn(), e1, e2, e3, e4}); }
|
||||
expr mk_not_exists_fn();
|
||||
bool is_not_exists_fn(expr const & e);
|
||||
inline expr mk_not_exists_th(expr const & e1, expr const & e2) { return mk_app({mk_not_exists_fn(), e1, e2}); }
|
||||
expr mk_not_exists_elim_fn();
|
||||
bool is_not_exists_elim_fn(expr const & e);
|
||||
inline expr mk_not_exists_elim_th(expr const & e1, expr const & e2, expr const & e3, expr const & e4) { return mk_app({mk_not_exists_elim_fn(), e1, e2, e3, e4}); }
|
||||
expr mk_exists_unfold1_fn();
|
||||
bool is_exists_unfold1_fn(expr const & e);
|
||||
inline expr mk_exists_unfold1_th(expr const & e1, expr const & e2, expr const & e3, expr const & e4) { return mk_app({mk_exists_unfold1_fn(), e1, e2, e3, e4}); }
|
||||
expr mk_exists_unfold2_fn();
|
||||
bool is_exists_unfold2_fn(expr const & e);
|
||||
inline expr mk_exists_unfold2_th(expr const & e1, expr const & e2, expr const & e3, expr const & e4) { return mk_app({mk_exists_unfold2_fn(), e1, e2, e3, e4}); }
|
||||
expr mk_exists_unfold_fn();
|
||||
bool is_exists_unfold_fn(expr const & e);
|
||||
inline expr mk_exists_unfold_th(expr const & e1, expr const & e2, expr const & e3) { return mk_app({mk_exists_unfold_fn(), e1, e2, e3}); }
|
||||
expr mk_inhabited_fn();
|
||||
bool is_inhabited_fn(expr const & e);
|
||||
inline bool is_inhabited(expr const & e) { return is_app(e) && is_inhabited_fn(arg(e, 0)) && num_args(e) == 2; }
|
||||
inline expr mk_inhabited(expr const & e1) { return mk_app({mk_inhabited_fn(), e1}); }
|
||||
expr mk_inhabited_intro_fn();
|
||||
bool is_inhabited_intro_fn(expr const & e);
|
||||
inline expr mk_inhabited_intro_th(expr const & e1, expr const & e2) { return mk_app({mk_inhabited_intro_fn(), e1, e2}); }
|
||||
expr mk_inhabited_elim_fn();
|
||||
bool is_inhabited_elim_fn(expr const & e);
|
||||
inline expr mk_inhabited_elim_th(expr const & e1, expr const & e2, expr const & e3, expr const & e4) { return mk_app({mk_inhabited_elim_fn(), e1, e2, e3, e4}); }
|
||||
expr mk_inhabited_ex_intro_fn();
|
||||
bool is_inhabited_ex_intro_fn(expr const & e);
|
||||
inline expr mk_inhabited_ex_intro_th(expr const & e1, expr const & e2, expr const & e3) { return mk_app({mk_inhabited_ex_intro_fn(), e1, e2, e3}); }
|
||||
expr mk_inhabited_range_fn();
|
||||
bool is_inhabited_range_fn(expr const & e);
|
||||
inline expr mk_inhabited_range_th(expr const & e1, expr const & e2, expr const & e3, expr const & e4) { return mk_app({mk_inhabited_range_fn(), e1, e2, e3, e4}); }
|
||||
expr mk_exists_rem_fn();
|
||||
bool is_exists_rem_fn(expr const & e);
|
||||
inline expr mk_exists_rem_th(expr const & e1, expr const & e2, expr const & e3) { return mk_app({mk_exists_rem_fn(), e1, e2, e3}); }
|
||||
expr mk_forall_rem_fn();
|
||||
bool is_forall_rem_fn(expr const & e);
|
||||
inline expr mk_forall_rem_th(expr const & e1, expr const & e2, expr const & e3) { return mk_app({mk_forall_rem_fn(), e1, e2, e3}); }
|
||||
expr mk_not_and_fn();
|
||||
bool is_not_and_fn(expr const & e);
|
||||
inline expr mk_not_and_th(expr const & e1, expr const & e2) { return mk_app({mk_not_and_fn(), e1, e2}); }
|
||||
expr mk_not_and_elim_fn();
|
||||
bool is_not_and_elim_fn(expr const & e);
|
||||
inline expr mk_not_and_elim_th(expr const & e1, expr const & e2, expr const & e3) { return mk_app({mk_not_and_elim_fn(), e1, e2, e3}); }
|
||||
expr mk_not_or_fn();
|
||||
bool is_not_or_fn(expr const & e);
|
||||
inline expr mk_not_or_th(expr const & e1, expr const & e2) { return mk_app({mk_not_or_fn(), e1, e2}); }
|
||||
expr mk_not_or_elim_fn();
|
||||
bool is_not_or_elim_fn(expr const & e);
|
||||
inline expr mk_not_or_elim_th(expr const & e1, expr const & e2, expr const & e3) { return mk_app({mk_not_or_elim_fn(), e1, e2, e3}); }
|
||||
expr mk_not_implies_fn();
|
||||
bool is_not_implies_fn(expr const & e);
|
||||
inline expr mk_not_implies_th(expr const & e1, expr const & e2) { return mk_app({mk_not_implies_fn(), e1, e2}); }
|
||||
expr mk_and_imp_fn();
|
||||
bool is_and_imp_fn(expr const & e);
|
||||
inline expr mk_and_imp_th(expr const & e1, expr const & e2) { return mk_app({mk_and_imp_fn(), e1, e2}); }
|
||||
expr mk_not_implies_elim_fn();
|
||||
bool is_not_implies_elim_fn(expr const & e);
|
||||
inline expr mk_not_implies_elim_th(expr const & e1, expr const & e2, expr const & e3) { return mk_app({mk_not_implies_elim_fn(), e1, e2, e3}); }
|
||||
expr mk_a_eq_not_a_fn();
|
||||
bool is_a_eq_not_a_fn(expr const & e);
|
||||
inline expr mk_a_eq_not_a_th(expr const & e1) { return mk_app({mk_a_eq_not_a_fn(), e1}); }
|
||||
expr mk_a_iff_not_a_fn();
|
||||
bool is_a_iff_not_a_fn(expr const & e);
|
||||
inline expr mk_a_iff_not_a_th(expr const & e1) { return mk_app({mk_a_iff_not_a_fn(), e1}); }
|
||||
expr mk_true_eq_false();
|
||||
bool is_true_eq_false(expr const & e);
|
||||
expr mk_true_iff_false();
|
||||
bool is_true_iff_false(expr const & e);
|
||||
expr mk_false_eq_true();
|
||||
bool is_false_eq_true(expr const & e);
|
||||
expr mk_false_iff_true();
|
||||
bool is_false_iff_true(expr const & e);
|
||||
expr mk_a_iff_true_fn();
|
||||
bool is_a_iff_true_fn(expr const & e);
|
||||
inline expr mk_a_iff_true_th(expr const & e1) { return mk_app({mk_a_iff_true_fn(), e1}); }
|
||||
expr mk_a_iff_false_fn();
|
||||
bool is_a_iff_false_fn(expr const & e);
|
||||
inline expr mk_a_iff_false_th(expr const & e1) { return mk_app({mk_a_iff_false_fn(), e1}); }
|
||||
expr mk_not_iff_fn();
|
||||
bool is_not_iff_fn(expr const & e);
|
||||
inline expr mk_not_iff_th(expr const & e1, expr const & e2) { return mk_app({mk_not_iff_fn(), e1, e2}); }
|
||||
expr mk_not_iff_elim_fn();
|
||||
bool is_not_iff_elim_fn(expr const & e);
|
||||
inline expr mk_not_iff_elim_th(expr const & e1, expr const & e2, expr const & e3) { return mk_app({mk_not_iff_elim_fn(), e1, e2, e3}); }
|
||||
expr mk_imp_congrr_fn();
|
||||
bool is_imp_congrr_fn(expr const & e);
|
||||
inline expr mk_imp_congrr_th(expr const & e1, expr const & e2, expr const & e3, expr const & e4, expr const & e5, expr const & e6) { return mk_app({mk_imp_congrr_fn(), e1, e2, e3, e4, e5, e6}); }
|
||||
expr mk_imp_congrl_fn();
|
||||
bool is_imp_congrl_fn(expr const & e);
|
||||
inline expr mk_imp_congrl_th(expr const & e1, expr const & e2, expr const & e3, expr const & e4, expr const & e5, expr const & e6) { return mk_app({mk_imp_congrl_fn(), e1, e2, e3, e4, e5, e6}); }
|
||||
expr mk_imp_congr_fn();
|
||||
bool is_imp_congr_fn(expr const & e);
|
||||
inline expr mk_imp_congr_th(expr const & e1, expr const & e2, expr const & e3, expr const & e4, expr const & e5, expr const & e6) { return mk_app({mk_imp_congr_fn(), e1, e2, e3, e4, e5, e6}); }
|
||||
expr mk_or_congrr_fn();
|
||||
bool is_or_congrr_fn(expr const & e);
|
||||
inline expr mk_or_congrr_th(expr const & e1, expr const & e2, expr const & e3, expr const & e4, expr const & e5, expr const & e6) { return mk_app({mk_or_congrr_fn(), e1, e2, e3, e4, e5, e6}); }
|
||||
expr mk_or_congrl_fn();
|
||||
bool is_or_congrl_fn(expr const & e);
|
||||
inline expr mk_or_congrl_th(expr const & e1, expr const & e2, expr const & e3, expr const & e4, expr const & e5, expr const & e6) { return mk_app({mk_or_congrl_fn(), e1, e2, e3, e4, e5, e6}); }
|
||||
expr mk_or_congr_fn();
|
||||
bool is_or_congr_fn(expr const & e);
|
||||
inline expr mk_or_congr_th(expr const & e1, expr const & e2, expr const & e3, expr const & e4, expr const & e5, expr const & e6) { return mk_app({mk_or_congr_fn(), e1, e2, e3, e4, e5, e6}); }
|
||||
expr mk_and_congrr_fn();
|
||||
bool is_and_congrr_fn(expr const & e);
|
||||
inline expr mk_and_congrr_th(expr const & e1, expr const & e2, expr const & e3, expr const & e4, expr const & e5, expr const & e6) { return mk_app({mk_and_congrr_fn(), e1, e2, e3, e4, e5, e6}); }
|
||||
expr mk_and_congrl_fn();
|
||||
bool is_and_congrl_fn(expr const & e);
|
||||
inline expr mk_and_congrl_th(expr const & e1, expr const & e2, expr const & e3, expr const & e4, expr const & e5, expr const & e6) { return mk_app({mk_and_congrl_fn(), e1, e2, e3, e4, e5, e6}); }
|
||||
expr mk_and_congr_fn();
|
||||
bool is_and_congr_fn(expr const & e);
|
||||
inline expr mk_and_congr_th(expr const & e1, expr const & e2, expr const & e3, expr const & e4, expr const & e5, expr const & e6) { return mk_app({mk_and_congr_fn(), e1, e2, e3, e4, e5, e6}); }
|
||||
expr mk_forall_or_distributer_fn();
|
||||
bool is_forall_or_distributer_fn(expr const & e);
|
||||
inline expr mk_forall_or_distributer_th(expr const & e1, expr const & e2, expr const & e3) { return mk_app({mk_forall_or_distributer_fn(), e1, e2, e3}); }
|
||||
expr mk_forall_or_distributel_fn();
|
||||
bool is_forall_or_distributel_fn(expr const & e);
|
||||
inline expr mk_forall_or_distributel_th(expr const & e1, expr const & e2, expr const & e3) { return mk_app({mk_forall_or_distributel_fn(), e1, e2, e3}); }
|
||||
expr mk_forall_and_distribute_fn();
|
||||
bool is_forall_and_distribute_fn(expr const & e);
|
||||
inline expr mk_forall_and_distribute_th(expr const & e1, expr const & e2, expr const & e3) { return mk_app({mk_forall_and_distribute_fn(), e1, e2, e3}); }
|
||||
expr mk_exists_and_distributer_fn();
|
||||
bool is_exists_and_distributer_fn(expr const & e);
|
||||
inline expr mk_exists_and_distributer_th(expr const & e1, expr const & e2, expr const & e3) { return mk_app({mk_exists_and_distributer_fn(), e1, e2, e3}); }
|
||||
expr mk_exists_or_distribute_fn();
|
||||
bool is_exists_or_distribute_fn(expr const & e);
|
||||
inline expr mk_exists_or_distribute_th(expr const & e1, expr const & e2, expr const & e3) { return mk_app({mk_exists_or_distribute_fn(), e1, e2, e3}); }
|
||||
expr mk_eq_exists_intro_fn();
|
||||
bool is_eq_exists_intro_fn(expr const & e);
|
||||
inline expr mk_eq_exists_intro_th(expr const & e1, expr const & e2, expr const & e3, expr const & e4) { return mk_app({mk_eq_exists_intro_fn(), e1, e2, e3, e4}); }
|
||||
expr mk_not_forall_fn();
|
||||
bool is_not_forall_fn(expr const & e);
|
||||
inline expr mk_not_forall_th(expr const & e1, expr const & e2) { return mk_app({mk_not_forall_fn(), e1, e2}); }
|
||||
expr mk_not_forall_elim_fn();
|
||||
bool is_not_forall_elim_fn(expr const & e);
|
||||
inline expr mk_not_forall_elim_th(expr const & e1, expr const & e2, expr const & e3) { return mk_app({mk_not_forall_elim_fn(), e1, e2, e3}); }
|
||||
expr mk_exists_and_distributel_fn();
|
||||
bool is_exists_and_distributel_fn(expr const & e);
|
||||
inline expr mk_exists_and_distributel_th(expr const & e1, expr const & e2, expr const & e3) { return mk_app({mk_exists_and_distributel_fn(), e1, e2, e3}); }
|
||||
expr mk_exists_imp_distribute_fn();
|
||||
bool is_exists_imp_distribute_fn(expr const & e);
|
||||
inline expr mk_exists_imp_distribute_th(expr const & e1, expr const & e2, expr const & e3) { return mk_app({mk_exists_imp_distribute_fn(), e1, e2, e3}); }
|
||||
expr mk_forall_uninhabited_fn();
|
||||
bool is_forall_uninhabited_fn(expr const & e);
|
||||
inline expr mk_forall_uninhabited_th(expr const & e1, expr const & e2, expr const & e3, expr const & e4) { return mk_app({mk_forall_uninhabited_fn(), e1, e2, e3, e4}); }
|
||||
expr mk_allext_fn();
|
||||
bool is_allext_fn(expr const & e);
|
||||
inline expr mk_allext_th(expr const & e1, expr const & e2, expr const & e3, expr const & e4) { return mk_app({mk_allext_fn(), e1, e2, e3, e4}); }
|
||||
expr mk_proj1_congr_fn();
|
||||
bool is_proj1_congr_fn(expr const & e);
|
||||
inline expr mk_proj1_congr_th(expr const & e1, expr const & e2, expr const & e3, expr const & e4, expr const & e5) { return mk_app({mk_proj1_congr_fn(), e1, e2, e3, e4, e5}); }
|
||||
expr mk_proj2_congr_fn();
|
||||
bool is_proj2_congr_fn(expr const & e);
|
||||
inline expr mk_proj2_congr_th(expr const & e1, expr const & e2, expr const & e3, expr const & e4, expr const & e5) { return mk_app({mk_proj2_congr_fn(), e1, e2, e3, e4, e5}); }
|
||||
expr mk_hproj2_congr_fn();
|
||||
bool is_hproj2_congr_fn(expr const & e);
|
||||
inline expr mk_hproj2_congr_th(expr const & e1, expr const & e2, expr const & e3, expr const & e4, expr const & e5) { return mk_app({mk_hproj2_congr_fn(), e1, e2, e3, e4, e5}); }
|
||||
expr mk_funext_fn();
|
||||
bool is_funext_fn(expr const & e);
|
||||
inline expr mk_funext_th(expr const & e1, expr const & e2, expr const & e3, expr const & e4, expr const & e5) { return mk_app({mk_funext_fn(), e1, e2, e3, e4, e5}); }
|
||||
expr mk_eta_fn();
|
||||
bool is_eta_fn(expr const & e);
|
||||
inline expr mk_eta_th(expr const & e1, expr const & e2, expr const & e3) { return mk_app({mk_eta_fn(), e1, e2, e3}); }
|
||||
expr mk_eps_fn();
|
||||
bool is_eps_fn(expr const & e);
|
||||
inline bool is_eps(expr const & e) { return is_app(e) && is_eps_fn(arg(e, 0)) && num_args(e) == 4; }
|
||||
inline expr mk_eps(expr const & e1, expr const & e2, expr const & e3) { return mk_app({mk_eps_fn(), e1, e2, e3}); }
|
||||
expr mk_eps_ax_fn();
|
||||
bool is_eps_ax_fn(expr const & e);
|
||||
inline expr mk_eps_ax_th(expr const & e1, expr const & e2, expr const & e3, expr const & e4, expr const & e5) { return mk_app({mk_eps_ax_fn(), e1, e2, e3, e4, e5}); }
|
||||
expr mk_eps_th_fn();
|
||||
bool is_eps_th_fn(expr const & e);
|
||||
inline expr mk_eps_th_th(expr const & e1, expr const & e2, expr const & e3, expr const & e4) { return mk_app({mk_eps_th_fn(), e1, e2, e3, e4}); }
|
||||
expr mk_eps_singleton_fn();
|
||||
bool is_eps_singleton_fn(expr const & e);
|
||||
inline expr mk_eps_singleton_th(expr const & e1, expr const & e2, expr const & e3) { return mk_app({mk_eps_singleton_fn(), e1, e2, e3}); }
|
||||
expr mk_inhabited_dfun_fn();
|
||||
bool is_inhabited_dfun_fn(expr const & e);
|
||||
inline expr mk_inhabited_dfun_th(expr const & e1, expr const & e2, expr const & e3) { return mk_app({mk_inhabited_dfun_fn(), e1, e2, e3}); }
|
||||
expr mk_inhabited_fun_fn();
|
||||
bool is_inhabited_fun_fn(expr const & e);
|
||||
inline expr mk_inhabited_fun_th(expr const & e1, expr const & e2, expr const & e3) { return mk_app({mk_inhabited_fun_fn(), e1, e2, e3}); }
|
||||
expr mk_exists_to_eps_fn();
|
||||
bool is_exists_to_eps_fn(expr const & e);
|
||||
inline expr mk_exists_to_eps_th(expr const & e1, expr const & e2, expr const & e3) { return mk_app({mk_exists_to_eps_fn(), e1, e2, e3}); }
|
||||
expr mk_axiom_of_choice_fn();
|
||||
bool is_axiom_of_choice_fn(expr const & e);
|
||||
inline expr mk_axiom_of_choice_th(expr const & e1, expr const & e2, expr const & e3, expr const & e4) { return mk_app({mk_axiom_of_choice_fn(), e1, e2, e3, e4}); }
|
||||
expr mk_skolem_th_fn();
|
||||
bool is_skolem_th_fn(expr const & e);
|
||||
inline expr mk_skolem_th_th(expr const & e1, expr const & e2, expr const & e3) { return mk_app({mk_skolem_th_fn(), e1, e2, e3}); }
|
||||
expr mk_ite_fn();
|
||||
bool is_ite_fn(expr const & e);
|
||||
inline bool is_ite(expr const & e) { return is_app(e) && is_ite_fn(arg(e, 0)) && num_args(e) == 5; }
|
||||
inline expr mk_ite(expr const & e1, expr const & e2, expr const & e3, expr const & e4) { return mk_app({mk_ite_fn(), e1, e2, e3, e4}); }
|
||||
expr mk_if_true_fn();
|
||||
bool is_if_true_fn(expr const & e);
|
||||
inline expr mk_if_true_th(expr const & e1, expr const & e2, expr const & e3) { return mk_app({mk_if_true_fn(), e1, e2, e3}); }
|
||||
expr mk_if_false_fn();
|
||||
bool is_if_false_fn(expr const & e);
|
||||
inline expr mk_if_false_th(expr const & e1, expr const & e2, expr const & e3) { return mk_app({mk_if_false_fn(), e1, e2, e3}); }
|
||||
expr mk_if_a_a_fn();
|
||||
bool is_if_a_a_fn(expr const & e);
|
||||
inline expr mk_if_a_a_th(expr const & e1, expr const & e2, expr const & e3) { return mk_app({mk_if_a_a_fn(), e1, e2, e3}); }
|
||||
expr mk_if_congr_fn();
|
||||
bool is_if_congr_fn(expr const & e);
|
||||
inline expr mk_if_congr_th(expr const & e1, expr const & e2, expr const & e3, expr const & e4, expr const & e5, expr const & e6, expr const & e7, expr const & e8, expr const & e9, expr const & e10) { return mk_app({mk_if_congr_fn(), e1, e2, e3, e4, e5, e6, e7, e8, e9, e10}); }
|
||||
expr mk_if_imp_then_fn();
|
||||
bool is_if_imp_then_fn(expr const & e);
|
||||
inline expr mk_if_imp_then_th(expr const & e1, expr const & e2, expr const & e3, expr const & e4, expr const & e5) { return mk_app({mk_if_imp_then_fn(), e1, e2, e3, e4, e5}); }
|
||||
expr mk_if_imp_else_fn();
|
||||
bool is_if_imp_else_fn(expr const & e);
|
||||
inline expr mk_if_imp_else_th(expr const & e1, expr const & e2, expr const & e3, expr const & e4, expr const & e5) { return mk_app({mk_if_imp_else_fn(), e1, e2, e3, e4, e5}); }
|
||||
expr mk_app_if_distribute_fn();
|
||||
bool is_app_if_distribute_fn(expr const & e);
|
||||
inline expr mk_app_if_distribute_th(expr const & e1, expr const & e2, expr const & e3, expr const & e4, expr const & e5, expr const & e6) { return mk_app({mk_app_if_distribute_fn(), e1, e2, e3, e4, e5, e6}); }
|
||||
expr mk_eq_if_distributer_fn();
|
||||
bool is_eq_if_distributer_fn(expr const & e);
|
||||
inline expr mk_eq_if_distributer_th(expr const & e1, expr const & e2, expr const & e3, expr const & e4, expr const & e5) { return mk_app({mk_eq_if_distributer_fn(), e1, e2, e3, e4, e5}); }
|
||||
expr mk_eq_if_distributel_fn();
|
||||
bool is_eq_if_distributel_fn(expr const & e);
|
||||
inline expr mk_eq_if_distributel_th(expr const & e1, expr const & e2, expr const & e3, expr const & e4, expr const & e5) { return mk_app({mk_eq_if_distributel_fn(), e1, e2, e3, e4, e5}); }
|
||||
expr mk_injective_fn();
|
||||
bool is_injective_fn(expr const & e);
|
||||
inline bool is_injective(expr const & e) { return is_app(e) && is_injective_fn(arg(e, 0)) && num_args(e) == 4; }
|
||||
inline expr mk_injective(expr const & e1, expr const & e2, expr const & e3) { return mk_app({mk_injective_fn(), e1, e2, e3}); }
|
||||
expr mk_non_surjective_fn();
|
||||
bool is_non_surjective_fn(expr const & e);
|
||||
inline bool is_non_surjective(expr const & e) { return is_app(e) && is_non_surjective_fn(arg(e, 0)) && num_args(e) == 4; }
|
||||
inline expr mk_non_surjective(expr const & e1, expr const & e2, expr const & e3) { return mk_app({mk_non_surjective_fn(), e1, e2, e3}); }
|
||||
expr mk_ind();
|
||||
bool is_ind(expr const & e);
|
||||
expr mk_infinity();
|
||||
bool is_infinity(expr const & e);
|
||||
expr mk_pairext_fn();
|
||||
bool is_pairext_fn(expr const & e);
|
||||
inline expr mk_pairext_th(expr const & e1, expr const & e2, expr const & e3, expr const & e4, expr const & e5, expr const & e6) { return mk_app({mk_pairext_fn(), e1, e2, e3, e4, e5, e6}); }
|
||||
expr mk_pair_proj_eq_fn();
|
||||
bool is_pair_proj_eq_fn(expr const & e);
|
||||
inline expr mk_pair_proj_eq_th(expr const & e1, expr const & e2, expr const & e3) { return mk_app({mk_pair_proj_eq_fn(), e1, e2, e3}); }
|
||||
expr mk_pair_congr_fn();
|
||||
bool is_pair_congr_fn(expr const & e);
|
||||
inline expr mk_pair_congr_th(expr const & e1, expr const & e2, expr const & e3, expr const & e4, expr const & e5, expr const & e6, expr const & e7, expr const & e8) { return mk_app({mk_pair_congr_fn(), e1, e2, e3, e4, e5, e6, e7, e8}); }
|
||||
expr mk_pairext_proj_fn();
|
||||
bool is_pairext_proj_fn(expr const & e);
|
||||
inline expr mk_pairext_proj_th(expr const & e1, expr const & e2, expr const & e3, expr const & e4, expr const & e5, expr const & e6, expr const & e7) { return mk_app({mk_pairext_proj_fn(), e1, e2, e3, e4, e5, e6, e7}); }
|
||||
expr mk_hpairext_proj_fn();
|
||||
bool is_hpairext_proj_fn(expr const & e);
|
||||
inline expr mk_hpairext_proj_th(expr const & e1, expr const & e2, expr const & e3, expr const & e4, expr const & e5, expr const & e6, expr const & e7) { return mk_app({mk_hpairext_proj_fn(), e1, e2, e3, e4, e5, e6, e7}); }
|
||||
expr mk_cast_fn();
|
||||
bool is_cast_fn(expr const & e);
|
||||
inline bool is_cast(expr const & e) { return is_app(e) && is_cast_fn(arg(e, 0)) && num_args(e) == 5; }
|
||||
inline expr mk_cast(expr const & e1, expr const & e2, expr const & e3, expr const & e4) { return mk_app({mk_cast_fn(), e1, e2, e3, e4}); }
|
||||
expr mk_cast_heq_fn();
|
||||
bool is_cast_heq_fn(expr const & e);
|
||||
inline expr mk_cast_heq_th(expr const & e1, expr const & e2, expr const & e3, expr const & e4) { return mk_app({mk_cast_heq_fn(), e1, e2, e3, e4}); }
|
||||
expr mk_hsubst_fn();
|
||||
bool is_hsubst_fn(expr const & e);
|
||||
inline expr mk_hsubst_th(expr const & e1, expr const & e2, expr const & e3, expr const & e4, expr const & e5, expr const & e6, expr const & e7) { return mk_app({mk_hsubst_fn(), e1, e2, e3, e4, e5, e6, e7}); }
|
||||
expr mk_hsymm_fn();
|
||||
bool is_hsymm_fn(expr const & e);
|
||||
inline expr mk_hsymm_th(expr const & e1, expr const & e2, expr const & e3, expr const & e4, expr const & e5) { return mk_app({mk_hsymm_fn(), e1, e2, e3, e4, e5}); }
|
||||
expr mk_htrans_fn();
|
||||
bool is_htrans_fn(expr const & e);
|
||||
inline expr mk_htrans_th(expr const & e1, expr const & e2, expr const & e3, expr const & e4, expr const & e5, expr const & e6, expr const & e7, expr const & e8) { return mk_app({mk_htrans_fn(), e1, e2, e3, e4, e5, e6, e7, e8}); }
|
||||
expr mk_hcongr_fn();
|
||||
bool is_hcongr_fn(expr const & e);
|
||||
inline expr mk_hcongr_th(expr const & e1, expr const & e2, expr const & e3, expr const & e4, expr const & e5, expr const & e6, expr const & e7, expr const & e8, expr const & e9, expr const & e10) { return mk_app({mk_hcongr_fn(), e1, e2, e3, e4, e5, e6, e7, e8, e9, e10}); }
|
||||
expr mk_hfunext_fn();
|
||||
bool is_hfunext_fn(expr const & e);
|
||||
inline expr mk_hfunext_th(expr const & e1, expr const & e2, expr const & e3, expr const & e4, expr const & e5, expr const & e6, expr const & e7, expr const & e8) { return mk_app({mk_hfunext_fn(), e1, e2, e3, e4, e5, e6, e7, e8}); }
|
||||
expr mk_hpiext_fn();
|
||||
bool is_hpiext_fn(expr const & e);
|
||||
inline expr mk_hpiext_th(expr const & e1, expr const & e2, expr const & e3, expr const & e4, expr const & e5, expr const & e6) { return mk_app({mk_hpiext_fn(), e1, e2, e3, e4, e5, e6}); }
|
||||
expr mk_hsigext_fn();
|
||||
bool is_hsigext_fn(expr const & e);
|
||||
inline expr mk_hsigext_th(expr const & e1, expr const & e2, expr const & e3, expr const & e4, expr const & e5, expr const & e6) { return mk_app({mk_hsigext_fn(), e1, e2, e3, e4, e5, e6}); }
|
||||
expr mk_hallext_fn();
|
||||
bool is_hallext_fn(expr const & e);
|
||||
inline expr mk_hallext_th(expr const & e1, expr const & e2, expr const & e3, expr const & e4, expr const & e5, expr const & e6) { return mk_app({mk_hallext_fn(), e1, e2, e3, e4, e5, e6}); }
|
||||
expr mk_hsfunext_fn();
|
||||
bool is_hsfunext_fn(expr const & e);
|
||||
inline expr mk_hsfunext_th(expr const & e1, expr const & e2, expr const & e3, expr const & e4, expr const & e5, expr const & e6) { return mk_app({mk_hsfunext_fn(), e1, e2, e3, e4, e5, e6}); }
|
||||
expr mk_heq_congr_fn();
|
||||
bool is_heq_congr_fn(expr const & e);
|
||||
inline expr mk_heq_congr_th(expr const & e1, expr const & e2, expr const & e3, expr const & e4, expr const & e5, expr const & e6, expr const & e7, expr const & e8) { return mk_app({mk_heq_congr_fn(), e1, e2, e3, e4, e5, e6, e7, e8}); }
|
||||
expr mk_hheq_congr_fn();
|
||||
bool is_hheq_congr_fn(expr const & e);
|
||||
inline expr mk_hheq_congr_th(expr const & e1, expr const & e2, expr const & e3, expr const & e4, expr const & e5, expr const & e6, expr const & e7, expr const & e8, expr const & e9, expr const & e10) { return mk_app({mk_hheq_congr_fn(), e1, e2, e3, e4, e5, e6, e7, e8, e9, e10}); }
|
||||
expr mk_type_eq_fn();
|
||||
bool is_type_eq_fn(expr const & e);
|
||||
inline expr mk_type_eq_th(expr const & e1, expr const & e2, expr const & e3, expr const & e4, expr const & e5) { return mk_app({mk_type_eq_fn(), e1, e2, e3, e4, e5}); }
|
||||
expr mk_cast_eq_fn();
|
||||
bool is_cast_eq_fn(expr const & e);
|
||||
inline expr mk_cast_eq_th(expr const & e1, expr const & e2, expr const & e3) { return mk_app({mk_cast_eq_fn(), e1, e2, e3}); }
|
||||
expr mk_cast_trans_fn();
|
||||
bool is_cast_trans_fn(expr const & e);
|
||||
inline expr mk_cast_trans_th(expr const & e1, expr const & e2, expr const & e3, expr const & e4, expr const & e5, expr const & e6) { return mk_app({mk_cast_trans_fn(), e1, e2, e3, e4, e5, e6}); }
|
||||
expr mk_cast_pull_fn();
|
||||
bool is_cast_pull_fn(expr const & e);
|
||||
inline expr mk_cast_pull_th(expr const & e1, expr const & e2, expr const & e3, expr const & e4, expr const & e5, expr const & e6, expr const & e7) { return mk_app({mk_cast_pull_fn(), e1, e2, e3, e4, e5, e6, e7}); }
|
||||
expr mk_proof_irrel_fn();
|
||||
bool is_proof_irrel_fn(expr const & e);
|
||||
inline expr mk_proof_irrel_th(expr const & e1, expr const & e2, expr const & e3) { return mk_app({mk_proof_irrel_fn(), e1, e2, e3}); }
|
||||
expr mk_hproof_irrel_fn();
|
||||
bool is_hproof_irrel_fn(expr const & e);
|
||||
inline expr mk_hproof_irrel_th(expr const & e1, expr const & e2, expr const & e3, expr const & e4) { return mk_app({mk_hproof_irrel_fn(), e1, e2, e3, e4}); }
|
||||
}
|
|
@ -57,102 +57,4 @@ public:
|
|||
[[ noreturn ]] void throw_read_only_environment(ro_environment const & env) {
|
||||
throw_kernel_exception(env, "environment cannot be updated because it has children environments");
|
||||
}
|
||||
|
||||
|
||||
#if 0
|
||||
|
||||
|
||||
|
||||
format unknown_name_exception::pp(formatter const &, options const &) const {
|
||||
return format{format(what()), format(" '"), format(get_name()), format("'")};
|
||||
}
|
||||
|
||||
format has_no_type_exception::pp(formatter const &, options const &) const {
|
||||
return format{format("object '"), format(const_name(m_const)), format("' has no type associated with it")};
|
||||
}
|
||||
|
||||
format app_type_mismatch_exception::pp(formatter const & fmt, options const & opts) const {
|
||||
unsigned indent = get_pp_indent(opts);
|
||||
context const & ctx = get_context();
|
||||
expr const & app = get_application();
|
||||
format app_fmt = fmt(ctx, app, false, opts);
|
||||
std::vector<expr> const & arg_types = get_arg_types();
|
||||
auto it = arg_types.begin();
|
||||
format f_type_fmt = fmt(ctx, *it, false, opts);
|
||||
format arg_types_fmt;
|
||||
++it;
|
||||
for (unsigned i = 1; it != arg_types.end(); ++it, ++i) {
|
||||
expr const & a = arg(app, i);
|
||||
format arg_fmt = fmt(ctx, a, false, opts);
|
||||
if (is_pi(a) || is_lambda(a) || is_let(a))
|
||||
arg_fmt = paren(arg_fmt);
|
||||
format arg_type_fmt = fmt(ctx, *it, false, opts);
|
||||
arg_types_fmt += nest(indent, compose(line(), group(format{arg_fmt, space(), colon(), nest(indent, format{line(), arg_type_fmt})})));
|
||||
}
|
||||
format r;
|
||||
r += format{format("type mismatch in argument #"), format(m_arg_pos), format(" at application")};
|
||||
r += nest(indent, compose(line(), app_fmt));
|
||||
r += compose(line(), format("Function type:"));
|
||||
r += nest(indent, compose(line(), f_type_fmt));
|
||||
r += line();
|
||||
if (arg_types.size() > 2)
|
||||
r += format("Arguments types:");
|
||||
else
|
||||
r += format("Argument type:");
|
||||
r += arg_types_fmt;
|
||||
return r;
|
||||
}
|
||||
|
||||
format pair_type_mismatch_exception::pp(formatter const & fmt, options const & opts) const {
|
||||
unsigned indent = get_pp_indent(opts);
|
||||
context const & ctx = get_context();
|
||||
expr const & pair = get_pair();
|
||||
format pair_fmt = fmt(ctx, pair, false, opts);
|
||||
format r = format("type mismatch in the ");
|
||||
if (m_first)
|
||||
r += format("1st");
|
||||
else
|
||||
r += format("2nd");
|
||||
r += format(" argument of the pair");
|
||||
r += nest(indent, compose(line(), pair_fmt));
|
||||
r += compose(line(), format("Pair type:"));
|
||||
r += nest(indent, compose(line(), fmt(ctx, m_sig_type, false, opts)));
|
||||
r += line();
|
||||
r += format("Argument type:");
|
||||
r += nest(indent, compose(line(), fmt(ctx, m_arg_type, false, opts)));
|
||||
return r;
|
||||
}
|
||||
|
||||
format abstraction_expected_exception::pp(formatter const & fmt, options const & opts) const {
|
||||
unsigned indent = get_pp_indent(opts);
|
||||
format expr_fmt = fmt(get_context(), get_expr(), false, opts);
|
||||
format r;
|
||||
r += format(what());
|
||||
r += format(" at");
|
||||
r += nest(indent, compose(line(), expr_fmt));
|
||||
return r;
|
||||
}
|
||||
|
||||
format type_expected_exception::pp(formatter const & fmt, options const & opts) const {
|
||||
unsigned indent = get_pp_indent(opts);
|
||||
format expr_fmt = fmt(get_context(), get_expr(), false, opts);
|
||||
format r;
|
||||
r += format("type expected, got");
|
||||
r += nest(indent, compose(line(), expr_fmt));
|
||||
return r;
|
||||
}
|
||||
|
||||
format def_type_mismatch_exception::pp(formatter const & fmt, options const & opts) const {
|
||||
unsigned indent = get_pp_indent(opts);
|
||||
context const & ctx = get_context();
|
||||
format r;
|
||||
r += format("type mismatch at definition '");
|
||||
r += format(get_name());
|
||||
r += format("', expected type");
|
||||
r += nest(indent, compose(line(), fmt(ctx, get_type(), false, opts)));
|
||||
r += compose(line(), format("Given type:"));
|
||||
r += nest(indent, compose(line(), fmt(ctx, get_value_type(), false, opts)));
|
||||
return r;
|
||||
}
|
||||
#endif
|
||||
}
|
||||
|
|
|
@ -7,49 +7,61 @@ Author: Leonardo de Moura
|
|||
#include "util/freset.h"
|
||||
#include "util/flet.h"
|
||||
#include "util/interrupt.h"
|
||||
#include "kernel/environment.h"
|
||||
#include "kernel/type_checker.h"
|
||||
#include "kernel/expr_maps.h"
|
||||
#include "kernel/environment.h"
|
||||
#include "kernel/kernel_exception.h"
|
||||
#include "kernel/normalizer.h"
|
||||
#include "kernel/instantiate.h"
|
||||
#include "kernel/kernel.h"
|
||||
#include "kernel/free_vars.h"
|
||||
#include "kernel/type_checker_justification.h"
|
||||
|
||||
namespace lean {
|
||||
expr pi_body_at(expr const & pi, expr const & a) {
|
||||
lean_assert(is_pi(pi));
|
||||
if (closed(abst_body(pi)))
|
||||
return abst_body(pi);
|
||||
if (closed(binder_body(pi)))
|
||||
return binder_body(pi);
|
||||
else if (closed(a))
|
||||
return instantiate_with_closed(abst_body(pi), a);
|
||||
return instantiate_with_closed(binder_body(pi), a);
|
||||
else
|
||||
return instantiate(abst_body(pi), a);
|
||||
return instantiate(binder_body(pi), a);
|
||||
}
|
||||
|
||||
static name g_x_name("x");
|
||||
/** \brief Auxiliary functional object used to implement infer_type. */
|
||||
class type_checker::imp {
|
||||
typedef expr_map<expr> cache;
|
||||
typedef buffer<unification_constraint> unification_constraints;
|
||||
|
||||
ro_environment::weak_ref m_env;
|
||||
cache m_cache;
|
||||
normalizer m_normalizer;
|
||||
context m_ctx;
|
||||
cached_metavar_env m_menv;
|
||||
unification_constraints * m_uc;
|
||||
cache m_cache;
|
||||
name_generator * m_name_gen;
|
||||
constraints m_constraints; // constraints generated so far
|
||||
bool m_infer_only;
|
||||
|
||||
ro_environment env() const { return ro_environment(m_env); }
|
||||
expr lift_free_vars(expr const & e, unsigned s, unsigned d) { return ::lean::lift_free_vars(e, s, d, m_menv.to_some_ro_menv()); }
|
||||
expr lift_free_vars(expr const & e, unsigned d) { return ::lean::lift_free_vars(e, d, m_menv.to_some_ro_menv()); }
|
||||
expr lower_free_vars(expr const & e, unsigned s, unsigned n) { return ::lean::lower_free_vars(e, s, n, m_menv.to_some_ro_menv()); }
|
||||
expr instantiate_with_closed(expr const & e, expr const & v) { return ::lean::instantiate_with_closed(e, v, m_menv.to_some_ro_menv()); }
|
||||
expr instantiate(expr const & e, expr const & v) { return ::lean::instantiate(e, v, m_menv.to_some_ro_menv()); }
|
||||
expr normalize(expr const & e, context const & ctx, bool unfold_opaque) { return m_normalizer(e, ctx, m_menv.to_some_ro_menv(), unfold_opaque); }
|
||||
expr normalize(expr const & e) { return m_normalizer(e); }
|
||||
|
||||
#if 0
|
||||
expr check_sort(expr const & e, expr const & s) {
|
||||
if (is_sort(e))
|
||||
return e;
|
||||
expr u = normalize(e);
|
||||
if (is_sort(u))
|
||||
return u;
|
||||
if (has_metavar(u)) {
|
||||
justification jst = mk_type_expected_justification(ctx, s);
|
||||
m_uc->push_back(mk_convertible_constraint(ctx, e, TypeU1, jst));
|
||||
return u;
|
||||
}
|
||||
throw type_expected_exception(env(), ctx, s);
|
||||
}
|
||||
#endif
|
||||
};
|
||||
|
||||
|
||||
#if 0
|
||||
static name g_x_name("x");
|
||||
/** \brief Auxiliary functional object used to implement infer_type. */
|
||||
class type_checker::imp {
|
||||
expr check_type(expr const & e, expr const & s, context const & ctx) {
|
||||
if (is_type(e) || is_bool(e))
|
||||
return e;
|
||||
|
@ -196,10 +208,6 @@ class type_checker::imp {
|
|||
}
|
||||
case expr_kind::Type:
|
||||
return mk_type(ty_level(e) + 1);
|
||||
case expr_kind::HEq:
|
||||
if (m_infer_only)
|
||||
return Bool;
|
||||
break;
|
||||
case expr_kind::App: case expr_kind::Lambda:
|
||||
case expr_kind::Pi: case expr_kind::Let:
|
||||
case expr_kind::Sigma: case expr_kind::Proj:
|
||||
|
@ -263,12 +271,6 @@ class type_checker::imp {
|
|||
}
|
||||
}
|
||||
break;
|
||||
case expr_kind::HEq:
|
||||
lean_assert(!m_infer_only);
|
||||
infer_type_core(heq_lhs(e), ctx);
|
||||
infer_type_core(heq_rhs(e), ctx);
|
||||
r = Bool;
|
||||
break;
|
||||
case expr_kind::Pair:
|
||||
if (m_infer_only) {
|
||||
r = pair_type(e);
|
||||
|
@ -636,4 +638,5 @@ bool is_proposition(expr const & e, ro_environment const & env, context const &
|
|||
bool is_proposition(expr const & e, ro_environment const & env, context const & ctx) {
|
||||
return is_proposition(e, env, ctx, none_ro_menv());
|
||||
}
|
||||
#endif
|
||||
}
|
||||
|
|
|
@ -6,10 +6,10 @@ Author: Leonardo de Moura
|
|||
*/
|
||||
#pragma once
|
||||
#include <memory>
|
||||
#include <utility>
|
||||
#include "util/name_generator.h"
|
||||
#include "kernel/expr.h"
|
||||
#include "kernel/context.h"
|
||||
#include "kernel/unification_constraint.h"
|
||||
#include "kernel/metavar.h"
|
||||
#include "kernel/constraint.h"
|
||||
|
||||
namespace lean {
|
||||
class environment;
|
||||
|
@ -26,92 +26,74 @@ expr pi_body_at(expr const & pi, expr const & a);
|
|||
/**
|
||||
\brief Lean Type Checker. It can also be used to infer types, universes and check whether a
|
||||
type \c A is convertible to a type \c B.
|
||||
|
||||
Remark: several methods take a \c name_generator as argument. The name generator is used
|
||||
for creating fresh metavariables and local variables.
|
||||
|
||||
Remark: several methods return constraints. Three possible kinds of constraints a generated:
|
||||
unification constraints, convertability constraints and universe level constraints.
|
||||
See constraints.h for more details. The first two kinds of constraints are only generated
|
||||
if the input expression contains meta-variables or meta-level-parameters.
|
||||
*/
|
||||
class type_checker {
|
||||
class imp;
|
||||
std::unique_ptr<imp> m_ptr;
|
||||
public:
|
||||
type_checker(ro_environment const & env, bool infer_only = false);
|
||||
type_checker(ro_environment const & env);
|
||||
~type_checker();
|
||||
|
||||
/**
|
||||
\brief Return the type of \c e in the context \c ctx.
|
||||
\brief Return the type of \c e.
|
||||
|
||||
It does not check whether the input expression is type correct or not.
|
||||
The contract is: IF the input expression is type correct, then the inferred
|
||||
type is correct.
|
||||
Throw an exception if a type error is found.
|
||||
|
||||
\remark This method throws an exception if \c e is not type correct.
|
||||
|
||||
\remark If \c menv is not none, then \c e may contain metavariables.
|
||||
New metavariables and unification constraints may be created by the type checker.
|
||||
The new unification constraints are stored in \c new_constraints.
|
||||
The result is meaningful only if the resultant set of constraints can be solved.
|
||||
*/
|
||||
expr infer_type(expr const & e, context const & ctx, optional<metavar_env> const & menv, buffer<unification_constraint> * new_constraints);
|
||||
expr infer_type(expr const & e, context const & ctx, metavar_env const & menv, buffer<unification_constraint> & new_constraints);
|
||||
expr infer_type(expr const & e, context const & ctx, ro_metavar_env const & menv);
|
||||
expr infer_type(expr const & e, context const & ctx, optional<ro_metavar_env> const & menv);
|
||||
std::pair<expr, constraints> infer_type(expr const & e, name_generator & g);
|
||||
|
||||
/**
|
||||
\brief Return the type of \c e in the context \c ctx.
|
||||
\brief Type check the given expression, and return the type of \c e.
|
||||
Throw an exception if a type error is found.
|
||||
|
||||
\remark This method throws an exception if \c e is not type
|
||||
correct, or if \c e contains metavariables.
|
||||
The result is meaningful only if the resultant set of constraints can be solved.
|
||||
*/
|
||||
expr infer_type(expr const & e, context const & ctx = context());
|
||||
std::pair<expr, constraints> check(expr const & e, name_generator & g);
|
||||
|
||||
/**
|
||||
\brief Type check the given expression, and return the type of \c e in the context \c ctx.
|
||||
\brief Return a set of constraints that need to be solved for \c t1 to be convertible to \c t2.
|
||||
|
||||
\remark This method throws an exception if \c e is not type correct.
|
||||
|
||||
\remark If \c menv is not none, then \c e may contain metavariables.
|
||||
New metavariables and unification constraints may be created by the type checker.
|
||||
The new unification constraints are stored in \c new_constraints.
|
||||
Return none if \c t1 is not convertible to \c t2.
|
||||
*/
|
||||
expr check(expr const & e, context const & ctx, optional<metavar_env> const & menv, buffer<unification_constraint> * new_constraints);
|
||||
expr check(expr const & e, context const & ctx, metavar_env const & menv, buffer<unification_constraint> & new_constraints);
|
||||
expr check(expr const & e, context const & ctx, ro_metavar_env const & menv);
|
||||
optional<constraints> is_convertible(expr const & t1, expr const & t2, name_generator & g);
|
||||
|
||||
/**
|
||||
\brief Type check the given expression, and return the type of \c e in the context \c ctx.
|
||||
\brief Return a set of constraints that need to be solved for \c t1 to be definitionally equal to \c t2.
|
||||
|
||||
\remark This method throws an exception if \c e is not type
|
||||
correct, or if \c e contains metavariables.
|
||||
Return none if \c t1 is not definitionally equal to \c t2.
|
||||
*/
|
||||
expr check(expr const & e, context const & ctx = context());
|
||||
optional<constraints> is_definitionally_equal(expr const & t1, expr const & t2, name_generator & g);
|
||||
|
||||
/** \brief Throw an exception if \c e is not a type in the context \c ctx. */
|
||||
void check_type(expr const & e, context const & ctx = context());
|
||||
/**
|
||||
\brief Return a set of constraints that need to be solved for \c e to be a proposition (i.e., it has type Bool)
|
||||
|
||||
/** \brief Return true iff \c t1 is convertible to \c t2 in the context \c ctx. */
|
||||
bool is_convertible(expr const & t1, expr const & t2, context const & ctx, optional<ro_metavar_env> const & menv);
|
||||
bool is_convertible(expr const & t1, expr const & t2, context const & ctx = context());
|
||||
|
||||
/** \brief Return true iff \c t1 definitionally equal to \c t2 in the context \c ctx.
|
||||
|
||||
\remark is_definitionally_equal(t1, t2, ctx) implies is_convertible(t1, t2, ctx)
|
||||
Return none if \c e is not a proposition.
|
||||
*/
|
||||
bool is_definitionally_equal(expr const & t1, expr const & t2, context const & ctx, optional<ro_metavar_env> const & menv);
|
||||
bool is_definitionally_equal(expr const & t1, expr const & t2, context const & ctx = context());
|
||||
optional<constraints> is_proposition(expr const & e, name_generator & g);
|
||||
|
||||
/** \brief Return true iff \c e is a proposition (i.e., it has type Bool) */
|
||||
bool is_proposition(expr const & e, context const & ctx, optional<ro_metavar_env> const & menv);
|
||||
bool is_proposition(expr const & e, context const & ctx, ro_metavar_env const & menv);
|
||||
bool is_proposition(expr const & e, context const & ctx = context());
|
||||
/**
|
||||
\brief Return a Pi if \c e is convertible to a Pi type.
|
||||
Throw an exception if a type error is found.
|
||||
*/
|
||||
std::pair<expr, constraints> ensure_pi(expr const & e, name_generator & g);
|
||||
|
||||
/** \brief Return true iff \c e is a proposition or is a Pi s.t. the range is a flex_proposition */
|
||||
bool is_flex_proposition(expr e, context ctx, optional<ro_metavar_env> const & menv);
|
||||
bool is_flex_proposition(expr const & e, context const & ctx, ro_metavar_env const & menv);
|
||||
bool is_flex_proposition(expr const & e, context const & ctx = context());
|
||||
|
||||
/** \brief Return a Pi if \c e is convertible to Pi. Throw an exception otherwise. */
|
||||
expr ensure_pi(expr const & e, context const & ctx, optional<ro_metavar_env> const & menv);
|
||||
expr ensure_pi(expr const & e, context const & ctx = context());
|
||||
|
||||
/** \brief Return a Sigma if \c e is convertible to Sigma. Throw an exception otherwise. */
|
||||
expr ensure_sigma(expr const & e, context const & ctx, optional<ro_metavar_env> const & menv);
|
||||
expr ensure_sigma(expr const & e, context const & ctx = context());
|
||||
/**
|
||||
\brief Return a Sigma if \c e is convertible to a Sigma type.
|
||||
Throw an exception if a type error is found.
|
||||
*/
|
||||
std::pair<expr, constraints> ensure_sigma(expr const & e, name_generator & g);
|
||||
|
||||
/** \brief Reset internal caches */
|
||||
void clear();
|
||||
|
@ -119,25 +101,4 @@ public:
|
|||
/** \brief Return reference to the normalizer used by this type checker. */
|
||||
normalizer & get_normalizer();
|
||||
};
|
||||
class type_inferer : public type_checker {
|
||||
public:
|
||||
type_inferer(ro_environment const & env):type_checker(env, true) {}
|
||||
expr operator()(expr const & e, context const & ctx, optional<metavar_env> const & menv, buffer<unification_constraint> * new_constraints) {
|
||||
return infer_type(e, ctx, menv, new_constraints);
|
||||
}
|
||||
expr operator()(expr const & e, context const & ctx, metavar_env const & menv, buffer<unification_constraint> & new_constraints) {
|
||||
return infer_type(e, ctx, menv, new_constraints);
|
||||
}
|
||||
expr operator()(expr const & e, context const & ctx, ro_metavar_env const & menv) {
|
||||
return infer_type(e, ctx, menv);
|
||||
}
|
||||
expr operator()(expr const & e, context const & ctx = context()) {
|
||||
return infer_type(e, ctx);
|
||||
}
|
||||
};
|
||||
expr type_check(expr const & e, ro_environment const & env, context const & ctx = context());
|
||||
bool is_convertible(expr const & t1, expr const & t2, ro_environment const & env, context const & ctx = context());
|
||||
bool is_proposition(expr const & e, ro_environment const & env, context const & ctx, optional<ro_metavar_env> const & menv);
|
||||
bool is_proposition(expr const & e, ro_environment const & env, context const & ctx, ro_metavar_env const & menv);
|
||||
bool is_proposition(expr const & e, ro_environment const & env, context const & ctx = context());
|
||||
}
|
||||
|
|
Loading…
Add table
Reference in a new issue