-
Notifications
You must be signed in to change notification settings - Fork 0
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: theorems for ushiftRight
#33
Conversation
@mhk119 I just pushed to the PR, and broke the proof strategy down into smaller chunks so it's easier to upstream. Let me know what you think, and if you're happy with the PR. |
This looks good ! |
theorem shiftRight_zero (n : Int) : n >>> 0 = n := by | ||
simp [Int.shiftRight_eq_div_pow] |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Should n
be of type BitVec?
|
||
/-- | ||
Unsigned shift right by at least one bit makes the value of the bitvector less than or equal to `2^(w-1)`, | ||
makes the interpretation of the bitvector `Int` and `Nat` agree. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
makes the
two times in a row is grammatically suspicious.
have := show 2 * x.toNat >>> n < 2 ^ w by | ||
omega | ||
omega | ||
· have : x.toNat >>> n = 0 := by |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Can this be simplified with ushiftRight_eq_zero
?
@bollu, can this be closed? |
No description provided.