Theoria.Equation.Identity (theoria v0.6.0)

Copy Markdown View Source

Structured identity for generated equation artifacts.

Summary

Functions

Casts API selectors to structured names.

Builds a definition equation name.

Formats a structured equation name for humans.

Formats a declaration key for humans.

Builds an indexed matcher equation name.

Builds a matcher equation name.

Builds an identity for a simplifier-produced equality artifact.

Builds a definition unfold equation name.

Types

kind()

@type kind() ::
  :equation | :unfold | :matcher_equation | :indexed_matcher_equation | :simp

selector()

@type selector() :: t() | keyword()

t()

@type t() :: %Theoria.Equation.Identity{
  kind: kind(),
  namespace: atom() | nil,
  owner: atom(),
  target: atom()
}

Functions

cast(selector, owner \\ nil, kind \\ nil)

@spec cast(selector(), atom() | nil, kind() | nil) :: {:ok, t()} | {:error, term()}

Casts API selectors to structured names.

equation(owner, target)

@spec equation(atom(), atom()) :: t()

Builds a definition equation name.

format(identity)

@spec format(t()) :: String.t()

Formats a structured equation name for humans.

format_declaration(name)

@spec format_declaration(atom() | t()) :: String.t()

Formats a declaration key for humans.

indexed_matcher_equation(owner, target)

@spec indexed_matcher_equation(atom(), atom()) :: t()

Builds an indexed matcher equation name.

matcher_equation(owner, target)

@spec matcher_equation(atom(), atom()) :: t()

Builds a matcher equation name.

simp(owner \\ :simp, target \\ :normalize)

@spec simp(atom(), atom()) :: t()

Builds an identity for a simplifier-produced equality artifact.

unfold(owner)

@spec unfold(atom()) :: t()

Builds a definition unfold equation name.