Skip to content

Commit

Permalink
fix: use getTransparency in librarySearch SolveByElim.Config (#566)
Browse files Browse the repository at this point in the history
  • Loading branch information
dwrensha authored Jan 30, 2024
1 parent 128fd8e commit a11bdfc
Show file tree
Hide file tree
Showing 2 changed files with 9 additions and 1 deletion.
3 changes: 2 additions & 1 deletion Std/Tactic/LibrarySearch.lean
Original file line number Diff line number Diff line change
Expand Up @@ -366,7 +366,8 @@ def solveByElim (required : List Expr) (exfalso : Bool) (goals : List MVarId) (m
-- There is only a marginal decrease in performance for using the `symm` option for `solveByElim`.
-- (measured via `lake build && time lake env lean test/librarySearch.lean`).
let cfg : SolveByElim.Config :=
{ maxDepth, exfalso := exfalso, symm := true, commitIndependentGoals := true }
{ maxDepth, exfalso := exfalso, symm := true, commitIndependentGoals := true,
transparency := ← getTransparency }
let ⟨lemmas, ctx⟩ ← SolveByElim.mkAssumptionSet false false [] [] #[]
let cfg := if !required.isEmpty then cfg.requireUsingAll required else cfg
SolveByElim.solveByElim cfg lemmas ctx goals
Expand Down
7 changes: 7 additions & 0 deletions test/library_search/basic.lean
Original file line number Diff line number Diff line change
Expand Up @@ -231,3 +231,10 @@ warning: declaration uses 'sorry'
#guard_msgs in
example {x : Int} (h : x ≠ 0) : 2 * x ≠ 0 := by
std_apply? using h

-- Check that adding `with_reducible` prevents expensive kernel reductions.
-- https://leanprover.zulipchat.com/#narrow/stream/287929-mathlib4/topic/.60exact.3F.60.20failure.3A.20.22maximum.20recursion.20depth.20has.20been.20reached.22/near/417649319
/-- info: Try this: exact Nat.add_comm n m -/
#guard_msgs in
example (_h : List.range 10000 = List.range 10000) (n m : Nat) : n + m = m + n := by
with_reducible std_exact?

0 comments on commit a11bdfc

Please sign in to comment.