Package kodkod.engine.satlab

Examples of kodkod.engine.satlab.Clause


        final IntSet varReachable = new IntBitSet(var+1);
        varReachable.add(var);
        hits.put(var, varReachable);
      }
      for(Iterator<Clause> clauseItr = trace.reverseIterator(trace.axioms()); clauseItr.hasNext();) {
        final Clause clause = clauseItr.next();
        final int maxVar = clause.maxVariable();
        for(IntSet reachableVars : hits.values()) {
          if (reachableVars.contains(maxVar)) {
            for(IntIterator lits = clause.literals(); lits.hasNext(); ) {
              reachableVars.add(StrictMath.abs(lits.next()));
            }
          }
        }
      }
    }
   
    final long[] counts = new long[hits.size()];
   
    for(Iterator<Clause> clauseItr = trace.iterator(trace.core()); clauseItr.hasNext(); ) {
      final Clause clause = clauseItr.next();
      final int maxVar = clause.maxVariable();
      int i = 0;
      for(IntSet reachableVars : hits.values()) {
        if (reachableVars.contains(maxVar)) {
          counts[i]++;
        }
View Full Code Here


  public IntSet next(ResolutionTrace trace) {
    if (topVars.isEmpty()) return Ints.EMPTY_SET; // tried everything
    final IntSet core = trace.core();
   
    for(Iterator<Clause> iter = trace.iterator(core); iter.hasNext();) {
      Clause clause = iter.next();
      int maxVar = clause.maxVariable();
      if (topVars.remove(maxVar)) {
        // get all core clauses with the given maximum variable
        IntSet exclude = coreClausesWithMaxVar(trace, maxVar);
        assert !exclude.isEmpty();
        //  get all clauses reachable from the conflict clause
View Full Code Here

    final IntSet core = trace.core();
    final IntSet restricted = new IntBitSet(core.max()+1);
    final Iterator<Clause> clauses = trace.iterator(core);
    final IntIterator indices = core.iterator();
    while(clauses.hasNext()) {
      Clause clause = clauses.next();
      int index = indices.next();
      if (clause.maxVariable()==maxVariable)
        restricted.add(index);
    }
    return restricted;
  }
View Full Code Here

  public static IntSet coreVars(ResolutionTrace trace) {

    final IntSet posVars = new IntTreeSet(), negVars = new IntTreeSet();
   
    for(Iterator<Clause> iter = trace.iterator(trace.core()); iter.hasNext();) {
      Clause clause = iter.next();
      for(IntIterator lits = clause.literals(); lits.hasNext(); ) {
        int lit = lits.next();
        if (lit > 0) posVars.add(lit);
        else negVars.add(-lit);
      }
    }
View Full Code Here

   */
  public static IntSet coreUnits(ResolutionTrace trace) {
    final IntSet units = new IntTreeSet();
   
    for(Iterator<Clause> itr = trace.reverseIterator(trace.core()); itr.hasNext(); ) {  
      Clause c = itr.next();
      if (c.size()==1) {
        units.add(c.maxVariable());
      }
    }
   
    if (units.isEmpty()) return Ints.EMPTY_SET;
   
View Full Code Here

   */
  static IntSet coreTailUnits(ResolutionTrace trace) {
    final IntSet units = new IntTreeSet();
   
    for(Iterator<Clause> itr = trace.reverseIterator(trace.core()); itr.hasNext(); ) {  
      Clause c = itr.next();
      if (c.size()==1) {
        units.add(c.maxVariable());
      } else {
        break;
      }
    }
   
View Full Code Here

    final IntSet relevantAxioms = new IntBitSet(axioms.size());
   
    final Iterator<Clause> itr = trace.reverseIterator(axioms);
    for(int i = axioms.max(); i >= 0; i--) {
      Clause clause = itr.next();
      int maxVar = clause.maxVariable();
      if (reachableVars.contains(maxVar)) {
        for(IntIterator lits = clause.literals(); lits.hasNext(); ) {
          reachableVars.add(StrictMath.abs(lits.next()));
        }
        relevantAxioms.add(i);
      }
    }
View Full Code Here

TOP

Related Classes of kodkod.engine.satlab.Clause

Copyright © 2018 www.massapicom. 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.