Theoria.Equation.Branch (theoria v0.4.0)

Copy Markdown View Source

Experimental/internal API for 0.2; subject to change before 0.3. Internal constructor-specific branch descriptors for equation compilation.

Summary

Functions

Builds a generic branch descriptor from recursor-rule metadata.

Builds the List cons branch descriptor.

Builds the Nat successor branch descriptor.

Builds a Vec cons branch metadata descriptor for indexed-equation planning.

Wraps a body in the branch binders.

Types

binder()

@type binder() :: {atom(), Theoria.Term.t()}

t()

@type t() :: %Theoria.Equation.Branch{
  binders: [binder()],
  context: Theoria.Equation.Context.t()
}

Functions

from_recursor_rule(clause, rule, field_types, outer \\ %{})

@spec from_recursor_rule(
  Theoria.Equation.Clause.t(),
  Theoria.Env.RecursorRule.t(),
  [Theoria.Term.t()],
  map()
) :: t()

Builds a generic branch descriptor from recursor-rule metadata.

list_cons(clause, element_type, motive)

Builds the List cons branch descriptor.

nat_succ(clause)

@spec nat_succ(Theoria.Equation.Clause.t()) :: t()

Builds the Nat successor branch descriptor.

vec_cons(clause, element_type, length_index, motive)

Builds a Vec cons branch metadata descriptor for indexed-equation planning.

wrap(branch, body)

@spec wrap(t(), Theoria.Term.t()) :: Theoria.Term.t()

Wraps a body in the branch binders.