Skip to content

Commit

Permalink
Fix test cases
Browse files Browse the repository at this point in the history
  • Loading branch information
marcusrossel committed Oct 25, 2024
1 parent 164d9ba commit b34c078
Show file tree
Hide file tree
Showing 8 changed files with 10 additions and 16 deletions.
2 changes: 1 addition & 1 deletion Lean/Egg/Tests/BVar Index Correction.lean
Original file line number Diff line number Diff line change
Expand Up @@ -23,7 +23,7 @@ example : False := by
contradiction

set_option egg.shiftCapturedBVars true in
/-- error: egg failed to prove the goal (reached time limit) -/
/-- error: egg failed to prove the goal (saturated) -/
#guard_msgs in
example : (fun x => (x, 5).fst) = (fun _ : Nat => (fun x => x) 1) := by
egg [thm₁]
2 changes: 1 addition & 1 deletion Lean/Egg/Tests/Block Invalid Matches.lean
Original file line number Diff line number Diff line change
Expand Up @@ -35,7 +35,7 @@ theorem thm₂ : ∀ x y : Nat, x = (fun _ => x) y :=

-- This test covers Condition (1) of valid matches.
set_option egg.blockInvalidMatches true in
/-- error: egg failed to prove the goal (reached time limit) -/
/-- error: egg failed to prove the goal (saturated) -/
#guard_msgs in
example : (fun x => x) = (fun _ : Nat => (fun x => x) 1) := by
egg [thm₂]
6 changes: 3 additions & 3 deletions Lean/Egg/Tests/Builtins.lean
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
import Egg

/-- error: egg failed to prove the goal (reached time limit) -/
/-- error: egg failed to prove the goal (saturated) -/
#guard_msgs in
set_option egg.builtins false in
example : Nat.succ a = a + 1 := by
Expand All @@ -10,7 +10,7 @@ set_option egg.builtins true in
example : Nat.succ a = a + 1 := by
egg

/-- error: egg failed to prove the goal (reached time limit) -/
/-- error: egg failed to prove the goal (saturated) -/
#guard_msgs in
set_option egg.builtins false in
example (a : Nat) (h₁ : a < b → 1 = 2) (h₂ : b > a) : 1 = 2 := by
Expand All @@ -21,7 +21,7 @@ example (a : Nat) (h₁ : a < b → 1 = 2) (h₂ : b > a) : 1 = 2 := by
-- example (a : Nat) (h₁ : a < b → 1 = 2) (h₂ : b > a) : 1 = 2 := by
-- egg [h₁; h₂]

/-- error: egg failed to prove the goal (reached time limit) -/
/-- error: egg failed to prove the goal (saturated) -/
#guard_msgs in
set_option egg.builtins false in
example (a : Nat) (h₁ : a ≤ b → 1 = 2) (h₂ : b ≥ a) : 1 = 2 := by
Expand Down
4 changes: 2 additions & 2 deletions Lean/Egg/Tests/Conditional.lean
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
import Egg

/-- error: egg failed to prove the goal (reached time limit) -/
/-- error: egg failed to prove the goal (saturated) -/
#guard_msgs in
example (h : x ∧ y → 1 = 2) : 1 = 2 := by
egg [h]
Expand Down Expand Up @@ -36,7 +36,7 @@ example (h₁ : ∀ n, n > 2 → n > 3 → n = x) (h₃ : 4 > 3) (h₂ : 4 > 2)
example {a : Nat} (h : a < b) : a % b = a := by
egg [Nat.mod_eq_of_lt; h]

/-- error: egg failed to prove the goal (reached time limit) -/
/-- error: egg failed to prove the goal (saturated) -/
#guard_msgs in
example {x : Nat} (h₁ : x = y) (h₂ : x = y → 1 = 2) : 1 = 2 := by
egg [h₁, h₂]
Expand Down
2 changes: 1 addition & 1 deletion Lean/Egg/Tests/Crash 2.lean
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@ import Egg

-- This used to crash, before we changed proof erasure to encode the type of propositions.

/-- error: egg failed to prove the goal (reached time limit) -/
/-- error: egg failed to prove the goal (saturated) -/
#guard_msgs in
example (a : Array α) (i : Fin a.size) {j : Nat} (v : α) (hj : j < a.size)
(h : i.1 ≠ j) : (a.set i v)[j]'(by simp [*]) = a[j] := by
Expand Down
4 changes: 2 additions & 2 deletions Lean/Egg/Tests/Eta.lean
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@ set_option egg.genEtaRw true
set_option egg.genBetaRw false

set_option egg.genEtaRw false in
/-- error: egg failed to prove the goal (reached time limit) -/
/-- error: egg failed to prove the goal (saturated) -/
#guard_msgs in
example : (fun x => Nat.succ x) = Nat.succ := by
egg
Expand Down Expand Up @@ -45,7 +45,7 @@ example : (eta 50 Nat.succ Nat) = Nat.succ := by
egg

set_option egg.genEtaRw false in
/-- error: egg failed to prove the goal (reached time limit) -/
/-- error: egg failed to prove the goal (saturated) -/
#guard_msgs in
example (a : Nat) (h : ∀ b : Nat, b.succ.add a = 0) : (10 |> fun x => Nat.succ x).add a = 0 := by
egg [h]
Expand Down
6 changes: 0 additions & 6 deletions Lean/Egg/Tests/Rudi.lean
Original file line number Diff line number Diff line change
Expand Up @@ -2,9 +2,3 @@ import Egg

example : (fun x => (fun t _y => t) (fun z => x z)) = (fun (x : α → α) (_y : α) => x) := by
egg

variable (m : TypeType) (map : {α β : Type _} → (α → β) → m α → m β)

example (f : α → β → β) (g : β → β) (arg : m β) (ω : α) :
map (f ω) (map g arg) = map (fun x => (f ω) (g x)) arg := by
sorry -- Which rewrites should prove this?
File renamed without changes.

0 comments on commit b34c078

Please sign in to comment.