Theoria.Equation.Extension (theoria v0.5.0)

Copy Markdown View Source

Experimental/internal API for 0.2; subject to change before 0.3. Typed registry helpers for generated equation and matcher metadata.

Summary

Functions

Builds an in-memory equation registry snapshot from the environment.

Returns equation definitions known to the registry.

Returns generated ordinary equation names for a source definition.

Returns generated ordinary equation names for a source definition in an environment.

Returns generated ordinary equation identities for a source definition.

Returns generated ordinary equation identities for a source definition in an environment.

Returns generated matcher equation names for a matcher declaration.

Returns generated matcher equation identities for a matcher declaration.

Returns matcher declarations known to the registry.

Returns matcher declarations generated for a source definition.

Returns whether a generated theorem can be realized from registry metadata.

Realizes any generated ordinary, unfold, or matcher equation theorem without installing it.

Realizes every theorem known to the generated equation registry.

Returns the source definition or matcher for a generated theorem name.

Returns compact registry counts for diagnostics and validation output.

Returns all generated theorem names known to the registry.

Returns all generated theorem identities known to the registry.

Returns the unfold theorem identity for a source definition.

Returns the unfold theorem name for a source definition.

Validates registry coherence and theorem realization.

Functions

build(env)

Builds an in-memory equation registry snapshot from the environment.

definitions(env)

@spec definitions(Theoria.Env.t()) :: [Theoria.Equation.Info.t()]

Returns equation definitions known to the registry.

equation_identities(info)

@spec equation_identities(Theoria.Equation.Info.t()) :: [atom()]

Returns generated ordinary equation names for a source definition.

equation_identities(env, source)

@spec equation_identities(Theoria.Env.t(), atom()) ::
  {:ok, [atom()]} | {:error, term()}

Returns generated ordinary equation names for a source definition in an environment.

equation_ids(info)

Returns generated ordinary equation identities for a source definition.

equation_ids(env, source)

@spec equation_ids(Theoria.Env.t(), atom()) ::
  {:ok, [Theoria.Equation.Identity.t()]} | {:error, term()}

Returns generated ordinary equation identities for a source definition in an environment.

matcher_equation_identities(env, matcher)

@spec matcher_equation_identities(Theoria.Env.t(), Theoria.Env.Matcher.t()) :: [
  atom()
]

Returns generated matcher equation names for a matcher declaration.

matcher_equation_ids(env, matcher)

@spec matcher_equation_ids(Theoria.Env.t(), Theoria.Env.Matcher.t()) :: [
  Theoria.Equation.Identity.t()
]

Returns generated matcher equation identities for a matcher declaration.

matchers(env)

@spec matchers(Theoria.Env.t()) :: [Theoria.Env.Matcher.t()]

Returns matcher declarations known to the registry.

matchers_for(env, source)

@spec matchers_for(Theoria.Env.t(), atom()) :: [Theoria.Env.Matcher.t()]

Returns matcher declarations generated for a source definition.

realizable?(env, theorem_name)

@spec realizable?(Theoria.Env.t(), term()) :: boolean()

Returns whether a generated theorem can be realized from registry metadata.

realize(env, theorem_name)

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

Realizes any generated ordinary, unfold, or matcher equation theorem without installing it.

realize_all(env)

@spec realize_all(Theoria.Env.t()) :: {:ok, [Theoria.Theorem.t()]} | {:error, term()}

Realizes every theorem known to the generated equation registry.

source_for(env_or_registry, theorem_name)

@spec source_for(Theoria.Env.t() | Theoria.Equation.Extension.Registry.t(), term()) ::
  {:ok, atom()} | :error

Returns the source definition or matcher for a generated theorem name.

summary(env)

Returns compact registry counts for diagnostics and validation output.

theorem_identities(env)

@spec theorem_identities(Theoria.Env.t() | Theoria.Equation.Extension.Registry.t()) ::
  [atom()]

Returns all generated theorem names known to the registry.

theorem_ids(env)

Returns all generated theorem identities known to the registry.

unfold_id(env, source)

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

Returns the unfold theorem identity for a source definition.

unfold_identity(env, source)

@spec unfold_identity(Theoria.Env.t(), atom()) :: {:ok, atom()} | {:error, term()}

Returns the unfold theorem name for a source definition.

validate(env)

@spec validate(Theoria.Env.t()) :: :ok | {:error, term()}

Validates registry coherence and theorem realization.