diff options
author | 2008-06-25 18:22:26 +0000 | |
---|---|---|
committer | 2008-06-25 18:22:26 +0000 | |
commit | 8ebcb152ca0cf260fe1980758e4434c74926d78e (patch) | |
tree | d6d07b4c7ad7e0d067d26059cfd882cafbfdd597 /theories/Numbers/Rational/SpecViaQ | |
parent | 693d398b5e4e55a916bbdaa8e4c23c83d9dbcef7 (diff) |
Some work on BigQ :
* keep only one implementation of BigQ
* QMake (ex-Q0Make) becomes functorial
* proofs in it have been reworked, some new functions (e.g. red, power)
* BigQ.t is declared to be a setoid and a field
git-svn-id: svn+ssh://scm.gforge.inria.fr/svn/coq/trunk@11178 85f007b7-540e-0410-9357-904b9bb8a0f7
Diffstat (limited to 'theories/Numbers/Rational/SpecViaQ')
-rw-r--r-- | theories/Numbers/Rational/SpecViaQ/QSig.v | 23 |
1 files changed, 18 insertions, 5 deletions
diff --git a/theories/Numbers/Rational/SpecViaQ/QSig.v b/theories/Numbers/Rational/SpecViaQ/QSig.v index 6840eae25..7c88d25aa 100644 --- a/theories/Numbers/Rational/SpecViaQ/QSig.v +++ b/theories/Numbers/Rational/SpecViaQ/QSig.v @@ -40,14 +40,24 @@ Module Type QType. Parameter compare : t -> t -> comparison. - Parameter spec_compare: forall x y, compare x y = ([x] ?= [y]). + Parameter spec_compare : forall x y, compare x y = ([x] ?= [y]). Definition lt n m := compare n m = Lt. Definition le n m := compare n m <> Gt. Definition min n m := match compare n m with Gt => m | _ => n end. Definition max n m := match compare n m with Lt => m | _ => n end. - Parameter add : t -> t -> t. + Parameter eq_bool : t -> t -> bool. + + Parameter spec_eq_bool : forall x y, + if eq_bool x y then [x]==[y] else ~([x]==[y]). + + Parameter red : t -> t. + + Parameter spec_red : forall x, [red x] == [x]. + Parameter strong_spec_red : forall x, [red x] = Qred [x]. + + Parameter add : t -> t -> t. Parameter spec_add: forall x y, [add x y] == [x] + [y]. @@ -75,10 +85,13 @@ Module Type QType. Parameter spec_div: forall x y, [div x y] == [x] / [y]. - Parameter power_pos : t -> positive -> t. + Parameter power : t -> Z -> t. - Parameter spec_power_pos: forall x n, [power_pos x n] == [x] ^ Zpos n. + Parameter spec_power: forall x z, [power x z] == [x] ^ z. End QType. -(* TODO: add norm function and variants, add eq_bool, what about Qc ? *)
\ No newline at end of file +(** NB: several of the above functions come with [..._norm] variants + that expect reduced arguments and return reduced results. *) + +(** TODO : also speak of specifications via Qcanon ... *) |