diff options
author | letouzey <letouzey@85f007b7-540e-0410-9357-904b9bb8a0f7> | 2010-01-05 15:24:29 +0000 |
---|---|---|
committer | letouzey <letouzey@85f007b7-540e-0410-9357-904b9bb8a0f7> | 2010-01-05 15:24:29 +0000 |
commit | 9332ed8f53f544c0dccac637a88d09a252c3c653 (patch) | |
tree | fe59e48dd8bbce65a19b3e806c70e52db1ed0858 /theories/Numbers/Integer | |
parent | b63cd131e8b4a5600973c860d2ccc6e3e5c8ce91 (diff) |
Division in Numbers: factorisation of signatures
git-svn-id: svn+ssh://scm.gforge.inria.fr/svn/coq/trunk@12624 85f007b7-540e-0410-9357-904b9bb8a0f7
Diffstat (limited to 'theories/Numbers/Integer')
-rw-r--r-- | theories/Numbers/Integer/Abstract/ZDivEucl.v | 14 | ||||
-rw-r--r-- | theories/Numbers/Integer/Abstract/ZDivFloor.v | 13 | ||||
-rw-r--r-- | theories/Numbers/Integer/Abstract/ZDivTrunc.v | 13 |
3 files changed, 3 insertions, 37 deletions
diff --git a/theories/Numbers/Integer/Abstract/ZDivEucl.v b/theories/Numbers/Integer/Abstract/ZDivEucl.v index 2ec1cc9b0..e6af6f16f 100644 --- a/theories/Numbers/Integer/Abstract/ZDivEucl.v +++ b/theories/Numbers/Integer/Abstract/ZDivEucl.v @@ -26,21 +26,9 @@ Require Import ZAxioms ZProperties NZDiv. Open Scope NumScope. Module Type ZDiv (Import Z : ZAxiomsSig). - - Parameter Inline div : t -> t -> t. - Parameter Inline modulo : t -> t -> t. - - Infix "/" := div : NumScope. - Infix "mod" := modulo (at level 40, no associativity) : NumScope. - - Declare Instance div_wd : Proper (eq==>eq==>eq) div. - Declare Instance mod_wd : Proper (eq==>eq==>eq) modulo. - + Include Type NZDivCommon Z. (** div, mod, compat with eq, equation a=bq+r *) Definition abs z := max z (-z). - - Axiom div_mod : forall a b, b ~= 0 -> a == b*(a/b) + (a mod b). Axiom mod_always_pos : forall a b, 0 <= a mod b < abs b. - End ZDiv. Module Type ZDivSig := ZAxiomsSig <+ ZDiv. diff --git a/theories/Numbers/Integer/Abstract/ZDivFloor.v b/theories/Numbers/Integer/Abstract/ZDivFloor.v index 473631293..c152fa83e 100644 --- a/theories/Numbers/Integer/Abstract/ZDivFloor.v +++ b/theories/Numbers/Integer/Abstract/ZDivFloor.v @@ -29,20 +29,9 @@ Require Import ZAxioms ZProperties NZDiv. Open Scope NumScope. Module Type ZDiv (Import Z : ZAxiomsSig). - - Parameter Inline div : t -> t -> t. - Parameter Inline modulo : t -> t -> t. - - Infix "/" := div : NumScope. - Infix "mod" := modulo (at level 40, no associativity) : NumScope. - - Declare Instance div_wd : Proper (eq==>eq==>eq) div. - Declare Instance mod_wd : Proper (eq==>eq==>eq) modulo. - - Axiom div_mod : forall a b, b ~= 0 -> a == b*(a/b) + (a mod b). + Include Type NZDivCommon Z. (** div, mod, compat with eq, equation a=bq+r *) Axiom mod_pos_bound : forall a b, 0 < b -> 0 <= a mod b < b. Axiom mod_neg_bound : forall a b, b < 0 -> b < a mod b <= 0. - End ZDiv. Module Type ZDivSig := ZAxiomsSig <+ ZDiv. diff --git a/theories/Numbers/Integer/Abstract/ZDivTrunc.v b/theories/Numbers/Integer/Abstract/ZDivTrunc.v index 2522f70c1..eca1e2ba1 100644 --- a/theories/Numbers/Integer/Abstract/ZDivTrunc.v +++ b/theories/Numbers/Integer/Abstract/ZDivTrunc.v @@ -29,21 +29,10 @@ Require Import ZAxioms ZProperties NZDiv. Open Scope NumScope. Module Type ZDiv (Import Z : ZAxiomsSig). - - Parameter Inline div : t -> t -> t. - Parameter Inline modulo : t -> t -> t. - - Infix "/" := div : NumScope. - Infix "mod" := modulo (at level 40, no associativity) : NumScope. - - Declare Instance div_wd : Proper (eq==>eq==>eq) div. - Declare Instance mod_wd : Proper (eq==>eq==>eq) modulo. - - Axiom div_mod : forall a b, b ~= 0 -> a == b*(a/b) + (a mod b). + Include Type NZDivCommon Z. (** div, mod, compat with eq, equation a=bq+r *) Axiom mod_bound : forall a b, 0<=a -> 0<b -> 0 <= a mod b < b. Axiom mod_opp_l : forall a b, b ~= 0 -> (-a) mod b == - (a mod b). Axiom mod_opp_r : forall a b, b ~= 0 -> a mod (-b) == a mod b. - End ZDiv. Module Type ZDivSig := ZAxiomsSig <+ ZDiv. |