CVCL::ArithProofRules Class Reference

#include <arith_proof_rules.h>

Inheritance diagram for CVCL::ArithProofRules:

Inheritance graph
[legend]
List of all members.

Public Member Functions


Detailed Description

Definition at line 40 of file arith_proof_rules.h.


Constructor & Destructor Documentation

virtual CVCL::ArithProofRules::~ArithProofRules  )  [inline, virtual]
 

Definition at line 43 of file arith_proof_rules.h.


Member Function Documentation

virtual Theorem CVCL::ArithProofRules::uMinusToMult const Expr e  )  [pure virtual]
 

==> -(e) = (-1) * e

Implemented in CVCL::ArithTheoremProducer, and CVCL::RefinedArithTheoremProducer.

Referenced by CVCL::TheoryArith::canon().

virtual Theorem CVCL::ArithProofRules::minusToPlus const Expr x,
const Expr y
[pure virtual]
 

==> x - y = x + (-1) * y

Implemented in CVCL::ArithTheoremProducer, and CVCL::RefinedArithTheoremProducer.

Referenced by CVCL::TheoryArith::canon().

virtual Theorem CVCL::ArithProofRules::canonUMinusToDivide const Expr e  )  [pure virtual]
 

-(e) ==> e / (-1); takes 'e'

Canon Rule for unary minus: it just converts it to division by -1, the result is not yet canonical:

Implemented in CVCL::ArithTheoremProducer.

virtual Theorem CVCL::ArithProofRules::canonDivideConst const Expr c,
const Expr d
[pure virtual]
 

(c) / d ==> (c/d), takes c and d

Canon Rules for division by constant 'd'

Implemented in CVCL::ArithTheoremProducer.

virtual Theorem CVCL::ArithProofRules::canonDivideMult const Expr cx,
const Expr d
[pure virtual]
 

(c * x) / d ==> (c/d) * x, takes (c*x) and d

Implemented in CVCL::ArithTheoremProducer.

virtual Theorem CVCL::ArithProofRules::canonDividePlus const Expr e,
const Expr d
[pure virtual]
 

(+ c ...)/d ==> push division to all the coefficients.

The result is not canonical, but canonizing the summands will make it canonical. Takes (+ c ...) and d

Implemented in CVCL::ArithTheoremProducer.

virtual Theorem CVCL::ArithProofRules::canonDivideVar const Expr e,
const Expr e
[pure virtual]
 

x / d ==> (1/d) * x, takes x and d

Implemented in CVCL::ArithTheoremProducer.

virtual Theorem CVCL::ArithProofRules::canonMultMtermMterm const Expr e  )  [pure virtual]
 

Implemented in CVCL::ArithTheoremProducer.

virtual Theorem CVCL::ArithProofRules::canonPlus const Expr e  )  [pure virtual]
 

Canonize (PLUS t1 ... tn).

Implemented in CVCL::ArithTheoremProducer, and CVCL::RefinedArithTheoremProducer.

Referenced by CVCL::TheoryArith::canon().

virtual Theorem CVCL::ArithProofRules::canonMult const Expr e  )  [pure virtual]
 

Canonize (MULT t1 ... tn).

Implemented in CVCL::ArithTheoremProducer.

Referenced by CVCL::TheoryArith::canon().

virtual Theorem CVCL::ArithProofRules::canonInvert const Expr e  )  [pure virtual]
 

==> 1/e = e' where e' is canonical; takes e.

Implemented in CVCL::ArithTheoremProducer.

virtual Theorem CVCL::ArithProofRules::canonDivide const Expr e  )  [pure virtual]
 

Canonize t1/t2.

Implemented in CVCL::ArithTheoremProducer.

Referenced by CVCL::TheoryArith::canon().

virtual Theorem CVCL::ArithProofRules::canonMultTermConst const Expr c,
const Expr t
[pure virtual]
 

t*c ==> c*t, takes constant c and term t

Implemented in CVCL::ArithTheoremProducer.

virtual Theorem CVCL::ArithProofRules::canonMultTerm1Term2 const Expr t1,
const Expr t2
[pure virtual]
 

t1*t2 ==> Error, takes t1 and t2 where both are non-constants

Implemented in CVCL::ArithTheoremProducer.

virtual Theorem CVCL::ArithProofRules::canonMultZero const Expr e  )  [pure virtual]
 

0*t ==> 0, takes 0*t

Implemented in CVCL::ArithTheoremProducer.

virtual Theorem CVCL::ArithProofRules::canonMultOne const Expr e  )  [pure virtual]
 

1*t ==> t, takes 1*t

Implemented in CVCL::ArithTheoremProducer.

virtual Theorem CVCL::ArithProofRules::canonMultConstConst const Expr c1,
const Expr c2
[pure virtual]
 

c1*c2 ==> c', takes constant c1*c2

Implemented in CVCL::ArithTheoremProducer.

virtual Theorem CVCL::ArithProofRules::canonMultConstTerm const Expr c1,
const Expr c2,
const Expr t
[pure virtual]
 

c1*(c2*t) ==> c'*t, takes c1 and c2 and t

Implemented in CVCL::ArithTheoremProducer.

virtual Theorem CVCL::ArithProofRules::canonMultConstSum const Expr c1,
const Expr sum
[pure virtual]
 

c1*(+ c2 v1 ...) ==> (+ c' c1v1 ...), takes c1 and the sum

Implemented in CVCL::ArithTheoremProducer.

virtual Theorem CVCL::ArithProofRules::canonPowConst const Expr pow  )  [pure virtual]
 

c^n = c' (compute the constant power expression)

Implemented in CVCL::ArithTheoremProducer.

Referenced by CVCL::TheoryArith::canon().

virtual Theorem CVCL::ArithProofRules::canonFlattenSum const Expr e  )  [pure virtual]
 

flattens the input. accepts a PLUS expr

Implemented in CVCL::ArithTheoremProducer.

virtual Theorem CVCL::ArithProofRules::canonComboLikeTerms const Expr e  )  [pure virtual]
 

combine like terms. accepts a flattened PLUS expr

Implemented in CVCL::ArithTheoremProducer.

virtual Theorem CVCL::ArithProofRules::constPredicate const Expr e  )  [pure virtual]
 

e0 @ e1 <==> true | false, where @ is {=,<,<=,>,>=}

Parameters:
e takes e is (e0@e1) where e0 and e1 are constants

Implemented in CVCL::ArithTheoremProducer.

Referenced by CVCL::TheoryArith::doSolve(), CVCL::TheoryArith::isolateVariable(), CVCL::TheoryArith::normalizeProjectIneqs(), and CVCL::TheoryArith::rewrite().

virtual Theorem CVCL::ArithProofRules::rightMinusLeft const Expr e  )  [pure virtual]
 

e[0] @ e[1] <==> 0 @ e[1] - e[0], where @ is {=,<,<=,>,>=}

Implemented in CVCL::ArithTheoremProducer.

Referenced by CVCL::TheoryArith::addToBuffer(), CVCL::TheoryArith::doSolve(), CVCL::TheoryArith::normalizeProjectIneqs(), and CVCL::TheoryArith::rewrite().

virtual Theorem CVCL::ArithProofRules::plusPredicate const Expr x,
const Expr y,
const Expr z,
int  kind
[pure virtual]
 

x @ y <==> x + z @ y + z, where @ is {=,<,<=,>,>=} (given as 'kind')

Implemented in CVCL::ArithTheoremProducer.

Referenced by CVCL::TheoryArith::isolateVariable(), CVCL::TheoryArith::processRealEq(), and CVCL::TheoryArith::processSimpleIntEq().

virtual Theorem CVCL::ArithProofRules::multEqn const Expr x,
const Expr y,
const Expr z
[pure virtual]
 

x = y <==> x * z = y * z, where z is a non-zero constant

Implemented in CVCL::ArithTheoremProducer.

Referenced by CVCL::TheoryArith::normalize(), CVCL::TheoryArith::processRealEq(), and CVCL::TheoryArith::processSimpleIntEq().

virtual Theorem CVCL::ArithProofRules::multIneqn const Expr e,
const Expr z
[pure virtual]
 

Multiplying inequation by a non-zero constant.

z>0 ==> e[0] @ e[1] <==> e[0]*z @ e[1]*z

z<0 ==> e[0] @ e[1] <==> e[1]*z @ e[0]*z

for @ in {<,<=,>,>=}:

Implemented in CVCL::ArithTheoremProducer.

Referenced by CVCL::TheoryArith::isolateVariable(), CVCL::TheoryArith::normalize(), CVCL::TheoryArith::normalizeProjectIneqs(), and CVCL::TheoryArith::processFiniteInterval().

virtual Theorem CVCL::ArithProofRules::flipInequality const Expr e  )  [pure virtual]
 

"op1 GE|GT op2" <==> op2 LE|LT op1

Implemented in CVCL::ArithTheoremProducer.

Referenced by CVCL::TheoryArith::rewrite().

virtual Theorem CVCL::ArithProofRules::negatedInequality const Expr e  )  [pure virtual]
 

Propagating negation over <,<=,>,>=.

NOT (op1 < op2) <==> (op1 >= op2)

NOT (op1 <= op2) <==> (op1 > op2)

NOT (op1 > op2) <==> (op1 <= op2)

NOT (op1 >= op2) <==> (op1 < op2)

Implemented in CVCL::ArithTheoremProducer.

Referenced by CVCL::TheoryArith::rewrite().

virtual Theorem CVCL::ArithProofRules::realShadow const Theorem alphaLTt,
const Theorem tLTbeta
[pure virtual]
 

Real shadow: a <(=) t, t <(=) b ==> a <(=) b.

Implemented in CVCL::ArithTheoremProducer.

Referenced by CVCL::TheoryArith::normalizeProjectIneqs().

virtual Theorem CVCL::ArithProofRules::realShadowEq const Theorem alphaLEt,
const Theorem tLEalpha
[pure virtual]
 

Projecting a tight inequality: alpha <= t <= alpha ==> t = alpha.

Implemented in CVCL::ArithTheoremProducer.

Referenced by CVCL::TheoryArith::normalizeProjectIneqs().

virtual Theorem CVCL::ArithProofRules::finiteInterval const Theorem aLEt,
const Theorem tLEac,
const Theorem isInta,
const Theorem isIntt
[pure virtual]
 

Finite interval for integers: a <= t <= a + c ==> G(t, a, 0, c).

Implemented in CVCL::ArithTheoremProducer.

Referenced by CVCL::TheoryArith::processFiniteInterval().

virtual Theorem CVCL::ArithProofRules::darkGrayShadow2ab const Theorem betaLEbx,
const Theorem axLEalpha,
const Theorem isIntAlpha,
const Theorem isIntBeta,
const Theorem isIntx
[pure virtual]
 

Dark & Gray shadows when a <= b.

takes two integer ineqs (i.e. all vars are ints) "|- beta <= b.x" and "|- a.x <= alpha" and checks if "1 <= a <= b" and returns (D or G) and (!D or !G), where D = Dark_Shadow(ab-1, b.alpha - a.beta), G = Gray_Shadow(a.x, alpha, -(a-1), 0).

Implemented in CVCL::ArithTheoremProducer.

Referenced by CVCL::TheoryArith::normalizeProjectIneqs().

virtual Theorem CVCL::ArithProofRules::darkGrayShadow2ba const Theorem betaLEbx,
const Theorem axLEalpha,
const Theorem isIntAlpha,
const Theorem isIntBeta,
const Theorem isIntx
[pure virtual]
 

Dark & Gray shadows when b <= a.

takes two integer ineqs (i.e. all vars are ints) "|- beta <= b.x" and "|- a.x <= alpha" and checks if "1 <= b < a" and returns (D or G) and (!D or !G), where D = Dark_Shadow(ab-1, b.alpha - a.beta), G = Gray_Shadow(b.x, beta, 0, b-1).

Implemented in CVCL::ArithTheoremProducer.

Referenced by CVCL::TheoryArith::normalizeProjectIneqs().

virtual Theorem CVCL::ArithProofRules::expandDarkShadow const Theorem darkShadow  )  [pure virtual]
 

DARK_SHADOW(t1, t2) ==> t1 <= t2.

Implemented in CVCL::ArithTheoremProducer.

Referenced by CVCL::TheoryArith::assertFact().

virtual Theorem CVCL::ArithProofRules::expandGrayShadow0 const Theorem g  )  [pure virtual]
 

GRAY_SHADOW(v, e, c, c) ==> v=e+c.

Implemented in CVCL::ArithTheoremProducer.

Referenced by CVCL::TheoryArith::assertFact().

virtual Theorem CVCL::ArithProofRules::splitGrayShadow const Theorem g  )  [pure virtual]
 

G(x, e, c1, c2) ==> (G1 or G2) and (!G1 or !G2).

Here G1 = G(x,e,c1,c), G2 = G(x,e,c+1,c2), and c = floor((c1+c2)/2).

Implemented in CVCL::ArithTheoremProducer.

Referenced by CVCL::TheoryArith::assertFact().

virtual Theorem CVCL::ArithProofRules::expandGrayShadow const Theorem g  )  [pure virtual]
 

G(x, e, c1, c2) ==> e+c1 <= x AND x <= e+c2.

Implemented in CVCL::ArithTheoremProducer.

Referenced by CVCL::TheoryArith::assertFact().

virtual Theorem CVCL::ArithProofRules::expandGrayShadowConst const Theorem g  )  [pure virtual]
 

Optimized rules: GRAY_SHADOW(a*x, c, c1, c2) ==> [expansion].

Implements three versions of the rule:

\[\frac{\mathrm{GRAY\_SHADOW}(ax,c,c1,c2)} {ax = c + i - \mathrm{sign}(i)\cdot j(c,i,a) \lor GRAY\_SHADOW(ax, c, i-\mathrm{sign}(i)\cdot (a+j(c,i,a)))}\]

where the conclusion may become FALSE or without the GRAY_SHADOW part, depending on the values of a, c and i.

Implemented in CVCL::ArithTheoremProducer.

virtual Theorem CVCL::ArithProofRules::grayShadowConst const Theorem g  )  [pure virtual]
 

|- G(ax, c, c1, c2) ==> |- G(x, 0, ceil((c1+c)/a), floor((c2+c)/a))

In the case the new c1 > c2, return |- FALSE

Implemented in CVCL::ArithTheoremProducer.

Referenced by CVCL::TheoryArith::assertFact().

virtual Theorem CVCL::ArithProofRules::lessThanToLE const Theorem less,
const Theorem isIntLHS,
const Theorem isIntRHS,
bool  changeRight
[pure virtual]
 

a,b: INT; a < b ==> a <= b-1 [or a+1 <= b]

Takes a Theorem(\alpha < \beta) and returns Theorem(\alpha < \beta <==> \alpha <= \beta -1) or Theorem(\alpha < \beta <==> \alpha + 1 <= \beta), depending on which side must be changed (changeRight flag)

Implemented in CVCL::ArithTheoremProducer.

Referenced by CVCL::TheoryArith::projectInequalities().

virtual Theorem CVCL::ArithProofRules::intVarEqnConst const Expr eqn,
const Theorem isIntx
[pure virtual]
 

Parameters:
eqn is an equation 0 = a.x or 0 = c + a.x, where x is integer
isIntx is a proof of IS_INTEGER(x)
Returns:
the theorem 0 = c + a.x <==> x=-c/a if -c/a is int else return the theorem 0 = c + a.x <==> false.
It also handles the special case of 0 = a.x <==> x = 0

Implemented in CVCL::ArithTheoremProducer.

Referenced by CVCL::TheoryArith::processSimpleIntEq().

virtual Theorem CVCL::ArithProofRules::eqElimIntRule const Theorem eqn,
const Theorem isIntx,
const std::vector< Theorem > &  isIntVars
[pure virtual]
 

Equality elimination rule for integers:

\[\frac{\mathsf{int}(a\cdot x)\quad \mathsf{int}(C+\sum_{i=1}^{n}a_{i}\cdot x_{i})} {a\cdot x=C+\sum_{i=1}^{n}a_{i}\cdot x_{i} \quad\equiv\quad x=t_{2}\wedge 0=t_{3}} \]

See the detailed description for explanations.

\[\frac{\Gamma\models ax=t\quad \Gamma'\models\mathsf{int}(x)\quad \{\Gamma_i\models\mathsf{int}(x_i) | x_i\mbox{ is var in }t\}} {\Gamma,\Gamma',\bigcup_i\Gamma_i\models \exists (y:\mathrm{int}).\ x=t_2(y)\wedge 0=t_3(y)} \]

See detailed docs for more information.

This rule implements a step in the iterative algorithm for eliminating integer equality. The terms in the rule are defined as follows:

\[\begin{array}{rcl} t & = & C+\sum_{i=1}^na_{i}\cdot x_{i}\\ t_{2}(y) & = & -(C\ \mathbf{mod}\ m+\sum_{i=1}^{n}(a_{i}\ \mathbf{mod}\ m) \cdot x_{i}-m\cdot y)\\ & & \\ t_{3}(y) & = & \mathbf{f}(C,m)+\sum_{i=1}^{n}\mathbf{f}(a_{i},m)\cdot x_{i} -a\cdot y\\ & & \\ m & = & a+1\\ & & \\ \mathbf{f}(i,m) & = & \left\lfloor \frac{i}{m} +\frac{1}{2}\right\rfloor +i\ \mathbf{mod}\ m\\ & & \\ i\ \mathbf{mod}\ m & = & i-m\left\lfloor\frac{i}{m} +\frac{1}{2}\right\rfloor \end{array} \]

All the variables and coefficients are integer, and a >= 2.

Parameters:
eqn is the equation ax=t:

\[a\cdot x = C + \sum_{i=1}^n a_i\cdot x_i.\]

isIntx is a Theorem deriving the integrality of the LHS variable: IS_INTEGER(x)
isIntVars is a vector of Theorems deriving the integrality of all variables on the RHS

Implemented in CVCL::ArithTheoremProducer.

Referenced by CVCL::TheoryArith::processSimpleIntEq().

virtual Theorem CVCL::ArithProofRules::isIntConst const Expr e  )  [pure virtual]
 

return e <=> TRUE/FALSE for e == IS_INTEGER(c), where c is a constant

Parameters:
e is a predicate IS_INTEGER(c) where c is a rational constant

Implemented in CVCL::ArithTheoremProducer.

virtual Theorem CVCL::ArithProofRules::equalLeaves1 const Theorem thm  )  [pure virtual]
 

Implemented in CVCL::ArithTheoremProducer.

virtual Theorem CVCL::ArithProofRules::equalLeaves2 const Theorem thm  )  [pure virtual]
 

Implemented in CVCL::ArithTheoremProducer.

virtual Theorem CVCL::ArithProofRules::equalLeaves3 const Theorem thm  )  [pure virtual]
 

Implemented in CVCL::ArithTheoremProducer.

virtual Theorem CVCL::ArithProofRules::equalLeaves4 const Theorem thm  )  [pure virtual]
 

Implemented in CVCL::ArithTheoremProducer.

virtual Theorem CVCL::ArithProofRules::diseqToIneq const Theorem diseq  )  [pure virtual]
 

x /= y ==> (x < y) OR (x > y)

Used in concrete model generation

Implemented in CVCL::ArithTheoremProducer.

Referenced by CVCL::TheoryArith::checkSat().


The documentation for this class was generated from the following file:
Generated on Thu Apr 13 16:57:46 2006 for CVC Lite by  doxygen 1.4.4