Package kodkod.util.ints

Examples of kodkod.util.ints.IntSet.addAll()


   
    posVars.retainAll(negVars);
   
    assert !posVars.isEmpty();
    final IntSet ret = new IntBitSet(posVars.max()+1);
    ret.addAll(posVars);
   
    return ret;
  }
 
  /**
 
View Full Code Here


  static IntSet clausesFor(ResolutionTrace trace, IntSet relevantVars) {
//    System.out.println("relevant: " + relevantVars);
    final IntSet axioms = trace.axioms();

    final IntSet reachableVars = new IntBitSet(relevantVars.max()+1);
    reachableVars.addAll(relevantVars);

    final IntSet relevantAxioms = new IntBitSet(axioms.size());
   
    final Iterator<Clause> itr = trace.reverseIterator(axioms);
    for(int i = axioms.max(); i >= 0; i--) {
View Full Code Here

   */
  private void refinePartitions(IntSet set) {
    for(ListIterator<IntSet> partsIter = parts.listIterator(); partsIter.hasNext(); ) {
      IntSet part = partsIter.next();
      IntSet intersection = Ints.bestSet(part.min(), part.max());
      intersection.addAll(part);
      intersection.retainAll(set);
      if (!intersection.isEmpty() && intersection.size() < part.size()) {
        part.removeAll(intersection);
        partsIter.add(intersection);
      }
View Full Code Here

   */
  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]);
View Full Code Here

   */
  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);
View Full Code Here

   */
  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;
View Full Code Here

   */
  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;
View Full Code Here

    final Instance instance = new Instance(bounds.universe());
//    System.out.println(varUsage);
    for(Relation r : bounds.relations()) {
      TupleSet lower = bounds.lowerBound(r);
      IntSet indeces = Ints.bestSet(lower.capacity());
      indeces.addAll(lower.indexView());
      IntSet vars = primaryVarUsage.get(r);
      if (vars!=null) {
        int lit = vars.min();
        for(IntIterator iter = bounds.upperBound(r).indexView().iterator(); iter.hasNext();) {
          final int index = iter.next();
View Full Code Here

   */
  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++) {
View Full Code Here

   */
  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])) {
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.