Result
unsignedModulus(vector<FixedBits*>& children, FixedBits& output);
-int bvOrF(int a, int b)
-{
- return a | b;
-}
-
-int bvXOrF(int a, int b)
-{
- return a ^ b;
-}
-
-int bvAndF(int a, int b)
-{
- return a &b;
-}
-
-int rightSF(int a, int b)
-{
- if (b >= sizeof(int)*8)
- return 0;
-
- return a>>b;
-}
-
-int leftSF(int a, int b)
-{
- if (b >= sizeof(int)*8)
- return 0;
-
- return a<<b;
-}
-
-int plusF(int a, int b)
-{
- return a+b;
-}
-
-int multiplyF(int a, int b)
-{
- return a*b;
-}
-
-int divideF(int a, int b)
-{
- if (b==0)
- return 1;
- return a/b;
-}
+int bvOrF(int a, int b);
+int bvXOrF(int a, int b);
+int bvAndF(int a, int b);
+int rightSF(int a, int b);
+int leftSF(int a, int b);
+int plusF(int a, int b);
+int multiplyF(int a, int b);
+int divideF(int a, int b);
+int subF(int a, int b);
+int eqF(int a, int b);
+int ltF(int a, int b);
+int remF(int a, int b);
-int subF(int a, int b)
-{
- return a-b;
-}
-
-int eqF(int a, int b)
-{
- return (a==b)? 1:0;
-}
-
-int ltF(int a, int b)
-{
- return (a<b)? 1:0;
-}
-
-int remF(int a, int b)
-{
- if (b ==0)
- return a;
- return (a %b);
-}
-
struct Functions
{
}
};
+
std::list<Function> l;
/*
Functions()
{
- //l.push_back(Function(BVSGE, "signed greater than equals", &bvSignedGreaterThanEqualsBothWays));
+ l.push_back(Function(BVSGE, "signed greater than equals", &bvSignedGreaterThanEqualsBothWays, NULL));
l.push_back(Function(BVLT, "unsigned less than", &bvLessThanBothWays, <F));
l.push_back(Function(EQ, "equals", &bvEqualsBothWays, &eqF));
l.push_back(Function(BVXOR, "bit-vector xor", &bvXorBothWays, &bvXOrF));
l.push_back(Function(BVAND, "bit-vector and", &bvAndBothWays, &bvAndF));
l.push_back(Function(BVRIGHTSHIFT, "right shift", &bvRightShiftBothWays, &rightSF));
l.push_back(Function(BVLEFTSHIFT, "left shift", &bvLeftShiftBothWays, &leftSF));
- //l.push_back(Function(BVSRSHIFT, "arithmetic shift", &bvArithmeticRightShiftBothWays));
+ l.push_back(Function(BVSRSHIFT, "arithmetic shift", &bvArithmeticRightShiftBothWays, NULL));
l.push_back(Function(BVPLUS, "addition", &bvAddBothWays, &plusF));
l.push_back(Function(BVSUB, "subtraction", &bvSubtractBothWays, &subF));
l.push_back(Function(BVMULT, "multiplication", &multiply, &multiplyF));
l.push_back(Function(BVDIV, "unsigned division", &unsignedDivide, ÷F));
l.push_back(Function(BVMOD, "unsigned remainder", &unsignedModulus, &remF));
- //l.push_back(Function(SBVDIV, "signed division", &signedDivide));
- //l.push_back(Function(SBVREM, "signed remainder",&signedRemainder ));
+ l.push_back(Function(SBVDIV, "signed division", &signedDivide, NULL));
+ l.push_back(Function(SBVREM, "signed remainder",&signedRemainder,NULL ));
}
{
BBAsProp bbP(k,mgr,bits);
+ bbP.numberClauses();
Relations relations(iterations, bits, k, mgr, prob);
// After unit propagation.
int clauseCount = 0;
- clauseCount = bbP.addToClauseCount();
+ clauseCount = bbP.fixedCount();
clause += clauseCount;
mgr = new STPMgr;
Cpp_interface interface(*mgr);
mgr->UserFlags.division_by_zero_returns_one_flag=true;
+ //mgr->UserFlags.set("simple-cnf","1");
out << "\\begin{subtables}" << endl;
- work(1);
- work(5);
+ //work(1);
+ // work(5);
work(50);
- work(95);
+ // work(95);
out << "\\end{subtables}" << endl;
out << "% Iterations:" << iterations << " bit-width:" << bits << endl;