Theoria.Equality.Chain (theoria v0.5.0)

Copy Markdown View Source

Builds kernel-checked equality artifacts for rewrite/simp traces.

Summary

Functions

Starts an equality chain at a term of the given type.

Returns the proof term and strategy selected for a chain.

Realizes the chain as a checked equality artifact.

Appends one equality step to the chain.

Types

step()

@type step() :: %{after: Theoria.Term.t(), proof: Theoria.Term.t() | nil}

t()

@type t() :: %Theoria.Equality.Chain{
  current: Theoria.Term.t(),
  start: Theoria.Term.t(),
  steps: [step()],
  type: Theoria.Term.t()
}

Functions

new(type, start)

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

Starts an equality chain at a term of the given type.

proof_result(chain)

@spec proof_result(t()) :: Theoria.Equality.Chain.Result.t()

Returns the proof term and strategy selected for a chain.

realize(env, chain, identity)

@spec realize(Theoria.Env.t(), t(), Theoria.Equation.Identity.t()) ::
  {:ok, Theoria.Equation.Realized.t()} | {:error, term()}

Realizes the chain as a checked equality artifact.

step(chain, next, proof \\ nil)

@spec step(t(), Theoria.Term.t(), Theoria.Term.t() | nil) :: t()

Appends one equality step to the chain.