Module Term.T
type symbol= Symbol.tSymbol
type var= Var.tVariable
type sort= Type.tSort
type lambda_node= private|L of sort list * tLambda abstraction over symbols, variables and sort of the types given. Values of the type cannot be constructed outside this module in order to maintain invariants about the data type.
and lambda= private (lambda_node, unit) Hashcons.hash_consedHashconsed lambda abstraction
and t_node= private|FreeVar of var|BoundVar of int|Leaf of symbol|Node of symbol * t list|Let of lambda * t list|Exists of lambda|Forall of lambda|Annot of t * attrAbstract syntax term over symbols, variables and sort of the types given. Values of the type cannot be constructed outside this module in order to maintain invariants about the data type. Use the constructors
mk_var,mk_const,mk_app,mk_let,mk_existsandmk_forall.
and t= private (t_node, t_prop) Hashcons.hash_consedHashconsed abstract syntax term
and flat= private|Var of var|Const of symbol|App of symbol * t list|Attr of t * attrTerm over symbols, variables and sort of the types given where the topmost symbol is not a binding
This type must remain private, because
constructdoes not check the invariants and would be a backdoor to construct unsafe terms.
val hash : t -> intHash function on terms
val tag : t -> intUnique identifier for term
val mk_exists : var list -> t -> tConstructor for an existential quantification over an indexed free variable
val mk_forall : var list -> t -> tConstructor for a universal quantification over an indexed free variable
val node_of_lambda : lambda -> lambda_nodeReturn the node of a hashconsed lamda abstraction
val tag_of_t : t -> intReturn the unique tag of a hashconsed term
val eval_t : ?fail_on_quantifiers:bool -> (flat -> 'a list -> 'a) -> t -> 'aEvaluate the term bottom-up and right-to-left. The evaluation function is called at each node of the term with the term being evaluated and the list of values computed for the subterms. Let bindings are lazily unfolded.
val map : (int -> t -> t) -> t -> tTail-recursive bottom-up right-to-left map on the term
Not every subterm is a proper term, since the de Bruijn indexes are shifted. Therefore, the function
fis called with the number of let bindings the subterm is under as first argument, so that the indexes can be adjusted in the subterm if necessary.
val destruct : t -> flatReturn the top symbol of a term along with its subterms
If the top symbol of a term is a let binding, the binding is distributed over the subterms.
val has_quantifier : t -> boolReturns
trueif the term has quantifiers
val instantiate : lambda -> t list -> tval construct : flat -> tConvert the flattened representation back into a term
val import_lambda : lambda -> lambdaImport a lambda abstraction into the hashcons table by rebuilding it bottom up
val pp_print_term : ?db:int -> Stdlib.Format.formatter -> t -> unitPretty-print a term
val pp_print_term : ?db:int -> Stdlib.Format.formatter -> t -> unitPretty-print a term
val pp_print_lambda_w : (?arity:int -> Stdlib.Format.formatter -> symbol -> unit) -> (Stdlib.Format.formatter -> var -> unit) -> (Stdlib.Format.formatter -> sort -> unit) -> ?db:int -> Stdlib.Format.formatter -> lambda -> unitval pp_print_term_w : (?arity:int -> Stdlib.Format.formatter -> symbol -> unit) -> (Stdlib.Format.formatter -> var -> unit) -> (Stdlib.Format.formatter -> sort -> unit) -> ?db:int -> Stdlib.Format.formatter -> t -> unitval print_term : ?db:int -> t -> unitPretty-print a term
val pp_print_lambda : ?db:int -> Stdlib.Format.formatter -> lambda -> unitPretty-print a lambda abstraction
val print_lambda : ?db:int -> lambda -> unitPretty-print a lambda abstraction