Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

What does the simpl tactic do in COQ

Tags:

coq

I am wondering how the simpl tactic works in COQ.
Assume the following Lemma:

Parameter n:nat. 
Lemma test: S n + 0 = S (n+0).

Now, the simpl. tactic produces

S (n + 0) = S (n + 0)

My understanding is that simpl performs a sequence of cbv beta, delta, iota conversions. I tried that, but could not manage to get the same result as simpl. The basic problem is that after a cbv delta expansion, the plus term keeps expanded. How can I de-expand it, i.e. re-substitute the plus name for the expanded definition?
Or, can anyone show me how I can get the effect of simpl by manually performing more elementary tactics?

like image 236
Cryptostasis Avatar asked Oct 31 '22 10:10

Cryptostasis


1 Answers

I do not believe it possible to emulate the simpl tactic using only cbv, because indeed cbv delta does not let you choose which occurences to replace, while simpl only performs delta-reduction when it leads to a iota step. (cf. https://coq.inria.fr/distrib/current/refman/proof-engine/tactics.html#coq:tacn.simpl)

So, even if informally we can say that simpl performs such a sequence of calls, it seems like it has access to a lower-level way of performing those reductions than what the cbv tactic exposes.

like image 193
Ptival Avatar answered Nov 15 '22 10:11

Ptival