0

I want to make a tactic like

let x := fresh in
epose (x := _);
forward_call x.

forward_call is tactic to process function call in VST. I find if I do epose _; forward_call x (if x is the name by epose), it goes into finite loop, too. But it works if I do epose _. forward_call x. then it works. The same will also happen if I use eset instead of epose. I don't understand why using semicolon to connect two tactics is different from using two commands separated by dot, when the first tactic only generate exactly one goal. Do you know any difference between these two?

One thing I find is epose (_); show_hyps. gives y := ?y : ?T, while epose (_). show_hyps. gives y := ?Goal0 : ?Goal. Maybe that suggests some difference.

I didn't find a simple example for this problem. I tried simple cases as below and there is no difference between using dot and semicolon.

Require Import Coq.omega.Omega.
Require Import Coq.Program.Tactics.

Open Scope Z_scope.

Goal exists x, x = 2.
epose (y := _). refine (ex_intro _ y _); subst y.
reflexivity.
Qinshi Wang
  • 129
  • 4
  • Please include a self-contained example. The code you give will error with something like "Reference foo not found", and if I replace "foo" with "idtac", I highly doubt that would infinite loop. – Jason Gross Jan 26 '19 at 16:40
  • Yes, `idtac` will not lead to any problem. Both `foo` and `x` are abstract in my problem. `foo` is the tactic I'm using and `x` is a generated name, so it depends on what is in the context. – Qinshi Wang Jan 27 '19 at 06:21
  • I am working on [VST](https://github.com/PrincetonUniversity/VST) project, and I tried to pass an evar into `forward_call` which is to process a function call by looking up the specification of the function in library and the argument of tactic means the witness used to instantiate the specification, which includes abstract version of argument passed to the function. This tactic implementation does not concern evars, so I am not surprised if the result is strange. But I don't understand why `epose _. forward_call x.` works but `epose _; forward_call x` doesn't. – Qinshi Wang Jan 27 '19 at 06:21
  • It's probably a bug in Coq, but I can't debug it without code that compiles. – Jason Gross Jan 27 '19 at 13:29
  • I can give a minimal example on VST. But maybe it is still too big to debug. – Qinshi Wang Jan 28 '19 at 02:29
  • By the way, VST is moving to Coq 8.9.0. Hopefully it will solve this issue. But it's unlikely as it doesn't seem to be relevant. So we may look at this issue later if it is still there in Coq 8.9.0. – Qinshi Wang Jan 28 '19 at 02:33

0 Answers0