emit rows
ProvedResourceScheduling.Graph.emit_rowsalgorithmspolynomial-time
The complete nested emission loops produce the exact ordered resource matrix in reversed storage and preserve the uniform numeric bound.
Preamble
import Definitions.Def_ResourceScheduling_Graph_ReductionProgram import Definitions.Def_ResourceScheduling_Graph_RAMFields import Definitions.Def_ResourceScheduling_Graph_RAMSafe open ResourceScheduling.Graph GraphReg GraphProgram
Formal statement
namespace ResourceScheduling.Graph
theorem emit_rows (B N : ℕ) (s : RAMState GraphReg) (hs : RAMBound B s)
(hn : s.val n = N) (hB : N * N + N ≤ B) (hpos : 1 ≤ B) :
RAMSafe emitRows B s ∧ (emitRows.eval s).out =
((wordNonEdges N s.word).flatMap fun p => (List.range N).flatMap fun k =>
unary (if k = p.1 ∨ k = p.2 then 1 else 0)).reverse ++ s.out := by sorry
end ResourceScheduling.GraphSource
New auxiliary formalization for the ResourceScheduling Q2 reduction. The target is the unchanged CookPvsNP one-tape machine model, following Cook, The P versus NP problem, Clay Mathematics Institute (2000), Appendix. This explicit finite-column stack compiler and its simulation lemmas are new contributions, not numbered claims from Cook or the scheduling source paper.