| 1 |
Module First. |
| 2 |
Definition bar := 1. |
| 3 |
Lemma bar_1 : bar = 1. Proof. reflexivity. Qed. |
| 4 |
End First. |
| 5 |
|
| 6 |
Module Import Second. |
| 7 |
Include First. |
| 8 |
Search bar. (*First.bar_1: First.bar = 1*) |
| 9 |
Search "bar". |
| 10 |
Lemma one_bar : 1 = bar. Proof. rewrite bar_1. reflexivity. Qed. |
| 11 |
End Second. |
| 12 |
|
| 13 |
Module Type B. |
| 14 |
Definition bar := 1. |
| 15 |
Lemma bar_1 : bar = 1. Proof. reflexivity. Qed. |
| 16 |
End B. |
| 17 |
|
| 18 |
Module A. |
| 19 |
Include B. |
| 20 |
Search bar. (* was nothing *) |
| 21 |
Lemma one_bar : 1 = bar. Proof. rewrite bar_1; reflexivity. Qed. |
| 22 |
Search bar. (* was only one_bar *) |
| 23 |
End A. |
| 24 |
|
| 25 |
Module Type HasFoo. |
| 26 |
Parameter t : Type. |
| 27 |
Parameter foo : t. |
| 28 |
End HasFoo. |
| 29 |
|
| 30 |
Module MakeBaz (Import M : HasFoo). |
| 31 |
Definition baz := fun (_ : unit) => foo. |
| 32 |
Lemma baz_foo : baz tt = foo. Proof. reflexivity. Qed. |
| 33 |
End MakeBaz. |
| 34 |
|
| 35 |
Module Import Baz <: HasFoo. |
| 36 |
Definition t := nat. |
| 37 |
Definition foo := 42. |
| 38 |
Include MakeBaz. |
| 39 |
Search baz. (* was nothing *) |
| 40 |
Search "baz". (* was nothing *) |
| 41 |
Lemma foo_bas : foo = baz tt. Proof. rewrite baz_foo. reflexivity. Qed. |
| 42 |
End Baz. |