lean4-htt/tests/lean/run/grind_lookahead.lean
Leonardo de Moura f513c35742
feat: lookahead in grind (#7937)
This PR implements a lookahead feature to reduce the size of the search
space in `grind`. It is currently effective only for arithmetic atoms.
2025-04-13 03:01:47 +00:00

19 lines
626 B
Text
Raw Blame History

This file contains ambiguous Unicode characters

This file contains Unicode characters that might be confused with other characters. If you think that this is intentional, you can safely ignore this warning. Use the Escape button to reveal them.

set_option grind.warning false
reset_grind_attrs%
attribute [grind] List.eq_nil_of_length_eq_zero
example (as : List α) (h : as.length < 2) (h : as.length ≠ 1) (f : List α → Nat) :
f as = f [] := by
grind
example (as : List α) (h : as.length < 2) (h : as.length ≠ 1) : as = [] := by
grind -lookahead
example (as : List α) (h : as.length < 2) (h : as.length ≠ 1) : as = [] := by
grind (splits := 0)
example (as : List α) (h : as.length < 2) (h : as.length ≠ 1) (f : List α → Nat)
: f as = f [] := by
fail_if_success grind (splits := 0) -lookahead -- Need lookahead or case-splits
sorry