]> matita.cs.unibo.it Git - helm.git/blobdiff - helm/software/matita/contribs/procedural/Coq/ZArith/Zsqrt.mma
transcript: we improved the parser/lexer to read the scripts of the standard
[helm.git] / helm / software / matita / contribs / procedural / Coq / ZArith / Zsqrt.mma
diff --git a/helm/software/matita/contribs/procedural/Coq/ZArith/Zsqrt.mma b/helm/software/matita/contribs/procedural/Coq/ZArith/Zsqrt.mma
new file mode 100644 (file)
index 0000000..25e5591
--- /dev/null
@@ -0,0 +1,80 @@
+(**************************************************************************)
+(*       ___                                                              *)
+(*      ||M||                                                             *)
+(*      ||A||       A project by Andrea Asperti                           *)
+(*      ||T||                                                             *)
+(*      ||I||       Developers:                                           *)
+(*      ||T||         The HELM team.                                      *)
+(*      ||A||         http://helm.cs.unibo.it                             *)
+(*      \   /                                                             *)
+(*       \ /        This file is distributed under the terms of the       *)
+(*        v         GNU General Public License Version 2                  *)
+(*                                                                        *)
+(**************************************************************************)
+
+(* This file was automatically generated: do not edit *********************)
+
+include "Coq.ma".
+
+(*#**********************************************************************)
+
+(*  v      *   The Coq Proof Assistant  /  The Coq Development Team    *)
+
+(* <O___,, *        INRIA-Rocquencourt  &  LRI-CNRS-Orsay              *)
+
+(*   \VV/  *************************************************************)
+
+(*    //   *      This file is distributed under the terms of the      *)
+
+(*         *       GNU Lesser General Public License Version 2.1       *)
+
+(*#**********************************************************************)
+
+(* $Id: Zsqrt.v,v 1.11 2003/12/15 19:48:23 barras Exp $ *)
+
+include "ZArith/ZArith_base.ma".
+
+(* UNEXPORTED
+Open Local Scope Z_scope.
+*)
+
+(*#*********************************************************************)
+
+(*#* Definition and properties of square root on Z *)
+
+(*#* The following tactic replaces all instances of (POS (xI ...)) by
+    `2*(POS ...)+1`, but only when ... is not made only with xO, XI, or xH. *)
+
+(* UNEXPORTED
+Ltac compute_POS :=
+  match goal with
+  |  |- context [(Zpos (xI ?X1))] =>
+      match constr:X1 with
+      | context [1%positive] => fail
+      | _ => rewrite (BinInt.Zpos_xI X1)
+      end
+  |  |- context [(Zpos (xO ?X1))] =>
+      match constr:X1 with
+      | context [1%positive] => fail
+      | _ => rewrite (BinInt.Zpos_xO X1)
+      end
+  end.
+*)
+
+inline procedural "cic:/Coq/ZArith/Zsqrt/sqrt_data.ind".
+
+inline procedural "cic:/Coq/ZArith/Zsqrt/sqrtrempos.con" as definition.
+
+(*#* Define with integer input, but with a strong (readable) specification. *)
+
+inline procedural "cic:/Coq/ZArith/Zsqrt/Zsqrt.con" as definition.
+
+(*#* Define a function of type Z->Z that computes the integer square root,
+    but only for positive numbers, and 0 for others. *)
+
+inline procedural "cic:/Coq/ZArith/Zsqrt/Zsqrt_plain.con" as definition.
+
+(*#* A basic theorem about Zsqrt_plain *)
+
+inline procedural "cic:/Coq/ZArith/Zsqrt/Zsqrt_interval.con" as theorem.
+