-
Notifications
You must be signed in to change notification settings - Fork 10
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
1 parent
31724bd
commit 5c75d93
Showing
2 changed files
with
38 additions
and
38 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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,36 @@ | ||
namespace BitVec | ||
|
||
def ushr_xor_distrib (a b c : BitVec w) : | ||
(a ^^^ b) >>> c = (a >>> c) ^^^ (b >>> c) := by | ||
simp only [HShiftRight.hShiftRight] | ||
ext | ||
simp | ||
|
||
def ushr_and_distrib (a b c : BitVec w) : | ||
(a &&& b) >>> c = (a >>> c) &&& (b >>> c) := by | ||
simp only [HShiftRight.hShiftRight] | ||
ext | ||
simp | ||
|
||
def ushr_or_distrib (a b c : BitVec w) : | ||
(a ||| b) >>> c = (a >>> c) ||| (b >>> c) := by | ||
simp only [HShiftRight.hShiftRight] | ||
ext | ||
simp | ||
|
||
def xor_assoc (a b c : BitVec w) : | ||
a ^^^ b ^^^ c = a ^^^ (b ^^^ c) := by | ||
ext i | ||
simp [Bool.xor_assoc] | ||
|
||
def and_assoc (a b c : BitVec w) : | ||
a &&& b &&& c = a &&& (b &&& c) := by | ||
ext i | ||
simp [Bool.and_assoc] | ||
|
||
def or_assoc (a b c : BitVec w) : | ||
a ||| b ||| c = a ||| (b ||| c) := by | ||
ext i | ||
simp [Bool.or_assoc] | ||
|
||
end BitVec |