Theoria.Theorem (theoria v0.3.0)

Copy Markdown View Source

A theorem accepted by the trusted kernel.

Summary

Functions

Checks and installs every theorem registered by a theorem module in order.

Adds a checked theorem to an environment as an opaque theorem declaration.

Returns trusted axioms used by a checked theorem.

Checks every theorem registered by a use Theoria.DSL theorem module.

Types

t()

@type t() :: %Theoria.Theorem{
  name: Theoria.Env.name(),
  proof: Theoria.Term.t(),
  type: Theoria.Term.t(),
  universe_params: [atom()]
}

Functions

add_all_to_env(module, env)

@spec add_all_to_env(module(), Theoria.Env.t()) ::
  {:ok, Theoria.Env.t(), [t()]} | {:error, {atom(), Theoria.Error.t()}}

Checks and installs every theorem registered by a theorem module in order.

add_to_env(env, theorem)

@spec add_to_env(Theoria.Env.t(), t()) ::
  {:ok, Theoria.Env.t()} | {:error, Theoria.Error.t()}

Adds a checked theorem to an environment as an opaque theorem declaration.

axioms(env, theorem)

@spec axioms(Theoria.Env.t(), t()) :: {:ok, MapSet.t(atom())}

Returns trusted axioms used by a checked theorem.

check_all(module, env)

@spec check_all(module(), Theoria.Env.t()) ::
  {:ok, [t()]} | {:error, {atom(), Theoria.Error.t()}}

Checks every theorem registered by a use Theoria.DSL theorem module.