Represent the scalar and address banks in real pointer-machine memory
DefinitionSmaleNinth_LPTraceMemoryUse target cell for source scalar register , with its value stored with the opposite sign. Use target cell for source address register , with its natural value stored as an exact real number. The initial eight pointer-machine instructions copy the dimensions from cells and to address-bank cells and .
Definition code
import Definitions.Def_OAILP_RAM_Basic import Definitions.Def_SmaleNinth_RealRAM namespace SmaleNinth open OAI.Optimization.LinearProgramming /-- The source data bank uses the input cells after the two dimension cells. The stored real is the negative of its source value. -/ def lpTraceDataCell (j : ℕ) : ℤ := (j : ℤ) + 2 /-- The source address bank uses negative cells, storing naturals as exact reals. -/ def lpTraceIndexCell (j : ℕ) : ℤ := -(j : ℤ) - 1 /-- Only the two source banks matter between instruction blocks. Scratch registers and the two non-bank cells are unrestricted. -/ def LPTraceMemory (s : RAM.State ℝ) (u : RAMConfig) : Prop := (∀ j, u.mem (lpTraceDataCell j) = -s.data j) ∧ (∀ j, u.mem (lpTraceIndexCell j) = (s.index j : ℝ)) /-- Initialize the first two source address registers from the dimensions. The data bank is already in place and the other address cells start at zero. -/ def lpTracePrelude : RAMProgram := [.pset 0 0, .load 0 0, .pset 0 (-1), .store 0 0, .pset 0 1, .load 0 0, .pset 0 (-2), .store 0 0] end SmaleNinth
Source