You can search for identifiers within the package.
in-package search v0.2.0
Source file intf.ml
123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144(* Copyright (C) 2021 Alan Hu <alanh@ccs.neu.edu>
This Source Code Form is subject to the terms of the Mozilla Public
License, v. 2.0. If a copy of the MPL was not distributed with this
file, You can obtain one at https://mozilla.org/MPL/2.0/. *)type(_,_)eq=|Refl:('a,'a)eq(** Proof that ['a] and ['a] are equal. *)(** [('a, 'b) eq] is the proposition that ['a] and ['b] are equal. *)type'sortar=Arityof'sort[@@ocaml.unbox](** A helper type for specifying arities. *)type'sortva=Valenceof'sort[@@ocaml.unbox](** A helper type for specifying valences. *)(** The {i arity} of an operator typically consists of a sequence of sorts
{i s{_ 1}, ..., s{_ n}} describing the operator's parameters, and the sort
{i s} that the operator belongs to. The arity usually takes the form
{i s{_ 1} × ... × s{_ n} → s}.
Abstract binding trees record variables that are bound in the scope of a
term. Therefore, operands have a {i valence}, which lists the sorts of the
variables bound in the operand in addition to the sort of the operand
itself. The valence takes the form {i s{_ 1} × ... × s{_ k} → s}, where
{i s{_ 1}, ..., s{_ k}} are the sorts of the variables and {i s} is the
sort of the operand.
As a result, the arity for an operator of an abstract binding tree really
takes the form {i v{_ 1} × ... × v{_ n} → s} where each {i v{_ i}} is a
valence.
Throughout this library, the ['valence] type parameter takes the form
['s1 -> ... 'sk -> 's va] where each ['si] is the sort of a bound variable
and ['s] is the sort of the operand, and the ['arity] type parameter takes
the form ['v1 -> ... -> 'vn -> 's ar], where each ['vi] is a valence of
of an operand and ['s] is the sort of the operator. *)moduletypeSort=sigtype'sortt(** The type parameter is a phantom type that represents the sort. *)valequal:'sort1t->'sort2t->(('sort1,'sort2)eq,('sort1,'sort2)eq->'any)Either.t(** Decides the equality of two sorts. Iff the sorts are equal, returns
a proof that their types are equal. Iff the sorts are unequal, it
returns a proof that their types are not equal. *)end(** A sort is the syntactic class that an operator belongs to. *)moduletypeOperator=sigtype('arity,'sort)t(** The operator's type contains two phantom type parameters, the first for
the operator's arity and the second for the operator's sort. *)valequal:('arity1,'sort)t->('arity2,'sort)t->('arity1,'arity2)eqoption(** Checks the equality of two operators from the same sort. Iff the
operators are equal, returns a proof that their arities are equal. *)valpp_print:Format.formatter->(_,_)t->unit(** Prettyprints the operator. *)end(** An operator is a function symbol. *)moduletypeVariable=sigtype'sortt(** A variable annotated by its sort. *)type'sortsort(** A sort. *)valfresh:'sortsort->string->'sortt(** Generates a fresh variable of the given sort. The variable is unique
from any other variable generated from the function. *)valsort:'sortt->'sortsort(** Retrieves the sort of the variable. *)valname:_t->string(** Retrieves the name of the variable. *)valequal:'sort1t->'sort2t->('sort1,'sort2)eqoption(** Checks two variables for equality. Iff the variables are equal, returns
[Some proof] that their sorts are the same. *)endmoduletypeS=sigmoduleSort:SortmoduleOperator:OperatormoduleVariable:Variablewithtype'sortsort='sortSort.ttype'valencet(** An abstract binding tree (ABT). ['valence] is a phantom type parameter
representing the valence of the ABT. *)type('arity,'sort)operands=|[]:('sortar,'sort)operands(** An empty list of operands. *)|(::):'valencet*('arity,'sort)operands->('valence->'arity,'sort)operands(** An operand followed by a list of operands. *)(** A list of operands. *)type'valenceview=|Abs:'sortVariable.t*'valencet->('sort->'valence)view(** An abstractor, which binds a variable within a term. *)|Op:('arity,'sort)Operator.t*('arity,'sort)operands->'sortvaview(** An operator applied to operands. *)|Var:'sortVariable.t->'sortvaview(** A variable. *)(** A view of an ABT.*)valabs:'sortVariable.t->'valencet->('sort->'valence)t(** Constructs an abstractor ABT. *)valop:('arity,'sort)Operator.t->('arity,'sort)operands->'sortvat(** Constructs an operation ABT. *)valvar:'sortVariable.t->'sortvat(** Constructs a variable ABT. *)valinto:'valenceview->'valencet(** Constructs an ABT from a view. *)valout:'valencet->'valenceview(** Views an ABT. *)valsubst:'sortSort.t->('sortVariable.t->'sortvatoption)->'valencet->'valencet(** Applies a substitution to the ABT. *)valaequiv:'valencet->'valencet->bool(** Checks two ABTs for alpha-equivalence. Two ABTs are alpha-equivalent iff
they are structurally equal up to renaming of bound variables. *)valpp_print:Format.formatter->_t->unit(** Pretty-prints an ABT. *)end(** Output signature of the functor {!module:Make}. *)