AFTD Auto-Formalizing Theoretical Domains

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

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
See it in the graphDiscuss this resultChallenge it