aboutsummaryrefslogtreecommitdiffhomepage
path: root/theories/Numbers/Integer
diff options
context:
space:
mode:
authorGravatar letouzey <letouzey@85f007b7-540e-0410-9357-904b9bb8a0f7>2011-02-11 16:54:18 +0000
committerGravatar letouzey <letouzey@85f007b7-540e-0410-9357-904b9bb8a0f7>2011-02-11 16:54:18 +0000
commit483e36a76c4a31a1711a4602be45f66e7f46760f (patch)
tree6a490563e2a55d14e91da600f3843b8fc0b09552 /theories/Numbers/Integer
parent1e1bc1952499bf3528810f2b3e6efad76ab843d0 (diff)
Annotations at functor applications:
- The experimental syntax "<30>F M" is transformed into "F M [inline at level 30]" - The earlier syntax !F X should now be written "F X [no inline]" (note that using ! is still possible for compatibility) - A new annotation "F M [scope foo_scope to bar_scope]" allow to substitute foo_scope by bar_scope in all arguments scope of objects in F. BigN and BigZ are cleaned from the zillions of Arguments Scope used earlier. Arguments scope for lemmas are fixed for instances of Numbers. git-svn-id: svn+ssh://scm.gforge.inria.fr/svn/coq/trunk@13839 85f007b7-540e-0410-9357-904b9bb8a0f7
Diffstat (limited to 'theories/Numbers/Integer')
-rw-r--r--theories/Numbers/Integer/BigZ/BigZ.v77
-rw-r--r--theories/Numbers/Integer/BigZ/ZMake.v2
-rw-r--r--theories/Numbers/Integer/Binary/ZBinary.v5
3 files changed, 22 insertions, 62 deletions
diff --git a/theories/Numbers/Integer/BigZ/BigZ.v b/theories/Numbers/Integer/BigZ/BigZ.v
index 583491386..9748a4366 100644
--- a/theories/Numbers/Integer/BigZ/BigZ.v
+++ b/theories/Numbers/Integer/BigZ/BigZ.v
@@ -24,65 +24,24 @@ Require Import ZProperties ZDivFloor ZSig ZSigZAxioms ZMake.
*)
+Delimit Scope bigZ_scope with bigZ.
Module BigZ <: ZType <: OrderedTypeFull <: TotalOrder :=
- ZMake.Make BigN <+ ZTypeIsZAxioms <+ !ZProp <+ HasEqBool2Dec
- <+ !MinMaxLogicalProperties <+ !MinMaxDecProperties.
+ ZMake.Make BigN [scope abstract_scope to bigZ_scope]
+ <+ ZTypeIsZAxioms [scope abstract_scope to bigZ_scope]
+ <+ ZProp [no inline, scope abstract_scope to bigZ_scope]
+ <+ HasEqBool2Dec [no inline, scope abstract_scope to bigZ_scope]
+ <+ MinMaxLogicalProperties [no inline, scope abstract_scope to bigZ_scope]
+ <+ MinMaxDecProperties [no inline, scope abstract_scope to bigZ_scope].
(** Notations about [BigZ] *)
-Notation bigZ := BigZ.t.
+Local Open Scope bigZ_scope.
-Delimit Scope bigZ_scope with bigZ.
-Bind Scope bigZ_scope with bigZ.
-Bind Scope bigZ_scope with BigZ.t.
-Bind Scope bigZ_scope with BigZ.t_.
-(* Bind Scope has no retroactive effect, let's declare scopes by hand. *)
+Notation bigZ := BigZ.t.
+Bind Scope bigZ_scope with bigZ BigZ.t BigZ.t_.
Arguments Scope BigZ.Pos [bigN_scope].
Arguments Scope BigZ.Neg [bigN_scope].
-Arguments Scope BigZ.to_Z [bigZ_scope].
-Arguments Scope BigZ.succ [bigZ_scope].
-Arguments Scope BigZ.pred [bigZ_scope].
-Arguments Scope BigZ.opp [bigZ_scope].
-Arguments Scope BigZ.square [bigZ_scope].
-Arguments Scope BigZ.add [bigZ_scope bigZ_scope].
-Arguments Scope BigZ.sub [bigZ_scope bigZ_scope].
-Arguments Scope BigZ.mul [bigZ_scope bigZ_scope].
-Arguments Scope BigZ.div [bigZ_scope bigZ_scope].
-Arguments Scope BigZ.eq [bigZ_scope bigZ_scope].
-Arguments Scope BigZ.lt [bigZ_scope bigZ_scope].
-Arguments Scope BigZ.le [bigZ_scope bigZ_scope].
-Arguments Scope BigZ.eq [bigZ_scope bigZ_scope].
-Arguments Scope BigZ.compare [bigZ_scope bigZ_scope].
-Arguments Scope BigZ.min [bigZ_scope bigZ_scope].
-Arguments Scope BigZ.max [bigZ_scope bigZ_scope].
-Arguments Scope BigZ.eq_bool [bigZ_scope bigZ_scope].
-Arguments Scope BigZ.pow_pos [bigZ_scope positive_scope].
-Arguments Scope BigZ.pow_N [bigZ_scope N_scope].
-Arguments Scope BigZ.pow [bigZ_scope bigZ_scope].
-Arguments Scope BigZ.log2 [bigZ_scope].
-Arguments Scope BigZ.sqrt [bigZ_scope].
-Arguments Scope BigZ.div_eucl [bigZ_scope bigZ_scope].
-Arguments Scope BigZ.modulo [bigZ_scope bigZ_scope].
-Arguments Scope BigZ.quot [bigZ_scope bigZ_scope].
-Arguments Scope BigZ.rem [bigZ_scope bigZ_scope].
-Arguments Scope BigZ.gcd [bigZ_scope bigZ_scope].
-Arguments Scope BigZ.lcm [bigZ_scope bigZ_scope].
-Arguments Scope BigZ.even [bigZ_scope].
-Arguments Scope BigZ.odd [bigZ_scope].
-Arguments Scope BigN.testbit [bigZ_scope bigZ_scope].
-Arguments Scope BigN.shiftl [bigZ_scope bigZ_scope].
-Arguments Scope BigN.shiftr [bigZ_scope bigZ_scope].
-Arguments Scope BigN.lor [bigZ_scope bigZ_scope].
-Arguments Scope BigN.land [bigZ_scope bigZ_scope].
-Arguments Scope BigN.ldiff [bigZ_scope bigZ_scope].
-Arguments Scope BigN.lxor [bigZ_scope bigZ_scope].
-Arguments Scope BigN.setbit [bigZ_scope bigZ_scope].
-Arguments Scope BigN.clearbit [bigZ_scope bigZ_scope].
-Arguments Scope BigN.lnot [bigZ_scope].
-Arguments Scope BigN.div2 [bigZ_scope].
-Arguments Scope BigN.ones [bigZ_scope].
-
Local Notation "0" := BigZ.zero : bigZ_scope.
Local Notation "1" := BigZ.one : bigZ_scope.
Local Notation "2" := BigZ.two : bigZ_scope.
@@ -94,21 +53,19 @@ Infix "/" := BigZ.div : bigZ_scope.
Infix "^" := BigZ.pow : bigZ_scope.
Infix "?=" := BigZ.compare : bigZ_scope.
Infix "==" := BigZ.eq (at level 70, no associativity) : bigZ_scope.
-Notation "x != y" := (~x==y)%bigZ (at level 70, no associativity) : bigZ_scope.
+Notation "x != y" := (~x==y) (at level 70, no associativity) : bigZ_scope.
Infix "<" := BigZ.lt : bigZ_scope.
Infix "<=" := BigZ.le : bigZ_scope.
-Notation "x > y" := (BigZ.lt y x)(only parsing) : bigZ_scope.
-Notation "x >= y" := (BigZ.le y x)(only parsing) : bigZ_scope.
-Notation "x < y < z" := (x<y /\ y<z)%bigZ : bigZ_scope.
-Notation "x < y <= z" := (x<y /\ y<=z)%bigZ : bigZ_scope.
-Notation "x <= y < z" := (x<=y /\ y<z)%bigZ : bigZ_scope.
-Notation "x <= y <= z" := (x<=y /\ y<=z)%bigZ : bigZ_scope.
+Notation "x > y" := (y < x) (only parsing) : bigZ_scope.
+Notation "x >= y" := (y <= x) (only parsing) : bigZ_scope.
+Notation "x < y < z" := (x<y /\ y<z) : bigZ_scope.
+Notation "x < y <= z" := (x<y /\ y<=z) : bigZ_scope.
+Notation "x <= y < z" := (x<=y /\ y<z) : bigZ_scope.
+Notation "x <= y <= z" := (x<=y /\ y<=z) : bigZ_scope.
Notation "[ i ]" := (BigZ.to_Z i) : bigZ_scope.
Infix "mod" := BigZ.modulo (at level 40, no associativity) : bigZ_scope.
Infix "รท" := BigZ.quot (at level 40, left associativity) : bigZ_scope.
-Local Open Scope bigZ_scope.
-
(** Some additional results about [BigZ] *)
Theorem spec_to_Z: forall n : bigZ,
diff --git a/theories/Numbers/Integer/BigZ/ZMake.v b/theories/Numbers/Integer/BigZ/ZMake.v
index 7534628fa..57b98e860 100644
--- a/theories/Numbers/Integer/BigZ/ZMake.v
+++ b/theories/Numbers/Integer/BigZ/ZMake.v
@@ -29,6 +29,8 @@ Module Make (N:NType) <: ZType.
Definition t := t_.
+ Bind Scope abstract_scope with t t_.
+
Definition zero := Pos N.zero.
Definition one := Pos N.one.
Definition two := Pos N.two.
diff --git a/theories/Numbers/Integer/Binary/ZBinary.v b/theories/Numbers/Integer/Binary/ZBinary.v
index 366418035..fbb91ef7f 100644
--- a/theories/Numbers/Integer/Binary/ZBinary.v
+++ b/theories/Numbers/Integer/Binary/ZBinary.v
@@ -223,8 +223,9 @@ Definition eq := (@eq Z).
(** Now the generic properties. *)
-Include ZProp
- <+ UsualMinMaxLogicalProperties <+ UsualMinMaxDecProperties.
+Include ZProp [scope abstract_scope to Z_scope]
+ <+ UsualMinMaxLogicalProperties [scope abstract_scope to Z_scope]
+ <+ UsualMinMaxDecProperties [scope abstract_scope to Z_scope].
End Z.