Module Logtk.TypedSTerm
Simple Typed Terms
.
type location= ParseLocation.ttype ttype term= ttype ty= ttype match_cstor={cstor_id : ID.t;cstor_ty : ty;cstor_args : ty list;}a 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.tvariable
|Const of ID.tconstant
|App of t * t listapply 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 * tbind variable in term
|AppBuiltin of Builtin.t * t list|Multiset of t list|Record of (string * t) list * t optionextensible record
|Meta of meta_varUnification variable
and meta_var= t Var.t * t option Stdlib.ref * [ `Generalize | `BindDefault | `NoBind ]
val view : t -> viewval loc : t -> location optionval ty : t -> t optionval ty_exn : t -> tval head : t -> ID.t optionval head_exn : t -> ID.t- raises Not_found
if not an application/const
Constructors
val tType : tval prop : tval var : ?loc:location -> t Var.t -> tval var_of_string : ?loc:location -> ty:t -> string -> tval app : ?loc:location -> ty:t -> t -> t list -> tval app_whnf : ?loc:location -> ty:t -> t -> t list -> tapplication + WHNF
val const : ?loc:location -> ty:t -> ID.t -> tval const_of_cstor : ?loc:location -> match_cstor -> tval ite : ?loc:location -> t -> t -> t -> tval match_ : ?loc:location -> t -> match_branch list -> tval let_ : ?loc:location -> (t Var.t * t) list -> t -> tval app_builtin : ?loc:location -> ty:t -> Builtin.t -> t list -> tval builtin : ?loc:location -> ty:t -> Builtin.t -> tval bind : ?loc:location -> ty:t -> Binder.t -> t Var.t -> t -> tval bind_list : ?loc:location -> ty:t -> Binder.t -> t Var.t list -> t -> tval multiset : ?loc:location -> ty:t -> t list -> tval meta : ?loc:location -> meta_var -> tval record : ?loc:location -> ty:t -> (string * t) list -> rest:t Var.t option -> tval record_flatten : ?loc:location -> ty:t -> (string * t) list -> rest:t option -> tBuild a record with possibly a row variable.
- raises IllFormedTerm
if the
restis not either a record or a variable.
val fun_l : ?loc:location -> t Var.t list -> t -> tval of_string : ?loc:location -> ty:t -> string -> tMake a constant from this string
Specific Views
module Ty : sig ... endval sort_ty_vars_first : t Var.t list -> t Var.t listsort 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 -> booltrueiff there is no free variable
val is_monomorphic : t -> booltrueif there are no type variables
val is_subterm : strict:bool -> t -> of_:t -> boolis_subterm a ~of_:bis true ifais a subterm ofb.- parameter strict
if true,
amust be a strict subterm ofb, that is, notbitself
val closed : t -> boolclosed tistrueiff all bound variables oftoccur under a binder (i.e. they are actually bound int)
val unfold_binder : Binder.t -> t -> t Var.t list * tunfold_binder b (b v1 (b v2... (b vn t)))returns[v1,...,vn], t
val unfold_fun : t -> t Var.t list * tval var_occurs : var:t Var.t -> t -> boolvar_occurs ~var tistrueiffvaroccurs int
val as_id_app : t -> (ID.t * Ty.t * t list) optionval vars : t -> t Var.t listval free_vars : t -> t Var.t listval free_vars_l : t list -> t Var.t listval free_vars_set : t -> t Var.Set.tval close_all : ty:t -> Binder.t -> t -> tBind all free vars with the symbol
val close_with_vars : ?binder:Binder.t -> t list -> t -> tval map : f:('a -> t -> t) -> bind:('a -> ty Var.t -> 'a * ty Var.t) -> 'a -> t -> tGeneric non-recursive map
include Interfaces.PRINT with type t := t
val pp_inner : t CCFormat.printerval pp_with_ty : t CCFormat.printerval pp_in : Output_format.t -> t CCFormat.printer
module Seq : sig ... endSubstitutions
module Subst : sig ... endTable of Variables
Unification
module 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.- parameter allow_open
if true, metas can be unified to terms with free variables (default false)
- parameter st
used for backtracking
- parameter subst
substitution for bound variables
- raises UnifyFailure
if unification fails.
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 argscompute the type of a function of typef_ty, when applied to parametersargs. The first elements ofargsmight be interpreted as types, the other ones as terms (whose types are unified against expected types).
Conversion
TPTP
module TPTP : sig ... endmodule TPTP_THF : sig ... endmodule ZF : sig ... end