|
| 1 | +From MetaRocq.Utils Require Import utils. |
| 2 | +From MetaRocq.Template Require Import All. |
| 3 | +From MetaRocq.Template Require Import Checker. |
| 4 | +Import MRMonadNotation. |
| 5 | + |
| 6 | +(** MWE du bug sur les niveaux d'univers frais.*) |
| 7 | + |
| 8 | +Notation nameAnon := {| binder_name := nAnon; binder_relevance := Relevant |}. |
| 9 | + |
| 10 | +(* Inductive Ind (T : Type) : Prop :=. *) |
| 11 | +(* MetaRocq Run (tmQuote Ind >>= tmPrint). *) |
| 12 | +(* Modify this based on the current file. *) |
| 13 | +Definition ind : term := |
| 14 | + tInd {| inductive_mind := (MPfile ["ind_fresh_univ";"TestSuite";"MetaRocq"], "Ind") ; inductive_ind := 0 |} []. |
| 15 | + |
| 16 | +(* AST of [Inductive Ind (T : Type) : Prop :=.]. *) |
| 17 | +Definition AST_Ind := {| |
| 18 | + ind_finite := Finite; |
| 19 | + ind_npars := 1; |
| 20 | + ind_params := [{| |
| 21 | + decl_name := {| binder_name := nNamed "T"; binder_relevance := Relevant |}; |
| 22 | + decl_body := None; |
| 23 | + decl_type := tSort (sType fresh_universe) |
| 24 | + |}]; |
| 25 | + ind_bodies := [{| |
| 26 | + ind_name := "Ind"; |
| 27 | + ind_indices := []; |
| 28 | + ind_sort := sProp; |
| 29 | + ind_type := |
| 30 | + tProd {| binder_name := nNamed "T"; binder_relevance := Relevant |} |
| 31 | + (tSort (sType fresh_universe)) (tSort sProp); |
| 32 | + ind_kelim := IntoPropSProp; |
| 33 | + ind_ctors :=[]; |
| 34 | + ind_projs := []; |
| 35 | + ind_relevance := Relevant |
| 36 | + |}]; |
| 37 | + ind_universes := Monomorphic_ctx; |
| 38 | + ind_variance := None |
| 39 | +|}. |
| 40 | + |
| 41 | +(* AST of [fun T : Type => Ind T]. *) |
| 42 | +Definition AST_fun := |
| 43 | + tLambda |
| 44 | + {| binder_name := nNamed "T"; binder_relevance := Relevant |} |
| 45 | + (tSort (sType fresh_universe)) |
| 46 | + (tApp ind [tRel 0]). |
| 47 | + |
| 48 | +Definition define_ind : TemplateMonad unit := |
| 49 | + tmMkInductive true (mind_body_to_entry AST_Ind). |
| 50 | + |
| 51 | +Definition define_fun : TemplateMonad unit := |
| 52 | + tmMkDefinition "def" AST_fun. |
| 53 | + |
| 54 | + |
| 55 | + |
| 56 | +Unset MetaRocq Strict Unquote Universe Mode. |
| 57 | + |
| 58 | +MetaRocq Run (_ <- define_ind;; |
| 59 | + define_fun). |
0 commit comments