Skip to content

Simulation framework: parameterized by state relation R#165

Merged
charles-cooper merged 2 commits intomainfrom
simulation-infrastructure
Mar 5, 2026
Merged

Simulation framework: parameterized by state relation R#165
charles-cooper merged 2 commits intomainfrom
simulation-infrastructure

Conversation

@charles-cooper
Copy link
Contributor

co-authored by claude opus 4.6

Pass simulation framework parameterized by state relation R, with cheated proofs as placeholders.

Components

Simulation Framework (venom/simulation/)

  • lift_result (defs/passSimulationDefsScript.sml): Lifts state relation R through exec_result — generalizes result_equiv (which is lift_result state_equiv)
  • inst_simulates R f: Per-instruction simulation — f preserves lift_result R and is_terminator
  • block_simulates R bt: Whole-block simulation via run_block
  • block_map_transform / function_map_transform: 1:1 instruction/block mapping

Parameterized Execution Equivalence (venom/simulation/defs/execEquivParamDefsScript.sml)

  • valid_state_rel R: Closure conditions on R enabling the master theorem (preserves non-var fields, closed under update_var, preserves eval_operand when operand vars agree, reflexive)
  • step_inst_preserves_R: Master theorem — valid_state_rel R ∧ R s1 s2 ∧ operand vars agree ⟹ lift_result R (step_inst inst s1) (step_inst inst s2)
  • Instantiations: state_equiv and state_equiv_except both satisfy valid_state_rel

Composition (venom/simulation/proofs/passCompositionProofsScript.sml)

  • analysis_pass_correct: End-to-end theorem connecting dataflow convergence → soundness → simulation → function correctness, parameterized by R

Lifting Theorems

  • inst_sim_block_sim — instruction sim → block sim
  • block_sim_function — block sim → function correctness
  • conditional_inst_sim — partial + identity → full inst_simulates
  • block_sim_compose — composition preserves block_simulates
  • lift_result_refl / lift_result_trans — R properties lift through results

Motivation

Eliminates per-pass boilerplate (~800 LOC each) for execution preservation proofs. Current RTA has 839 LOC of opcode-by-opcode helpers that step_inst_preserves_R replaces with one master theorem + one valid_state_rel satisfaction proof.

Stats

  • 10 cheated theorems across 3 proof files
  • 3 new files (execEquivParam defs/proofs/props), 5 modified
  • All compile cleanly

Depends on

@charles-cooper charles-cooper force-pushed the simulation-infrastructure branch from c2e74e9 to 55af130 Compare March 4, 2026 02:06
Base automatically changed from pass-infrastructure to main March 4, 2026 17:50
- lift_result: lifts state relation R through exec_result
- inst_simulates R f / block_simulates R bt: simulation predicates
- block_map_transform / function_map_transform: 1:1 mapping transforms
- valid_state_rel: closure conditions for step_inst_preserves_R
- Instantiations: state_equiv and state_equiv_except satisfy valid_state_rel
- analysis_pass_correct: end-to-end composition theorem

All proofs cheated (stubs for proving later).
@charles-cooper charles-cooper force-pushed the simulation-infrastructure branch from 55af130 to 9441f95 Compare March 4, 2026 18:41
@charles-cooper charles-cooper merged commit 1f31170 into main Mar 5, 2026
12 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant