| 1 |
From Corelib Require Extraction. |
| 2 |
|
| 3 |
Record mixin_of T0 (b : unit) (T := T0) := Mixin { _ : T0 -> let U:=T0 in U }. |
| 4 |
Definition d := Mixin nat tt (fun x => x). |
| 5 |
|
| 6 |
Extraction TestCompile d. |
| 7 |
|
| 8 |
(* Extra tests *) |
| 9 |
|
| 10 |
Record R T0 (b:nat) (c:=b) (T:=T0) (e:nat) (d:c=e) := Build |
| 11 |
{ g : T0 -> let U:=T0 in U ; h : d = d ; x : nat ; y := x+x }. |
| 12 |
|
| 13 |
Definition r := {| g := (fun x : nat => x) ; h := eq_refl (eq_refl 0) ; x := 0 |}. |
| 14 |
|
| 15 |
Extraction TestCompile r. |
| 16 |
(* |
| 17 |
(** val r0 : nat r **) |
| 18 |
|
| 19 |
let r0 = |
| 20 |
{ g = (fun x0 -> x0); x = O } |
| 21 |
*) |
| 22 |
|
| 23 |
Inductive I T (a:T) (U:=T) (b:T) (c:=(a,b)) : forall d (e:=S d) (h : S d = e), Type := |
| 24 |
| C : I T a b 0 eq_refl |
| 25 |
| D : J T a b true eq_refl -> I T a b 1 eq_refl |
| 26 |
with J T (a:T) (U:=T) (b:T) (c:=(a,b)) : forall (d:bool) (h:d = true), Type := |
| 27 |
| E : I T a b 0 eq_refl -> J T a b true eq_refl. |
| 28 |
|
| 29 |
Definition c := D _ _ _ (E _ _ _ (C nat 0 0)). |
| 30 |
|
| 31 |
Extraction TestCompile c. |
| 32 |
|
| 33 |
(* |
| 34 |
(** val c : nat i **) |
| 35 |
|
| 36 |
let c = |
| 37 |
D (E C) |
| 38 |
*) |
| 39 |
|
| 40 |
CoInductive V T0 (b:nat) (c:=b) (T:=T0) (e:nat) (d:c=e) := |
| 41 |
{ k : T; b := c+e ; m : nat; z : option (W nat 0 0 eq_refl) } |
| 42 |
with W T0 (b:nat) (c:=b) (T:=T0) (e:nat) (d:c=e) := |
| 43 |
{ l : V nat 0 0 eq_refl }. |
| 44 |
|
| 45 |
CoFixpoint v := |
| 46 |
{| k := 0 ; m := 0 ; z := Some w ; |} |
| 47 |
with w := {| l := v |}. |
| 48 |
|
| 49 |
Extraction TestCompile v. |
| 50 |
(* |
| 51 |
(** val v0 : nat v **) |
| 52 |
|
| 53 |
let rec v0 = |
| 54 |
lazy (Build_V (O, O, (Some w0))) |
| 55 |
|
| 56 |
(** val w0 : nat w **) |
| 57 |
|
| 58 |
and w0 = |
| 59 |
lazy (Build_W v0) |
| 60 |
*) |