-
Notifications
You must be signed in to change notification settings - Fork 297
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
feat(well_founded_tactics): patch default_dec_tac (#1419)
* let simp flip inequalities * feat(well_founded_tactics): patch default_dec_tac * Keeley's suggested syntax, and adding to the docs * more * add docs
- Loading branch information
1 parent
e27142a
commit 140a606
Showing
11 changed files
with
71 additions
and
5 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -20,4 +20,5 @@ import | |
tactic.simpa | ||
tactic.split_ifs | ||
tactic.squeeze | ||
tactic.well_founded_tactics | ||
tactic.where |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,45 @@ | ||
/- | ||
Copyright (c) 2017 Scott Morrison. All rights reserved. | ||
Released under Apache 2.0 license as described in the file LICENSE. | ||
Authors: Scott Morrison | ||
-/ | ||
|
||
/-! | ||
Replacement for the definition of `well_founded_tactics.default_dec_tac` in core. | ||
-/ | ||
|
||
namespace well_founded_tactics | ||
open tactic | ||
|
||
/-- | ||
The definition of `default_dec_tac` in core is broken, because `unfold_sizeof` | ||
could actually discharge the goal. | ||
Here we add a test using `done` to detect this. | ||
-/ | ||
meta def default_dec_tac' : tactic unit := | ||
abstract $ | ||
do clear_internals, | ||
unfold_wf_rel, | ||
process_lex (unfold_sizeof >> (done <|> (cancel_nat_add_lt >> trivial_nat_lt))) | ||
end well_founded_tactics | ||
|
||
/-- | ||
The default `well_founded_tactics` provided in core are broken in some situations, often indicated | ||
by the message | ||
``` | ||
The nested exception contains the failure state for the decreasing tactic. | ||
nested exception message: | ||
tactic failed, there are no goals to be solved | ||
state: | ||
no goals | ||
``` | ||
Use this replacement by adding | ||
``` | ||
using_well_founded wf_tacs | ||
``` | ||
at the end of your inductive definition. | ||
-/ | ||
meta def wf_tacs : well_founded_tactics := | ||
{ dec_tac := well_founded_tactics.default_dec_tac' } |