coq


How to leverage auto's searching and hint databases 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 custom tactics by e.g. combining repeat with match.
Now, I already have a powerful one-shot tactic in use, auto. It strings together chains of steps found from hint databases. I have invested some effort in curating those hint databases, so I'd like to continue using it as well.
However this presents a problem. It isn't clear what the "right" way is to incorporate auto's functionality into customized tactics.
For example, since (per its page) auto always either solves the goal or does nothing, putting it inside a loop is no more powerful than calling it once after the loop.
To see why this isn't ideal, consider a hypothetical way to directly call a single "step" of auto, which succeeds if it could make a change (as opposed to only when it solved the goal) and fails otherwise. Such single-steps could be interleaved with custom behavior in a match repeat loop, allowing us to e.g. try contradiction or try congruence at intermediate points within the search tree.
Are there good design patterns for incorporating auto's functionality into custom tactics?
Can auto's behavior be decomposed into "single step" tactics that we can use?
What I would do instead would be to incorporate other tactics within auto.
You can do so by using the Hint Extern num pat => mytactic : mybase. command where num is a priority number (0 being the highest priority), pat a pattern to filter when the hint should be used and mytactic and mybase are of course the tactic you want to apply and the base you want to add the hint to (do not use the default core; build up your custom base instead and call it with auto with mybase; if you do not want to include the lemmas from the core base in the search, add the fake base nocore: auto with mybase nocore).
If you start relying on auto very much, I would switch instead to the almost equivalent but better behaved typeclasses eauto with mybase. Contrary to what its name suggests, it is a general purpose tactic that has nothing to do with type classes (as long as you explicitly provide the hint base on which it should be working). One of the main behavior difference to know is that the search depth is unbounded by default. So beware of possible infinite loops or fix a finite limit with the variant typeclasses eauto num with mybase. For more details, read the manual.

Related Links

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
How to automatically prove simple equality of real numbers in Coq?
How to simplify real number terms in Coq?
How can I prove that (eqb x y) means x = y
What's the difference between `Reals` and `Coq.Reals.*` in Coq?
when is the `:` (colon) in necessary in ssreflect/Coq?
What's with the `of` and `&` in the Coq Inductive definition?
How to simplify A + 0 > 0 into A > 0?
Combine_split from Software Foundations exercise

Categories

HOME
cakephp
bluetooth
urbancode
isabelle
server
json.net
vmware
android-4.4-kitkat
routes
programming-languages
filtering
sharepoint-designer
windows-server
ravendb
node-notifier
gitpitch
gorm
numeral.js
apache-cayenne
spring-tool-suite
windows-phone-7
dtrace
percona
systemc
finite-automata
undefined
ab-testing
plunker
amazonsellercentral
opencover
extjs5
core-text
sparse-matrix
kannel
fluentvalidation
publish
elasticsearch-ruby
madlib
skia
stormpath
javascriptcore
google-cloud-endpoints-v2
http-status-code-503
ioio
scorm2004
winrt-xaml-toolkit
calibre
hybridauth
form-data
http-referer
y86
mmenu
nssegmentedcontrol
vapor
grid.mvc
turbogears
websphere-mq-fte
apple-news
skeleton-css-boilerplate
smartcontracts
alphabet
dropbox-php
colorama
jxcore
sqlclient
spring-cache
color-profile
blacklist
eventkit
passport-google-oauth
ctest
etsy
paypal-express
pervasive-sql
python-3.2
comobject
mutation-observers
computer-algebra-systems
sankey-diagram
createprocessasuser
p2
graph-api-explorer
device-orientation
codeigniter-url
asp.net-web-api-odata
titanium-modules
rdl
dml
kgdb
pyhdf
batterylevel
rabl
jquery-mobile-dialog
http-unit
hamiltonian-cycle
broken-links
pysimplesoap
parametric-equations
hgsubversion
custom-backend
javax.script
yetanotherforum
android-sdk-2.1
radcombobox
yslow
wise
asp.net-profiles
mtj
privilege
mediarss
misv

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