Word-RAM bag inclusion and erasure routines #
This module certifies two materialized-bag subroutines used by the CSP dynamic program:
subsetBagProg: tests whether a constraint scope slice is a subset of a bag slice via repeatedbagMemProgcalls.eraseBagProg: allocates|xs.erase v|words and copies the bag list omitting the first occurrence ofv.
Main definitions #
Cslib.Algorithms.WordRAM.TreeDecomposition.SubsetBagArgs,Cslib.Algorithms.WordRAM.TreeDecomposition.SubScanState: loop input and accumulator states.Cslib.Algorithms.WordRAM.TreeDecomposition.subsetBagProg: scope-inclusion check.Cslib.Algorithms.WordRAM.TreeDecomposition.eraseBagProg: single-element bag erasure copy.
Main results #
Cslib.Algorithms.WordRAM.TreeDecomposition.subsetBagProg_spec,Cslib.Algorithms.WordRAM.TreeDecomposition.subsetBagProg_realizes: correctness and realization ofsubsetBagProg.Cslib.Algorithms.WordRAM.TreeDecomposition.eraseBagProg_spec,Cslib.Algorithms.WordRAM.TreeDecomposition.eraseBagProg_realizes: correctness and realization oferaseBagProg.
Scope subset test (subsetBagProg) and bag erasure (eraseBagProg) #
Register arguments for the linear scope-inclusion test subsetBagProg.
- scopePtr : ℕ
Base memory address of the constraint scope list.
- scopeLen : ℕ
Length of the constraint scope list.
- bagPtr : ℕ
Base memory address of the bag list.
- bagLen : ℕ
Length of the bag list.
Instances For
Tuple equivalence encoding SubsetBagArgs into Word-RAM registers.
Loop cursor and accumulator flag used by subsetBagProg and constraint scans.
- cur : ℕ
Current memory pointer in the scanned slice.
- found : ℕ
Boolean-in-
ℕaccumulator flag (1while all entries pass,0once falsified).
Instances For
Tuple equivalence encoding SubScanState into Word-RAM registers.
Decide whether every element of the scope slice appears in the bag slice (1 iff true).
subsetBagProg is read-only and leaves memory unchanged.
Memory validity, functional correctness, and cost bound for subsetBagProg.
Exact-basis Word-RAM realization certificate for subsetBagProg.
Materialized bag erasure (eraseBagProg) #
Allocate and copy a materialized bag with the first occurrence of args.target erased.
Memory validity, framing, functional correctness, and cost bound for eraseBagProg.
Exact-basis Word-RAM realization certificate for eraseBagProg.