coq


How to use auto with repeat in custom tactics?


In my coq development I am learning how to create new tactics tailored to my problem domain, a la Prof. Adam Chlipala.
On that page he describes how to create powerful tactics by wrapping repeat around a match that responds to various interesting conditions. The repeat then iterates, allowing for far-reaching inference.
The use of repeat has a caveat (emphasis mine):
The repeat that we use here is called a tactical, or tactic combinator. The behavior of repeat t is to loop through running t, running t on all generated subgoals, running t on their generated subgoals, and so on. When t fails at any point in this search tree, that particular subgoal is left to be handled by later tactics. Thus, it is important never to use repeat with a tactic that always succeeds.
Now, I already have a powerful tactic in use, auto. It similarly strings together chains of steps, this time found from hint databases. From auto's page:
auto either solves completely the goal or else leaves it intact. auto and trivial never fail.
Boo! I have already invested some effort in curating auto's hint databases, but it seems I am forbidden from employing them in tactics using repeat (that is, interesting tactics.)
Is there some variation of auto that can fail, or otherwise be used correctly in loops?
For example, perhaps this variant fails when it "leaves [the goal] intact".
EDIT: Incorporating auto into loops isn't the "right" way to do it anyway (see this), but the actual question of a failing version of auto is still perhaps interesting.
As mentioned by #AntonTrunov you can always use the progress tactical to make the tactic fail if the goal has not been changed. In the case of auto since it is supposed to solve the goal or leave it unchanged, you can also wrap it in solve [ auto ] which will have the same effect because it will fail if auto does not solve the goal completely (here is the doc for solve).

Related Links

Decomposing equality of constructors coq
From an Inductive predicate to list A -> list A -> bool
Weakening hypothesis without a cut
Rewriting at the type level
Port a Coq lemma over Z to a similar lemma over nat
Coq fixpoint defintion numerated by natural numbers.(type of (n+1)'s type depends on (n)'s type)
`No more subgoals, but there are non-instantiated existential variables` in Coq proof language?
Simplify assumption
Apply partially instantiated lemma
Using reflexivity in Coq
High-speed calculation of Coq's theorems
Topological Definition of Continuous in Coq
Reference in Coq Lists library not found
Purpose of maximal vs non-maximal implicit arguments
Idris type system properties
How to destruct/generalize over Program's rewritten match statements

Categories

HOME
log4j
variables
vbscript
reflection
fluentd
mfc
comparison
smarty
read-eval-print-loop
setup-deployment
microservices
azure-media-services
ios-charts
amazon-cloudformation
python-unittest
export-to-csv
postgres-xl
google-cloud-ml
flask-wtforms
lombok
connection-string
interop
karma-jasmine
grails3
graphicsmagick
kvc
jndi
hammerspoon
crosstab
java-7
apache-commons-io
facet
kannel
replaceall
unboundid
sql-server-2012-express
tinymce-4
http-get
noraui
webtest
hybridauth
multilingual
abstract-class
pdf-reactor
turbogears
btrace
wptoolkit
skeleton-css-boilerplate
rainbowtable
jquery-nestable
pnotify
git-diff
jxcore
mediaelement
objective-c-swift-bridge
gridpane
database-optimization
fody
gridview-sorting
lua-5.1
pagedlist
hill-climbing
suffix-tree
qtableview
execute
ora-00900
cakephp-3.1
twirl
truevault
relocation
javafx-webengine
applescript-objc
titanium-modules
terminfo
tld
elliptic-curve
jquery-layout
expected-exception
html5-notifications
spring-io
batterylevel
random-seed
wsdl-2.0
specification-pattern
angularjs-controller
simba
datawindow
automount
eclipse-templates
tomcat-valve
appender
self-extracting
table-footer
floating
infrastructure
modelstate
web-architecture
putchar
defensive-programming
rtml

Resources

Mobile Apps Dev
Database Users
javascript
java
csharp
php
android
MS Developer
developer works
python
ios
c
html
jquery
RDBMS discuss
Cloud Virtualization
Database Dev&Adm
javascript
java
csharp
php
python
android
jquery
ruby
ios
html
Mobile App
Mobile App
Mobile App