I have an Ltac tactic which generates several closed terms. How can I bind those terms to global names, as if I had used Definition
several times?
To be concrete, say I have the following, and want to get x
, y
, and z
out.
Ltac foo :=
pose (x := Prop);
pose (y := Set);
pose (z := 4);
idtac.
They could also be let x := constr:(Prop) in ...
&c; I don't mind.
something with abstract
may work but is not recommended
tactics are not expected to modify the global environment
Is there a more normal way of programmatically generating global definitions?
using templatecoq I guess
Or coq-elpi nowadays
Paolo Giarrusso said:
Or coq-elpi nowadays
Just for interest, I'd dismissed coq-elpi for this job because I needed to bind terms that involve universe polymorphism. In fact, it was my first choice, and I'd assumed that because coq-elpi let me do it, standard Coq tools would too.
Last updated: Oct 13 2024 at 01:02 UTC