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

What does the simpl tactic do in COQ
Induction on predicates with product type arguments
Construct Sets in Coq
Is this relationship between forall and exists provable in Coq/intuitionistic logic?
Proof automation in Coq how to factorize a proof
How to use matched case and variable equivalence in coq
Proof with false hypothesis in Isabelle/HOL Isar
Is there a convention for the order of applying ssreflect tactic/taticals?
How to systematically normalize inequalities to < (lt) and <= (le) in Coq?
Inductive subset of an inductive set in Coq
How to find the source file for an identifier in Coq
Coq “Unknown interpretation for notation” error
How to switch the current goal in Coq?
Reasoning about lists in Coq
what does the curly braces {} do in ssreflect rewrite
How to define unspecified constants in Coq

Categories

HOME
maven
compiler-construction
pandas
relative-path
grep
cplex
alfresco
framework7
routes
getelementsbytagname
setup-deployment
leon
twitter-bootstrap-4
windows-server
flyway4
elasticsearch-hadoop
communication
ssl-client-authentication
node-pdfkit
here-api
usergrid
hapi
progressive-web-apps
propel
solaris-10
nodatime
visjs
clickonce
ehcache
web-sql
chromium-embedded
wijmo
smb
xpages-ssjs
fish
centos6.5
poltergeist
large-file-upload
jaxb2
sql-server-2012-express
fabric8
code-contracts
retina-display
automake
android-fingerprint-api
streamreader
opshub
ncalc
keydown
dropbox-php
pearson
memory-alignment
gcsfuse
blacklist
mediaelement
google-feed-api
passport-google-oauth
removechild
home-directory
skype4py
bluemix-app-scan
natvis
rtbkit
msys
mutation-observers
spidermonkey
rgeo
browser-bugs
ibaction
responsive-images
mmc
dundas
android-nested-fragment
tld
jquery-layout
system.net.webexception
srs
typo3-neos
uv-mapping
django-nonrel
wsdl-2.0
anonymous-methods
browser-detection
google-email-migration
imac
datareader
html-input
h.323
.nettiers
getresponsestream
filtered-index
ext3
kdbg
xetex
mdac
.net-1.0
paul-graham

Resources

Database Users
RDBMS discuss
Database Dev&Adm
javascript
java
csharp
php
android
javascript
java
csharp
php
python
android
jquery
ruby
ios
html
Mobile App
Mobile App
Mobile App