What is the Ltac2 equivalent of "let H := fresh in assert (H:=True))" ?
There is a Fresh module
so, something along the lines of let h := Fresh.of_goal @H in assert ($h := True)
oh, the version of the doc I saw did not have the "of_goal" function
thanks
rather, Fresh.in_goal
of_goal is part of Free, not Fresh, and generates a set of free variables
I reimplemented it by accident, as the stdlib-online doc did not show it :D let valt := Fresh.fresh (Fresh.Free.of_goal ()) @H in ...
No, it showed it, but i failed to readuntil the end
We have an infrastructure problem with the Ltac2 documentation btw.
The refman was designed to duplicate the information there, but it doesn't scale past a handful of primitive tactics.
Since Ltac2 is a full-blown language, we should rely on coqdoc generated documentation for exploration.
It's quite cumbersome to have to go reading the v file currently.
and can i tell ltac 2 that it should try to type my recursive function at unit? I think it tries to type it at constr, and now shows me the cases where unit is returned as errors. I'm not sure where the constr-idea comes from currently.
Hard to tell without looking at the code.
Ah, no, i fail to find the translation for "lazymatch typeof H with ... end" in Ltac 2, that was the problem
and of course just using ltac1:() soes not work, as it is not a unit-tactic
Const.type :D
Last updated: Oct 13 2024 at 01:02 UTC