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

Redundant clause in match
Dependent type list concatenation in Coq
How to access the elements of a record in coq
Type hierarchy definition in Coq or Agda
Applying tactics to local subgoals of a semicolon chain in Coq
How to build an inductive type for cobordisms using Coq?
Coq: “dependent induction” inside Ltac
Omitting forall in Coq
Why can't inversion be used on a universally qualified hypothesis in Coq?
How to duplicate a hypothesis in Coq?
Why Coq doesn't allow inversion, destruct, etc. when the goal is a Type?
Working with semirings in Coq
Eliminating cases with propositions in Coq
Using sets as hyphotesis and goal in COQ
What does `omega` really do here?
What is the idiomatic way to express countable infinity in Coq?

Categories

HOME
pdf
jdo
zeromq
tizen
pycharm
plone
iot
enterprise-library-5
medical
maude-system
vifm
quickfix
try-catch
opentracing
openrefine
fatal-error
transformation
google-static-maps
flux
jprofiler
object-detection
ehcache
captiveportal
facebook-access-token
functor
ioio
perlin-noise
amazon-kinesis-kpl
mpmediaquery
swift3.0.2
squib
awt
preconditions
android-tabhost
ensembles
eclipse-scout
nand2tetris
flashair
acoustics
slick-3.0
auto-update
menuitem
react-scripts
sqlclient
dtexec
iso8601
quartz-composer
time-and-attendance
heidisql
mikroc
measures
connect-by
kendonumerictextbox
feedback
deis
remobjects
asp.net-web-api-odata
typeof
html5-notifications
terminal-services
jmapviewer
excel-2003
venn-diagram
external-accessory
coredump
xdomainrequest
recent-documents
gamma
dbal
bespin
backcolor
privilege
port-number
putchar
mediarss
w3wp

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