feat(tactic/solve_by_elim): add accept parameter to prune tree search#2245
feat(tactic/solve_by_elim): add accept parameter to prune tree search#2245mergify[bot] merged 35 commits intomasterfrom
Conversation
I don't really follow this. (What is a "current state of original goals"?) At least, I have no idea how I'd use this in practice. Could you add an example of when this option is useful and the syntax that would be used to give it? |
|
@robertylewis, I've updated the documentation in a few places. The main doc-string for In the doc-string on the configuration structure that contains Does this make more sense? (I use this |
|
I've also add a module doc. |
src/tactic/solve_by_elim.lean
Outdated
| Configuration options for `solve_by_elim`. | ||
|
|
||
| * `accept : list expr → tactic unit` determines whether the current branch should be explored. | ||
| It is passed the original goals as a `list expr` argument |
There was a problem hiding this comment.
Sorry, this line is still confusing me. I would guess first that it's looking for a list of mvars, and second that it's looking for a list of the types of these mvars. In the code, it looks like you give it neither -- you instantiate the mvars before passing them to accept. Is that optional, or required? What's structure is this list expr argument expected to have?
There was a problem hiding this comment.
Okay, I've tried again.
The idea is that when solve_by_elim is first invoked, we call get_goals, and stash them. Now, at every step in the search tree, we take those "original goals", instantiate metavariables in them (as those original goals have by now been partly solved by previous apply steps), and pass them to the accept tactic. Thus the accept tactic can inspect the history of apply steps that have succeeded up to this point, by looking at how the original metavariables from get_goals have been partially unified.
The main change I made in the docs is to replace phrases like "original goals", explicitly saying that solve_by_elim calls get_goals:
It is passed the original metavariables reported by
get_goalswhensolve_by_elimstarted, as alist exprargument (these metavariables may by now have been partially solved by previousapplysteps), ...
I agree this is non-obvious, and my doc-strings were not adequate, so please tell me if we're still not there yet!
There was a problem hiding this comment.
accept is run before the current goals are explored, right? It would be good to clarify that in the docstring.
Co-Authored-By: Rob Lewis <Rob.y.lewis@gmail.com>
…leanprover-community#2245) * chore(tactic/solve_by_elim): cleanup * cleanup * what happened to my commit? * fix * fix * fixed? * Tweak comments * feat(tactic/solve_by_elim): add accept parameter to prune tree search * when called with empty lemmas, use the same default set as the interactive tactic * stop cheating with [] ~ none * indenting * various * various * docstring * fix docstrings * more docs * docs * fix doc-strings * improve documentation of accept, and add doc-string * improve docs * try again with documentation * clarify when accept runs * Update src/tactic/solve_by_elim.lean Co-Authored-By: Rob Lewis <Rob.y.lewis@gmail.com> * Update src/tactic/solve_by_elim.lean * Update src/tactic/solve_by_elim.lean Co-authored-by: Rob Lewis <Rob.y.lewis@gmail.com> Co-authored-by: mergify[bot] <37929162+mergify[bot]@users.noreply.github.com>
…leanprover-community#2245) * chore(tactic/solve_by_elim): cleanup * cleanup * what happened to my commit? * fix * fix * fixed? * Tweak comments * feat(tactic/solve_by_elim): add accept parameter to prune tree search * when called with empty lemmas, use the same default set as the interactive tactic * stop cheating with [] ~ none * indenting * various * various * docstring * fix docstrings * more docs * docs * fix doc-strings * improve documentation of accept, and add doc-string * improve docs * try again with documentation * clarify when accept runs * Update src/tactic/solve_by_elim.lean Co-Authored-By: Rob Lewis <Rob.y.lewis@gmail.com> * Update src/tactic/solve_by_elim.lean * Update src/tactic/solve_by_elim.lean Co-authored-by: Rob Lewis <Rob.y.lewis@gmail.com> Co-authored-by: mergify[bot] <37929162+mergify[bot]@users.noreply.github.com>
Adds some features to
solve_by_elim, to allow pruning of the search tree.From the doc-string of
solve_by_elim.basic_opt: