-
Notifications
You must be signed in to change notification settings - Fork 11
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: add overflow flags to lean semantics #471
Closed
Closed
Changes from all commits
Commits
Show all changes
9 commits
Select commit
Hold shift + click to select a range
d66a7b8
add flags
ce2e0d9
Make changes
5730a60
change syntax parser
3ad683a
add all overflow flags
7492a71
fix a bug
18b38fc
fix autogenerated messages
a203c33
please pass the github actions
65fd1d5
please work please work
b37e2f5
Merge remote-tracking branch 'origin/main' into feat/overflow_flags
tobiasgrosser File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,2 +1,3 @@ | ||
SSA/Projects/InstCombine/tests/LLVM/** linguist-generated=true | ||
SSA/Projects/InstCombine/all.lean linguist-generated=true | ||
test/LLVMDialect/InstCombine/** linguist-generated=true |
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
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 | ||||
---|---|---|---|---|---|---|
|
@@ -65,7 +65,7 @@ def or {Γ : Ctxt _} (w : ℕ) (l r : Nat) | |||||
:= by get_elem_tactic) : | ||||||
Expr InstCombine.LLVM Γ .pure (InstCombine.Ty.bitvec w) := | ||||||
Expr.mk | ||||||
(op := InstCombine.MOp.or w) | ||||||
(op := InstCombine.MOp.or false w) | ||||||
(eff_le := by constructor) | ||||||
(ty_eq := rfl) | ||||||
(args := .cons ⟨l, lp⟩ <| .cons ⟨r, rp⟩ .nil) | ||||||
|
@@ -93,7 +93,7 @@ def shl {Γ : Ctxt _} (w : ℕ) (l r : Nat) | |||||
:= by get_elem_tactic) : | ||||||
Expr InstCombine.LLVM Γ .pure (InstCombine.Ty.bitvec w) := | ||||||
Expr.mk | ||||||
(op := InstCombine.MOp.shl w) | ||||||
(op := InstCombine.MOp.shl false false w) | ||||||
(eff_le := by constructor) | ||||||
(ty_eq := rfl) | ||||||
(args := .cons ⟨l, lp⟩ <| .cons ⟨r, rp⟩ .nil) | ||||||
|
@@ -107,7 +107,7 @@ def lshr {Γ : Ctxt _} (w : ℕ) (l r : Nat) | |||||
:= by get_elem_tactic) : | ||||||
Expr InstCombine.LLVM Γ .pure (InstCombine.Ty.bitvec w) := | ||||||
Expr.mk | ||||||
(op := InstCombine.MOp.lshr w) | ||||||
(op := InstCombine.MOp.lshr false w) | ||||||
(eff_le := by constructor) | ||||||
(ty_eq := rfl) | ||||||
(args := .cons ⟨l, lp⟩ <| .cons ⟨r, rp⟩ .nil) | ||||||
|
@@ -121,7 +121,7 @@ def ashr {Γ : Ctxt _} (w : ℕ) (l r : Nat) | |||||
:= by get_elem_tactic) : | ||||||
Expr InstCombine.LLVM Γ .pure (InstCombine.Ty.bitvec w) := | ||||||
Expr.mk | ||||||
(op := InstCombine.MOp.ashr w) | ||||||
(op := InstCombine.MOp.ashr false w) | ||||||
(eff_le := by constructor) | ||||||
(ty_eq := rfl) | ||||||
(args := .cons ⟨l, lp⟩ <| .cons ⟨r, rp⟩ .nil) | ||||||
|
@@ -135,7 +135,7 @@ def sub {Γ : Ctxt _} (w : ℕ) (l r : Nat) | |||||
:= by get_elem_tactic) : | ||||||
Expr InstCombine.LLVM Γ .pure (InstCombine.Ty.bitvec w) := | ||||||
Expr.mk | ||||||
(op := InstCombine.MOp.sub w) | ||||||
(op := InstCombine.MOp.sub false false w) | ||||||
(eff_le := by constructor) | ||||||
(ty_eq := rfl) | ||||||
(args := .cons ⟨l, lp⟩ <| .cons ⟨r, rp⟩ .nil) | ||||||
|
@@ -149,7 +149,7 @@ def add {Γ : Ctxt _} (w : ℕ) (l r : Nat) | |||||
:= by get_elem_tactic) : | ||||||
Expr InstCombine.LLVM Γ .pure (InstCombine.Ty.bitvec w) := | ||||||
Expr.mk | ||||||
(op := InstCombine.MOp.add w) | ||||||
(op := InstCombine.MOp.add false false w) | ||||||
(eff_le := by constructor) | ||||||
(ty_eq := rfl) | ||||||
(args := .cons ⟨l, lp⟩ <| .cons ⟨r, rp⟩ .nil) | ||||||
|
@@ -163,7 +163,7 @@ def mul {Γ : Ctxt _} (w : ℕ) (l r : Nat) | |||||
:= by get_elem_tactic) : | ||||||
Expr InstCombine.LLVM Γ .pure (InstCombine.Ty.bitvec w) := | ||||||
Expr.mk | ||||||
(op := InstCombine.MOp.mul w) | ||||||
(op := InstCombine.MOp.mul false false w) | ||||||
(eff_le := by constructor) | ||||||
(ty_eq := rfl) | ||||||
(args := .cons ⟨l, lp⟩ <| .cons ⟨r, rp⟩ .nil) | ||||||
|
@@ -177,7 +177,7 @@ def sdiv {Γ : Ctxt _} (w : ℕ) (l r : Nat) | |||||
:= by get_elem_tactic) : | ||||||
Expr InstCombine.LLVM Γ .pure (InstCombine.Ty.bitvec w) := | ||||||
Expr.mk | ||||||
(op := InstCombine.MOp.sdiv w) | ||||||
(op := InstCombine.MOp.sdiv false w) | ||||||
(eff_le := by constructor) | ||||||
(ty_eq := rfl) | ||||||
(args := .cons ⟨l, lp⟩ <| .cons ⟨r, rp⟩ .nil) | ||||||
|
@@ -191,7 +191,7 @@ def udiv {Γ : Ctxt _} (w : ℕ) (l r : Nat) | |||||
:= by get_elem_tactic) : | ||||||
Expr InstCombine.LLVM Γ .pure (InstCombine.Ty.bitvec w) := | ||||||
Expr.mk | ||||||
(op := InstCombine.MOp.udiv w) | ||||||
(op := InstCombine.MOp.udiv false w) | ||||||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more.
Suggested change
|
||||||
(eff_le := by constructor) | ||||||
(ty_eq := rfl) | ||||||
(args := .cons ⟨l, lp⟩ <| .cons ⟨r, rp⟩ .nil) | ||||||
|
Oops, something went wrong.
Oops, something went wrong.
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
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.
non-terminal simp (if a simp is not the last element of a proof, it should be
simp only
to reduce chances of the proof breaking when the global simp-set changes, you can usesimp?
to "squeeze" the simp)