#include <bitvector_proof_rules.h>
Inheritance diagram for CVC3::BitvectorProofRules:
Definition at line 33 of file bitvector_proof_rules.h.
virtual CVC3::BitvectorProofRules::~BitvectorProofRules | ( | ) | [inline, virtual] |
Definition at line 36 of file bitvector_proof_rules.h.
virtual Theorem CVC3::BitvectorProofRules::bitvectorFalseRule | ( | const Theorem & | thm | ) | [pure virtual] |
thm | input theorem: (e1[i]<=>e2[i])<=>false |
Implemented in CVC3::BitvectorTheoremProducer.
Referenced by CVC3::TheoryBitvector::bitBlastEqn().
thm | input theorem: (~e1[i]<=>e2[i])<=>true |
Implemented in CVC3::BitvectorTheoremProducer.
Referenced by CVC3::TheoryBitvector::bitBlastDisEqn().
virtual Theorem CVC3::BitvectorProofRules::bitBlastEqnRule | ( | const Expr & | e, | |
const Expr & | f | |||
) | [pure virtual] |
t1=t2 ==> AND_i(t1[i:i] = t2[i:i])
e | is a Expr(t1=t2) | |
f | is the resulting expression AND_i(t1[i:i] = t2[i:i]) is passed to the rule for efficiency. |
Implemented in CVC3::BitvectorTheoremProducer.
Referenced by CVC3::TheoryBitvector::bitBlastEqn().
virtual Theorem CVC3::BitvectorProofRules::bitBlastDisEqnRule | ( | const Theorem & | e, | |
const Expr & | f | |||
) | [pure virtual] |
t1/=t2 ==> OR_i(NOT t1[i]<=>t2[i])
e | is a Theorem(t1/=t2) | |
f | is the resulting expression OR_i(NOT t1[i]<=>t2[i]), passed to the rule for efficiency. |
Implemented in CVC3::BitvectorTheoremProducer.
Referenced by CVC3::TheoryBitvector::bitBlastDisEqn().
sign extend the input SX(e) appropriately
Implemented in CVC3::BitvectorTheoremProducer.
Referenced by CVC3::TheoryBitvector::rewriteBV(), and CVC3::TheoryBitvector::signExtendBVLT().
Pad the kids of BVLT/BVLE to make their length equal.
Implemented in CVC3::BitvectorTheoremProducer.
Referenced by CVC3::TheoryBitvector::bitBlastIneqn(), and CVC3::TheoryBitvector::rewriteBV().
Sign Extend the kids of BVSLT/BVSLE to make their length equal.
Implemented in CVC3::BitvectorTheoremProducer.
Referenced by CVC3::TheoryBitvector::signExtendBVLT().
virtual Theorem CVC3::BitvectorProofRules::signBVLTRule | ( | const Expr & | e, | |
const Theorem & | topBit0, | |||
const Theorem & | topBit1 | |||
) | [pure virtual] |
input: e0 <=(s) e1. output depends on whether the topbits(MSB) of e0 and e1 are constants. If they are constants then optimizations are done, otherwise the following rule is implemented.
e0 <=(s) e1 <==> (e0[n-1] AND NOT e1[n-1]) OR (e0[n-1] AND e1[n-1] AND e1[n-2:0] <= e0[n-2:0]) OR (NOT e0[n-1] AND NOT e1[n-1] AND e0[n-2:0] <= e1[n-2:0])
Implemented in CVC3::BitvectorTheoremProducer.
Referenced by CVC3::TheoryBitvector::rewriteBV().
NOT(e[0][0] < e[0][1]) <==> (e[0][1] <= e[0][0]), NOT(e[0][0] <= e[0][1]) <==> (e[0][1] < e[0][0])
Implemented in CVC3::BitvectorTheoremProducer.
virtual Theorem CVC3::BitvectorProofRules::lhsEqRhsIneqn | ( | const Expr & | e, | |
int | kind | |||
) | [pure virtual] |
if(lhs==rhs) then we have (lhs < rhs <==> false),(lhs <= rhs <==> true)
Implemented in CVC3::BitvectorTheoremProducer.
Referenced by CVC3::TheoryBitvector::bitBlastIneqn(), and CVC3::TheoryBitvector::rewriteBV().
Implemented in CVC3::BitvectorTheoremProducer.
Referenced by CVC3::TheoryBitvector::bitBlastIneqn(), and CVC3::TheoryBitvector::rewriteBV().
virtual Theorem CVC3::BitvectorProofRules::generalIneqn | ( | const Expr & | e, | |
const Theorem & | e0, | |||
const Theorem & | e1, | |||
int | kind | |||
) | [pure virtual] |
Implemented in CVC3::BitvectorTheoremProducer.
Referenced by CVC3::TheoryBitvector::bitBlastIneqn().
virtual Theorem CVC3::BitvectorProofRules::bitExtractToExtract | ( | const Theorem & | thm | ) | [pure virtual] |
t[i] ==> t[i:i] = 0bin1 or NOT t[i] ==> t[i:i] = 0bin0
Implemented in CVC3::BitvectorTheoremProducer.
t[i] <=> t[i:i][0] (to use rewriter for simplifying t[i:i])
Implemented in CVC3::BitvectorTheoremProducer.
Referenced by CVC3::TheoryBitvector::rewriteBV().
virtual Theorem CVC3::BitvectorProofRules::bitExtractConstant | ( | const Expr & | x, | |
int | i | |||
) | [pure virtual] |
x | is bitvector constant | |
i | is extracted bitposition |
, if bitposition has a 1;
, if the bitposition has a 0
Implemented in CVC3::BitvectorTheoremProducer.
Referenced by CVC3::TheoryBitvector::bitBlastTerm(), CVC3::TheoryBitvector::rewriteBV(), and CVC3::TheoryBitvector::rewriteConst().
virtual Theorem CVC3::BitvectorProofRules::bitExtractConcatenation | ( | const Expr & | x, | |
int | i | |||
) | [pure virtual] |
x | is bitvector binary concatenation | |
i | is extracted bitposition |
, where
, another case of boolextract over concatenation is:
, where
Implemented in CVC3::BitvectorTheoremProducer.
Referenced by CVC3::TheoryBitvector::bitBlastTerm().
virtual Theorem CVC3::BitvectorProofRules::bitExtractConstBVMult | ( | const Expr & | t, | |
int | i | |||
) | [pure virtual] |
t | is bitvector binary BVMULT. x[0] must be BVCONST | |
i | is extracted bitposition |
Implemented in CVC3::BitvectorTheoremProducer.
Referenced by CVC3::TheoryBitvector::bitBlastTerm().
virtual Theorem CVC3::BitvectorProofRules::bitExtractBVMult | ( | const Expr & | t, | |
int | i | |||
) | [pure virtual] |
t | : input1 is bitvector binary BVMULT. t[0] must not be BVCONST | |
i | : input2 is extracted bitposition |
Implemented in CVC3::BitvectorTheoremProducer.
Referenced by CVC3::TheoryBitvector::bitBlastTerm().
virtual Theorem CVC3::BitvectorProofRules::bitExtractExtraction | ( | const Expr & | x, | |
int | i | |||
) | [pure virtual] |
x | is bitvector extraction e[k:j] | |
i | is extracted bitposition |
, where
Implemented in CVC3::BitvectorTheoremProducer.
Referenced by CVC3::TheoryBitvector::bitBlastTerm().
virtual Theorem CVC3::BitvectorProofRules::bitExtractBVPlus | ( | const std::vector< Theorem > & | t1, | |
const std::vector< Theorem > & | t2, | |||
const Expr & | bvPlusTerm, | |||
int | i | |||
) | [pure virtual] |
t1 | is vector of bitblasts of t, from bit i-1 to 0 | |
t2 | is vector of bitblasts of q, from bit i-1 to 0 | |
bvPlusTerm | is BVPLUS term: BVPLUS(n,t,q) | |
i | is extracted bitposition |
, when
, we have
, where c(t,q,i) is the carry generated by the addition of bits from 0 to i-1
Implemented in CVC3::BitvectorTheoremProducer.
Referenced by CVC3::TheoryBitvector::bitBlastTerm().
virtual Theorem CVC3::BitvectorProofRules::bitExtractBVPlusPreComputed | ( | const Theorem & | t1_i, | |
const Theorem & | t2_i, | |||
const Expr & | bvPlusTerm, | |||
int | bitPos, | |||
int | precomputed | |||
) | [pure virtual] |
Implemented in CVC3::BitvectorTheoremProducer.
virtual Theorem CVC3::BitvectorProofRules::bvPlusAssociativityRule | ( | const Expr & | bvPlusTerm | ) | [pure virtual] |
bvPlusTerm | : input1 is bvPlusTerm, a BVPLUS term with arity > 2 |
Implemented in CVC3::BitvectorTheoremProducer.
Referenced by CVC3::TheoryBitvector::bitBlastTerm().
x | : input1 is bitwise NEGATION | |
i | : input2 is extracted bitposition |
Implemented in CVC3::BitvectorTheoremProducer.
Referenced by CVC3::TheoryBitvector::bitBlastTerm().
x | : input1 is bitwise AND | |
i | : input2 is extracted bitposition |
Implemented in CVC3::BitvectorTheoremProducer.
Referenced by CVC3::TheoryBitvector::bitBlastTerm().
x | : input1 is bitwise OR | |
i | : input2 is extracted bitposition |
Implemented in CVC3::BitvectorTheoremProducer.
Referenced by CVC3::TheoryBitvector::bitBlastTerm().
virtual Theorem CVC3::BitvectorProofRules::bitExtractFixedLeftShift | ( | const Expr & | x, | |
int | i | |||
) | [pure virtual] |
x | : input1 is bitvector FIXED SHIFT
| |
i | : input2 is extracted bitposition |
, if 0 <= i < k. however, if k <= i < n then, result is
Implemented in CVC3::BitvectorTheoremProducer.
Referenced by CVC3::TheoryBitvector::bitBlastTerm().
virtual Theorem CVC3::BitvectorProofRules::bitExtractFixedRightShift | ( | const Expr & | x, | |
int | i | |||
) | [pure virtual] |
Implemented in CVC3::BitvectorTheoremProducer.
e | : input1 is bitvector term | |
r | : input2 is extracted bitposition |
Implemented in CVC3::BitvectorTheoremProducer.
Referenced by CVC3::TheoryBitvector::bitBlastTerm().
virtual Theorem CVC3::BitvectorProofRules::bitExtractSXRule | ( | const Expr & | e, | |
int | i | |||
) | [pure virtual] |
Implemented in CVC3::BitvectorTheoremProducer.
c1=c2 <=> TRUE/FALSE (equality of constant bitvectors)
Implemented in CVC3::BitvectorTheoremProducer.
Referenced by CVC3::TheoryBitvector::rewriteBV(), CVC3::TheoryBitvector::rewriteConst(), and CVC3::TheoryBitvector::solve().
|- c1=c2 ==> |- AND(c1[i:i] = c2[i:i]) - expanding equalities into bits
Implemented in CVC3::BitvectorTheoremProducer.
t<<n = c @ 0bin00...00, takes e == (t<<n)
Implemented in CVC3::BitvectorTheoremProducer.
Referenced by CVC3::TheoryBitvector::rewriteBV(), and CVC3::TheoryBitvector::simplifyOp().
virtual Theorem CVC3::BitvectorProofRules::constWidthLeftShiftToConcat | ( | const Expr & | e | ) | [pure virtual] |
t<<n = c @ 0bin00...00, takes e == (t<<n)
Implemented in CVC3::BitvectorTheoremProducer.
Referenced by CVC3::TheoryBitvector::rewriteBV(), and CVC3::TheoryBitvector::simplifyOp().
t>>m = 0bin00...00 @ t[bvlength-1:m], takes e == (t>>n)
Implemented in CVC3::BitvectorTheoremProducer.
Referenced by CVC3::TheoryBitvector::rewriteBV(), and CVC3::TheoryBitvector::simplifyOp().
a XOR b <=> (a & ~b) | (~a & b)
Implemented in CVC3::BitvectorTheoremProducer.
Referenced by CVC3::TheoryBitvector::rewriteBV().
a XNOR b <=> (~a & ~b) | (a & b)
Implemented in CVC3::BitvectorTheoremProducer.
Referenced by CVC3::TheoryBitvector::rewriteBV().
a NAND b <=> ~(a & b)
Implemented in CVC3::BitvectorTheoremProducer.
Referenced by CVC3::TheoryBitvector::rewriteBV().
a NOR b <=> ~(a | b)
Implemented in CVC3::BitvectorTheoremProducer.
Referenced by CVC3::TheoryBitvector::rewriteBV().
a - b <=> a + (-b)
Implemented in CVC3::BitvectorTheoremProducer.
Referenced by CVC3::TheoryBitvector::rewriteBV().
k*t = BVPLUS(n, <sum of shifts of t>) -- translation of k*t to BVPLUS
If k = 2^m, return k*t = t@0...0
Implemented in CVC3::BitvectorTheoremProducer.
0bin0...0 @ BVPLUS(n, args) = BVPLUS(n+k, args)
provided that m+ceil(log2(l)) <= n, where k is the size of the 0bin0...0, m is the max. length of each argument, and l is the number of arguments.
Implemented in CVC3::BitvectorTheoremProducer.
Referenced by CVC3::TheoryBitvector::normalizeConcat(), and CVC3::TheoryBitvector::simplifyOp().
Implemented in CVC3::BitvectorTheoremProducer.
Referenced by CVC3::TheoryBitvector::normalizeBVArith().
Implemented in CVC3::BitvectorTheoremProducer.
Referenced by CVC3::TheoryBitvector::normalizeBVArith().
Implemented in CVC3::BitvectorTheoremProducer.
Referenced by CVC3::TheoryBitvector::normalizeBVArith().
Make args the same length as the result (zero-extend).
Implemented in CVC3::BitvectorTheoremProducer.
Referenced by CVC3::TheoryBitvector::normalizeBVArith(), and CVC3::TheoryBitvector::normalizeConcat().
Make args the same length as the result (zero-extend).
Implemented in CVC3::BitvectorTheoremProducer.
Referenced by CVC3::TheoryBitvector::normalizeBVArith().
Implemented in CVC3::BitvectorTheoremProducer.
Referenced by CVC3::TheoryBitvector::normalizeBVArith().
Implemented in CVC3::BitvectorTheoremProducer.
Implemented in CVC3::BitvectorTheoremProducer.
Referenced by CVC3::TheoryBitvector::normalizeBVArith().
Implemented in CVC3::BitvectorTheoremProducer.
Referenced by CVC3::TheoryBitvector::flattenBVPlus().
Implemented in CVC3::BitvectorTheoremProducer.
Referenced by CVC3::TheoryBitvector::normalizeBVArith().
(x *[n] y)[m:k] = (x *[m+1] y)[m:k], where m < n
Implemented in CVC3::BitvectorTheoremProducer.
Referenced by CVC3::TheoryBitvector::normalizeConcat(), and CVC3::TheoryBitvector::simplifyOp().
(x +[n] y)[m:k] = (x +[m+1] y)[m:k], where m < n
Implemented in CVC3::BitvectorTheoremProducer.
Referenced by CVC3::TheoryBitvector::normalizeConcat(), and CVC3::TheoryBitvector::simplifyOp().
Implemented in CVC3::BitvectorTheoremProducer.
Implemented in CVC3::BitvectorTheoremProducer.
Implemented in CVC3::BitvectorTheoremProducer.
Implemented in CVC3::BitvectorTheoremProducer.
Implemented in CVC3::BitvectorTheoremProducer.
-t <==> ~t+1
Implemented in CVC3::BitvectorTheoremProducer.
Referenced by CVC3::TheoryBitvector::normalizeBVArith().
c1[i:j] = c (extraction from a constant bitvector)
Implemented in CVC3::BitvectorTheoremProducer.
Referenced by CVC3::TheoryBitvector::normalizeConcat(), and CVC3::TheoryBitvector::rewriteConst().
t[n-1:0] = t for n-bit t
Implemented in CVC3::BitvectorTheoremProducer.
Referenced by CVC3::TheoryBitvector::normalizeConcat().
t[i:j][k:l] = t[k+j:l+j] (eliminate double extraction)
Implemented in CVC3::BitvectorTheoremProducer.
Referenced by CVC3::TheoryBitvector::normalizeConcat().
(t1 @ t2)[i:j] = t1[...] @ t2[...] (push extraction through concat)
Implemented in CVC3::BitvectorTheoremProducer.
Referenced by CVC3::TheoryBitvector::normalizeConcat().
(t1 & t2)[i:j] = t1[i:j] & t2[i:j] (push extraction through OR)
Implemented in CVC3::BitvectorTheoremProducer.
Referenced by CVC3::TheoryBitvector::normalizeConcat().
(t1 | t2)[i:j] = t1[i:j] | t2[i:j] (push extraction through AND)
Implemented in CVC3::BitvectorTheoremProducer.
Referenced by CVC3::TheoryBitvector::normalizeConcat().
(~t)[i:j] = ~(t[i:j]) (push extraction through NEG)
Implemented in CVC3::BitvectorTheoremProducer.
Referenced by CVC3::TheoryBitvector::normalizeConcat().
virtual Theorem CVC3::BitvectorProofRules::extractBitwise | ( | const Expr & | e, | |
int | kind, | |||
const std::string & | name | |||
) | [pure virtual] |
Auxiliary function: (t1 op t2)[i:j] = t1[i:j] op t2[i:j].
Implemented in CVC3::BitvectorTheoremProducer.
Referenced by CVC3::TheoryBitvector::normalizeConcat().
~c1 = c (bit-wise negation of a constant bitvector)
Implemented in CVC3::BitvectorTheoremProducer.
Referenced by CVC3::TheoryBitvector::normalizeConcat(), CVC3::TheoryBitvector::pushNegationRec(), and CVC3::TheoryBitvector::rewriteConst().
~(t1@...@tn) = (~t1)@...@(~tn) -- push negation through concat
Implemented in CVC3::BitvectorTheoremProducer.
Referenced by CVC3::TheoryBitvector::normalizeConcat(), and CVC3::TheoryBitvector::pushNegationRec().
~(~t) = t -- eliminate double negation
Implemented in CVC3::BitvectorTheoremProducer.
Referenced by CVC3::TheoryBitvector::normalizeConcat(), and CVC3::TheoryBitvector::pushNegationRec().
~(t1 & t2) <=> ~t1 | ~t2 -- DeMorgan's Laws
Implemented in CVC3::BitvectorTheoremProducer.
Referenced by CVC3::TheoryBitvector::pushNegationRec().
~(t1 | t2) <=> ~t1 & ~t2 -- DeMorgan's Laws
Implemented in CVC3::BitvectorTheoremProducer.
Referenced by CVC3::TheoryBitvector::pushNegationRec().
~(t1 xor t2) = ~t1 xor t2
Implemented in CVC3::BitvectorTheoremProducer.
Referenced by CVC3::TheoryBitvector::pushNegationRec().
~(t1 xnor t2) = t1 xor t2
Implemented in CVC3::BitvectorTheoremProducer.
Referenced by CVC3::TheoryBitvector::pushNegationRec().
virtual Theorem CVC3::BitvectorProofRules::andConst | ( | const Expr & | e, | |
const std::vector< int > & | idxs | |||
) | [pure virtual] |
c1&c2&t = c&t -- compute bit-wise AND of constant bitvector arguments
e | is the bit-wise AND expression; | |
idxs | are the indices of the constant bitvectors. There must be at least constant expressions in this rule. |
Implemented in CVC3::BitvectorTheoremProducer.
Referenced by CVC3::TheoryBitvector::normalizeConcat(), and CVC3::TheoryBitvector::rewriteConst().
0bin0...0 & t = 0bin0...0 -- bit-wise AND with zero bitvector
e | is the bit-wise AND expr | |
idx | is the index of the zero bitvector |
Implemented in CVC3::BitvectorTheoremProducer.
Referenced by CVC3::TheoryBitvector::normalizeConcat().
virtual Theorem CVC3::BitvectorProofRules::andOne | ( | const Expr & | e, | |
const std::vector< int > | idxs | |||
) | [pure virtual] |
0bin1...1 & t = t -- bit-wise AND with bitvector of 1's
e | is the bit-wise AND expr | |
idxs | is a vector of indices of the bitvectors of 1's which will be dropped |
Implemented in CVC3::BitvectorTheoremProducer.
Referenced by CVC3::TheoryBitvector::normalizeConcat().
... & (t1@...@tk) & ... = (...& t1 &...)@...@(...& tk &...)
Lifts concatenation to the top of bit-wise AND. Takes the bit-wise AND expression 'e' and the index 'i' of the concatenation.
Implemented in CVC3::BitvectorTheoremProducer.
Referenced by CVC3::TheoryBitvector::normalizeConcat().
(t1 & (t2 & t3) & t4) = t1 & t2 & t3 & t4 -- flatten bit-wise AND
Also reorders the terms according to a fixed total ordering
Implemented in CVC3::BitvectorTheoremProducer.
Referenced by CVC3::TheoryBitvector::normalizeConcat().
virtual Theorem CVC3::BitvectorProofRules::orConst | ( | const Expr & | e, | |
const std::vector< int > & | idxs | |||
) | [pure virtual] |
c1|c2|t = c|t -- compute bit-wise OR of constant bitvector arguments
e | is the bit-wise OR expression; | |
idxs | are the indices of the constant bitvectors. There must be at least constant expressions in this rule. |
Implemented in CVC3::BitvectorTheoremProducer.
Referenced by CVC3::TheoryBitvector::normalizeConcat(), and CVC3::TheoryBitvector::rewriteConst().
0bin1...1 | t = 0bin1...1 -- bit-wise OR with bitvector of 1's
e | is the bit-wise OR expr | |
idx | is the index of the bitvector of 1's |
Implemented in CVC3::BitvectorTheoremProducer.
Referenced by CVC3::TheoryBitvector::normalizeConcat().
virtual Theorem CVC3::BitvectorProofRules::orZero | ( | const Expr & | e, | |
const std::vector< int > | idxs | |||
) | [pure virtual] |
0bin0...0 | t = t -- bit-wise OR with bitvector of 0's
e | is the bit-wise OR expr | |
idxs | is a vector of indices of the bitvectors of 0's which will be dropped |
Implemented in CVC3::BitvectorTheoremProducer.
Referenced by CVC3::TheoryBitvector::normalizeConcat().
... | (t1@...@tk) | ... = (...| t1 |...)@...@(...| tk |...)
Lifts concatenation to the top of bit-wise OR. Takes the bit-wise OR expression 'e' and the index 'i' of the concatenation.
Implemented in CVC3::BitvectorTheoremProducer.
Referenced by CVC3::TheoryBitvector::normalizeConcat().
(t1 | (t2 | t3) | t4) = t1 | t2 | t3 | t4 -- flatten bit-wise OR
Also reorders the terms according to a fixed total ordering
Implemented in CVC3::BitvectorTheoremProducer.
Referenced by CVC3::TheoryBitvector::normalizeConcat().
c1@c2@...@cn = c (concatenation of constant bitvectors)
Implemented in CVC3::BitvectorTheoremProducer.
Referenced by CVC3::TheoryBitvector::normalizeConcat(), and CVC3::TheoryBitvector::rewriteConst().
Flatten one level of nested concatenation, e.g.: x@(y@z)@w = x@y@z@w.
Implemented in CVC3::BitvectorTheoremProducer.
Referenced by CVC3::TheoryBitvector::normalizeConcat().
Merge n-ary concat. of adjacent extractions: x[15:8]@x[7:0] = x[15:0].
Implemented in CVC3::BitvectorTheoremProducer.
Referenced by CVC3::TheoryBitvector::normalizeConcat().
BVPLUS(n, c1,c2,...,cn) = c (bit-vector plus of constant bitvectors).
Implemented in CVC3::BitvectorTheoremProducer.
Referenced by CVC3::TheoryBitvector::rewriteConst().
n*c1 = c, where n >= 0 (multiplication of a constant bitvector by a non-negative constant)
Implemented in CVC3::BitvectorTheoremProducer.
Referenced by CVC3::TheoryBitvector::normalizeBVArith(), and CVC3::TheoryBitvector::rewriteConst().
Expand the type predicate wrapper (compute the actual type predicate).
Implemented in CVC3::BitvectorTheoremProducer.