coq


Smart modification of Coq environment


Ltac is used for automating proofs and modifying proof environment, outputting strings and defining complex notations. Can it be also used for "smart" modifications of Coq environment? Here are two failed attempts:
Variable Phy: Set.
Fail Let pp (x:Type) := ltac: (match type of x with
| Set => constr: (Reset Phy)
| _ => idtac end).
(*Cannot infer an internal placeholder of type "Type" in environment: x : Type*)
Fail Ltac pp x := match type of x with
| Set => constr: (Reset Phy)
| _ => idtac end.
(*The reference Reset was not found in the current environment.*)
Also, if this isn't a job for Ltac, maybe there's another way?
Short answer: No.
Even if you would achieve to do that using some hack, it will stop working in the next Coq version.
The reason is because the interpretation of ltac commands happens at a lower level than document interpretation. This choice could be debatable, but it is the way it is. Tactics run in a constant environment and have only access to the proof. Thus, the most you can do from ltac is to modify the current proof.
Your error happens because Reset is indeed parsed at a higher level which ltac doesn't have access to.
For programmatic manipulation of the environment and documents themselves, the you need to rely in ML code or maybe you could try to script some interfacing tool such as SerAPI to achieve what you want.

Related Links

How to destruct a exist in goal for coq
Why do Coq recursion principles pass along both the substructure and the result of the recursive call?
Stronger completeness axiom for real numbers in Coq
Subtyping in Coq
When is the first input to `list_rec` not a constant function?
what does the colon greater than sign mean in coq
Prove that a sequence of steps terminates
How to leverage auto's searching and hint databases in custom tactics?
How to use auto with repeat in custom tactics?
How to use Coq GenericMinMax to prove facts about the reals
Coq modular arithmetic
Break “forall” hypothesis with conjunctions up into components?
How to write coq definitions with “subtypes”
Getting access to Coq's rich XML-like AST output
Subsets of list nat in coq
Unable to locate library

Categories

HOME
testing
heroku
comparison
smarty
relative-path
relayjs
setup-deployment
tizen-web-app
callback
mvvmcross
ios-charts
spring-xd
n-gram
leiningen
libtiff
saxon
pc
text-rendering
nhibernate-envers
jprofiler
facebook-instant-articles
excel-2007
jndi
librato
r-raster
preg-match-all
airconsole
scorm2004
perlin-noise
geopositioning
amazon-kinesis-kpl
html5-fullscreen
devextreme
libraries
opshub
lumberjack
google-closure
no-www
flashair
angular-resource
chain-builder
filepicker
pebble-watch
svmlight
tactic
worker-thread
url-pattern
django-debug-toolbar
master-slave
pagerank
design-by-contract
pyke
jfugue
r-tree
metaclass
varargs
twirl
arcanist
method-parameters
graph-drawing
streambase
csquery
tt-news
device-manager
html-helper
yorick
app42
terminal-services
opcache
dotnetnuke-5
distutils
mhtml
newtonscript
errai
hgsubversion
gnu-prolog
qt-jambi
infobox
xmemcached
lang
subviews
sproutcore-2
suppress
mozilla-prism
firefox-5
w3wp
windows-live-messenger

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