Documentation

CslibFrontier.Algorithms.WordRAM.Auction.Loop

Workspace initialization and outer auction loop (auctionCoreProg) #

Initializes the owner, price, and reversed unassigned-person stack arrays for an n × n auction instance and runs boundedWhile over bidStepProg from Auction.BidStep until the stack empties, matching the pure auction loop state in ≤ bids * (4 * n + 6) + 3 * n memory operations.

The initialization step (initStep), its realize certificate, and the boundedWhile induction remain private to this module.

Main definitions #

Main results #

Workspace state initialization #

Bounded-while outer loop #

Initialize workspace state (owner, price, stack) and run the Gauss–Seidel auction loop until all persons are assigned.

theorem Cslib.Algorithms.WordRAM.Auction.auctionCoreProg_spec {w : ℕ} (ws : AuctionWS) {C : Fin ws.n × Fin ws.n → ℕ} (hε : 0 < ws.eps) (hC_le : ∀ (i j : Fin ws.n), C (i, j) ≤ 2 * ws.scale * ws.M) (s₀ : DataStructure.Memory.State) (hws : ValidWS ws s₀) (hC_mem : ∀ (i j : Fin ws.n), s₀.mem (ws.bC + (↑i * ws.n + ↑j)) = C (i, j)) (hfit1 : WordRAM.Fits w 1) (hfit_ws : WordRAM.Fits w (ws.outBase + ws.n + 1)) (hfit_p : WordRAM.Fits w (4 * ws.scale * ws.M + 2 * ws.eps)) :

Full specification of auctionCoreProg: initializes arrays and reaches the exact final state auction (fun e => (C e : ℤ)) ws.eps within bids * (4 * n + 6) + 3 * n memory steps.