# lawref.evaluator

*module*

Оракул L0 — первый инкремент (WP-07-срез): support-семантика assertions,
тривиальная epistemic acceptance, halt-политика E-0001, календарные операции,
schema-валидный результат с proof graph и детерминированными хэшами.

Ещё не реализовано (по вехам WP-07): strict rules (naive fixpoint), closure [§70](https://github.com/arxohq/law/blob/master/spec/SPEC.ru/10-part-x-propositions-and-four-valued-support.ru.md#70-closed-world-declarations),
collect/агрегаты [§51](https://github.com/arxohq/law/blob/master/spec/SPEC.ru/08-part-viii-type-system.ru.md#51-collections)–52.1, relation keys [§45.1](https://github.com/arxohq/law/blob/master/spec/SPEC.ru/08-part-viii-type-system.ru.md#451-relation-keys)/KEY_CONFLICT [§196](https://github.com/arxohq/law/blob/master/spec/SPEC.ru/27-part-xxvi-static-semantics-and-diagnostics.ru.md#196-data-quality-checks) — оракул
наращивается вертикальными срезами, каждый закрывает конкретные векторы.

Хэш-конвенции v1 (кандидаты в errata при расхождении с будущей нормой):
- manifest.semanticHash = sha256 канонических байтов манифеста без semanticHash;
- proofGraph.proofHash = sha256 канонических байтов графа без proofHash;
- resultHash = sha256 канонических байтов документа без resultHash и
  executionReceipt ([§2.18](https://github.com/arxohq/law/blob/master/spec/SPEC.ru/01-part-i-audit.ru.md#218-версия-compiler-не-должна-загрязнять-semantic-manifest)/AUDIT [§2.13](https://github.com/arxohq/law/blob/master/spec/AUDIT.ru.md#213-compiler-identity-в-semantic-hash): receipt вне semantic result);
- оракул receipt не эмитит (поле опционально) — выход детерминирован байтово.

Модуль вырос в пакет: границы совпадают с секциями `law-eval/src/lib.rs`, с
которым оракул сверяется байтово (FND [§5.4](https://github.com/arxohq/law/blob/master/spec/FOUNDATION.ru.md#54-differential-контракт)). Публичная поверхность прежняя —
`from lawref.evaluator import evaluate` продолжает работать.

## lawref.evaluator.ACCEPTED_ORIGINS

*attribute* · *module attribute*

```python
ACCEPTED_ORIGINS = {'case_input', 'source_asserted', 'external_snapshot', 'adjudicated', 'derived'}
```

Re-exported from: `lawref.evaluator.facts`

[View source](https://github.com-arxohq/arxo-io/law/blob/2edc2b92ce22b52e03f4081d2769a58229684379/engines/lawref/lawref/evaluator/facts.py#L17-L17)

## lawref.evaluator.NORM_STD

*attribute* · *module attribute*

```python
NORM_STD = 'urn:law:std#'
```

Re-exported from: `lawref.evaluator.norms`

[View source](https://github.com-arxohq/arxo-io/law/blob/2edc2b92ce22b52e03f4081d2769a58229684379/engines/lawref/lawref/evaluator/norms.py#L29-L29)

## lawref.evaluator.SCHEMA_VERSION

*attribute* · *module attribute*

```python
SCHEMA_VERSION = 'law.core.evaluation/0.1'
```

Re-exported from: `lawref.evaluator.document`

[View source](https://github.com-arxohq/arxo-io/law/blob/2edc2b92ce22b52e03f4081d2769a58229684379/engines/lawref/lawref/evaluator/document.py#L19-L19)

## lawref.evaluator.EvaluationRequest

*class* · *dataclass*

```python
class EvaluationRequest
```

Re-exported from: `lawref.evaluator.engine`

Типизированный единственный вход evaluation (DECISION-0111 [§2.2](https://github.com/arxohq/law/blob/master/spec/SPEC.ru/01-part-i-audit.ru.md#22-четырёхзначной-логики-самой-по-себе-недостаточно)).

Семантические options живут только в ``case["options"]``. Calendar,
external snapshots и receipt — transport-поля запроса и не входят в
caseHash. Неизвестный верхнеуровневый ключ wire-формы отклоняет схема.

[View source](https://github.com-arxohq/arxo-io/law/blob/2edc2b92ce22b52e03f4081d2769a58229684379/engines/lawref/lawref/evaluator/engine.py#L104-L251)

### lawref.evaluator.EvaluationRequest.calendar_resource

*attribute* · *class attribute* · *instance attribute*

```python
calendar_resource: bytes | None = None
```

[View source](https://github.com-arxohq/arxo-io/law/blob/2edc2b92ce22b52e03f4081d2769a58229684379/engines/lawref/lawref/evaluator/engine.py#L116-L116)

### lawref.evaluator.EvaluationRequest.case

*attribute* · *instance attribute*

```python
case: dict
```

[View source](https://github.com-arxohq/arxo-io/law/blob/2edc2b92ce22b52e03f4081d2769a58229684379/engines/lawref/lawref/evaluator/engine.py#L114-L114)

### lawref.evaluator.EvaluationRequest.editions_as_presented

*attribute* · *class attribute* · *instance attribute*

```python
editions_as_presented: str | None = None
```

[View source](https://github.com-arxohq/arxo-io/law/blob/2edc2b92ce22b52e03f4081d2769a58229684379/engines/lawref/lawref/evaluator/engine.py#L123-L123)

### lawref.evaluator.EvaluationRequest.external_snapshots

*attribute* · *class attribute* · *instance attribute*

```python
external_snapshots: tuple[dict, ...] = field(default_factory=tuple)
```

[View source](https://github.com-arxohq/arxo-io/law/blob/2edc2b92ce22b52e03f4081d2769a58229684379/engines/lawref/lawref/evaluator/engine.py#L117-L117)

### lawref.evaluator.EvaluationRequest.ir

*attribute* · *instance attribute*

```python
ir: dict
```

[View source](https://github.com-arxohq/arxo-io/law/blob/2edc2b92ce22b52e03f4081d2769a58229684379/engines/lawref/lawref/evaluator/engine.py#L113-L113)

### lawref.evaluator.EvaluationRequest.proof_graph

*attribute* · *class attribute* · *instance attribute*

```python
proof_graph: bool = True
```

[View source](https://github.com-arxohq/arxo-io/law/blob/2edc2b92ce22b52e03f4081d2769a58229684379/engines/lawref/lawref/evaluator/engine.py#L127-L127)

### lawref.evaluator.EvaluationRequest.query

*attribute* · *instance attribute*

```python
query: dict
```

[View source](https://github.com-arxohq/arxo-io/law/blob/2edc2b92ce22b52e03f4081d2769a58229684379/engines/lawref/lawref/evaluator/engine.py#L115-L115)

### lawref.evaluator.EvaluationRequest.receipt

*attribute* · *class attribute* · *instance attribute*

```python
receipt: dict | None = None
```

[View source](https://github.com-arxohq/arxo-io/law/blob/2edc2b92ce22b52e03f4081d2769a58229684379/engines/lawref/lawref/evaluator/engine.py#L118-L118)

### lawref.evaluator.EvaluationRequest.semantic_version

*attribute* · *class attribute* · *instance attribute*

```python
semantic_version: str = ''
```

[View source](https://github.com-arxohq/arxo-io/law/blob/2edc2b92ce22b52e03f4081d2769a58229684379/engines/lawref/lawref/evaluator/engine.py#L119-L119)

### lawref.evaluator.EvaluationRequest.build

*method* · *classmethod*

```python
def build(ir: dict, case: dict, query: dict, options: dict | None = None, external_snapshots: list[dict] | tuple[dict, ...] | None = None, *, semantic_version: str | None = None, editions_as_presented: str | None = None) -> 'EvaluationRequest'
```

Собрать typed request из внутренних объектов хоста.

``options`` здесь — лишь адаптер старых хостовых переменных на
единственное нормативное место ``case.options``. Несемантические
calendar/receipt извлекаются из него и в caseHash не попадают.
Если хост не передал версию явно, она наследуется из закреплённого IR.
Отозванная ветвь 0.1 отклоняется по обеим осям: ни IR, ни явная
версия request не могут вернуть её в active evaluation.
Публичная граница исполнения всё равно одна: ``evaluate(request)``.

[View source](https://github.com-arxohq/arxo-io/law/blob/2edc2b92ce22b52e03f4081d2769a58229684379/engines/lawref/lawref/evaluator/engine.py#L150-L182)

### lawref.evaluator.EvaluationRequest.from_dict

*method* · *classmethod*

```python
def from_dict(document: dict) -> 'EvaluationRequest'
```

[View source](https://github.com-arxohq/arxo-io/law/blob/2edc2b92ce22b52e03f4081d2769a58229684379/engines/lawref/lawref/evaluator/engine.py#L184-L209)

### lawref.evaluator.EvaluationRequest.from_wire_bytes

*method* · *classmethod*

```python
def from_wire_bytes(raw: bytes) -> 'EvaluationRequest'
```

Build a request from the exact bytes admitted to the verdict cache.

The cache key is safe only when this method itself parsed ``raw`` into
the object passed to validation. Object callers use :meth:`from_dict`.

[View source](https://github.com-arxohq/arxo-io/law/blob/2edc2b92ce22b52e03f4081d2769a58229684379/engines/lawref/lawref/evaluator/engine.py#L211-L239)

## lawref.evaluator.EvaluationRequestError

*class*

```python
class EvaluationRequestError(ValueError)
```

Bases: `ValueError`

Re-exported from: `lawref.evaluator.engine`

[View source](https://github.com-arxohq/arxo-io/law/blob/2edc2b92ce22b52e03f4081d2769a58229684379/engines/lawref/lawref/evaluator/engine.py#L254-L262)

### lawref.evaluator.EvaluationRequestError.code

*attribute* · *class attribute* · *instance attribute*

```python
code = 'EVALUATION_REQUEST_INVALID'
```

[View source](https://github.com-arxohq/arxo-io/law/blob/2edc2b92ce22b52e03f4081d2769a58229684379/engines/lawref/lawref/evaluator/engine.py#L255-L255)

### lawref.evaluator.EvaluationRequestError.message

*attribute* · *instance attribute*

```python
message = EvaluationRequest не соответствует evaluation-request.schema.json: {detail} (DECISION-0111 §2.2)
```

[View source](https://github.com-arxohq/arxo-io/law/blob/2edc2b92ce22b52e03f4081d2769a58229684379/engines/lawref/lawref/evaluator/engine.py#L258-L261)

## lawref.evaluator.LimitExceeded

*class*

```python
class LimitExceeded(Exception)
```

Bases: `Exception`

Re-exported from: `lawref.evaluator.limits`

[§238](https://github.com/arxohq/law/blob/master/spec/SPEC.ru/31-part-xxx-scalability.ru.md#238-resource-limits): превышение семантического лимита — детерминированный отказ RESOURCE_LIMIT.

[View source](https://github.com-arxohq/arxo-io/law/blob/2edc2b92ce22b52e03f4081d2769a58229684379/engines/lawref/lawref/evaluator/limits.py#L9-L16)

### lawref.evaluator.LimitExceeded.code

*attribute* · *instance attribute*

```python
code = 'RESOURCE_LIMIT'
```

[View source](https://github.com-arxohq/arxo-io/law/blob/2edc2b92ce22b52e03f4081d2769a58229684379/engines/lawref/lawref/evaluator/limits.py#L14-L14)

### lawref.evaluator.LimitExceeded.counter

*attribute* · *instance attribute*

```python
counter = counter
```

[View source](https://github.com-arxohq/arxo-io/law/blob/2edc2b92ce22b52e03f4081d2769a58229684379/engines/lawref/lawref/evaluator/limits.py#L15-L15)

### lawref.evaluator.LimitExceeded.limit

*attribute* · *instance attribute*

```python
limit = limit
```

[View source](https://github.com-arxohq/arxo-io/law/blob/2edc2b92ce22b52e03f4081d2769a58229684379/engines/lawref/lawref/evaluator/limits.py#L16-L16)

## lawref.evaluator.ProofRegistry

*class*

```python
class ProofRegistry
```

Re-exported from: `lawref.evaluator.proof`

Единый реестр proof-узлов: support-id → proof-node-id (детерминированно).

[View source](https://github.com-arxohq/arxo-io/law/blob/2edc2b92ce22b52e03f4081d2769a58229684379/engines/lawref/lawref/evaluator/proof.py#L11-L110)

### lawref.evaluator.ProofRegistry.assertions

*attribute* · *instance attribute*

```python
assertions = assertions
```

[View source](https://github.com-arxohq/arxo-io/law/blob/2edc2b92ce22b52e03f4081d2769a58229684379/engines/lawref/lawref/evaluator/proof.py#L15-L15)

### lawref.evaluator.ProofRegistry.by_support

*attribute* · *instance attribute*

```python
by_support: dict[str, str] = {}
```

[View source](https://github.com-arxohq/arxo-io/law/blob/2edc2b92ce22b52e03f4081d2769a58229684379/engines/lawref/lawref/evaluator/proof.py#L17-L17)

### lawref.evaluator.ProofRegistry.last_application_id

*attribute* · *instance attribute*

```python
last_application_id: str | None = None
```

[View source](https://github.com-arxohq/arxo-io/law/blob/2edc2b92ce22b52e03f4081d2769a58229684379/engines/lawref/lawref/evaluator/proof.py#L18-L18)

### lawref.evaluator.ProofRegistry.nodes

*attribute* · *instance attribute*

```python
nodes: list[dict] = []
```

[View source](https://github.com-arxohq/arxo-io/law/blob/2edc2b92ce22b52e03f4081d2769a58229684379/engines/lawref/lawref/evaluator/proof.py#L16-L16)

### lawref.evaluator.ProofRegistry.add_application

*method*

```python
def add_application(rule_id: str, seq: int, subst: dict[str, dict], conclusion: dict, premises: list[str]) -> str
```

[View source](https://github.com-arxohq/arxo-io/law/blob/2edc2b92ce22b52e03f4081d2769a58229684379/engines/lawref/lawref/evaluator/proof.py#L43-L61)

### lawref.evaluator.ProofRegistry.annotate_a3_application

*method*

```python
def annotate_a3_application(rule: dict, calls: Iterable[dict] = ()) -> None
```

Attach A3 row provenance to the just-created ordinary rule proof.

[View source](https://github.com-arxohq/arxo-io/law/blob/2edc2b92ce22b52e03f4081d2769a58229684379/engines/lawref/lawref/evaluator/proof.py#L85-L110)

### lawref.evaluator.ProofRegistry.annotate_definition_application

*method*

```python
def annotate_definition_application(rule: dict) -> None
```

DECISION-0151 / [§180](https://github.com/arxohq/law/blob/master/spec/SPEC.ru/26-part-xxv-proof-graph-and-explanations.ru.md#180-rule-application-proof): применение правила, порождённого определением
[§144](https://github.com/arxohq/law/blob/master/spec/SPEC.ru/20-part-xix-definitions-presumptions-fictions-exceptions.ru.md#144-definition), несёт `attributes.definition` — понятие (символ-цель ребра
provenance), режим, половину и номер альтернативы. Объяснение [§183](https://github.com/arxohq/law/blob/master/spec/SPEC.ru/26-part-xxv-proof-graph-and-explanations.ru.md#183-human-readable-explanation)
читает это поле и говорит «по определению», а не «по правилу».
В content-id узла [§180](https://github.com/arxohq/law/blob/master/spec/SPEC.ru/26-part-xxv-proof-graph-and-explanations.ru.md#180-rule-application-proof) поле не входит: тождество применения —
правило, подстановка, посылки и вывод.

[View source](https://github.com-arxohq/arxo-io/law/blob/2edc2b92ce22b52e03f4081d2769a58229684379/engines/lawref/lawref/evaluator/proof.py#L63-L83)

### lawref.evaluator.ProofRegistry.for_support

*method*

```python
def for_support(support_id: str) -> str
```

[View source](https://github.com-arxohq/arxo-io/law/blob/2edc2b92ce22b52e03f4081d2769a58229684379/engines/lawref/lawref/evaluator/proof.py#L20-L41)

## lawref.evaluator.SupportStore

*class*

```python
class SupportStore
```

Re-exported from: `lawref.evaluator.support`

Пара поддержки (t, f) на ground-атом (SPEC [§62](https://github.com/arxohq/law/blob/master/spec/SPEC.ru/10-part-x-propositions-and-four-valued-support.ru.md#62-support-pair)); стороны хранятся раздельно ([§61](https://github.com/arxohq/law/blob/master/spec/SPEC.ru/10-part-x-propositions-and-four-valued-support.ru.md#61-literal)).

[View source](https://github.com-arxohq/arxo-io/law/blob/2edc2b92ce22b52e03f4081d2769a58229684379/engines/lawref/lawref/evaluator/support.py#L37-L317)

### lawref.evaluator.SupportStore.apply_counters

*attribute* · *instance attribute*

```python
apply_counters: dict[str, int] = {}
```

[View source](https://github.com-arxohq/arxo-io/law/blob/2edc2b92ce22b52e03f4081d2769a58229684379/engines/lawref/lawref/evaluator/support.py#L85-L85)

### lawref.evaluator.SupportStore.atoms

*attribute* · *instance attribute*

```python
atoms: dict[str, dict] = {}
```

[View source](https://github.com-arxohq/arxo-io/law/blob/2edc2b92ce22b52e03f4081d2769a58229684379/engines/lawref/lawref/evaluator/support.py#L61-L61)

### lawref.evaluator.SupportStore.closures_done

*attribute* · *instance attribute*

```python
closures_done: set[str] = set()
```

[View source](https://github.com-arxohq/arxo-io/law/blob/2edc2b92ce22b52e03f4081d2769a58229684379/engines/lawref/lawref/evaluator/support.py#L90-L90)

### lawref.evaluator.SupportStore.derived_seen

*attribute* · *instance attribute*

```python
derived_seen: set[tuple[str, bytes]] = set()
```

[View source](https://github.com-arxohq/arxo-io/law/blob/2edc2b92ce22b52e03f4081d2769a58229684379/engines/lawref/lawref/evaluator/support.py#L84-L84)

### lawref.evaluator.SupportStore.derived_type_errors

*attribute* · *instance attribute*

```python
derived_type_errors: set[tuple[str, str, int, str]] = set()
```

[View source](https://github.com-arxohq/arxo-io/law/blob/2edc2b92ce22b52e03f4081d2769a58229684379/engines/lawref/lawref/evaluator/support.py#L106-L106)

### lawref.evaluator.SupportStore.dnegative

*attribute* · *instance attribute*

```python
dnegative: dict[str, list[str]] = {}
```

[View source](https://github.com-arxohq/arxo-io/law/blob/2edc2b92ce22b52e03f4081d2769a58229684379/engines/lawref/lawref/evaluator/support.py#L60-L60)

### lawref.evaluator.SupportStore.dpositive

*attribute* · *instance attribute*

```python
dpositive: dict[str, list[str]] = {}
```

[View source](https://github.com-arxohq/arxo-io/law/blob/2edc2b92ce22b52e03f4081d2769a58229684379/engines/lawref/lawref/evaluator/support.py#L59-L59)

### lawref.evaluator.SupportStore.negative

*attribute* · *instance attribute*

```python
negative: dict[str, list[str]] = {}
```

[View source](https://github.com-arxohq/arxo-io/law/blob/2edc2b92ce22b52e03f4081d2769a58229684379/engines/lawref/lawref/evaluator/support.py#L56-L56)

### lawref.evaluator.SupportStore.norm_counters

*attribute* · *instance attribute*

```python
norm_counters: dict[str, int] = {}
```

[View source](https://github.com-arxohq/arxo-io/law/blob/2edc2b92ce22b52e03f4081d2769a58229684379/engines/lawref/lawref/evaluator/support.py#L110-L110)

### lawref.evaluator.SupportStore.norm_seen

*attribute* · *instance attribute*

```python
norm_seen: set[tuple[str, bytes]] = set()
```

[View source](https://github.com-arxohq/arxo-io/law/blob/2edc2b92ce22b52e03f4081d2769a58229684379/engines/lawref/lawref/evaluator/support.py#L109-L109)

### lawref.evaluator.SupportStore.positive

*attribute* · *instance attribute*

```python
positive: dict[str, list[str]] = {}
```

[View source](https://github.com-arxohq/arxo-io/law/blob/2edc2b92ce22b52e03f4081d2769a58229684379/engines/lawref/lawref/evaluator/support.py#L55-L55)

### lawref.evaluator.SupportStore.predicate_versions

*attribute* · *instance attribute*

```python
predicate_versions: dict[str, int] = {}
```

[View source](https://github.com-arxohq/arxo-io/law/blob/2edc2b92ce22b52e03f4081d2769a58229684379/engines/lawref/lawref/evaluator/support.py#L44-L44)

### lawref.evaluator.SupportStore.rule_stamps

*attribute* · *instance attribute*

```python
rule_stamps: dict[str, int] = {}
```

[View source](https://github.com-arxohq/arxo-io/law/blob/2edc2b92ce22b52e03f4081d2769a58229684379/engines/lawref/lawref/evaluator/support.py#L54-L54)

### lawref.evaluator.SupportStore.sig_aliases

*attribute* · *instance attribute*

```python
sig_aliases: dict[str, str] = {}
```

[View source](https://github.com-arxohq/arxo-io/law/blob/2edc2b92ce22b52e03f4081d2769a58229684379/engines/lawref/lawref/evaluator/support.py#L102-L102)

### lawref.evaluator.SupportStore.sig_bases

*attribute* · *instance attribute*

```python
sig_bases: dict[str, str] = {}
```

[View source](https://github.com-arxohq/arxo-io/law/blob/2edc2b92ce22b52e03f4081d2769a58229684379/engines/lawref/lawref/evaluator/support.py#L100-L100)

### lawref.evaluator.SupportStore.sig_constants

*attribute* · *instance attribute*

```python
sig_constants: dict[str, str | None] = {}
```

[View source](https://github.com-arxohq/arxo-io/law/blob/2edc2b92ce22b52e03f4081d2769a58229684379/engines/lawref/lawref/evaluator/support.py#L99-L99)

### lawref.evaluator.SupportStore.signatures

*attribute* · *instance attribute*

```python
signatures: dict[str, list[tuple[str, str | None]]] = {}
```

[View source](https://github.com-arxohq/arxo-io/law/blob/2edc2b92ce22b52e03f4081d2769a58229684379/engines/lawref/lawref/evaluator/support.py#L98-L98)

### lawref.evaluator.SupportStore.stamp

*attribute* · *instance attribute*

```python
stamp: int = 0
```

[View source](https://github.com-arxohq/arxo-io/law/blob/2edc2b92ce22b52e03f4081d2769a58229684379/engines/lawref/lawref/evaluator/support.py#L50-L50)

### lawref.evaluator.SupportStore.stamps

*attribute* · *instance attribute*

```python
stamps: dict[str, int] = {}
```

[View source](https://github.com-arxohq/arxo-io/law/blob/2edc2b92ce22b52e03f4081d2769a58229684379/engines/lawref/lawref/evaluator/support.py#L51-L51)

### lawref.evaluator.SupportStore.term_errors

*attribute* · *instance attribute*

```python
term_errors: set[tuple[str, str]] = set()
```

[View source](https://github.com-arxohq/arxo-io/law/blob/2edc2b92ce22b52e03f4081d2769a58229684379/engines/lawref/lawref/evaluator/support.py#L93-L93)

### lawref.evaluator.SupportStore.warned_rules

*attribute* · *instance attribute*

```python
warned_rules: set[str] = set()
```

[View source](https://github.com-arxohq/arxo-io/law/blob/2edc2b92ce22b52e03f4081d2769a58229684379/engines/lawref/lawref/evaluator/support.py#L86-L86)

### lawref.evaluator.SupportStore.accepted_positive_keys

*method*

```python
def accepted_positive_keys(predicate: str) -> list[str]
```

Ключи атомов предиката, у которых есть ВХОДНАЯ positive-опора
(assertion или strict-вывод), в возрастающем порядке ключа.

Отличие от `established_positive` — не фильтр статуса, а сторона:
[§45.1](https://github.com/arxohq/law/blob/master/spec/SPEC.ru/08-part-viii-type-system.ru.md#451-relation-keys)/[§196](https://github.com/arxohq/law/blob/master/spec/SPEC.ru/27-part-xxvi-static-semantics-and-diagnostics.ru.md#196-data-quality-checks) смотрят на `positive`, как halt E-0001 и closure [§70](https://github.com/arxohq/law/blob/master/spec/SPEC.ru/10-part-x-propositions-and-four-valued-support.ru.md#70-closed-world-declarations), и
defeasible-опоры (`dpositive`) в счёт не идут. Индекс `_by_predicate`
держит объединение сторон, поэтому отбор по `positive` остаётся.

Множество и порядок те же, что давал `sorted(self.positive)` с отбором
по предикату: порядок ключей тотален, и фильтрация глобально
отсортированной последовательности совпадает с сортировкой
отфильтрованного подмножества (тот же аргумент, что у индекса выше).

[View source](https://github.com-arxohq/arxo-io/law/blob/2edc2b92ce22b52e03f4081d2769a58229684379/engines/lawref/lawref/evaluator/support.py#L233-L248)

### lawref.evaluator.SupportStore.add

*method*

```python
def add(literal: dict, assertion_id: str) -> None
```

[View source](https://github.com-arxohq/arxo-io/law/blob/2edc2b92ce22b52e03f4081d2769a58229684379/engines/lawref/lawref/evaluator/support.py#L167-L176)

### lawref.evaluator.SupportStore.add_defeasible

*method*

```python
def add_defeasible(literal: dict, proof_id: str) -> None
```

[View source](https://github.com-arxohq/arxo-io/law/blob/2edc2b92ce22b52e03f4081d2769a58229684379/engines/lawref/lawref/evaluator/support.py#L250-L259)

### lawref.evaluator.SupportStore.conflicts

*method*

```python
def conflicts() -> list[str]
```

Ключи атомов с одновременной accepted-поддержкой обеих полярностей.

[View source](https://github.com-arxohq/arxo-io/law/blob/2edc2b92ce22b52e03f4081d2769a58229684379/engines/lawref/lawref/evaluator/support.py#L315-L317)

### lawref.evaluator.SupportStore.established_positive

*method*

```python
def established_positive(predicate: str, bound: tuple[tuple[int, bytes], ...] = (), min_stamp: int = -1) -> list[dict]
```

Ground-атомы предиката со статусом TRUE_ONLY (established, [§65](https://github.com/arxohq/law/blob/master/spec/SPEC.ru/10-part-x-propositions-and-four-valued-support.ru.md#65-status-tests)/[§66](https://github.com/arxohq/law/blob/master/spec/SPEC.ru/10-part-x-propositions-and-four-valued-support.ru.md#66-rule-body-default)) —
база для grounding строгих правил ([§103](https://github.com/arxohq/law/blob/master/spec/SPEC.ru/16-part-xv-defeasible-semantics-and-conflict-resolution.ru.md#103-strict-closure)). Порядок детерминирован.
`min_stamp` — как у `supported_positive`.

[View source](https://github.com-arxohq/arxo-io/law/blob/2edc2b92ce22b52e03f4081d2769a58229684379/engines/lawref/lawref/evaluator/support.py#L218-L231)

### lawref.evaluator.SupportStore.established_side

*method*

```python
def established_side(literal: dict) -> list[str]
```

Опоры БЕЗ defeasible ([§107](https://github.com/arxohq/law/blob/master/spec/SPEC.ru/16-part-xv-defeasible-semantics-and-conflict-resolution.ru.md#107-defeat) правило 1: только strict/assertions
побеждают кандидата безусловно).

[View source](https://github.com-arxohq/arxo-io/law/blob/2edc2b92ce22b52e03f4081d2769a58229684379/engines/lawref/lawref/evaluator/support.py#L261-L265)

### lawref.evaluator.SupportStore.status_only

*method*

```python
def status_only(literal: dict) -> str
```

truth_status без списков опор: та же [§62](https://github.com/arxohq/law/blob/master/spec/SPEC.ru/10-part-x-propositions-and-four-valued-support.ru.md#62-support-pair)-проекция, [§63](https://github.com/arxohq/law/blob/master/spec/SPEC.ru/10-part-x-propositions-and-four-valued-support.ru.md#63-explicit-negation)-зеркало
для negative-литерала. Байтам документа не виден — оба пути обязаны
давать один статус (сверяется в selftest).

[View source](https://github.com-arxohq/arxo-io/law/blob/2edc2b92ce22b52e03f4081d2769a58229684379/engines/lawref/lawref/evaluator/support.py#L286-L296)

### lawref.evaluator.SupportStore.support_sides

*method*

```python
def support_sides(literal: dict) -> tuple[list[str], list[str]]
```

Стороны пары [§62](https://github.com/arxohq/law/blob/master/spec/SPEC.ru/10-part-x-propositions-and-four-valued-support.ru.md#62-support-pair) литерала — опоры `t` и `f`, отсортированные; [§63](https://github.com/arxohq/law/blob/master/spec/SPEC.ru/10-part-x-propositions-and-four-valued-support.ru.md#63-explicit-negation):
у negative-литерала стороны зеркалятся. Одна сборка для
`truth_status` и для составного условия цели (errata E-0218).

[View source](https://github.com-arxohq/arxo-io/law/blob/2edc2b92ce22b52e03f4081d2769a58229684379/engines/lawref/lawref/evaluator/support.py#L298-L307)

### lawref.evaluator.SupportStore.supported_positive

*method*

```python
def supported_positive(predicate: str, bound: tuple[tuple[int, bytes], ...] = (), min_stamp: int = -1) -> list[dict]
```

Ground-атомы предиката с ЛЮБОЙ positive-опорой ([§65](https://github.com/arxohq/law/blob/master/spec/SPEC.ru/10-part-x-propositions-and-four-valued-support.ru.md#65-status-tests) supported —
монотонный перечислитель: BOTH не исключается; [§103](https://github.com/arxohq/law/blob/master/spec/SPEC.ru/16-part-xv-defeasible-semantics-and-conflict-resolution.ru.md#103-strict-closure) разрешает
рекурсию строгих правил только через такие рёбра). `min_stamp ≥ 0` —
только атомы, получившие опору позже этого штампа (semi-naive);
подсписок того же упорядоченного списка, порядок цел.

[View source](https://github.com-arxohq/arxo-io/law/blob/2edc2b92ce22b52e03f4081d2769a58229684379/engines/lawref/lawref/evaluator/support.py#L201-L216)

### lawref.evaluator.SupportStore.term_bytes

*method*

```python
def term_bytes(term: dict) -> bytes
```

[View source](https://github.com-arxohq/arxo-io/law/blob/2edc2b92ce22b52e03f4081d2769a58229684379/engines/lawref/lawref/evaluator/support.py#L112-L122)

### lawref.evaluator.SupportStore.truth_status

*method*

```python
def truth_status(literal: dict) -> tuple[str, list[str]]
```

[§62](https://github.com/arxohq/law/blob/master/spec/SPEC.ru/10-part-x-propositions-and-four-valued-support.ru.md#62-support-pair): (t,f) → TRUE_ONLY | FALSE_ONLY | BOTH | NEITHER; [§63](https://github.com/arxohq/law/blob/master/spec/SPEC.ru/10-part-x-propositions-and-four-valued-support.ru.md#63-explicit-negation): запрос negative-
литерала — это neg(t,f), т.е. статусы зеркалятся. Пары считаются по
объединению established и surviving defeasible supports ([§108](https://github.com/arxohq/law/blob/master/spec/SPEC.ru/16-part-xv-defeasible-semantics-and-conflict-resolution.ru.md#108-surviving-support)/[§111.7](https://github.com/arxohq/law/blob/master/spec/SPEC.ru/16-part-xv-defeasible-semantics-and-conflict-resolution.ru.md#111-порядок-evaluation-strata)).

[View source](https://github.com-arxohq/arxo-io/law/blob/2edc2b92ce22b52e03f4081d2769a58229684379/engines/lawref/lawref/evaluator/support.py#L309-L313)

## lawref.evaluator.UnsupportedLanguageVersionError

*class*

```python
class UnsupportedLanguageVersionError(EvaluationRequestError)
```

Bases: `lawref.evaluator.engine.EvaluationRequestError`

Re-exported from: `lawref.evaluator.engine`

LDC-E1401 на evaluation boundary для отозванной семантики.

[View source](https://github.com-arxohq/arxo-io/law/blob/2edc2b92ce22b52e03f4081d2769a58229684379/engines/lawref/lawref/evaluator/engine.py#L265-L273)

### lawref.evaluator.UnsupportedLanguageVersionError.code

*attribute* · *class attribute* · *instance attribute*

```python
code = 'UNSUPPORTED_LANGUAGE_VERSION'
```

[View source](https://github.com-arxohq/arxo-io/law/blob/2edc2b92ce22b52e03f4081d2769a58229684379/engines/lawref/lawref/evaluator/engine.py#L268-L268)

### lawref.evaluator.UnsupportedLanguageVersionError.diagnostic_code

*attribute* · *class attribute* · *instance attribute*

```python
diagnostic_code = 'LDC-E1401'
```

[View source](https://github.com-arxohq/arxo-io/law/blob/2edc2b92ce22b52e03f4081d2769a58229684379/engines/lawref/lawref/evaluator/engine.py#L269-L269)

### lawref.evaluator.UnsupportedLanguageVersionError.message

*attribute* · *instance attribute*

```python
message = revision.withdrawn_evaluation_message(version)
```

[View source](https://github.com-arxohq/arxo-io/law/blob/2edc2b92ce22b52e03f4081d2769a58229684379/engines/lawref/lawref/evaluator/engine.py#L272-L272)

## lawref.evaluator.evaluate

*function*

```python
def evaluate(request: EvaluationRequest) -> dict
```

Re-exported from: `lawref.evaluator.engine`

Публичная граница исполнения (DECISION-0111 [§2.2](https://github.com/arxohq/law/blob/master/spec/SPEC.ru/01-part-i-audit.ru.md#22-четырёхзначной-логики-самой-по-себе-недостаточно)).

Отчёт acceptance-фазы [§78.2.7](https://github.com/arxohq/law/blob/master/spec/SPEC.ru/11-part-xi-assertions-facts-evidence.ru.md#7827-доказательство) вкладывается ЗДЕСЬ, одним владельцем на все
девять ветвей запроса: `_evaluate` кладёт его в `sink`, а `attach_acceptance`
вкладывает и пересчитывает `resultHash`. Без выбранной политики `sink`
пуст и документ возвращается тем же объектом — байты прежние ([§78.2.8](https://github.com/arxohq/law/blob/master/spec/SPEC.ru/11-part-xi-assertions-facts-evidence.ru.md#7828-выбор-политики-идентичность-и-совместимость)).

[View source](https://github.com-arxohq/arxo-io/law/blob/2edc2b92ce22b52e03f4081d2769a58229684379/engines/lawref/lawref/evaluator/engine.py#L308-L339)

## lawref.evaluator.literal_key

*function*

```python
def literal_key(literal: dict) -> str
```

Re-exported from: `lawref.evaluator.support`

Ключ ground-атома: predicate + канонические args (полярность отдельно, [§61](https://github.com/arxohq/law/blob/master/spec/SPEC.ru/10-part-x-propositions-and-four-valued-support.ru.md#61-literal)–[§62](https://github.com/arxohq/law/blob/master/spec/SPEC.ru/10-part-x-propositions-and-four-valued-support.ru.md#62-support-pair)).

[View source](https://github.com-arxohq/arxo-io/law/blob/2edc2b92ce22b52e03f4081d2769a58229684379/engines/lawref/lawref/evaluator/support.py#L18-L23)

## lawref.evaluator.run_vector

*function*

```python
def run_vector(vector_dir, layer: str | None = None, semantic_version: str | None = None) -> tuple[str, dict]
```

Re-exported from: `lawref.evaluator.engine`

Исполнение evaluate-вектора: ('result', doc) | ('error', {'error': {...}}).

Артефакты: ir.json (hand-authored CLIR до появления парсера M3 — G-M1b
заменит их выходом компилятора), case.json (интерим-JSON вместо .lawcase до
M3), query.json, calendar.resource.json (для calendar_op), expected.json.

[View source](https://github.com-arxohq/arxo-io/law/blob/2edc2b92ce22b52e03f4081d2769a58229684379/engines/lawref/lawref/evaluator/engine.py#L1027-L1095)

**Modules**

- `lawref.evaluator.argumentation`
- `lawref.evaluator.constants`
- `lawref.evaluator.constraints`
- `lawref.evaluator.defeasible`
- `lawref.evaluator.document`
- `lawref.evaluator.editions`
- `lawref.evaluator.effects`
- `lawref.evaluator.engine`
- `lawref.evaluator.events`
- `lawref.evaluator.evidence`
- `lawref.evaluator.facts`
- `lawref.evaluator.focus`
- `lawref.evaluator.interpretations`
- `lawref.evaluator.limits`
- `lawref.evaluator.normconflict`
- `lawref.evaluator.norms`
- `lawref.evaluator.precedent`
- `lawref.evaluator.prepared`
- `lawref.evaluator.procedures`
- `lawref.evaluator.proof`
- `lawref.evaluator.queries`
- `lawref.evaluator.query_shape`
- `lawref.evaluator.rules`
- `lawref.evaluator.solver`
- `lawref.evaluator.strict`
- `lawref.evaluator.support`
- `lawref.evaluator.whynot`
