op75_parse_subset_aux
def
A total fuel-bounded decoder for canonical subset-sum instances.
Statement
def op75_parse_subset_aux : ℕ → List Bool → Option (List ℕ × ℕ)- Source
- OP-75: canonical subset-sum input decoder for the width-three ReLU compiler.
- Verified
- 15 Nov 2026
- Axioms
- none listed
- Built on 1
- op75_parse_natDecode one canonical self-delimiting binary natural, returning its value, the unconsumed suffix, and whether the value is nonzero; reject…
- Used by 3
- op75_parse_subset_aux_soundEvery successful fuel-bounded parse reconstructs exactly the original canonical subset-sum word.
- op75_parse_subset_aux_completeSufficient fuel makes the parser accept every canonical instance and return its weights and target.
- op75_parse_subsetDecode a canonical subset-sum bit string, rejecting malformed or trailing data.
Lean source view module on GitHub
def op75_parse_subset_aux : ℕ → List Bool → Option (List ℕ × ℕ) | 0, _ => none | _ + 1, [] => none | fuel + 1, false :: tail => match op75_parse_nat tail with | some (t, [], _) => some ([], t) | _ => none | fuel + 1, true :: tail => match op75_parse_nat tail with | some (a, rest, _) => match op75_parse_subset_aux fuel rest with | some (as, t) => some (a :: as, t) | none => none | none => none