package logtk
Module Logtk.TypedSTerm
Simple Typed Terms
Similar to STerm, but this time the terms are properly scoped (using Var) and typed.
These terms are suitable for many preprocessing transformations, including CNF.
They can be obtained from STerm.t using TypeInference.
type location = ParseLocation.ttype term = ttype ty = ta constructor of given type, applied to a list of type argumentss
type match_branch = match_cstor * t Var.t list * ttype view = private | Var of t Var.t(*variable
*)| Const of ID.t(*constant
*)| App of t * t list(*apply term
*)| Ite of t * t * t| Match of t * match_branch list| Let of (t Var.t * t) list * t| Bind of Binder.t * t Var.t * t(*bind variable in term
*)| AppBuiltin of Builtin.t * t list| Multiset of t list| Record of (string * t) list * t option(*extensible record
*)| Meta of meta_var(*Unification variable
*)
include Interfaces.ORD with type t := t
Constructors
val tType : tval prop : tval const_of_cstor : ?loc:location -> match_cstor -> tval match_ : ?loc:location -> t -> match_branch list -> tBuild a record with possibly a row variable.
Specific Views
module Ty : sig ... endsort the given list of variables by putting type variables first
module Form : sig ... endUtils
val is_var : t -> boolval is_meta : t -> boolval is_const : t -> boolval is_fun : t -> boolval is_ground : t -> booltrue iff there is no free variable
val is_monomorphic : t -> booltrue if there are no type variables
is_subterm a ~of_:b is true if a is a subterm of b.
val closed : t -> boolclosed t is true iff all bound variables of t occur under a binder (i.e. they are actually bound in t)
unfold_binder b (b v1 (b v2... (b vn t))) returns [v1,...,vn], t
Generic non-recursive map
val pp_inner : t CCFormat.printerval pp_with_ty : t CCFormat.printerval pp_in : Output_format.t -> t CCFormat.printermodule Set : Iter.Set.S with type elt = termmodule Map : Iter.Map.S with type key = termmodule Seq : sig ... endSubstitutions
module Subst : sig ... endTable of Variables
module Var_tbl : CCHashtbl.S with type key = t Var.tUnification
val pp_stack : (term * term) list CCFormat.printermodule UStack : sig ... endval unify :
?allow_open:bool ->
?loc:location ->
?st:UStack.t ->
?subst:Subst.t ->
term ->
term ->
unitunifies destructively the two given terms, by modifying references that occur under Meta. Regular variables are not modified.
val apply_unify :
?gen_fresh_meta:(unit -> meta_var) ->
?allow_open:bool ->
?loc:location ->
?st:UStack.t ->
?subst:Subst.t ->
t ->
t list ->
tapply_unify f_ty args compute the type of a function of type f_ty, when applied to parameters args. The first elements of args might be interpreted as types, the other ones as terms (whose types are unified against expected types).
app_infer f l computes the type ty of f l, and return app ~ty f l
val depth : t -> intConversion
TPTP
module TPTP : sig ... endmodule TPTP_THF : sig ... endmodule ZF : sig ... end