coq icon indicating copy to clipboard operation
coq copied to clipboard

Ltac2 doc does not explain why `Control.refine` takes a thunk

Open JasonGross opened this issue 3 years ago • 1 comments

Description of the problem

In particular it's not clear what the difference is between let x := f () in Control.refine (fun () => x) and Control.refine f. (And I don't know the answer to this.)

cc @ppedrot

Coq Version

8.16

JasonGross avatar Sep 23 '22 08:09 JasonGross

Weird, I was pretty sure this used to be documented somewhere. The answer is that a thunk unit -> constr can create new evars, and those are added to the set of goals when refine returns. With the let-expanded function these evars are just shelved.

ppedrot avatar Sep 23 '22 09:09 ppedrot