-
Notifications
You must be signed in to change notification settings - Fork 11
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Chore: Change Automata Tactic from Equality to Congruence on w Bits (#…
…507) In a previous version of the Automata tactic, I had relied on statements for re-writing that were not true, for example ```lean @[simp] theorem ofBitVec_add : ofBitVec (x + y) = (ofBitVec x) + (ofBitVec y) := sorry ``` But in this patch, I use a Simproc to only require a weaker statement: ```lean @[simp] theorem ofBitVec_add : EqualUpTo w (ofBitVec (x + y)) ((ofBitVec x) + (ofBitVec y)) := sorry ``` So the code has become uglier and more complicated, but at least all the sorries are provable now. The main new point of complication is that I introduced a new Simproc (because I no longer rely on the congruence properties of equality), and this makes the code more complicated. The reason why is that for equality, congruence comes for free, i.e. if a=b, then f(a) = f(b). For other equivalence relations, congruence is not automatic, so we have to prove and apply congruence manually. There are still three sorries in the tactic, namely ```lean @[simp] theorem ofBitVec_sub : ofBitVec (x - y) ≈ʷ (ofBitVec x) - (ofBitVec y) := by sorry @[simp] theorem ofBitVec_add : ofBitVec (x + y) ≈ʷ (ofBitVec x) + (ofBitVec y) := by sorry @[simp] theorem ofBitVec_neg : ofBitVec (- x) ≈ʷ - (ofBitVec x) := by sorry ``` But as I find these statements difficult to prove, I will prove them in a later PR. cc: @Equilibris --------- Co-authored-by: Atticus Kuhn <[email protected]> Co-authored-by: Atticus Kuhn <[email protected]>
- Loading branch information
1 parent
6bcf937
commit cf6d655
Showing
2 changed files
with
197 additions
and
68 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters