Omega
NAME
Omega - solves a universally quantified problem in Presburger Arithmetic
SYNOPSIS
Omega;
Flag Omega "[+-]{time|system|action}".
DESCRIPTION
Omega
solves a goal in Presburger arithmetic, ie a universally quantified
formula made of equations and inequations.
Equations may be specified either on the type nat or on the type
Z. Formulas on nat are automatically injected into
Z.
The procedure may use any hypothesis to solve the goal.
Overview of the tactic
- The goal is negated twice and the first negation is introduced as an
hypothesis.
- Hypothesis are decomposed in simple equations or inequations. Multiple
goals may result from this phase.
- Equations and inequations over natare translated over
Z, multiple goals may result from the translation of
substraction.
- Equations and inequations are normalized.
- Goals are solved by the OMEGA decision procedure.
- The script of the solution is replayed.
Overview of the decision procedure
We use a small subset of the decision procedure presented in
"The Omega Test: a fast and practical integer
programming algorithm for dependence analysis",
William Pugh, CACM [8], 1992, p 102-114
Here is an overview.
The reader is refered to the original paper for more information.
- Equations and inequations are normalized by division by the GCD of their
coefficients.
- Equations are eliminated, using the Banerjee test to get a coefficient
equal to one.
- Note that each inequation defines a half space in the space of real value
of the variables.
- Inequations are solved by projecting on the hyperspace defined by
cancelling one of the variable.
They are partitioned according to the sign of
the coefficient of the eliminated variable. Pairs of inequations from
different classes define a new edge in the projection.
- Redundant inequations are eliminated or merged in new equations that can
be eliminated by the Banerjee test.
- The last two steps are iterated until a contradiction is reached (success)
or there is no more variable to eliminate (failure).
It may happen that there is a real solution and no integer one. The last
steps of the Omega procedure (dark shadow) are not implemented, so the
decision procedure is only partial.
Restrictions
Connectors recognised by the tactic
/\, \/, ~, ->
Operators on nat recognized by the tactic
=, le, lt, gt, ge, plus, minus, mult, S
Operators on Z recognized by the tactic
=, Zle, Zlt, Zgt, Zge, Zplus, Zminus, Zinv, Zmult, Zs
Control over the output
There are some flags that can be set to get more information on the procedure
- time to get the time used by the procedure
- system to visualize the normalized systems.
- action to visualize the actions performed by the OMEGA
procedure.
Use Omega Flag followed by a string to change the state of a
flag. +<flag> to set it, -<flag> to unset
it and <flag> to toggle it.
EXAMPLE
Coq < Flag Omega "+time".
Coq < Goal (m,n:Z) ~((Zle (Zplus (1) (Zmult (2) m)) (Zmult (2) n)) /\
Coq < (Zle (Zmult (2) n) (Zplus (1) (Zmult (2) m)))).
1 subgoal
============================
(m,n:Z)
~((Zle (Zplus (##1) (Zmult (##10) m)) (Zmult (##10) n))
/\(Zle (Zmult (##10) n) (Zplus (##1) (Zmult (##10) m))))
Unnamed_thm < Intros; Omega.
Rewrites : tu=0.60 ts=0.02 (* Time taken to perform rewriting *)
Omega : tu=3.57 ts=0.03 (* Global time *)
Elim : tu=0.08 ts=0.00 (* Time taken by Elim *)
Simpl : tu=0.48 ts=0.00 (* Time taken by Simpl *)
Generalize : tu=1.08 ts=0.00 (* Time taken by Generalize *)
Solver : tu=2.83 ts=0.03 (* Global time - normalization time *)
Subtree proved!
BUGS
The procedure does not fail nicely so an Undo step may be necessary if the
goal can't be solved.
The simplification procedure is very dumb and this results in many redundant
cases to explore.
Much too slow.
Certainely plenty other bugs !!
You can report them to
cregut@lannion.cnet.fr