Skip to content

Conversation

@charles-cooper
Copy link
Contributor

Summary

  • Add run_block_data_equiv_no_phi theorem proving that running the same no-phi block from data-equivalent states produces equivalent results
  • Update proof strategy comments for merge_blocks_execution
  • Build on previous work: step_in_block_data_equiv_no_phi, data_equiv infrastructure

Test plan

  • VFMDIR=/home/ubuntu/verifereum Holmake --qof passes

🤖 Generated with Claude Code

charles-cooper and others added 13 commits December 8, 2025 18:34
Proof structure for the SimplifyCFG pass following phi_elimination pattern:
- cfgTransformScript.sml: transformation definitions (merge_blocks, thread_jump)
- cfgWellFormedScript.sml: well-formedness conditions
- cfgBlockScript.sml: block-level correctness theorems
- cfgFunctionScript.sml: function-level correctness theorems

Main theorems (sketched with cheat):
- merge_blocks_execution: merged block equiv to sequential execution
- simplify_cfg_merge_correct: block merge preserves semantics
- simplify_cfg_thread_correct: jump threading preserves semantics
- simplify_cfg_steps_correct: sequence of steps preserves semantics

🤖 Generated with [Claude Code](https://claude.com/claude-code)

Co-Authored-By: Claude Opus 4.5 <[email protected]>
Add helper lemmas for CFG simplification proofs:
- eval_operand_replace_label: label replacement doesn't affect eval_operand
- replace_label_inst_opcode/output: label replacement preserves opcode/output
- exec_binop/unop/modop_replace_label: exec functions ignore label changes

Prove replace_label_inst_preserves_step showing that for non-JMP/JNZ/PHI
instructions, label replacement doesn't change step_inst semantics.

Also fix proofs in cfgWellFormedScript.sml and cfgTransformScript.sml:
- all_distinct_map_filter, remove_block_unique_labels
- map_preserves_unique_labels
- lookup_block_remove, lookup_block_map

🤖 Generated with [Claude Code](https://claude.com/claude-code)

Co-Authored-By: Claude Opus 4.5 <[email protected]>
- Add data_equiv definition (state equiv ignoring control flow fields)
- Add state_equiv_merge and result_equiv_merge for block merging
- Prove data_equiv helper lemmas: refl, sym, trans
- Prove eval_operand_data_equiv, update_var_data_equiv
- Prove mload/mstore/sload/sstore/tload/tstore_data_equiv
- Prove halt_state/revert_state/next_inst_data_equiv
- Prove exec_binop/unop/modop_data_equiv
- Prove step_inst_data_equiv for non-PHI/non-branch instructions
- Add step_in_block_data_equiv_no_phi (cheated, structure verified)
- Fix inst_output -> inst_outputs in replace_label_inst_outputs

🤖 Generated with [Claude Code](https://claude.com/claude-code)

Co-Authored-By: Claude Opus 4.5 <[email protected]>
- Add jump_to_data_equiv: JMP preserves data_equiv
- Add next_inst_data_equiv_full: next_inst preserves data_equiv and control flow
- Add step_inst_preserves_ctrl: non-JMP/JNZ instructions preserve vs_current_bb/vs_inst_idx
- Add step_inst_jmp_data_equiv: JMP preserves data_equiv with control flow
- Add step_inst_jnz_data_equiv: JNZ preserves data_equiv with control flow
- Add non_jmp_jnz_terminator_not_ok: non-JMP/JNZ terminators never return OK
- Complete proof of step_in_block_data_equiv_no_phi

🤖 Generated with [Claude Code](https://claude.com/claude-code)

Co-Authored-By: Claude Opus 4.5 <[email protected]>
This theorem shows that running the same no_phi block from two
data-equivalent states produces result_equiv_merge results.

Key proof technique:
- Complete induction on remaining instructions
- Uses step_in_block_data_equiv_no_phi for each step
- Handles OK/OK case with subcases for halted and terminator

🤖 Generated with [Claude Code](https://claude.com/claude-code)

Co-Authored-By: Claude Opus 4.5 <[email protected]>
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.

2 participants