aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorFrédéric Besson2013-12-20 01:22:45 +0100
committerFrédéric Besson2013-12-20 01:22:45 +0100
commitca1305a0187653edcf63e46b84c65130ac78d117 (patch)
tree3a50c809ff3f33b722fb1377a5290162c4f09a8a
parent631298df172c1e034d6898ff13d5d5aabb9a5098 (diff)
micromega: removal of spurious Export; addition of Lia.v encapsulating lia and nia.
-rw-r--r--doc/refman/Micromega.tex4
-rw-r--r--plugins/micromega/Lia.v39
-rw-r--r--plugins/micromega/Psatz.v2
-rw-r--r--plugins/micromega/vo.itarget1
-rw-r--r--test-suite/micromega/heap3_vcgen_25.v2
-rw-r--r--test-suite/micromega/zomicron.v2
6 files changed, 45 insertions, 5 deletions
diff --git a/doc/refman/Micromega.tex b/doc/refman/Micromega.tex
index 5f9ed443c4..7bdbd6d84e 100644
--- a/doc/refman/Micromega.tex
+++ b/doc/refman/Micromega.tex
@@ -132,7 +132,7 @@ Theorem~\ref{thm:psatz}, the goal is valid.
\tacindex{lia}
\label{sec:lia}
-The tactic {\tt lia} offers an alternative to the {\tt omega} and {\tt romega} tactic (see
+The tactic {\tt lia} ({\tt Require Lia.}) offers an alternative to the {\tt omega} and {\tt romega} tactic (see
Chapter~\ref{OmegaChapter}).
%
Rougthly speaking, the deductive power of {\tt lia} is the combined deductive power of {\tt ring\_simplify} and {\tt omega}.
@@ -145,7 +145,7 @@ following so-called \emph{omega nightmare}~\cite{TheOmegaPaper}.
-10 <= 7 * x - 9 * y <= 4 -> False.
\end{coq_example*}
\begin{coq_eval}
-intro x; lia;
+intro x; lia.
\end{coq_eval}
The estimation of the relative efficiency of lia \emph{vs} {\tt omega}
and {\tt romega} is under evaluation.
diff --git a/plugins/micromega/Lia.v b/plugins/micromega/Lia.v
new file mode 100644
index 0000000000..4553f03e30
--- /dev/null
+++ b/plugins/micromega/Lia.v
@@ -0,0 +1,39 @@
+(************************************************************************)
+(* v * The Coq Proof Assistant / The Coq Development Team *)
+(* <O___,, * INRIA - CNRS - LIX - LRI - PPS - Copyright 1999-2012 *)
+(* \VV/ **************************************************************)
+(* // * This file is distributed under the terms of the *)
+(* * GNU Lesser General Public License Version 2.1 *)
+(************************************************************************)
+(* *)
+(* Micromega: A reflexive tactic using the Positivstellensatz *)
+(* *)
+(* Frédéric Besson (Irisa/Inria) 2013 *)
+(* *)
+(************************************************************************)
+
+Require Import ZMicromega.
+Require Import ZArith.
+Require Import RingMicromega.
+Require Import VarMap.
+Require Tauto.
+Declare ML Module "micromega_plugin".
+
+Ltac lia :=
+ zify ; unfold Z.succ in * ;
+ (*cbv delta - [Z.add Z.sub Z.opp Z.mul Z.pow Z.gt Z.ge Z.le Z.lt iff not] ;*) xlia ;
+ intros __wit __varmap __ff ;
+ change (Tauto.eval_f (Zeval_formula (@find Z Z0 __varmap)) __ff) ;
+ apply (ZTautoChecker_sound __ff __wit); vm_compute ; reflexivity.
+
+Ltac nia :=
+ zify ; unfold Z.succ in * ;
+ xnlia ;
+ intros __wit __varmap __ff ;
+ change (Tauto.eval_f (Zeval_formula (@find Z Z0 __varmap)) __ff) ;
+ apply (ZTautoChecker_sound __ff __wit); vm_compute ; reflexivity.
+
+
+(* Local Variables: *)
+(* coding: utf-8 *)
+(* End: *)
diff --git a/plugins/micromega/Psatz.v b/plugins/micromega/Psatz.v
index 5090542c6a..804a16b793 100644
--- a/plugins/micromega/Psatz.v
+++ b/plugins/micromega/Psatz.v
@@ -18,7 +18,7 @@ Require Import RMicromega.
Require Import QArith.
Require Import ZArith.
Require Import Rdefinitions.
-Require Export RingMicromega.
+Require Import RingMicromega.
Require Import VarMap.
Require Tauto.
Declare ML Module "micromega_plugin".
diff --git a/plugins/micromega/vo.itarget b/plugins/micromega/vo.itarget
index fb75bf20c8..bf6a1a7db2 100644
--- a/plugins/micromega/vo.itarget
+++ b/plugins/micromega/vo.itarget
@@ -10,3 +10,4 @@ Tauto.vo
VarMap.vo
ZCoeff.vo
ZMicromega.vo
+Lia.vo \ No newline at end of file
diff --git a/test-suite/micromega/heap3_vcgen_25.v b/test-suite/micromega/heap3_vcgen_25.v
index efb5c7fd5c..00522f50aa 100644
--- a/test-suite/micromega/heap3_vcgen_25.v
+++ b/test-suite/micromega/heap3_vcgen_25.v
@@ -7,7 +7,7 @@
(************************************************************************)
Require Import ZArith.
-Require Import Psatz.
+Require Import Lia.
Open Scope Z_scope.
diff --git a/test-suite/micromega/zomicron.v b/test-suite/micromega/zomicron.v
index 3b24602336..0ec1dbfbcd 100644
--- a/test-suite/micromega/zomicron.v
+++ b/test-suite/micromega/zomicron.v
@@ -1,5 +1,5 @@
Require Import ZArith.
-Require Import Psatz.
+Require Import Lia.
Open Scope Z_scope.
Lemma two_x_eq_1 : forall x, 2 * x = 1 -> False.