Skip to content

Commit

Permalink
fix(tactic/suggest): fixing library_search (#12616)
Browse files Browse the repository at this point in the history
Further enhancing `library_search` search possibilities for 'ne' and 'not eq'

Related: #11742
  • Loading branch information
arthurpaulino committed Mar 12, 2022
1 parent e8d0cac commit 1463f59
Show file tree
Hide file tree
Showing 2 changed files with 9 additions and 2 deletions.
4 changes: 2 additions & 2 deletions src/tactic/suggest.lean
Expand Up @@ -64,8 +64,8 @@ meta def allowed_head_symbols : expr → list name

-- These allow `library_search` to search for lemmas of type `¬ a = b` when proving `a ≠ b`
-- and vice-versa.
| `(_ ≠ _) := [`false]
| `(¬ _ = _) := [`ne]
| `(_ ≠ _) := [`false, `ne]
| `(¬ _ = _) := [`ne, `false]

-- And then the generic cases:
| (expr.pi _ _ _ t) := allowed_head_symbols t
Expand Down
7 changes: 7 additions & 0 deletions test/library_search/basic.lean
Expand Up @@ -157,4 +157,11 @@ axiom ne_axiom : w ≠ z
example : x ≠ y := by library_search
example : ¬ w = z := by library_search

structure foo := (a : nat) (b : nat)
constants (k l : foo)
axiom ne_axiom' (h : k.a ≠ 0) : k.b ≠ 0
axiom not_axiom' (h : l.a ≠ 0) : ¬ l.b = 0
example (hq : k.a ≠ 0) : k.b ≠ 0 := by library_search
example (hq : l.a ≠ 0) : ¬ l.b = 0 := by library_search

end test.library_search

0 comments on commit 1463f59

Please sign in to comment.