Skip to Content.
Sympa Menu

coq-club - [Coq-Club] How to evaluate reflexive tactics? (in a robust way)

coq-club AT inria.fr

Subject: The Coq mailing list

List archive

[Coq-Club] How to evaluate reflexive tactics? (in a robust way)


Chronological Thread 
  • From: Armaël Guéneau <armael.gueneau AT ens-lyon.fr>
  • To: coq-club AT inria.fr
  • Cc: François Pottier <francois.pottier AT inria.fr>
  • Subject: [Coq-Club] How to evaluate reflexive tactics? (in a robust way)
  • Date: Thu, 8 Nov 2018 11:24:23 +0100
  • Authentication-results: mail2-smtp-roc.national.inria.fr; spf=None smtp.pra=armael.gueneau AT ens-lyon.fr; spf=Pass smtp.mailfrom=armael.gueneau AT ens-lyon.fr; spf=None smtp.helo=postmaster AT labbe.ens-lyon.fr
  • Ironport-phdr: 9a23:Ns6tJR+GjR77Kv9uRHKM819IXTAuvvDOBiVQ1KB31uocTK2v8tzYMVDF4r011RmVBdqds6oMotGVmpioYXYH75eFvSJKW713fDhBt/8rmRc9CtWOE0zxIa2iRSU7GMNfSA0tpCnjYgBaF8nkelLdvGC54yIMFRXjLwp1Ifn+FpLPg8it2O2+55/ebx9UiDahfLh/MAi4oQLNu8cMnIBsMLwxyhzHontJf+RZ22ZlLk+Nkhj/+8m94odt/zxftPw9+cFAV776f7kjQrxDEDsmKWE169b1uhTFUACC+2ETUmQSkhpPHgjF8BT3VYr/vyfmquZw3jSRMNboRr4oRzut86ZrSAfpiCgZMT457HrXgdF0gK5CvR6tuwBzz4vSbYqINvRxY7ndcMsES2RBQ8hfVCJPDY2zYIQTAOQMJvpYoornqlcSsRezCwuhCeXywTFInH/22qg63vw9HAHc2QwvBc4JsHDMo9v0KacVS+a1w7fSwjXecvhb3i3y6JLNch87v/6MWah8ccXMyUYxEQPKkE+fqZH+MjyL0OQNqHGX7+5gVOKojW4rsQ9xoiK2y8oql4LHhZoVx0jZ+Sh23Io5P9+1RUxhbdK5EZZdtTuWO5VoTs88W21kpTg2x74ctZO/ciUG0pUqyh/FZ/GJdYWD/wjtW/yLIThigXJoYLK/iAi28Uin0uD8UtO7301RoSVbiNXDqHYN1wfK5siDSvp9+UGh1SyB1wDJ8u1EIEY0mrTHK5M537I9mYYfvV7BEyL0gkn6ka6be0c+9uS29ejrfK3qppqGOI91jgH+PL4umsu6AekgKAcORW2b9v6i273n50H5T6hKgeMwkqbHqp/aON8WqbC/Aw9Oy4oj7xa+DzCg0NgCk3kHNkpJeAibgIjxJ1HOPPf4AO+jjFSriTdn3uzJPrn8AprWNXXDi7fgfbNl60FG0gYzzNZf54hVCr4bOv7zVFXxvsTCDhAlKwy03/rnCNJl24MQQWKPBbOZML/TsVCW/OIiOOiNZI4QuDnmMfgq/eTijX4/mV8HfKmmx4EbaH6iHqcuH0LMan31x9wFDG0ivwwkTeWshkfRfyRUYiObRac1ZTUMJ58nC4rKW8j5iaaE1Sq/WJJLa2ZLA02kHHHzMoGVXPFKZjjEcZwpqSANSbX0E9xp7hqprgKvjuM/drOFqB1djorq0Z1O38OWkBgz8TJuCMHEiDOASXoxmnIPQXk4xvIm+BAv+hK4yaF9xsdgO5lL/foQCVU3M4WZy/19DZb8QFCZJ4rbeBOdWtyjRAoJYJcxztsJOhcvH9yohB2F0iyxRrsEkLrNCoZmqq8=

Dear Coq-club,

I'm writing a reflexive tactic that (roughly speaking) simplifies
arithmetic expressions. It first reifies the goal into something like:

Inductive expr :=
| EAdd : expr -> expr -> expr
| EMul : expr -> expr -> expr
| ECst : Z -> expr.

ECst is a catch-all case: it may store arbitrary-looking terms, not only
numerical constants. These should be treated as abstract by the tactic.

Then, I implemented a [simplify : expr -> expr] Coq function, and proved
that it is meaning-preserving. Finally, my tactic reifies the goal,
applies the theorem specialized to the reified expression, and reduces
the result to obtain the simplified goal.

The issue I have is with this last part: I want to evaluate [simplify],
but I do not want the reduction tactic to reduce the contents of [ECst
..], since these can contain arbitrary terms that should be treated as
abstract.

How do I evaluate my tactic in a robust way? I feel like this is a
relatively fundamental issue, and for example I wonder how
[ring_simplifies] works around it? Does anyone know?

For the moment I thought about:

- Listing all the functions transitively used by [simplify] and reduce
with a whitelist (cbv [the functions...]). However: 1) there is a lot of
them 2) it's bad from a maintainability perspective 3) it does not quite
work as the whitelist will include stuff like Nat.eqb that might very
well be used in a [ECst ..].

- Introducing local definitions for the terms in [ECst foo] (using [set
(x := foo)]); and blacklisting these local definitions during reduction.
There is a technical issue: the blacklist is discovered dynamically, so
I cannot specify it in Ltac using cbv -[foo bar baz]. I guess I could
write a small plugin to handle dynamically constructing the blacklist,
if that's what it takes...

Any ideas?

— Armaël



Archive powered by MHonArc 2.6.18.

Top of Page