Basic theorems
This file contains many small lemmata about the built machine model.
These lemmata help proving
statements about the MRiscX language by simplifying terms.
All these lemmata are added to the simp command with
the @[simp]. This can shorten proofs because lean
can apply these theorems with simp automatically.
@[simp]
theorem
MState.addRegister_getRegister_neq
(ms : MState)
(r1 r2 v : UInt64)
:
r1 ≠ r2 → (ms.addRegister r1 v).getRegisterAt r2 = ms.getRegisterAt r2
theorem
MState.addRegister_getRegister_eq
(ms : MState)
(r1 r2 v : UInt64)
:
r1 = r2 → (ms.addRegister r1 v).getRegisterAt r2 = v
@[simp]
theorem
MState.runNSteps_currInstruction
(ms : MState)
(n : ℕ)
:
(ms.runNSteps n).currInstruction = TMap.get (ms.runNSteps n).code.instructionMap (ms.runNSteps n).pc
@[simp]
theorem
MState.get_register_only_register'
(ms : MState)
(m : Memory)
(r : Registers)
(c : Code)
(terminated : Bool)
(i p : UInt64)
:
{ memory := m, registers := r, pc := p, code := c, terminated := terminated }.getRegisterAt i = { memory := ms.memory, registers := r, pc := ms.pc, code := ms.code, terminated := ms.terminated }.getRegisterAt i
theorem
MState.get_register_only_memory'
(ms : MState)
(m : Memory)
(r : Registers)
(c : Code)
(terminated : Bool)
(i p : UInt64)
:
{ memory := m, registers := r, pc := p, code := c, terminated := terminated }.getMemoryAt i = { memory := m, registers := ms.registers, pc := ms.pc, code := ms.code, terminated := ms.terminated }.getMemoryAt i
@[simp]
@[simp]