AFTD Auto-Formalizing Theoretical Domains

pathOddRunFinish

def

Count odd true runs while retaining a pending run parity.

Statement

open scoped BigOperators in
def pathOddRunFinish (prev : Bool) : List Bool → ℕ
Source
Finite-state path cut-matching certificate for OP-827; exhaustive transition check in experiment 22529.
Verified
11 Nov 2026
Axioms
none listed
Used by 3

Lean source view module on GitHub

open scoped BigOperators in
def pathOddRunFinish (prev : Bool) : List Bool → ℕ
  | [] => if prev then 1 else 0
  | b :: bs => (if prev && !b then 1 else 0) + pathOddRunFinish (b && !prev) bs
See it in the graphDiscuss this resultChallenge it