]> matita.cs.unibo.it Git - helm.git/blob - helm/software/matita/contribs/procedural/Coq/ZArith/Zsqrt.mma
Preparing for 0.5.9 release.
[helm.git] / helm / software / matita / contribs / procedural / Coq / ZArith / Zsqrt.mma
1 (**************************************************************************)
2 (*       ___                                                              *)
3 (*      ||M||                                                             *)
4 (*      ||A||       A project by Andrea Asperti                           *)
5 (*      ||T||                                                             *)
6 (*      ||I||       Developers:                                           *)
7 (*      ||T||         The HELM team.                                      *)
8 (*      ||A||         http://helm.cs.unibo.it                             *)
9 (*      \   /                                                             *)
10 (*       \ /        This file is distributed under the terms of the       *)
11 (*        v         GNU General Public License Version 2                  *)
12 (*                                                                        *)
13 (**************************************************************************)
14
15 (* This file was automatically generated: do not edit *********************)
16
17 include "Coq.ma".
18
19 (*#***********************************************************************)
20
21 (*  v      *   The Coq Proof Assistant  /  The Coq Development Team     *)
22
23 (* <O___,, * CNRS-Ecole Polytechnique-INRIA Futurs-Universite Paris Sud *)
24
25 (*   \VV/  **************************************************************)
26
27 (*    //   *      This file is distributed under the terms of the       *)
28
29 (*         *       GNU Lesser General Public License Version 2.1        *)
30
31 (*#***********************************************************************)
32
33 (* $Id: Zsqrt.v,v 1.11.2.1 2004/07/16 19:31:22 herbelin Exp $ *)
34
35 include "ZArith/ZArith_base.ma".
36
37 (* UNEXPORTED
38 Open Local Scope Z_scope.
39 *)
40
41 (*#*********************************************************************)
42
43 (*#* Definition and properties of square root on Z *)
44
45 (*#* The following tactic replaces all instances of (POS (xI ...)) by
46     `2*(POS ...)+1`, but only when ... is not made only with xO, XI, or xH. *)
47
48 (* UNEXPORTED
49 Ltac compute_POS :=
50   match goal with
51   |  |- context [(Zpos (xI ?X1))] =>
52       match constr:X1 with
53       | context [1%positive] => fail
54       | _ => rewrite (BinInt.Zpos_xI X1)
55       end
56   |  |- context [(Zpos (xO ?X1))] =>
57       match constr:X1 with
58       | context [1%positive] => fail
59       | _ => rewrite (BinInt.Zpos_xO X1)
60       end
61   end.
62 *)
63
64 inline procedural "cic:/Coq/ZArith/Zsqrt/sqrt_data.ind".
65
66 inline procedural "cic:/Coq/ZArith/Zsqrt/sqrtrempos.con" as definition.
67
68 (*#* Define with integer input, but with a strong (readable) specification. *)
69
70 inline procedural "cic:/Coq/ZArith/Zsqrt/Zsqrt.con" as definition.
71
72 (*#* Define a function of type Z->Z that computes the integer square root,
73     but only for positive numbers, and 0 for others. *)
74
75 inline procedural "cic:/Coq/ZArith/Zsqrt/Zsqrt_plain.con" as definition.
76
77 (*#* A basic theorem about Zsqrt_plain *)
78
79 inline procedural "cic:/Coq/ZArith/Zsqrt/Zsqrt_interval.con" as theorem.
80