Examples of IntBitSet


Examples of kodkod.util.ints.IntBitSet

   * @see kodkod.engine.satlab.ResolutionTrace#implicants(kodkod.util.ints.IntSet)
   */
  public IntSet reachable(IntSet indices) {
    if (indices.isEmpty()) return Ints.EMPTY_SET;
    else if (valid(indices)) {
      final IntSet ret = new IntBitSet(trace.length);
      ret.addAll(indices);
      for(int i = indices.max(); i >= axioms; i--) {
        if (ret.contains(i)) {
          int[] resolvent = trace[i];
          if (resolved(i)) {
            for(int j = 1, antes = resolvent[0]; j <= antes; j++) {
              ret.add(resolvent[j]);
            }
          } else {
            for(int j = 0; j < resolvent.length; j++) {
              ret.add(resolvent[j]);
            }
          }
        }
      }
      return ret;
View Full Code Here

Examples of kodkod.util.ints.IntBitSet

   * @see kodkod.engine.satlab.ResolutionTrace#backwardReachable(kodkod.util.ints.IntSet)
   */
  public IntSet backwardReachable(IntSet indices) {
    if (indices.isEmpty()) return Ints.EMPTY_SET;
    else if (valid(indices)) {
      final IntSet ret = new IntBitSet(trace.length);
      ret.addAll(indices);
      for(int i = axioms, length = trace.length; i < length; i++) {
        int[] resolvent = trace[i];
        if (resolved(i)) {
          for(int j = 1, antes = resolvent[0]; j <= antes; j++) {
            if (ret.contains(resolvent[j])) {
              ret.add(i);
              break;
            }
          }
        } else {
          for(int j = 0; j < resolvent.length; j++) {
            if (ret.contains(resolvent[j])) {
              ret.add(i);
              break;
            }
          }
        }
      }
View Full Code Here

Examples of kodkod.util.ints.IntBitSet

   * @see kodkod.engine.satlab.ResolutionTrace#learnable(kodkod.util.ints.IntSet)
   */
  public IntSet learnable(IntSet indices) {
    if (indices.isEmpty()) return Ints.EMPTY_SET;
    else if (valid(indices)) {
      final IntSet ret = new IntBitSet(trace.length);
      ret.addAll(indices);
      TOP: for(int i = axioms, length = trace.length; i < length; i++) {
        int[] resolvent = trace[i];
        if (resolved(i)) {
          for(int j = 1, antes = resolvent[0]; j <= antes; j++) {
            if (!ret.contains(resolvent[j])) {
              continue TOP;
            }
          }
        } else {
          for(int j = 0; j < resolvent.length; j++) {
            if (!ret.contains(resolvent[j])) {
              continue TOP;
            }
          }
        }
        ret.add(i);
      }
      return ret;
    }
    else throw new IndexOutOfBoundsException("invalid indices: " + indices);
  }
View Full Code Here

Examples of kodkod.util.ints.IntBitSet

   * @see kodkod.engine.satlab.ResolutionTrace#directlyLearnable(kodkod.util.ints.IntSet)
   */
  public IntSet directlyLearnable(IntSet indices) {
    if (indices.isEmpty()) return Ints.EMPTY_SET;
    else if (valid(indices)) {
      final IntSet ret = new IntBitSet(trace.length);
      ret.addAll(indices);
      TOP: for(int i = axioms, length = trace.length; i < length; i++) {
        int[] resolvent = trace[i];
        if (resolved(i)) {
          for(int j = 1, antes = resolvent[0]; j <= antes; j++) {
            if (!indices.contains(resolvent[j])) {
              continue TOP;
            }
          }
        } else {
          for(int j = 0; j < resolvent.length; j++) {
            if (!indices.contains(resolvent[j])) {
              continue TOP;
            }
          }
        }
        ret.add(i);
      }
      return ret;
    }
   
    else throw new IndexOutOfBoundsException("invalid indices: " + indices);
View Full Code Here

Examples of kodkod.util.ints.IntBitSet

   * properties specified by the {@linkplain ArrayTrace#ArrayResolution(int[][], int)}
   * constructor.
   * @return the indices of the core clauses in the given trace
   */
  private static IntSet core(int[][] trace, int axioms) {
    final IntSet core = new IntBitSet(axioms);
    final IntSet reachable = new IntBitSet(trace.length);
    reachable.add(trace.length-1);
    for(int i = trace.length-1; i >= axioms; i--) {
      if (reachable.contains(i)) {
        int[] resolvent = trace[i];
        for(int j = 1, antes = resolvent[0]; j <= antes; j++) {
          reachable.add(resolvent[j]);
        }
      }
    }
   
    for(IntIterator itr = reachable.iterator(0, axioms-1); itr.hasNext(); ) {
      core.add(itr.next());
    }
   
    return core;
  }
View Full Code Here

Examples of kodkod.util.ints.IntBitSet

   * @see kodkod.engine.satlab.ResolutionTrace#implicants(kodkod.util.ints.IntSet)
   */
  public IntSet reachable(IntSet indices) {
    if (indices.isEmpty()) return Ints.EMPTY_SET;
    else if (valid(indices)) {
      final IntSet ret = new IntBitSet(trace.length);
      ret.addAll(indices);
      for(int i = indices.max(); i >= axioms; i--) {
        if (ret.contains(i)) {
          int[] resolvent = trace[i];
          for(int j = 1, antes = resolvent[0]; j <= antes; j++) {
            ret.add(resolvent[j]);
          }
        }
      }
      return ret;
    }
View Full Code Here

Examples of kodkod.util.ints.IntBitSet

   * @see kodkod.engine.satlab.ResolutionTrace#backwardReachable(kodkod.util.ints.IntSet)
   */
  public IntSet backwardReachable(IntSet indices) {
    if (indices.isEmpty()) return Ints.EMPTY_SET;
    else if (valid(indices)) {
      final IntSet ret = new IntBitSet(trace.length);
      ret.addAll(indices);
      for(int i = axioms, length = trace.length; i < length; i++) {
        int[] resolvent = trace[i];
        for(int j = 1, antes = resolvent[0]; j <= antes; j++) {
          if (ret.contains(resolvent[j])) {
            ret.add(i);
            break;
          }
        }
      }
      return ret;
View Full Code Here

Examples of kodkod.util.ints.IntBitSet

   * @see kodkod.engine.satlab.ResolutionTrace#learnable(kodkod.util.ints.IntSet)
   */
  public IntSet learnable(IntSet indices) {
    if (indices.isEmpty()) return Ints.EMPTY_SET;
    else if (valid(indices)) {
      final IntSet ret = new IntBitSet(trace.length);
      ret.addAll(indices);
      TOP: for(int i = axioms, length = trace.length; i < length; i++) {
        int[] resolvent = trace[i];
        for(int j = 1, antes = resolvent[0]; j <= antes; j++) {
          if (!ret.contains(resolvent[j])) {
            continue TOP;
          }
        }
        ret.add(i);
      }
      return ret;
    }
    else throw new IndexOutOfBoundsException("invalid indices: " + indices);
  }
View Full Code Here

Examples of kodkod.util.ints.IntBitSet

   * @see kodkod.engine.satlab.ResolutionTrace#directlyLearnable(kodkod.util.ints.IntSet)
   */
  public IntSet directlyLearnable(IntSet indices) {
    if (indices.isEmpty()) return Ints.EMPTY_SET;
    else if (valid(indices)) {
      final IntSet ret = new IntBitSet(trace.length);
      ret.addAll(indices);
      TOP: for(int i = axioms, length = trace.length; i < length; i++) {
        int[] resolvent = trace[i];
        for(int j = 1, antes = resolvent[0]; j <= antes; j++) {
          if (!indices.contains(resolvent[j])) {
            continue TOP;
          }
        }
        ret.add(i);
      }
      return ret;
    }
   
    else throw new IndexOutOfBoundsException("invalid indices: " + indices);
View Full Code Here

Examples of kodkod.util.ints.IntBitSet

   * given trace that have the specified maximum variable.
   * @return { i: trace.core() | trace[i].maxVariable() = maxVariable }
   */
  private static IntSet coreClausesWithMaxVar(ResolutionTrace trace, int maxVariable) {
    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
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.