Skip to content

Commit

Permalink
inspiration: two more theorem classes (#446)
Browse files Browse the repository at this point in the history
Co-authored-by: Atticus Kuhn <[email protected]>
  • Loading branch information
tobiasgrosser and Atticus Kuhn authored Jul 10, 2024
1 parent 3d45c8f commit 0b66518
Showing 1 changed file with 35 additions and 0 deletions.
35 changes: 35 additions & 0 deletions SSA/Projects/InstCombine/TacticAuto.lean
Original file line number Diff line number Diff line change
Expand Up @@ -112,6 +112,40 @@ macro "simp_alive_bitvec": tactic =>
)
)

/-
This tactic attempts to shift ofBool to the outer-most level,
and then convert everything to arithmetic
and then solve with the omega tactic.
-/
macro "of_bool_tactic" : tactic =>
`(tactic|
(
repeat (
first
| simp [bv_ofBool]
| simp [ForLean.ofBool_eq']
| simp
| simp only [bne]
)
repeat (
first
| simp only [BitVec.ule]
| simp only [BitVec.ult]
| simp only [BitVec.sle]
| simp only [BitVec.slt]
| simp only [BitVec.toInt]
| simp only [BEq.beq]
| simp only [← Bool.decide_or]
| simp only [← Bool.decide_and]
| simp only [← decide_not]
| simp only [decide_eq_decide]
| simp [of_decide_eq_true]
| simp only [BitVec.toNat_eq]
)
try omega
)
)

macro "alive_auto": tactic =>
`(tactic|
(
Expand All @@ -122,5 +156,6 @@ macro "alive_auto": tactic =>
ensure_only_goal
)
simp_alive_bitvec
of_bool_tactic
)
)

0 comments on commit 0b66518

Please sign in to comment.