module InnerTerm:sig..end
Those terms are not designed to be used directly, but rather to provide
a generic backend (implementing De Bruijn indices, subterms, substitutions,
etc.) for other more specific representations like Type, FOTerm, ...
type t
typeterm =t
type view = private
| |
Var of |
(* |
Free variable
| *) |
| |
DB of |
|||
| |
Bind of |
(* |
Type, sub-term
| *) |
| |
Const of |
(* |
Constant
| *) |
| |
App of |
(* |
Uncurried application
| *) |
| |
AppBuiltin of |
(* |
For representing special constructors
| *) |
val view : t -> viewtype type_result =
| |
NoType |
| |
HasType of |
val ty : t -> type_resultval ty_exn : t -> tInnerTerm.ty, but fails if the term has no typeInvalid_argument if the type is NoTypeinclude Interfaces.HASH
include Interfaces.ORD
val same_l : t list -> t list -> bool
Some constructors, such as record, may raise
InnerTerm.IllFormedTermif the arguments are ill-formed (several occurrences of
a key), or, for variables, if the number is negative
exception IllFormedTerm of string
typenat =int
val const : ty:t -> ID.t -> t
val app : ty:t -> t -> t list -> t
val bind : ty:t -> varty:t -> Binder.t -> t -> t
val var : t HVar.t -> t
val bvar : ty:t -> nat -> t
val app_builtin : ty:t -> Builtin.t -> t list -> t
val builtin : ty:t -> Builtin.t -> t
val tType : tKind.Typeval cast : ty:t -> t -> tval is_var : t -> bool
val is_bvar : t -> bool
val is_const : t -> bool
val is_bind : t -> bool
val is_app : t -> bool
val hashcons_stats : unit -> int * int * int * int * int * intmodule Map:CCMap.Swith type key = term
module Set:CCSet.Swith type elt = term
module Tbl:CCHashtbl.Swith type key = term
module VarMap:CCMap.Swith type key = t HVar.t
module VarSet:CCSet.Swith type elt = t HVar.t
module VarTbl:CCHashtbl.Swith type key = t HVar.t
module DB:sig..end
module Seq:sig..end
module Pos:sig..end
val replace : t -> old:t -> by:t -> treplace t ~old ~by syntactically replaces all occurrences of old
in t by the term by.val bind_vars : ty:t ->
Binder.t -> t HVar.t list -> t -> tbind_vars ~ty b vars t binds each v in vars with the binder b,
with body t, and each intermediate result has type ty
(not suitable for functions)val close_vars : ty:t -> Binder.t -> t -> tval is_ground : t -> booltrue if the term contains no free variablesval size : t -> int
val depth : t -> int
val head : t -> ID.t optionval print_hashconsing_ids : bool Pervasives.refinclude Interfaces.PRINT
include Interfaces.PRINT_DE_BRUIJN
val add_default_hook : print_hook -> unitval debugf : t CCFormat.printer