Skip to main content

Module deontic_compose

Module deontic_compose 

Source
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 × temporalO(Gφ) “must hold throughout”, O(φ U ψ) “must hold until”, via temporal_ltl::evaluate_ltl_trace.
  • deontic × epistemicmens 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:within it, via dl::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) KNOW claim? An epistemic quin with predicate[0..7] == OP_KNOWS, subject == agent, object == claim.
classify_mens_rea
Classify the mens rea of a possible violation of norm by its bearer: F[α stit φ] is violated when α brought φ about; O[α stit φ] when α did not (omission). A violation is Knowing if α knew the forbidden/obligatory content, else Ignorant — upgraded to InexcusableIgnorance when had_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_derogable obligation is INVALID — non-derogable protections do not expire. Any other composition is valid. Returns true iff the composition preserves the right.
diagnose_breach
Abductive breach diagnosis: walk backward from an observed violation along the explanatory rules (predicate == explains) to the root cause — the missing duty or bad act that accounts for it. Composes abductive::abductive_explanation.
discharge_obligation
Discharge an obligation by fulfilment: if the bearer brought the obligation’s content about, the duty is Discharged and consumed (linear::consume_quin — a duty paid is spent once, not reusable). Returns the status; mutates norm to 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. Composes fuzzy::conjunction.
generate_remedy_obligation
Automated remedy generation: when a composed norm is breached, generate the secondary obligation O(reparation) on the breaching party (the contrary-to-duty remedy). Composes deontic::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 attacks pairs (attacker, target), does goal SURVIVE (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. Composes argumentation::grounded_contains (bounded, zero-heap).
obligation_applies_in
Locative obligation subsumption: an obligation in force in norm_jurisdiction applies in target_jurisdiction iff the target is jur:within the norm’s jurisdiction (transitively). within holds jur:within Quins (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 property prop holds globally across a state trace. Discharged iff prop holds 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 that ante holds until consequent becomes 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 rules over atoms, written to out as bitmasks over atom indices. Composes asp::compute_answer_sets.
trust_gate
Behavioural-trust gate: a permission/capability activates only when the holder’s derived trust weight exceeds threshold τ. Composes probabilistic::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 verdict gated on proof_verified; an unverified proof yields None (the composition is withheld). Mirrors legal_compose::zk_eligibility.