module Type:sig..end
Types are represented using InnerTerm, with kind Type. Therefore, they are hashconsed and scoped.
Common representation of types, including higher-order and polymorphic types. All type variables are assumed to be universally quantified in the outermost possible scope (outside any other quantifier).
See TypeInference for inferring types from terms and formulas,
and Signature to associate types with symbols.
TODO: think of a good way of representating AC operators (+, ...)
typet = privateInnerTerm.t
typety =t
type builtin =
| |
TType |
| |
Prop |
| |
Term |
| |
Rat |
| |
Int |
val pp_builtin : builtin CCFormat.printer
val builtin_conv : builtin -> Builtin.t
type view = private
| |
Builtin of |
|||
| |
Var of |
|||
| |
DB of |
|||
| |
App of |
(* |
parametrized type
| *) |
| |
Fun of |
(* |
Function type (left to right, no left-nesting)
| *) |
| |
Forall of |
(* |
explicit quantification using De Bruijn index
| *) |
val view : t -> viewAssert_failure if the argument is not a typeinclude Interfaces.HASH
include Interfaces.ORD
val is_tType : t -> bool
val is_var : t -> bool
val is_bvar : t -> bool
val is_app : t -> bool
val is_fun : t -> bool
val is_forall : t -> boolval tType : t
val prop : t
val term : t
val int : t
val rat : t
val var : t HVar.t -> t
val var_of_int : int -> tval app : ID.t -> t list -> tval builtin : builtin -> t
val const : ID.t -> tval arrow : t list -> t -> tarrow l r is the type l -> r.val forall : t -> tval forall_n : int -> t -> tn type variable. Careful with the De Bruijn indices!val bvar : int -> tval (==>) : t list -> t -> tl ==> x is the same as x if l
is empty. Invariant: the return type is never a function type.val of_term_unsafe : InnerTerm.t -> tType.view fail. Only
use with caution.val of_terms_unsafe : InnerTerm.t list -> t list
val cast_var_unsafe : InnerTerm.t HVar.t -> t HVar.tmodule Set:CCSet.Swith type elt = t
module Map:CCMap.Swith type key = t
module Tbl:CCHashtbl.Swith type key = t
module Seq:sig..end
module VarSet:CCSet.Swith type elt = t HVar.t
module VarMap:CCMap.Swith type key = t HVar.t
module VarTbl:CCHashtbl.Swith type key = t HVar.t
val vars_set : VarSet.t -> t -> VarSet.tval vars : t -> t HVar.t listval close_forall : t -> ttype arity_result =
| |
Arity of |
| |
NoArity |
val arity : t -> arity_resultarity ty returns Arity (a, b) that means that it
expects a arguments to be used as arguments of Forall, and
b arguments to be used for function application. If
it returns NoArity then the arity is unknown (variable)val expected_args : t -> t listty. The length of the
list expected_args ty is the same as snd (arity ty).val expected_ty_vars : t -> intval is_ground : t -> bool
val size : t -> intval depth : t -> intval open_poly_fun : t -> int * t list * topen_poly_fun ty "unrolls" polymorphic function arrows from the left, so that
open_fun (forall a b. f a -> (g b -> (c -> d))) returns 2; [f a;g b;c], d.val open_fun : t -> t list * topen_fun ty "unrolls" function arrows from the left, so that
open_fun (a -> (b -> (c -> d))) returns [a;b;c], d.exception ApplyError of string
Type.apply failsval apply : t -> t list -> tApplyError if the types do not matchval apply1 : t -> t -> tapply1 a b is short for apply a [b].val apply_unsafe : t -> InnerTerm.t list -> tType.apply, but assumes its arguments are well-formed
types without more ado.ApplyError if types do not matchAssert_failure if the arguments are not proper typesinclude Interfaces.PRINT_DE_BRUIJN
include Interfaces.PRINT
val pp_surrounded : t CCFormat.printer
val pp_typed_var : t HVar.t CCFormat.printermodule TPTP:sig..end
module Conv:sig..end