Skip to content
Rainbow docs menu

Reference · The Applied Higher-Order Functions catalogue

rainbow.algorithms.proofs.ahof.beam-search

The Applied Higher-Order Functions cataloguesrc/rainbow/algorithms/proofs/ahof/beam_search.clj1 definitions, 3 theorems

AHoF D-family Beam Search: a bounded-breadth heuristic search that, at each level, expands only the K highest-scoring partial solutions (the beam) instead of the full frontier -- trading completeness for tractable memory, as in machine translation decoding and structured prediction. A candidate stays in the beam exactly when its score meets the beam's cutoff (the K-th best score at that level): in-beam? score cutoff = decide (cutoff <= score) over exact-rational candidate scores. Proved native and axiom-free: the beam-membership test; that a high-scoring candidate is kept; that a low-scoring candidate is pruned; and the certificate that a retained candidate really meets the cutoff (cutoff <= score as native nnrat/at-most). The successor expansion and the cutoff (K-th order statistic) are executable; what is proved is the beam pruning decision. 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.beam-search` prints this classification.

beam-search/in-beam?

DefinitionSource, line 53

beam-search/in-beam? :
  (x₁ x₂ : ℚ≥0)
  → data/Bool

ℚ≥0 = nnrat/NonnegativeRational

beam-search/keeps-high-scorer

TheoremWorked exampleNo axiomsSource, line 70

beam-search/keeps-high-scorer :
  → bo/is-safe 7 5 = data/true

= = equality/Eq

beam-search/retained-meets-cutoff

TheoremWorked exampleNo axiomsSource, line 78

beam-search/retained-meets-cutoff :
  → 5 ≤ 7

≤ = nnrat/at-most

beam-search/prunes-low-scorer

TheoremWorked exampleNo axiomsSource, line 84

beam-search/prunes-low-scorer :
  → bo/is-safe 3 5 = data/false

= = equality/Eq