| 1 |
Require Import Program.Basics Program.Tactics. |
| 2 |
(* Set Universe Polymorphism. *) |
| 3 |
Set Printing Universes. |
| 4 |
|
| 5 |
Axiom ALL : forall {T:Prop}, T. |
| 6 |
|
| 7 |
Inductive Expr : Set := E (a : Expr). |
| 8 |
|
| 9 |
Parameter Value : Set. |
| 10 |
|
| 11 |
Fixpoint eval (e: Expr): Value := |
| 12 |
match e with |
| 13 |
| E a => eval a |
| 14 |
end. |
| 15 |
|
| 16 |
Class Quote (n: Value) : Set := |
| 17 |
{ quote: Expr |
| 18 |
; eval_quote: eval quote = n }. |
| 19 |
|
| 20 |
Program Definition quote_mult n |
| 21 |
`{!Quote n} : Quote n := |
| 22 |
{| quote := E (quote (n:=n)) |}. |
| 23 |
|
| 24 |
Set Printing Universes. |
| 25 |
Next Obligation. |
| 26 |
Proof. |
| 27 |
Show Universes. |
| 28 |
destruct Quote0 as [q eq]. |
| 29 |
Show Universes. |
| 30 |
rewrite <- eq. |
| 31 |
clear n eq. |
| 32 |
Show Universes. |
| 33 |
apply ALL. |
| 34 |
Show Universes. |
| 35 |
Qed. |
| 36 |
Print quote_mult_obligation_1. |
| 37 |
(* quote_mult_obligation_1@{} = |
| 38 |
let Top_internal_eq_rew_dep := |
| 39 |
fun (A : Type@{Stdlib.Init.Logic.8}) (x : A) (P : forall a : A, x = a -> Type@{Top.5} (* <- XXX *)) |
| 40 |
(f : P x eq_refl) (y : A) (e : x = y) => |
| 41 |
match e as e0 in (_ = y0) return (P y0 e0) with |
| 42 |
| eq_refl => f |
| 43 |
end in |
| 44 |
fun (n : Value) (Quote0 : Quote n) => |
| 45 |
match Quote0 as q return (eval quote = n) with |
| 46 |
| {| quote := q; eval_quote := eq0 |} => |
| 47 |
Top_internal_eq_rew_dep Value (eval q) (fun (n0 : Value) (eq1 : eval q = n0) => eval quote = n0) |
| 48 |
ALL n eq0 |
| 49 |
end |
| 50 |
: forall (n : Value) (Quote0 : Quote n), eval (E quote) = n |
| 51 |
|
| 52 |
quote_mult_obligation_1 is universe polymorphic |
| 53 |
*) |