You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Synth's Rocq proof suite verifies that compile_wasm_to_arm preserves WASM semantics.
After aligning Compilation.v with the actual Rust compiler (trap guard sequences for
division, MOVW+MOVT for large constants), 7 proofs were re-admitted pending exec_program
extensions for PC-relative branching. 10 total admits remain.
Proof Tiers
Tier
Meaning
Count
T1: Result Correspondence
ARM output register = WASM result value
35
T2: Existence-Only
ARM execution succeeds (no result claim)
142
T3: Admitted
Not yet proven
10
Infrastructure
Properties of integers, states, flag lemmas
56
Total: 233 Qed / 10 Admitted across all files
T1: Result Correspondence (35 Qed)
These are the crown jewels — they prove the compiled ARM code produces the exact same
value as the WASM operation.
i32 Arithmetic (6)
File
Theorem
Operation
Correctness.v
compile_i32_add_correct
I32Add
Correctness.v
compile_i32_sub_correct
I32Sub
Correctness.v
compile_i32_mul_correct
I32Mul
Correctness.v
compile_i32_and_correct
I32And
Correctness.v
compile_i32_or_correct
I32Or
Correctness.v
compile_i32_xor_correct
I32Xor
(Also duplicated in CorrectnessI32.v: add, sub, mul, and, or, xor)
i32 Division (0 — moved to T3)
These were T1 proofs but are now Admitted because division compilation emits
trap guard sequences (CMP + BCondOffset + UDF) that cannot be verified in the
current sequential exec_program model. See T3 section below.
Note: i64 div/rem proofs use I32.divs/I32.divu hypotheses (what ARM actually computes
with 32-bit registers), not I64.divs/I64.divu.
Each T1 proof proves: get_reg astate' R0 = <result> after executing the compiled ARM program.
T2: Existence-Only (143 Qed)
These prove the ARM program executes successfully but don't claim the result value is correct.
Named *_executes to distinguish from T1 *_correct proofs.
To upgrade to T1 result-correspondence proofs, replace these axioms with Flocq
IEEE 754 definitions and prove correspondence with WASM float semantics.
Axioms
Integers.v — I32 Module (13 axioms)
Axiom
Purpose
I32.clz
Count leading zeros function
I32.ctz
Count trailing zeros function
I32.popcnt
Population count function
I32.rbit
Reverse bits function (ARM RBIT)
I32.clz_rbit
clz(rbit(v)) = ctz(v) — connects RBIT+CLZ to CTZ
I32.clz_range
0 <= clz(x) <= 32
I32.ctz_range
0 <= ctz(x) <= 32
I32.popcnt_range
0 <= popcnt(x) <= 32
I32.div_mul_rem_unsigned
Division/remainder relationship (unsigned)
I32.div_mul_rem_signed
Division/remainder relationship (signed)
I32.remu_formula
r = a - (a/b) * b (unsigned)
I32.rems_formula
r = a - (a/b) * b (signed)
I32.rotl_rotr_sub
rotl x y = rotr x (sub (repr 32) y) — rotl via rotr
ArmSemantics.v — VFP Operations (21 axioms)
Axiom
Purpose
f32_add/sub/mul/div_bits
F32 binary arithmetic on bit patterns
f32_sqrt/abs/neg_bits
F32 unary operations on bit patterns
f64_add/sub/mul/div_bits
F64 binary arithmetic on bit patterns
f64_sqrt/abs/neg_bits
F64 unary operations on bit patterns
f32_compare_flags
F32 comparison -> ARM condition flags
f64_compare_flags
F64 comparison -> ARM condition flags
cvt_f32_to_f64_bits
F32 -> F64 promotion
cvt_f64_to_f32_bits
F64 -> F32 demotion
cvt_s32_to_f32_bits
Signed int -> F32 conversion
cvt_f32_to_s32_bits
F32 -> Signed int conversion
Integers.v — I64 Module (6 axioms)
Axiom
Purpose
I64.clz
Count leading zeros function (64-bit)
I64.ctz
Count trailing zeros function (64-bit)
I64.popcnt
Population count function (64-bit)
I64.clz_range
0 <= clz(x) <= 64
I64.ctz_range
0 <= ctz(x) <= 64
I64.popcnt_range
0 <= popcnt(x) <= 64
ArmFlagLemmas.v (1 axiom)
Axiom
Purpose
nv_flag_sub_lts
N!=V flag after CMP <-> signed less-than (ARM architecture property)
ArmRefinement.v (1 axiom)
Axiom
Purpose
sail_exec_instr
Placeholder for Sail ARM specification (not yet imported)
Added LSL_reg/LSR_reg/ASR_reg/ROR_reg/RSB to ArmInstructions.v and ArmSemantics.v
Closed 5 i32 shift/rotate admits
Phase 3: Catch-all removal
Replaced | _ => Some s with | _ => None in ArmSemantics.v
Replaced | _ => Some s with | _ => None in WasmSemantics.v
Made proof accounting honest: unmodeled instructions now fail (None) instead
of silently succeeding as no-ops. 79 unmodeled WASM instructions affected
(i64 arithmetic/bitwise, all f32/f64, conversions, memory ops).
Correctness proofs remain valid because they take exec_wasm_instr = Some (...)
as a hypothesis; with None, the hypothesis is False, making theorems
vacuously true (honest: we don't claim correctness for what we haven't modeled).