AltErgoLib.ExprData structures
type term_view = private {f : Symbols.t;xs : t list;ty : Ty.t;bind : bind_kind;tag : int;vars : (Ty.t * int) Var.Map.t;Map of free term variables in the term to their type and number of occurrences.
*)vty : AltErgoLib.Ty.Svty.t;Map of free type variables in the term.
*)depth : int;nb_nodes : int;pure : bool;mutable neg : t option;}and quantified = private {name : string;Name of the lemma. This field is used by printers.
*)main : t;The underlying formula.
*)toplevel : bool;Determine if the quantified formula is at the top level of an asserted formula.
An asserted formula is a formula introduced by (assert ...) or generated by a function definition with (define-fun ...).
By top level, we mean that the quantified formula is not a subformula of another quantified formula.
For instance, the subformula ∀y:int. ¬G(y) of the asserted formula ¬(∀y:int. ¬G(y)) is also considered at the top level.
Notice that quantifiers of the same kind are packed as much as possible. For instance, if we assert the formula: ∀α. ∀x:list α. ∃y:α. F(x, y) Then the two universal quantifiers are packed in a same top level formula but the subformula ∃y:α. F(x, y) is not at the top level.
This flag is important for the prenex polymorphism.
true, all the free type variables of main are implicitely considered as quantified.main and are stored in the field sko_vty.user_trs : trigger list;List of the triggers defined by the user.
The solver doesn't generate multi-triggers if the user has defined some multi-triggers.
*)binders : binders;The ordered list of quantified term variables of main.
This list has to be ordered for the skolemization.
*)sko_v : t list;Set of all the free variables of the quantified formula. In other words, this set is always the complementary of binders in the set of free variables of main.
The purpose of this field is to retrieve these variables quickly while performing the lazy skolemization in the SAT solver (see skolemize).
sko_vty : Ty.t list;The set of free type variables. In particular this set is always empty if we are the top level.
*)loc : Loc.t;Location of the "GLOBAL" axiom containing this quantified formula. It forms with name a unique identifier.
*)kind : decl_kind;Kind of declaration.
*)}and semantic_trigger = | Interval of t * Symbols.bound * Symbols.bound| MapsTo of Var.t * t| NotTheoryConst of t| IsTheoryConst of t| LinearDependency of t * tand trigger = private {content : t list;List of terms that must be present for this trigger to match.
Sorted using matching heuristics; the first term is estimated as the least likely to match.
*)semantic : semantic_trigger list;hyp : t list;t_depth : int;from_user : bool;}different views of an expression
constant casts
val int_view : t -> intExtracts the integer value of the expression, if there is one.
The returned value may be negative or null.
val rounding_mode_view : t -> Fpa_rounding.rounding_modeExtracts the rounding mode value of the expression, if there is one.
pretty printing
val print : Stdlib.Format.formatter -> t -> unitval print_list : Stdlib.Format.formatter -> t list -> unitval print_list_sep : string -> Stdlib.Format.formatter -> t list -> unitval print_triggers : Stdlib.Format.formatter -> trigger list -> unitval pp_smtlib : t Fmt.tpp_smtlib ppf e prints the expression e on the formatter ppf using the SMT-LIB standard.
Comparison and hashing functions
val hash : t -> intval uid : t -> intval compare_quant : quantified -> quantified -> intval free_type_vars : t -> AltErgoLib.Ty.Svty.tval is_ground : t -> boolval size : t -> intval depth : t -> intval is_positive : t -> boolval is_int : t -> boolval is_real : t -> boolLabeling and models
val name_of_lemma : t -> stringval name_of_lemma_opt : t option -> stringsmart constructors for terms
val vrai : tval faux : tval void : tval int : string -> tval real : string -> tSpecial names used for AC(X) abstraction. These corresponds to the K sort in the AC(X) paper.
val is_fresh_ac_name : t -> boolmk_abstract ty creates an abstract model term of type ty. This function is intended to be used only in models.
smart constructors for literals
val mk_builtin : is_pos:bool -> Symbols.builtin -> t list -> tsimple smart constructors for formulas
smart constructor for datatypes.
val mk_constr : Uid.term_cst -> t list -> Ty.t -> tval mk_tester : Uid.term_cst -> t -> tSubstitutions
Subterms, and related stuff
val sub_terms : Set.t -> t -> Set.tsub_term acc e returns the acc augmented with the term and all its sub-terms. Returns the acc if e is not a term. Does not go through literals (except positive uninterpreted predicates application) and formulas
val max_pure_subterms : t -> Set.tmax_pure_subterms e returns the maximal pure terms of the given expression
val max_terms_of_lit : t -> Set.treturns the maximal terms of the given literal. Assertion failure if not a literal (should replace the assertion failure with a better error) *
val max_ground_terms_of_lit : t -> Set.treturns the maximal ground terms of the given literal. Assertion failure if not a literal *
val atoms_rec_of_form : only_ground:bool -> t -> Set.t -> Set.ttraverses a formula recursively and collects its atoms. Only ground atoms are kept if ~only_ground is true
val max_ground_terms_rec_of_form : t -> Set.ttraverses a formula recursively and collects its maximal ground terms
skolemization and other smart constructors for formulas *
val make_triggers :
t ->
binders ->
decl_kind ->
Util.matching_env ->
trigger listmake_triggers f binders decl menv generate multi-triggers for the formula f and binders binders.
An escaped variable of a pattern is a variable that is not in binders (but the variable is bound by an inner quantified formula). We can replace escaped variables by the underscore variable Var.underscore.
For instance, if binders is the set {x, y} and g(x, y, z) is a pattern where {(x, y, z)} are free term variables, we can replace z by _.
Our strategy for multi-trigger generations depends on the matching environment menv as follows:
If menv.greedy is false, we try to generate in order:
If menv.greedy is true, we try to generate in order:
If menv.triggers_var is true, we allow variables as valid triggers.
Note: Mono-trigger with `Sy.Plus` or `Sy.Minus` top symbols are ignored if other mono-triggers have been generated.
The matching environment env is used to limit the number of multi-triggers generated per axiom.
clean trigger: remove useless terms in multi-triggers after inlining of lets
val resolution_triggers : is_back:bool -> quantified -> trigger listval mk_match : t -> (Typed.pattern * t) list -> tval skolemize : quantified -> ttype th_elt = {th_name : string;ax_name : string;ax_form : t;extends : Util.theories_extensions;axiom_kind : Util.axiom_kind;}val print_th_elt : Stdlib.Format.formatter -> th_elt -> unitval is_pure : t -> boolval is_model_term : t -> boolis_model_term e checks if the expression e is a model terms. A model term can be:
module Core : sig ... endConstructors from the smtlib core theory. https://smtlib.cs.uiowa.edu/theories-Core.shtml
module Ints : sig ... endConstructors from the smtlib theory of integers. https://smtlib.cs.uiowa.edu/theories-Ints.shtml
module Reals : sig ... endConstructors from the smtlib theory of reals. https://smtlib.cs.uiowa.edu/theories-Reals.shtml
module BV : sig ... endConstructors from the smtlib theory of fixed-size bit-vectors and the QF_BV logic.
module ArraysEx : sig ... endConstructors from the smtlib theory of functional arrays with extensionality logic.