Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

feat: mem_separate_of_mem_separate' #229

Merged
merged 3 commits into from
Oct 10, 2024
Merged
Changes from all commits
Commits
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
23 changes: 8 additions & 15 deletions Arm/Memory/Separate.lean
Original file line number Diff line number Diff line change
Expand Up @@ -366,27 +366,20 @@ theorem mem_separate'_comm (h : mem_separate' a an b bn) :
apply mem_separate'.of_omega
omega


/-#
This is a theorem we ought to prove, which establishes the equivalence
between the old and new defintions of 'mem_separate'.
However, the proof is finicky, and so we leave it commented for now.
This theorem establishes the equivalence between the old and new definitions of 'mem_separate'.
-/
/-
theorem mem_separate_of_mem_separate' (h : mem_separate' a an b bn)
(ha' : a' = a + (BitVec.ofNat w₁ (an - 1) ) (hb' : b' = b + (BitVec.ofNat w₁ (bn - 1)))
(hlegala : mem_legal a an) (hlegalb: mem_legal b bn) :
mem_separate a a' b b' := by
theorem mem_separate_of_mem_separate' (a b : BitVec 64)
(an bn : Nat)
(han : an > 0) (hbn : bn > 0)
(h : mem_separate' a an b bn) :
mem_separate a (a + an - 1) b (b + bn - 1) := by
simp [mem_separate]
simp [mem_overlap]
obtain ⟨ha, hb, hsep⟩ := h
simp [mem_legal'] at ha hb
subst ha'
subst hb'
apply Classical.byContradiction
intro hcontra
· sorry
· sorry
-/
bv_omega

/-- `mem_subset' a an b bn` witnesses that `[a..a+an)` is a subset of `[b..b+bn)`.
In prose, we may notate this as `[a..an) ≤ [b..bn)`.
Expand Down
Loading