Example #1
0
const size_t
V3SvrBoolector::setImplyIntersection(const V3SvrDataVec& Exps) {
   if (Exps.size() == 0) return 0;
   vector<size_t>::const_iterator it = Exps.begin(); assert (*it);
   BtorExp *aExp = (isNegFormula(*it) ? boolector_not(_Solver, getOriExp(*it)) : boolector_copy(_Solver, getOriExp(*it)));
   BtorExp *bExp, *oExp; ++it;
   for (; it != Exps.end(); ++it) {
      assert (*it); assert (aExp);
      bExp = (isNegFormula(*it) ? boolector_not(_Solver, getOriExp(*it)) : boolector_copy(_Solver, getOriExp(*it)));
      oExp = boolector_and(_Solver, aExp, bExp); assert (oExp);
      boolector_release(_Solver, aExp);
      boolector_release(_Solver, bExp);
      aExp = oExp;
   }
   bExp = boolector_var(_Solver, 1, NULL);
   oExp = boolector_implies(_Solver, bExp, aExp);
   boolector_assert(_Solver, oExp);
   boolector_release(_Solver, oExp);
   boolector_release(_Solver, aExp);
   
   assert (!isNegFormula(getPosExp(bExp)));
   assert (bExp); return getPosExp(bExp);
}