aboutsummaryrefslogtreecommitdiffhomepage
path: root/test-suite/modules
diff options
context:
space:
mode:
authorGravatar coq <coq@85f007b7-540e-0410-9357-904b9bb8a0f7>2003-11-28 14:10:55 +0000
committerGravatar coq <coq@85f007b7-540e-0410-9357-904b9bb8a0f7>2003-11-28 14:10:55 +0000
commit40f44123d496b63ce6cfc6df3198ba98bd4bba8f (patch)
tree309576ae22f52c0f088d57ff0a537b1167b7891a /test-suite/modules
parentd91090510f7c8f29e9e37b8aa7426c56b54375d5 (diff)
Simplest Demo on modules
git-svn-id: svn+ssh://scm.gforge.inria.fr/svn/coq/trunk@5014 85f007b7-540e-0410-9357-904b9bb8a0f7
Diffstat (limited to 'test-suite/modules')
-rw-r--r--test-suite/modules/Demo.v55
1 files changed, 55 insertions, 0 deletions
diff --git a/test-suite/modules/Demo.v b/test-suite/modules/Demo.v
new file mode 100644
index 000000000..1e9273f07
--- /dev/null
+++ b/test-suite/modules/Demo.v
@@ -0,0 +1,55 @@
+Module M.
+ Definition t:=nat.
+ Definition x:=O.
+End M.
+
+Print M.t.
+
+
+Module Type SIG.
+ Parameter t:Set.
+ Parameter x:t.
+End SIG.
+
+
+Module F[X:SIG].
+ Definition t:=X.t->X.t.
+ Definition x:t.
+ Intro.
+ Exact X.x.
+ Defined.
+ Definition y:=X.x.
+End F.
+
+
+Module N := F M.
+
+Print N.t.
+Eval Compute in N.t.
+
+
+Module N' : SIG := N.
+
+Print N'.t.
+Eval Compute in N'.t.
+
+
+Module N'' <: SIG := F N.
+
+Print N''.t.
+Eval Compute in N''.t.
+
+Eval Compute in N''.x.
+
+
+Module N''' : SIG with Definition t:=nat->nat := N.
+
+Print N'''.t.
+Eval Compute in N'''.t.
+
+Print N'''.x.
+
+
+Import N'''.
+
+Print t. \ No newline at end of file