aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorherbelin2002-04-17 11:49:07 +0000
committerherbelin2002-04-17 11:49:07 +0000
commitcda6963b3ca8fd75c00a0c65dd9ecffdeadfb3c3 (patch)
tree453dbe7cc01abe5aa6413076365ad00576654572
parent4bdc6a6515de45027e43ad79271cf2d8793394e4 (diff)
Quelques bugs avec inject_nat
git-svn-id: svn+ssh://scm.gforge.inria.fr/svn/coq/trunk@2653 85f007b7-540e-0410-9357-904b9bb8a0f7
-rw-r--r--test-suite/output/ZSyntax.out22
-rw-r--r--test-suite/output/ZSyntax.v14
-rw-r--r--theories/ZArith/Zsyntax.v2
3 files changed, 37 insertions, 1 deletions
diff --git a/test-suite/output/ZSyntax.out b/test-suite/output/ZSyntax.out
index 7ef79aba44..9774f20cf1 100644
--- a/test-suite/output/ZSyntax.out
+++ b/test-suite/output/ZSyntax.out
@@ -2,3 +2,25 @@
: Z
[f:(nat->Z)]`(f O)+0`
: (nat->Z)->Z
+[x:positive](POS (xO x))
+ : positive->Z
+[x:positive]`(POS x)+1`
+ : positive->Z
+[x:positive](POS x)
+ : positive->Z
+[x:positive](NEG (xO x))
+ : positive->Z
+[x:positive]`(POS (xO x))+0`
+ : positive->Z
+[x:positive]`(Zopp (POS (xO x)))`
+ : positive->Z
+[x:positive]`(Zopp (POS (xO x)))+0`
+ : positive->Z
+`(inject_nat (0))+1`
+ : Z
+`0+(inject_nat (plus (0) (0)))`
+ : Z
+`(inject_nat (0)) = 0`
+ : Prop
+`0+(inject_nat (789))`
+ : Z
diff --git a/test-suite/output/ZSyntax.v b/test-suite/output/ZSyntax.v
index 0f5092c416..531d1afa76 100644
--- a/test-suite/output/ZSyntax.v
+++ b/test-suite/output/ZSyntax.v
@@ -1,3 +1,17 @@
Require ZArith.
Check `32`.
Check [f:nat->Z]`(f O) + 0`.
+Check [x:positive]`(POS (xO x))`.
+Check [x:positive]`(POS x)+1`.
+Check [x:positive]`(POS x)`.
+Check [x:positive]`(NEG (xO x))`.
+Check [x:positive]`(POS (xO x))+0`.
+Check [x:positive]`(Zopp (POS (xO x)))`.
+Check [x:positive]`(Zopp (POS (xO x)))+0`.
+Check `(inject_nat O)+1`.
+Check (Zplus `0` (inject_nat (plus O O))).
+Check `(inject_nat O)=0`.
+
+(* Submitted by Pierre Casteran *)
+Require Arith.
+Check (Zplus `0` (inject_nat (789))).
diff --git a/theories/ZArith/Zsyntax.v b/theories/ZArith/Zsyntax.v
index c68c9b218a..fd134f2df3 100644
--- a/theories/ZArith/Zsyntax.v
+++ b/theories/ZArith/Zsyntax.v
@@ -157,7 +157,7 @@ Syntax constr
Zappl_inside [ << (ZEXPR (APPLIST $h ($LIST $t))) >> ]
-> [ [<hov 0> "("(ZEXPR $h):E [1 0] (ZAPPLINSIDETAIL ($LIST $t)):E ")"] ]
| Zappl_inject_nat [ << (ZEXPR (APPLIST <<inject_nat>> $n)) >> ]
- -> [ [<hov 0> "(inject_nat" [1 1] $n ")"] ]
+ -> [ [<hov 0> "(inject_nat" [1 1] "(" $n "))"] ]
| Zappl_inside_tail [ << (ZAPPLINSIDETAIL $h ($LIST $t)) >> ]
-> [(ZEXPR $h):E [1 0] (ZAPPLINSIDETAIL ($LIST $t)):E]
| Zappl_inside_one [ << (ZAPPLINSIDETAIL $e) >> ] ->[(ZEXPR $e):E]