Skip to content
Closed
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
23 commits
Select commit Hold shift + click to select a range
fa8ecbc
sep-logic: iris-lean infrastructure — GenHeap, WP, adequacy, loop/blo…
Isabelle9999 Jul 14, 2026
80a7986
merge-sort: content lemmas — merge_sorted, merge_perm, wordsAt helpers
Isabelle9999 Jul 14, 2026
f628943
merge-sort: drain loops — right + left drain proven (zero sorry)
Isabelle9999 Jul 14, 2026
c545cb2
merge-sort: main merge loop — invariant + exit cases + content (zero …
Isabelle9999 Jul 14, 2026
5629b09
merge-sort: drain composition + h_main filled (zero sorry)
Isabelle9999 Jul 14, 2026
d38b1bc
merge-sort: top-level sort proof + allocator axiom (zero sorry)
Isabelle9999 Jul 14, 2026
8dd4540
merge-sort: program + spec + supporting files (verifier-generated Pro…
Isabelle9999 Jul 14, 2026
0d53567
merge-sort: allocator preconditions filled (hpristine + hmargin threa…
Isabelle9999 Jul 15, 2026
f0bdb7b
merge-sort: func33 proven, env_lift + hsp added to spec, 2 allocator …
Isabelle9999 Jul 15, 2026
6613570
merge-sort: func1 proven, func0 proven, merge_sort_correct wired (fun…
Isabelle9999 Jul 16, 2026
f037b08
merge-sort: func15_iProp + func0_iProp + wp_iProp_load32_sep (build p…
Isabelle9999 Jul 22, 2026
32005d1
merge-sort: func6 preamble iProp (frame setup)
Isabelle9999 Jul 22, 2026
0fe6cf8
merge-sort: func6 preamble + counter init iProp ( loop body pending)
Isabelle9999 Jul 23, 2026
ed5a6d1
infra: wp_wasm_iProp_loop — iProp invariant/body with Prop-level loop…
Isabelle9999 Jul 23, 2026
3f457b2
fix: move AllocSpec to MergeSort, use concrete «module» (fixes unsoun…
Isabelle9999 Jul 23, 2026
e67104e
infra: wp_wasm_iProp_block + exec 0 fix ( zero sorry)
Isabelle9999 Jul 24, 2026
01f8ee1
merge-sort: func6_iProp scaffold — wp_wasm_iProp_block + loop invaria…
Isabelle9999 Jul 24, 2026
9071e8b
refactor: axioms to hypotheses— Func2VecInitSpec + Func4DeallocSpec t…
Isabelle9999 Jul 24, 2026
bda947e
merge-sort: func6_iProp h_setup proved, h_form filled, build passes (…
Isabelle9999 Jul 25, 2026
3c7b320
merge-sort: hstep connected proof — pure_soundness + case split, no p…
Isabelle9999 Jul 25, 2026
ff8bd67
merge-sort: hmem8/hmem12/hframe from invariant via pure_soundness (ze…
Isabelle9999 Jul 25, 2026
4d53cc1
merge-sort: mergeI +3 invariants, mergeBody split infra, Break 1 boun…
Isabelle9999 Jul 26, 2026
62a6671
merge-sort: both Break 1 exec traces filled (simp+rfl), drain sorrys …
Isabelle9999 Jul 26, 2026
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
78 changes: 78 additions & 0 deletions .claude/CLAUDE.local.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,78 @@
\# personal rules (talos)



\## behavior

do not guess silently. state assumptions before acting.

if anything is ambiguous, list interpretations and ask.

if a simpler solution exists, say so before implementing.

before any pattern decision, check if the codebase already does it.

if found, use that. if not, stop and ask.



\## code style

minimum code to solve the problem. no extra features.

no abstractions for one-time use.

no decorative dividers. no emoji. no all-caps.

comments: plain lowercase, a word or two.

match existing style when editing existing code.

no Co-Authored-By trailers in commits.



\## scope

only change what the task requires.

do not refactor unrelated code.

mention unrelated problems separately, do not fix them.

touch as few files as possible.

preserve existing structure.



\## verification

turn requests into success criteria before starting.

run lake build to confirm. loop until it passes.



\## reading code

read surrounding code before editing.

identify local conventions before introducing new patterns.



\## lean 4 task patterns

wp lemma: @\[simp, wp\_simp] theorem wp\_X\_cons, proof is by wp\_atomic.

read execOne in Semantics.lean, mirror it in the wp body.

new instruction: Instruction type + execOne + wp lemma + decoder + emitter.

wp-only task: only touch Wp/Atomic.lean.

do not touch Program.lean files.

do not modify existing proofs.

1 change: 1 addition & 0 deletions .floatspec-ref
Submodule .floatspec-ref added at bb9d51
15 changes: 15 additions & 0 deletions .mcp.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,15 @@
{
"mcpServers": {
"lean-lsp-mcp": {
"type": "stdio",
"command": "C:\\Users\\User\\Miniconda\\Scripts\\lean-lsp-mcp.exe",
"args": [
"--lean-project-path",
"programs/lean"
],
"env": {
"PYTHONUTF8": "1"
}
}
}
}
1 change: 1 addition & 0 deletions .torchlean-ref
Submodule .torchlean-ref added at 564289
48 changes: 48 additions & 0 deletions codelib/CodeLib/RustStd/Frame.lean
Original file line number Diff line number Diff line change
Expand Up @@ -159,4 +159,52 @@ theorem Mem.read32_write64_disjoint (m : Mem) (a : UInt32) (b : UInt32) (v : UIn
@[simp] theorem Mem.write64_pages (m : Mem) (a : UInt32) (v : UInt64) :
(m.write64 a v).pages = m.pages := rfl

/-! ## Mixed-width read/write round-trips

These lemmas extract the lower or upper 32-bit half from a `write64` or
`read64` — the pattern that arises when func5 copies 8-byte descriptors
through the shadow stack and then reads back the individual 32-bit fields. -/

/-- Reading the lower 32 bits from a `write64` at the same address returns
the low 32-bit half of the stored value. -/
theorem Mem.read32_write64_low (m : Mem) (a : UInt32) (v : UInt64) :
(m.write64 a v).read32 a = v.toUInt32 := by
simp only [Mem.read32, Mem.write64]
simp only [Nat.add_eq_left, OfNat.ofNat_ne_zero, Nat.succ_ne_self, ↓reduceIte,
Nat.reduceEqDiff]
bv_decide

/-- The lower 32 bits of a `read64` equal the `read32` at the same address. -/
theorem Mem.read64_lo_is_read32 (m : Mem) (a : UInt32) :
(m.read64 a).toUInt32 = m.read32 a := by
simp only [Mem.read64, Mem.read32]
bv_decide

/-- Reading the upper 32 bits from a `write64` at the same base address
(offset +4) returns the high 32-bit half of the stored value.
Requires that the address does not overflow: `(a + 4).toNat = a.toNat + 4`. -/
theorem Mem.read32_write64_high (m : Mem) (a : UInt32) (v : UInt64)
(hnat : (a + 4).toNat = a.toNat + 4) :
(m.write64 a v).read32 (a + 4) = (v >>> 32).toUInt32 := by
-- After hnat, read positions are a.toNat+4, a.toNat+4+1, a.toNat+4+2, a.toNat+4+3;
-- normalize the +1/+2/+3 offsets so they match the write64 footprint indices.
simp only [Mem.read32, Mem.write64, hnat,
show a.toNat + 4 + 1 = a.toNat + 5 from by omega,
show a.toNat + 4 + 2 = a.toNat + 6 from by omega,
show a.toNat + 4 + 3 = a.toNat + 7 from by omega]
simp only [Nat.add_eq_left, OfNat.ofNat_ne_zero, Nat.succ_ne_self, ↓reduceIte,
Nat.reduceEqDiff]
bv_decide

/-- The upper 32 bits of a `read64` equal the `read32` at offset +4.
Requires that the address does not overflow: `(a + 4).toNat = a.toNat + 4`. -/
theorem Mem.read64_hi_is_read32 (m : Mem) (a : UInt32)
(hnat : (a + 4).toNat = a.toNat + 4) :
((m.read64 a) >>> 32).toUInt32 = m.read32 (a + 4) := by
simp only [Mem.read64, Mem.read32, hnat,
show a.toNat + 4 + 1 = a.toNat + 5 from by omega,
show a.toNat + 4 + 2 = a.toNat + 6 from by omega,
show a.toNat + 4 + 3 = a.toNat + 7 from by omega]
bv_decide

end Wasm
Loading