bool quick_statistics_flag;
+ bool tseitin_are_decision_variables_flag;
+
//CONSTRUCTOR
UserDefinedFlags()
{
division_by_zero_returns_one_flag = false;
quick_statistics_flag=false;
+
+ tseitin_are_decision_variables_flag=true;
} //End of constructor for UserDefinedFlags
}; //End of struct UserDefinedFlags
{
// For some unexplained reason, XORs are faster than converting
// them to cluases at this point
- ASTNode S0 = _bm->CreateSimpForm(XOR,
- _bm->CreateSimpForm(XOR, xi, yi),
- cin);
+ ASTNode S0 = _bm->CreateSimpForm(XOR,
+ _bm->CreateSimpForm(XOR, xi, yi),
+ cin);
return S0;
// ASTNode S1 = _bm->CreateSimpForm(OR,xi,yi,cin);
// ASTNode S2 = _bm->CreateSimpForm(OR,
namespace BEEV
{
- /* FUNCTION: lookup or create a new MINISAT literal
- * lookup or create new MINISAT Vars from the global MAP
- * _ASTNode_to_SATVar.
- */
+
+bool isTseitinVariable(const ASTNode& n) {
+ if (n.GetKind() == SYMBOL && n.GetType() == BOOLEAN_TYPE) {
+ const char * zz = n.GetName();
+ //if the variables ARE cnf variables then dont make them
+ // decision variables.
+ if (0 == strncmp("cnf", zz, 3))
+ {
+ return true;
+ }
+ }
+ return false;
+}
+
+ /* FUNCTION: lookup or create a new MINISAT literal
+ * lookup or create new MINISAT Vars from the global MAP
+ * _ASTNode_to_SATVar.
+ */
+
MINISAT::Var
ToSAT::LookupOrCreateSATVar(MINISAT::Solver& newS, const ASTNode& n)
{
//by 1 each time it is called, and the initial value of a
//MINISAT::Var is 0.
_SATVar_to_AST_Vector.push_back(n);
- }
+
+ // experimental. Don't add Tseitin variables as decision variables.
+ if (!bm->UserFlags.tseitin_are_decision_variables_flag && isTseitinVariable(n))
+ {
+ newS.setDecisionVar(v,false);
+ }
+
+ }
else
v = it->second;
return v;
float percentage=CLAUSAL_ABSTRACTION_CUTOFF;
if(count++ >= input_clauselist_size*percentage)
{
- //Arbitrary adding only 60% of the clauses in the hopes of
+ //Arbitrary adding only 60% of the clauses in the hopes of
//terminating early
// cout << "Percentage clauses added: "
// << percentage << endl;
} // End of For-loop adding the clauses
bm->GetRunTimes()->stop(RunTimes::SendingToSAT);
- //cout << "Added remaining clauses\n";
bm->GetRunTimes()->start(RunTimes::Solving);
newS.solve();
bm->GetRunTimes()->stop(RunTimes::Solving);