package alt-ergo-lib
Install
dune-project
Dependency
Authors
Maintainers
Sources
sha256=1269311af25278a466892ba878cc888ba59f177f53dd03f12a2c623b03fcf37e
sha512=8a841e1f295e889fa9cb95aa4021bbb481d73279e99512c2afb3510e1f6c9d367113ee6bd3a90bc51111fa3e766a302633e9d5d18fde7660b139cd19a271eb23
doc/alt-ergo-lib/AltErgoLib/Expr/index.html
Module AltErgoLib.Expr
Data 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 : 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.
- If this flag is
true, all the free type variables ofmainare implicitely considered as quantified. - Otherwise, the free type variables of the lemma are the same as the underlying formula
mainand are stored in the fieldsko_vty.
- If this flag is
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
bindersin the set of free variables ofmain.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 * t
and 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 : Format.formatter -> t -> unitval print_list : Format.formatter -> t list -> unitval print_list_sep : string -> Format.formatter -> t list -> unitval print_triggers : Format.formatter -> trigger list -> unitpp_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 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 -> stringval print_tagged_classes : Format.formatter -> Set.t list -> unitsmart 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
sub_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
max_pure_subterms e returns the maximal pure terms of the given expression
returns the maximal terms of the given literal. Assertion failure if not a literal (should replace the assertion failure with a better error) *
returns the maximal ground terms of the given literal. Assertion failure if not a literal *
traverses a formula recursively and collects its atoms. Only ground atoms are kept if ~only_ground is true
traverses 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:
- Mono-triggers;
- Multi-triggers without escaped variables.
If menv.greedy is true, we try to generate in order:
- Mono and multi-triggers with escaped variables.
- Mono and multi-triggers without escaped variables;
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 : 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:
- A record definition involving only model terms.
- A constructor application involving only model terms,
- A literal of a basic type (integer, real, boolean, unit or bitvector),
- A name.
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.