Reference · The Applied Higher-Order Functions catalogue
rainbow.algorithms.proofs.ahof.pc
AHoF D16 PC Algorithm: constraint-based Bayesian-network structure learning. Starting from the complete graph, PC removes an edge X-Y whenever a conditional independence test finds X and Y independent given some conditioning set. The independence test compares a dependence statistic against a significance threshold: independent? statistic threshold = decide (statistic <= threshold) over the exact-rational statistic (a chi-square / partial-correlation value). Proved native and axiom-free, as worked instances: statistic 2 against threshold 5 declares independence; the worked certificate 2 <= 5 (native nnrat/at-most); and statistic 8 against threshold 5 keeps the edge. The soundness of PC's edge removal is classical and not proved here. The statistic computation, the conditioning-set search, and the edge-orientation phase are executable concerns. Requires nnrat/at-most, audit/decide-nnrat-at-most, nnrat/decide-at-most-true-sound (all in the D63 checkpoint). Scope (measured by the kernel): this module has 3 worked instances (statements about specific values). None of its theorems is a guarantee about the algorithm for all inputs; `lein verify rainbow.algorithms.proofs.ahof.pc` prints this classification.
pc/independent?
pc/independent? : (x₁ x₂ : ℚ≥0) → data/Bool
ℚ≥0 = nnrat/NonnegativeRational
pc/declares-independence
pc/declares-independence : → lis/extends? 2 5 = data/true
= = equality/Eq
pc/independence-is-sound
pc/independence-is-sound : → 2 ≤ 5
≤ = nnrat/at-most
pc/keeps-dependent-edge
pc/keeps-dependent-edge : → lis/extends? 8 5 = data/false
= = equality/Eq