Expand description
Deontic compositions (Phase 4, DEONTIC_LOGIC_PLAN §4) — cluster A (zero-heap).
Phase 0 proved the modality engines real but uncomposed. This module wires the deontic verdict together with the temporal, epistemic, linear and DL/spatial engines — the joins that turn standalone logics into legal reasoning:
- deontic × temporal —
O(Gφ)“must hold throughout”,O(φ U ψ)“must hold until”, viatemporal_ltl::evaluate_ltl_trace. - deontic × epistemic — mens rea: classify a violation as knowing vs ignorant (and ignorance-is-no-excuse when there was a duty to know), via the epistemic encoding.
- deontic × linear — an obligation discharged by fulfilment consumes the duty
(
linear::consume_quin): a resource spent once, not reusable. - deontic × spatial — an obligation in force in a jurisdiction applies in every
sub-jurisdiction
jur:withinit, viadl::check_subsumption_quin.
All zero-heap (slice in / scalar or slice out). The heavier reasoning joins (argumentation, probabilistic/fuzzy, ASP/abductive) land in cluster B.
Enums§
- MensRea
- The mental state accompanying a deontic violation — the mens rea axis legal instruments use to grade culpability.
Functions§
- agent_
knows - Did
agent(per the epistemic frame) KNOWclaim? An epistemic quin withpredicate[0..7] == OP_KNOWS,subject == agent,object == claim. - classify_
mens_ rea - Classify the mens rea of a possible violation of
normby its bearer:F[α stit φ]is violated when α brought φ about;O[α stit φ]when α did not (omission). A violation isKnowingif α knew the forbidden/obligatory content, elseIgnorant— upgraded toInexcusableIgnorancewhenhad_duty_to_know. - composition_
preserves_ right - Formal verification of a composed norm: a temporal constraint must not void a
non-derogable right. A composition that places a temporal limit (expiry / window) on a
non_derogableobligation is INVALID — non-derogable protections do not expire. Any other composition is valid. Returnstrueiff the composition preserves the right. - diagnose_
breach - Abductive breach diagnosis: walk backward from an observed
violationalong the explanatoryrules(predicate ==explains) to the root cause — the missing duty or bad act that accounts for it. Composesabductive::abductive_explanation. - discharge_
obligation - Discharge an obligation by fulfilment: if the bearer brought the obligation’s content
about, the duty is
Dischargedand consumed (linear::consume_quin— a duty paid is spent once, not reusable). Returns the status; mutatesnormto mark consumption on discharge. A non-obligation, or an unfulfilled one, is left unconsumed. - fulfilment_
degree - Degree to which a progressively-realised obligation is fulfilled: the Gödel t-norm
(min) of its sub-requirements’ truth degrees — the weakest link gates the whole (the
ICESCR “progressive realization” reading). Each requirement carries its degree in
metadata. Composesfuzzy::conjunction. - generate_
remedy_ obligation - Automated remedy generation: when a composed norm is breached, generate the secondary
obligation
O(reparation)on the breachingparty(the contrary-to-duty remedy). Composesdeontic::compile_norm_quin; the caller records/enforces it like any obligation. - norm_
survives_ conflict - Resolve a normative conflict by Dung’s grounded semantics: given the competing norm IDs
and the
attackspairs(attacker, target), doesgoalSURVIVE (belong to the grounded extension)? The survivor is the objectively defensible verdict after all attacks and defences resolve — e.g. a general duty reinstated when an emergency override defeats its exception. Composesargumentation::grounded_contains(bounded, zero-heap). - obligation_
applies_ in - Locative obligation subsumption: an obligation in force in
norm_jurisdictionapplies intarget_jurisdictioniff the target isjur:withinthe norm’s jurisdiction (transitively).withinholdsjur:withinQuins (subject within object); the check reuses the DL transitive-closure search. (RCC-8 region geometry is not encodable in a 48-byte NQuin — we use the jurisdiction hierarchy, per the plan §1.) - obligation_
fuzzily_ met - Is a progressively-realised obligation met to at least
threshold∈ [0,1]? - obligation_
globally O(Gφ)— the obligation that propertypropholds globally across a state trace. Discharged iffpropholds in every state; otherwise Violated. (Continuous protections: “no one shall be subjected to torture” must hold in every state, not just eventually.)- obligation_
until O(φ U ψ)— the obligation thatanteholds untilconsequentbecomes true (provisional measures: “detention standards apply until release”). Discharged iff the until-formula holds over the trace; otherwise Violated.- remedy_
scenarios - Enumerate the valid compliance scenarios when an instrument under-determines the remedy
(“the State shall provide remedy X, Y, or Z”): the stable models (answer sets) of the
remedy
rulesoveratoms, written tooutas bitmasks over atom indices. Composesasp::compute_answer_sets. - trust_
gate - Behavioural-trust gate: a permission/capability activates only when the holder’s derived
trust
weightexceedsthresholdτ. Composesprobabilistic::evaluate_threshold. - zk_
wrapped_ composition - Zero-knowledge–wrapped composition: a complex composition’s verdict is applied only if a
zk proof of its premises verifies (the private witnesses — the underlying facts — stay hidden).
Returns the
verdictgated onproof_verified; an unverified proof yieldsNone(the composition is withheld). Mirrorslegal_compose::zk_eligibility.