Package org.jakstab.solver

Examples of org.jakstab.solver.Solver.push()


        SignState post = new SignState(s);
        for (RTLVariable v : assumption.getUsedVariables()) {
          // Check if we can restrict this variable
          if (s.getValue(v).isTop()) {

            solver.push();
            RTLExpression f = ExpressionFactory.createLessOrEqual(v, ExpressionFactory.createNumber(0, v.getBitWidth()));
            solver.addAssertion(f);
            if (!solver.isSatisfiable()) {
              post.setValue(v, SignElement.POSITIVE);
              logger.debug("Restricting state from " + s + " through " + assumption + " to " + post);
View Full Code Here


            if (!solver.isSatisfiable()) {
              post.setValue(v, SignElement.POSITIVE);
              logger.debug("Restricting state from " + s + " through " + assumption + " to " + post);
            } else {
              solver.pop();
              solver.push();
              f = ExpressionFactory.createNot(ExpressionFactory.createEqual(v, ExpressionFactory.createNumber(0, v.getBitWidth())));
              solver.addAssertion(f);
              if (!solver.isSatisfiable()) {
                post.setValue(v, SignElement.ZERO);
                logger.debug("Restricting state from " + s + " through " + assumption + " to " + post);
View Full Code Here

              if (!solver.isSatisfiable()) {
                post.setValue(v, SignElement.ZERO);
                logger.debug("Restricting state from " + s + " through " + assumption + " to " + post);
              } else {
                solver.pop();
                solver.push();
                f = ExpressionFactory.createLessOrEqual(ExpressionFactory.createNumber(0, v.getBitWidth()), v);
                solver.addAssertion(f);
                if (!solver.isSatisfiable()) {
                  post.setValue(v, SignElement.NEGATIVE);
                  logger.debug("Restricting state from " + s + " through " + assumption + " to " + post);
View Full Code Here

         
          // Clear variable from predicate BDD
          setVariableDontCare(postPreds, predIdx);
         
          // check if the predicate holds or not
          solver.push();
          solver.addAssertion(ExpressionFactory.createNot(p));

          if (solver.isUnsatisfiable()) {
            postPreds.andWith(bddFactory.ithVar(predIdx));
          } else {
View Full Code Here

          if (solver.isUnsatisfiable()) {
            postPreds.andWith(bddFactory.ithVar(predIdx));
          } else {
            // Now check whether the negative of the predicate holds
            solver.pop();
            solver.push();
            solver.addAssertion(p);
            if (solver.isUnsatisfiable()) {
              postPreds.andWith(bddFactory.nithVar(predIdx));
            }
          }
View Full Code Here

        BDD postPreds = s.predicates.id();

        for (int predIdx = 0; predIdx <= PredicateMap.getMaxIndex(); predIdx++) {
          RTLExpression p = PredicateMap.getPredicate(predIdx);
          // check if the predicate holds or not
          solver.push();
          solver.addAssertion(ExpressionFactory.createNot(p));
          if (solver.isUnsatisfiable()) {
            setVariableDontCare(postPreds, predIdx);
            postPreds.andWith(bddFactory.ithVar(predIdx));
          } else {
View Full Code Here

            setVariableDontCare(postPreds, predIdx);
            postPreds.andWith(bddFactory.ithVar(predIdx));
          } else {
            // Now check whether the negative of the predicate holds
            solver.pop();
            solver.push();
            solver.addAssertion(p);
            if (solver.isUnsatisfiable()) {
              setVariableDontCare(postPreds, predIdx);
              postPreds.andWith(bddFactory.nithVar(predIdx));
            }
View Full Code Here

TOP
Copyright © 2018 www.massapi.com. All rights reserved.
All source code are property of their respective owners. Java is a trademark of Sun Microsystems, Inc and owned by ORACLE Inc. Contact coftware#gmail.com.