-
Notifications
You must be signed in to change notification settings - Fork 81
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
tmDefinition
says that MetaCoq tactics are bugged and fail to declare universes
#853
Comments
Here is a smaller example: From Coq Require Import Lists.List MSetProperties.
From MetaCoq.Common Require Import Kernames.
From MetaCoq.Utils Require Import bytestring monad_utils.
From MetaCoq.Template Require Import TemplateMonad Ast Loader.
Local Open Scope bs.
Import MCMonadNotation.
Import ListNotations.
Class quotation_of {T} (t : T) := quoted_term_of : Ast.term.
Module KernameSetOrdProp := MSetProperties.OrdProperties KernameSet.
Definition foo :=
(top <- tmCurrentModPath tt;;
let gr := tConst (MPdot (MPdot (MPdot (MPdot top "KernameSetOrdProp") "ME") "OrderTac") "OTF", "t") [] in
(' {| my_projT1 := cty; my_projT2 := cv |} <- tmUnquote gr;;
' {| my_projT1 := cty0; my_projT2 := cv0 |} <- tmUnquote gr;;
ps <- ret [("qOrderTac__DOT__OTF__t",
{| my_projT1 := quotation_of cv; my_projT2 := gr |});
("qOrderTac__DOT__TO__t",
{| my_projT1 := quotation_of cv0; my_projT2 := gr |})];;
monad_map (fun '(name, {| my_projT1 := ty; my_projT2 := v |})
=> n <- @tmDefinition name ty v;; tmReturn tt)
ps);;
tmReturn tt).
MetaCoq Run foo. |
And a slightly smaller example: From Coq Require Import Lists.List.
From MetaCoq.Utils Require Import bytestring monad_utils.
From MetaCoq.Template Require Import TemplateMonad Ast Loader.
Local Open Scope bs.
Import MCMonadNotation.
Import ListNotations.
Definition t : Type := nat.
Class quotation_of {T} (t : T) := quoted_term_of : Ast.term.
Definition foo :=
(top <- tmCurrentModPath tt;;
let gr := tConst (top, "t") [] in
x1 <- tmUnquote gr;;
x2 <- tmUnquote gr;;
let ' {| my_projT1 := cty; my_projT2 := cv |} := x1 in
let ' {| my_projT1 := cty0; my_projT2 := cv0 |} := x2 in
tmPrint (x1, x2);;
ps <- ret [("foo0",
{| my_projT1 := quotation_of cv; my_projT2 := gr |});
("foo1",
{| my_projT1 := quotation_of cv0; my_projT2 := gr |})];;
tmPrint ps;;
monad_map
(fun '(name, {| my_projT1 := ty; my_projT2 := v |})
=> n <- @tmDefinition name ty v;; tmReturn tt)
ps;;
tmReturn tt).
Set Printing Universes. Set Printing Implicit.
MetaCoq Run foo. |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
The text was updated successfully, but these errors were encountered: