Examples of BDD


Examples of eas.math.fundamentalAlgorithms.graphBased.algorithms.bdd.BDD

        LinkedList<RepresentableAsGraph> list = new LinkedList<RepresentableAsGraph>();
        list.add(new FSM());
        list.add(new PDA());
        list.add(new Turing());
        list.add(new Grammar());
        list.add(new BDD());
        list.add(new Huffman());
        list.add(new PlainDOT());
        list.add(new PatTree());
        list.add(new MARB());
        list.add(new RedBlackTree());
View Full Code Here

Examples of net.sf.javabdd.BDD

    }


    public static FeatureExpr translate(PresenceConditionManager.PresenceCondition pc) {

        BDD bdd = pc.getBDD();

        List allsat;
        boolean firstTerm;

        if (bdd.isOne())
            return FeatureExprLib.True();
        if (bdd.isZero()) return FeatureExprLib.False();

        allsat = (List) bdd.allsat();

        FeatureExpr result = FeatureExprLib.False();

        firstTerm = true;
        for (Object o : allsat) {
View Full Code Here

Examples of net.sf.javabdd.BDD

        return fallThroughState();
      }

      @Override
      public Set<AbstractState> visit(RTLVariableAssignment stmt) {
        BDD postPreds = s.predicates.id();
        Writable lhs = stmt.getLeftHandSide();

        RTLExpression xprime = ExpressionFactory.createVariable("xprime" + lhs.getBitWidth(), lhs.getBitWidth());

        Context subCtx = new Context();
        subCtx.substitute(lhs, xprime);

        Solver solver = Solver.createSolver();
        RTLExpression stateFormula = s.getStateFormula(prec);
        solver.addAssertion(stateFormula);
        solver.addAssertion(ExpressionFactory.createEqual(xprime,
            stmt.getRightHandSide()));
       
        for (int predIdx = 0; predIdx <= PredicateMap.getMaxIndex(); predIdx++) {
          RTLExpression p = PredicateMap.getPredicate(predIdx);
          if (!p.getUsedVariables().contains(lhs))
            continue;
          // substitute x by xprime
          p = p.evaluate(subCtx);
         
          // 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 {
            // Now check whether the negative of the predicate holds
            solver.pop();
            solver.push();
            solver.addAssertion(p);
            if (solver.isUnsatisfiable()) {
              postPreds.andWith(bddFactory.nithVar(predIdx));
            }
          }
          // nothing for don't know, the predicate is already cleared from the BDD

          solver.pop();
        }

        return Collections.singleton((AbstractState)new PredicateAbstractionState(postPreds));
      }
     
      @Override
      public Set<AbstractState> visit(RTLMemoryAssignment stmt) {
        // Memory assignments not supported
        return fallThroughState();
      }

      @Override
      public Set<AbstractState> visit(RTLAssume stmt) {
        Solver solver = Solver.createSolver();
        solver.addAssertion(s.getStateFormula(prec));
        solver.addAssertion(stmt.getAssumption());
        if (solver.isUnsatisfiable())
          return Collections.emptySet();

        // OK? was empty in old impl
        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 {
            // 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));
            }
          }
          solver.pop();
        }
       
View Full Code Here

Examples of net.sf.javabdd.BDD

  public boolean stop(AbstractState s, ReachedSet reached, Precision precision) {
    return CPAOperators.stopSep(s, reached, precision);
  }

  private BDD setVariableDontCare(BDD bdd, int i) {
    BDD pos = bdd.restrict(bddFactory.ithVar(i));
    bdd.restrictWith(bddFactory.nithVar(i));
    bdd.orWith(pos);
    return bdd;
  }
View Full Code Here

Examples of net.sf.javabdd.BDD

    throw new UnsupportedOperationException(this.getClass().getSimpleName() + " does not contain location information.");
  }

  @Override
  public AbstractState join(LatticeElement l) {
    BDD join = predicates.or(((PredicateAbstractionState)l).predicates);
    return new PredicateAbstractionState(join);
  }
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.