Skip to content

Commit

Permalink
feat: use try? in some grind_constProp.lean examples
Browse files Browse the repository at this point in the history
  • Loading branch information
leodemoura committed Feb 2, 2025
1 parent 2d7c3ee commit b0a4859
Showing 1 changed file with 11 additions and 1 deletion.
12 changes: 11 additions & 1 deletion tests/lean/run/grind_constProp.lean
Original file line number Diff line number Diff line change
Expand Up @@ -207,6 +207,11 @@ def evalExpr (e : Expr) : EvalM Val := do
@[grind] theorem UnaryOp.simplify_eval (op : UnaryOp) : (op.simplify a).eval σ = (Expr.una op a).eval σ := by
grind [UnaryOp.simplify.eq_def]

/-- info: Try this: (induction e using Expr.simplify.induct) <;> grind? -/
#guard_msgs (info) in
example (e : Expr) : e.simplify.eval σ = e.eval σ := by
try?

@[simp, grind =] theorem Expr.eval_simplify (e : Expr) : e.simplify.eval σ = e.eval σ := by
induction e, σ using Expr.simplify.induct <;> grind

Expand Down Expand Up @@ -293,14 +298,19 @@ theorem State.cons_le_of_eq (h₁ : σ' ≼ σ) (h₂ : σ.find? x = some v) : (
grind

@[grind] theorem State.erase_le (σ : State) : σ.erase x ≼ σ := by
induction σ, x using State.erase.induct <;> grind
grind

@[grind] theorem State.join_le_left (σ₁ σ₂ : State) : σ₁.join σ₂ ≼ σ₁ := by
induction σ₁, σ₂ using State.join.induct <;> grind

@[grind] theorem State.join_le_left_of (h : σ₁ ≼ σ₂) (σ₃ : State) : σ₁.join σ₃ ≼ σ₂ := by
grind

/-- info: Try this: (induction σ₁, σ₂ using State.join.induct) <;> grind? -/
#guard_msgs (info) in
example (σ₁ σ₂ : State) : σ₁.join σ₂ ≼ σ₂ := by
try?

@[grind] theorem State.join_le_right (σ₁ σ₂ : State) : σ₁.join σ₂ ≼ σ₂ := by
induction σ₁, σ₂ using State.join.induct <;> grind

Expand Down

0 comments on commit b0a4859

Please sign in to comment.