package dolmen

  1. Overview
  2. Docs
Legend:
Page
Library
Module
Module type
Parameter
Class
Class type
Source

Module Expr.TySource

Usual definitions
Sourcetype t = ty

The type of types.

Sourcetype subst = (ty_var, ty) Subst.t

The type of substitutions over types.

Sourcetype 'a tag = 'a Tag.t

A type for tags to attach to arbitrary types.

Sourceexception Bad_arity of ty_cst * t list

Raised when applying a type constant to the wrong number of arguments.

Sourceexception Prenex_polymorphism of t

Raised when the type provided is polymorphic, but occurred in a place where polymorphic types are forbidden by prenex/rank-1 polymorphism.

Sourceval hash : t -> int

A hash function for types, should be suitable to create hashtables.

Sourceval equal : t -> t -> bool

An equality function on types. Should be compatible with the hash function.

Sourceval compare : t -> t -> int

Comparison function over types. Should be compativle with the equality function.

Sourceval print : Format.formatter -> t -> unit

Printing function.

Alias management
Sourceval alias_to : ty_cst -> ty_var list -> ty -> unit

Alias the given type constant.

Sourceval expand_head : t -> t

Expand head aliases.

View
Sourcetype view = [
  1. | `Int
    (*

    Integers

    *)
  2. | `Rat
    (*

    Rationals

    *)
  3. | `Real
    (*

    Reals

    *)
  4. | `Array of ty * ty
    (*

    Function arrays, from source to destination type.

    *)
  5. | `Bitv of int
    (*

    Bitvectors of fixed length.

    *)
  6. | `Float of int * int
    (*

    Floating points.

    *)
  7. | `String
    (*

    Strings

    *)
  8. | `String_reg_lang
    (*

    Regular languages over strings

    *)
  9. | `Var of ty_var
    (*

    Variables (excluding wildcards)

    *)
  10. | `Wildcard of ty_var
    (*

    Wildcards

    *)
  11. | `App of [ `Generic of ty_cst | `Builtin of builtin ] * ty list
    (*

    Generic applications.

    *)
  12. | `Arrow of ty list * ty
  13. | `Pi of ty_var list * ty
]

View on types.

Sourceval view : t -> view

View on types.

Sourceval pi_arity : t -> int

Reutnrs the number of expected type arguments that the given type expects (i.e. the number of prenex polymorphic variables in the given type).

Sourceval poly_sig : t -> ty_var list * ty list * ty

Split a type into a polymorphic signature.

Type structure definition
Sourcetype adt_case = {
  1. cstr : term_cst;
  2. tester : term_cst;
  3. dstrs : term_cst option array;
}

One case of an algebraic datatype definition.

Sourcetype def =
  1. | Abstract
  2. | Adt of {
    1. ty : ty_cst;
    2. record : bool;
    3. cases : adt_case array;
    }

The various ways to define a type inside the solver.

Sourceval define : ty_cst -> def -> unit

Register a type definition.

Sourceval definition : ty_cst -> def option

Return the definition of a type (if it exists).

Variables and constants
Sourcemodule Var : sig ... end

A module for variables that occur in types.

Sourcemodule Const : sig ... end

A module for constant symbols the occur in types.

Sourceval prop : t

The type of propositions

Sourceval bool : t

Alias for prop.

Sourceval unit : t

The unit type.

Sourceval base : t

An arbitrary type.

Sourceval int : t

The type of integers

Sourceval rat : t

The type of rationals

Sourceval real : t

The type of reals.

Sourceval string : t

The type of strings

Sourceval string_reg_lang : t

The type of regular language over strings.

Sourceval of_var : Var.t -> t

Create a type from a variable.

Sourceval apply : Const.t -> t list -> t

Application for types.

Sourceval arrow : t list -> t -> t

Create an arrow type (i.e. function type)

Sourceval pi : Var.t list -> t -> t

Create a prenex/rank-1 polymorphic type.

Sourceval array : t -> t -> t

Build an array type from source to destination types.

Sourceval bitv : int -> t

Bitvectors of a given length.

Sourceval float : int -> int -> t

Floating point of given exponent and significand.

Sourceval roundingMode : t

Type for the various Floating point rounding modes.

Sourceval subst : ?fix:bool -> subst -> t -> t

Substitution on types.

Sourceval fv : t -> Var.t list

Returns the list of free variables in the type.

Sourceval unify : t -> t -> t option

Try and unify two types.

Sourceval set_wildcard : ty_var -> t -> unit

Instantiate the given wildcard.

Sourceval add_wildcard_hook : hook:(ty_var -> ty -> unit) -> ty_var -> unit

Tag for hooks called upon the wildcard instantiation.

Sourceval get_tag : t -> 'a Tag.t -> 'a option

Get the value bound to a tag.

Sourceval get_tag_list : t -> 'a list Tag.t -> 'a list

Get the list of values bound to a list tag, returning the empty list if no value is bound.

Sourceval get_tag_last : t -> 'a list Tag.t -> 'a option

Get the last value bound to a list tag.

Sourceval set_tag : t -> 'a Tag.t -> 'a -> unit

Set the value bound to the tag.

Sourceval add_tag : t -> 'a list Tag.t -> 'a -> unit

Bind an additional value to a list tag.

Sourceval add_tag_opt : t -> 'a list Tag.t -> 'a option -> unit

Optionally bind an additional value to a list tag.

Sourceval add_tag_list : t -> 'a list Tag.t -> 'a list -> unit

Bind a list of additional values to a list tag.

Sourceval unset_tag : t -> _ Tag.t -> unit

Remove the binding to the given tag.

OCaml

Innovation. Community. Security.