package tyabt

  1. Overview
  2. Docs

Module Tyabt.MakeSource

Functor building an implementation of abstract binding trees given a signature.

Parameters

module Sort : Sort

Signature

Sourcemodule Sort : Sort with type 'sort t = 'sort Sort.t
Sourcemodule Operator : Operator with type ('arity, 'sort) t = ('arity, 'sort) Operator.t
Sourcemodule Variable : Variable with type 'sort sort = 'sort Sort.t
Sourcetype 'valence t

An abstract binding tree (ABT). 'valence is a phantom type parameter representing the valence of the ABT.

Sourcetype ('arity, 'sort) operands =
  1. | [] : ('sort ar, 'sort) operands
    (*

    An empty list of operands.

    *)
  2. | :: : 'valence t * ('arity, 'sort) operands -> ('valence -> 'arity, 'sort) operands
    (*

    An operand followed by a list of operands.

    *)

A list of operands.

Sourcetype 'valence view =
  1. | Abs : 'sort Variable.t * 'valence t -> ('sort -> 'valence) view
    (*

    An abstractor, which binds a variable within a term.

    *)
  2. | Op : ('arity, 'sort) Operator.t * ('arity, 'sort) operands -> 'sort va view
    (*

    An operator applied to operands.

    *)
  3. | Var : 'sort Variable.t -> 'sort va view
    (*

    A variable.

    *)

A view of an ABT.

Sourceval abs : 'sort Variable.t -> 'valence t -> ('sort -> 'valence) t

Constructs an abstractor ABT.

Sourceval op : ('arity, 'sort) Operator.t -> ('arity, 'sort) operands -> 'sort va t

Constructs an operation ABT.

Sourceval var : 'sort Variable.t -> 'sort va t

Constructs a variable ABT.

Sourceval into : 'valence view -> 'valence t

Constructs an ABT from a view.

Sourceval out : 'valence t -> 'valence view

Views an ABT.

Sourceval subst : 'sort Sort.t -> ('sort Variable.t -> 'sort va t option) -> 'valence t -> 'valence t

Applies a substitution to the ABT.

Sourceval aequiv : 'valence t -> 'valence t -> bool

Checks two ABTs for alpha-equivalence. Two ABTs are alpha-equivalent iff they are structurally equal up to renaming of bound variables.

Sourceval pp_print : Format.formatter -> _ t -> unit

Pretty-prints an ABT.