Skip to main content

Module causal

Module causal 

Source
Expand description

Causal & counterfactual logic (§16, legal_logic.md) — liability & dependency.

Standard implication (p → q) is insufficient for legal liability. Adjudicating a human-rights violation or a structural failure needs but-for causation (was the cause necessary for the harm?), root-node dependency (removing a foundational support voids everything that depends on it — the “deepest absence”), and overdetermination (several independent sufficient causes → joint liability, where no single one is but-for).

Causation is a DAG of (cause, q42:causeOf, effect) edges over a set of roots (the base facts that actually occurred). All evaluation is bounded BFS reachability — zero-heap (fixed frontier/visited arrays), the same shape as dl::check_subsumption_quin.

Constants§

MAX_CAUSAL_NODES
Bound on distinct nodes in one causal query.

Functions§

backdoor_satisfied
Backdoor criterion: a set z is admissible for estimating the effect of x on y iff (a) no node in z is a descendant of x, and (b) z blocks every backdoor (confounding) path — here, every common ancestor (confounder) of x and y is in z. nodes enumerates the model’s variables. Bounded, zero-heap (composes caused reachability).
but_for_cause
But-for causation: effect occurred, and but for cause it would NOT have — i.e. cause is a necessary condition (removing it makes effect unreachable). This is the legal “but-for” / sine-qua-non test.
cause_predicate
The causal-edge predicate (cause, q42:causeOf, effect).
caused
Did effect occur — i.e. is it reachable from the occurred roots along causeOf edges?
counterfactual_absent
Counterfactual “had intervene been absent, would effect still have occurred?” — the twin-network comparison of the factual world against the counterfactual do(intervene absent) world. Returns (factual, counterfactual); if they differ, intervene was counterfactually necessary for effect.
dependents_voided
Collect, into out, the candidates that are voided by removing removed. Returns the count written. Zero-heap (caller-supplied out).
do_intervene
Intervention do(...): force the variables in set_present to occur and set_absent to NOT occur — severing the absent nodes from the graph and treating the present ones as exogenous roots — then compute whether effect results (P(effect | do(X)) as boolean reachability). Zero-heap.
is_endogenous
Endogenous variable: determined within the model (≥1 incoming causal edge).
is_exogenous
Exogenous variable (SCM): a node with NO incoming causal edge — its value enters from outside the model (a root cause / external factor).
is_overdetermined
Causal overdetermination (joint liability): effect occurred, there are ≥2 candidate causes, and no single one is but-for — removing any one alone still yields the effect (another sufficient cause remains). Liability is then shared across all of them.
is_voided_by
Root-node dependency: is node voided by removing the foundational support removed? True iff node occurs normally but becomes unreachable once removed is gone — “if food/ shelter is removed, all dependent rights and capacities are voided” (the deepest-absence rule).