Skip to content

Commit

Permalink
fix(tactic/solve_by_elim): apply_assumption argument parsing (#15394)
Browse files Browse the repository at this point in the history
The optional list of expressions to `apply_assumption` should be parsed interactively. This fixes a bug where `none` would have to be provided before a config object.



Co-authored-by: Rob Lewis <rob.y.lewis@gmail.com>
  • Loading branch information
robertylewis and robertylewis committed Jul 16, 2022
1 parent 8963fcf commit 367714d
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 2 deletions.
4 changes: 2 additions & 2 deletions src/tactic/solve_by_elim.lean
Expand Up @@ -273,13 +273,13 @@ Optional arguments:
the next one will be attempted.
-/
meta def apply_assumption
(lemmas : option (list expr) := none)
(lemmas : parse pexpr_list?)
(opt : apply_any_opt := {})
(tac : tactic unit := skip) : tactic unit :=
do
lemmas ← match lemmas with
| none := local_context
| some lemmas := return lemmas
| some lemmas := lemmas.mmap to_expr
end,
tactic.apply_any lemmas opt tac

Expand Down
4 changes: 4 additions & 0 deletions test/solve_by_elim.lean
Expand Up @@ -171,3 +171,7 @@ begin
rintro ⟨n, hf | hg⟩,
solve_by_elim* [or.inl, or.inr, Exists.intro] { max_depth := 20 },
end

-- Check that no list of arguments is needed when using a config object
example (a : ℤ) (h : a = 2) : a = 2 :=
by apply_assumption {use_exfalso := ff}

0 comments on commit 367714d

Please sign in to comment.