# `ExGAM.Kernel.Recognition`
[🔗](https://github.com/elchemista/ex_gam/blob/0.1.0/lib/ex_gam/kernel/recognition.ex#L1)

Pure recognition of typed Evidence against typed Conditions.

Recognition answers only whether facts satisfy declared conditions. It
never resolves a Mandate, grants authority or performs I/O. Durable maps are
decoded before entering this module; consequently this algebra has one
record shape and cannot assign different meaning to atom- and string-keyed
representations of the same supposed fact.

Proposition, bindings, coverage and parameters remain portable opaque
values chosen by the application. Reserved recognition parameters use
string keys: `"issuer_refs"`, `"source_refs"`, `"required_labels"` and
`"accepted_assumptions"`.

A missing, stale, insufficient or provisional proof is `:undecidable`.
Explicit contrary Evidence is `:unsatisfied`; conflicting support and
contradiction remains `:undecidable` rather than being resolved by order.

# `reason`

```elixir
@type reason() :: term()
```

# `result`

```elixir
@type result() :: :satisfied | {:unsatisfied, [reason()]} | {:undecidable, [reason()]}
```

# `check`

```elixir
@spec check(
  [ExGAM.Condition.t()] | nil,
  [ExGAM.Evidence.t()] | map() | nil,
  integer()
) :: result()
```

Checks every condition against Evidence available at trusted `time`.

# `check_condition`

```elixir
@spec check_condition(ExGAM.Condition.t(), [ExGAM.Evidence.t()] | map(), integer()) ::
  :satisfied | {:unsatisfied, reason()} | {:undecidable, reason()}
```

Checks one Condition and returns a stable local explanation.

# `check_with_basis`

```elixir
@spec check_with_basis(
  [ExGAM.Condition.t()] | nil,
  [ExGAM.Evidence.t()] | map() | nil,
  integer()
) ::
  {result(), [String.t()]}
```

Checks conditions and returns the exact qualified Evidence basis.

The basis contains every current supporting or contradicting record that can
affect the result, plus qualified records used to establish assumptions.
This lets admission freeze the complete factual basis into its Act.

# `validate_declared_basis`

```elixir
@spec validate_declared_basis([String.t()], [String.t()]) :: :ok | {:error, term()}
```

Checks that every Evidence reference used by Recognition was declared by the Candidate.

---

*Consult [api-reference.md](api-reference.md) for complete listing*
