lawref.evaluator.support
Пара поддержки (t, f) на ground-атом — SPEC §61–§63.
Хранилище фактов оракула: стороны поддержки раздельны (§61), статус атома —
проекция пары (§62/§63), established и surviving defeasible (§108) считаются
вместе. Здесь же term_error — донесение ошибки вычисления терма §58, которое
дедуплицируется по store.term_errors и потому принадлежит store, а не
конкретному замыканию.
Classes
| Name | Description |
|---|---|
SupportStore | Пара поддержки (t, f) на ground-атом (SPEC §62); стороны хранятся раздельно (§61). |
Functions
| Name | Description |
|---|---|
literal_key | Ключ ground-атома: predicate + канонические args (полярность отдельно, §61–§62). |
pair_status | §62: стороны пары → статус и его опоры (у BOTH — сначала t, потом f). |
term_error | §58: ошибка вычисления терма при применении правила. Не превращается в |
term_error_issue | Полезная нагрузка issue ошибки терма §58 — одна сборка на оба пути: |
SupportStoreclass#
class SupportStore()apply_countersattributeinstance attribute#
apply_counters: dict[str, int] = {}atomsattributeinstance attribute#
atoms: dict[str, dict] = {}closures_doneattributeinstance attribute#
closures_done: set[str] = set()derived_seenattributeinstance attribute#
derived_seen: set[tuple[str, bytes]] = set()derived_type_errorsattributeinstance attribute#
derived_type_errors: set[tuple[str, str, int, str]] = set()dnegativeattributeinstance attribute#
dnegative: dict[str, list[str]] = {}dpositiveattributeinstance attribute#
dpositive: dict[str, list[str]] = {}negativeattributeinstance attribute#
negative: dict[str, list[str]] = {}norm_countersattributeinstance attribute#
norm_counters: dict[str, int] = {}norm_seenattributeinstance attribute#
norm_seen: set[tuple[str, bytes]] = set()positiveattributeinstance attribute#
positive: dict[str, list[str]] = {}predicate_versionsattributeinstance attribute#
predicate_versions: dict[str, int] = {}rule_stampsattributeinstance attribute#
rule_stamps: dict[str, int] = {}sig_aliasesattributeinstance attribute#
sig_aliases: dict[str, str] = {}sig_basesattributeinstance attribute#
sig_bases: dict[str, str] = {}sig_constantsattributeinstance attribute#
sig_constants: dict[str, str | None] = {}signaturesattributeinstance attribute#
signatures: dict[str, list[tuple[str, str | None]]] = {}stampattributeinstance attribute#
stamp: int = 0stampsattributeinstance attribute#
stamps: dict[str, int] = {}term_errorsattributeinstance attribute#
term_errors: set[tuple[str, str]] = set()warned_rulesattributeinstance attribute#
warned_rules: set[str] = set()accepted_positive_keysmethod#
def accepted_positive_keys(predicate: str) -> list[str]Ключи атомов предиката, у которых есть ВХОДНАЯ positive-опора (assertion или strict-вывод), в возрастающем порядке ключа.
Отличие от established_positive — не фильтр статуса, а сторона:
§45.1/§196 смотрят на positive, как halt E-0001 и closure §70, и
defeasible-опоры (dpositive) в счёт не идут. Индекс _by_predicate
держит объединение сторон, поэтому отбор по positive остаётся.
Множество и порядок те же, что давал sorted(self.positive) с отбором
по предикату: порядок ключей тотален, и фильтрация глобально
отсортированной последовательности совпадает с сортировкой
отфильтрованного подмножества (тот же аргумент, что у индекса выше).
addmethod#
def add(literal: dict, assertion_id: str) -> Noneadd_defeasiblemethod#
def add_defeasible(literal: dict, proof_id: str) -> Noneconflictsmethod#
def conflicts() -> list[str]Ключи атомов с одновременной accepted-поддержкой обеих полярностей.
established_positivemethod#
def established_positive(predicate: str, bound: tuple[tuple[int, bytes], ...] = (), min_stamp: int = -1) -> list[dict]established_sidemethod#
def established_side(literal: dict) -> list[str]Опоры БЕЗ defeasible (§107 правило 1: только strict/assertions побеждают кандидата безусловно).
status_onlymethod#
def status_only(literal: dict) -> strsupport_sidesmethod#
def support_sides(literal: dict) -> tuple[list[str], list[str]]supported_positivemethod#
def supported_positive(predicate: str, bound: tuple[tuple[int, bytes], ...] = (), min_stamp: int = -1) -> list[dict]Ground-атомы предиката с ЛЮБОЙ positive-опорой (§65 supported —
монотонный перечислитель: BOTH не исключается; §103 разрешает
рекурсию строгих правил только через такие рёбра). min_stamp ≥ 0 —
только атомы, получившие опору позже этого штампа (semi-naive);
подсписок того же упорядоченного списка, порядок цел.
term_bytesmethod#
def term_bytes(term: dict) -> bytestruth_statusmethod#
def truth_status(literal: dict) -> tuple[str, list[str]]literal_keyfunction#
def literal_key(literal: dict) -> strpair_statusfunction#
def pair_status(pos: list[str], neg: list[str]) -> tuple[str, list[str]]§62: стороны пары → статус и его опоры (у BOTH — сначала t, потом f).
term_errorfunction#
def term_error(store: SupportStore, issues: list[dict], rule_id: str, where: str, exc: 'vals.ValueError_') -> Noneterm_error_issuefunction#
def term_error_issue(rule_id: str, where: str, exc: 'vals.ValueError_') -> dictDocumentation for Arxo. Writings — blog.arxo.io.
Anonymous visit counts on stats.arxo.io, no cookies.