Module Logtk.Ind_ty
Inductive Types
val section : Util.Section.t
type constructor= private{cstor_name : ID.t;cstor_ty : Type.t;cstor_args : (Type.t * projector) list;}Constructor for an inductive type
type projector= private{p_id : ID.t;p_ty : Type.t;p_index : int;p_cstor : constructor lazy_t;}A projector for a given constructor and argument position
Inductive Types
type t= private{ty_id : ID.t;ty_vars : Type.t HVar.t list;ty_pattern : Type.t;ty_constructors : constructor list;ty_is_rec : bool lazy_t;ty_proof : Proof.t;}An inductive type, along with its set of constructors
val pp : t CCFormat.printer
exceptionInvalidDecl of stringexceptionNotAnInductiveType of ID.texceptionNotAnInductiveConstructor of ID.t
val declare_ty : ID.t -> ty_vars:Type.t HVar.t list -> constructor list -> proof:Proof.t -> tDeclare the given inductive type.
- raises InvalidDecl
if the type is already declared, or the list of constructors is empty
val as_inductive_ty : ID.t -> t optionval as_inductive_ty_exn : ID.t -> tUnsafe version of
as_inductive_ty- raises NotAnInductiveType
if the ID is not an inductive type
val is_inductive_ty : ID.t -> boolval as_inductive_type : Type.t -> (t * Type.t list) optionas_inductive_ty (list int)will returnlist, [int]as an inductive type applied to some arguments
val as_inductive_type_exn : Type.t -> t * Type.t listval is_inductive_type : Type.t -> boolis_inductive_type tyholds ifftyis an instance of some registered type (registered withdeclare_ty).
val is_inductive_simple_type : TypedSTerm.t -> boolval is_recursive : t -> boolval proof : t -> Proof.t
Constructors
val mk_constructor : ID.t -> Type.t -> (Type.t * (ID.t * Type.t)) list -> constructorval is_constructor : ID.t -> booltrue if the symbol is an inductive constructor (zero, successor...)
val as_constructor : ID.t -> (constructor * t) optionif
idis a constructor ofity, thenas_constructor idreturnsSome (cstor, ity)
val as_constructor_exn : ID.t -> constructor * tUnsafe version of
as_constructor- raises NotAnInductiveConstructor
if it fails
val contains_inductive_types : Term.t -> booltrueiff the term contains at least one subterm with an inductive type