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 -> view
type
type_result =
| |
NoType |
| |
HasType of |
val ty : t -> type_result
val ty_exn : t -> t
InnerTerm.ty
, but fails if the term has no typeInvalid_argument
if the type is NoType
include Interfaces.HASH
include Interfaces.ORD
val same_l : t list -> t list -> bool
Some constructors, such as record
, may raise
InnerTerm.IllFormedTerm
if 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 : t
Kind.Type
val cast : ty:t -> t -> t
val 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 * int
module Map:CCMap.S
with type key = term
module Set:CCSet.S
with type elt = term
module Tbl:CCHashtbl.S
with type key = term
module VarMap:CCMap.S
with type key = t HVar.t
module VarSet:CCSet.S
with type elt = t HVar.t
module VarTbl:CCHashtbl.S
with type key = t HVar.t
module DB:sig
..end
module Seq:sig
..end
module Pos:sig
..end
val replace : t -> old:t -> by:t -> t
replace 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 -> t
bind_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 -> t
val is_ground : t -> bool
true
if the term contains no free variablesval size : t -> int
val depth : t -> int
val head : t -> ID.t option
val print_hashconsing_ids : bool Pervasives.ref
include Interfaces.PRINT
include Interfaces.PRINT_DE_BRUIJN
val add_default_hook : print_hook -> unit
val debugf : t CCFormat.printer