package elpi

  1. Overview
  2. Docs

This module exposes the low level representation of terms. * * The data type term is opaque and can only be accessed by using the * look API that exposes a term view. The look view automatically * substitutes assigned unification variables by their value.

type constant = int

De Bruijn levels (not indexes): the distance of the binder from the root. Starts at 0 and grows for bound variables; global constants have negative values.

type builtin

De Bruijn levels (not indexes): the distance of the binder from the root. Starts at 0 and grows for bound variables; global constants have negative values.

type term = Data.term
type view = private
  1. | Const of constant
  2. | Lam of term
  3. | App of constant * term * term list
  4. | Cons of term * term
  5. | Nil
  6. | Builtin of builtin * term list
  7. | CData of RawOpaqueData.t
  8. | UnifVar of FlexibleData.Elpi.t * term list
val look : depth:int -> term -> view

Terms must be inspected after dereferencing their head. If the resulting term is UVar then its uvar_body is such that get_assignment uvar_body = None

val kool : view -> term
val mkGlobalS : string -> term

Smart constructors

val mkBound : constant -> term
val mkLam : term -> term
val mkAppS : string -> term -> term list -> term
val mkAppSL : string -> term list -> term
val mkCons : term -> term -> term
val mkNil : term
val mkDiscard : term
val mkBuiltinS : string -> term list -> term
val mkCData : RawOpaqueData.t -> term
val mkUnifVar : FlexibleData.Elpi.t -> args:term list -> State.t -> term
val mkGlobal : constant -> term

Lower level smart constructors

val mkApp : constant -> term -> term list -> term
val mkAppL : constant -> term list -> term
val mkBuiltin : builtin -> term list -> term
val mkConst : constant -> term
type hyp = {
  1. hdepth : int;
  2. hsrc : term;
}
type hyps = hyp list
val of_hyps : Data.hyp list -> hyps
type suspended_goal = {
  1. context : hyps;
  2. goal : int * term;
}
val constraints : Data.constraints -> suspended_goal list
val no_constraints : Data.constraints
module Constants : sig ... end
OCaml

Innovation. Community. Security.