module TypedSTerm:sig..end
These terms are scoped, and possibly typed. Type inference should be
performed on them.
typelocation =ParseLocation.t
type t
typeterm =t
type view = private
| |
Var of |
(* |
variable
| *) |
| |
Const of |
(* |
constant
| *) |
| |
App of |
(* |
apply term
| *) |
| |
Bind of |
(* |
bind variable in term
| *) |
| |
AppBuiltin of |
|||
| |
Multiset of |
|||
| |
Record of |
(* |
extensible record
| *) |
| |
Meta of |
(* |
Unification variable
| *) |
typemeta_var =t Var.t * t option Pervasives.ref *
[ `BindDefault | `Generalize | `NoBind ]
val view : t -> view
val loc : t -> location option
val ty : t -> t option
val ty_exn : t -> t
val head_exn : t -> ID.t
val deref : t -> tt is a bound Meta variable, follow its linkinclude Interfaces.HASH
include Interfaces.ORD
exception IllFormedTerm of string
val tType : t
val prop : t
val var : ?loc:location -> t Var.t -> t
val var_of_string : ?loc:location -> ty:t -> string -> t
val app : ?loc:location ->
ty:t -> t -> t list -> t
val const : ?loc:location -> ty:t -> ID.t -> t
val app_builtin : ?loc:location ->
ty:t -> Builtin.t -> t list -> t
val builtin : ?loc:location -> ty:t -> Builtin.t -> t
val bind : ?loc:location ->
ty:t ->
Binder.t -> t Var.t -> t -> t
val bind_list : ?loc:location ->
ty:t ->
Binder.t -> t Var.t list -> t -> t
val multiset : ?loc:location ->
ty:t -> t list -> t
val meta : ?loc:location -> meta_var -> t
val record : ?loc:location ->
ty:t ->
(string * t) list ->
rest:t Var.t option -> t
val record_flatten : ?loc:location ->
ty:t ->
(string * t) list -> rest:t option -> tIllFormedTerm if the rest is not either a record or a variable.val of_string : ?loc:location -> ty:t -> string -> tval at_loc : ?loc:location -> t -> t
val with_ty : ty:t -> t -> t
val map_ty : t -> f:(t -> t) -> t
val fresh_var : ?loc:location -> ty:t -> unit -> tmodule Ty:sig..end
module Form:sig..end
val is_var : t -> bool
val is_meta : t -> bool
val is_const : t -> bool
val is_ground : t -> booltrue iff there is no free variableval is_monomorphic : t -> booltrue if there are no type variablesval is_subterm : strict:bool -> t -> of_:t -> boolis_subterm a ~of_:b is true if a is a subterm of b.strict : if true, a must be a strict subterm of b,
that is, not b itselfval closed : t -> boolclosed t is true iff all bound variables of t occur under a
binder (i.e. they are actually bound in t)val open_binder : Binder.t -> t -> t Var.t list * topen_binder b (b v1 (b v2... (b vn t))) returns [v1,...,vn], tval var_occurs : var:t Var.t -> t -> boolvar_occurs ~var t is true iff var occurs in tval vars : t -> t Var.t list
val free_vars : t -> t Var.t list
val close_all : ty:t -> Binder.t -> t -> tinclude Interfaces.PRINT
module Set:Sequence.Set.Swith type elt = term
module Map:Sequence.Map.Swith type key = term
module Tbl:Hashtbl.Swith type key = term
module Seq:sig..end
module Subst:sig..end
exception UnifyFailure of string * (term * term) list
* location option
val pp_stack : (term * term) list CCFormat.printer
module UStack:sig..end
val unify : ?allow_open:bool ->
?loc:location ->
?st:UStack.t ->
?subst:Subst.t -> term -> term -> unitMeta. Regular variables are not modified.UnifyFailure if unification fails.allow_open : if true, metas can be unified to terms
with free variables (default false)st : used for backtrackingsubst : substitution for bound variablesval apply_unify : ?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).val deref_rec : t -> tval app_infer : ?st:UStack.t ->
?subst:Subst.t ->
t -> t list -> tapp_infer f l computes the type ty of f l, and return app ~ty f lUnifyFailure if types do not correspondval erase : t -> STerm.tmodule TPTP:sig..end
module ZF:sig..end