Example #1
0
 public void allLits(int arity, List result, boolean b) {
   Exp e;
   Iterator<Exp> i = exps.iterator();
   while (i.hasNext()) {
     e = i.next();
     e.allLits(arity, result, b);
   }
 }
Example #2
0
 public int hashCode() {
   int ret = 0;
   Iterator i = exps.iterator();
   while (i.hasNext()) {
     ret += i.next().hashCode();
   }
   return ret;
 }
Example #3
0
 public void extractPTypeExps(List l) {
   Exp e;
   Iterator<Exp> i = exps.iterator();
   while (i.hasNext()) {
     e = i.next();
     e.extractPTypeExps(l);
   }
 }
Example #4
0
 public void allPreds(int arity, List result) {
   Exp e;
   Iterator<Exp> i = exps.iterator();
   while (i.hasNext()) {
     e = i.next();
     e.allPreds(arity, result);
   }
 }
Example #5
0
 public double complexity() {
   Iterator<Exp> i = exps.iterator();
   double result = 0.0;
   while (i.hasNext()) {
     result += i.next().complexity();
   }
   return result;
 }
Example #6
0
 void getOuterRefs(Exp e, List<Exp> refs) {
   // now, recurse
   Iterator<Exp> i = exps.iterator();
   while (i.hasNext()) {
     Exp ex = i.next();
     ex.getOuterRefs(e, refs);
   }
 }
Example #7
0
 public Exp copy() {
   IntSet result = new IntSet();
   Iterator<Exp> i = exps.iterator();
   while (i.hasNext()) {
     result.exps.add(i.next().copy());
   }
   return result;
 }
Example #8
0
 public boolean removeUnscoped(List vars) {
   Iterator<Exp> i = exps.iterator();
   while (i.hasNext()) {
     Exp e = i.next();
     if (e.removeUnscoped(vars)) i.remove();
   }
   return false;
 }
Example #9
0
 public double varPenalty(List varNames) {
   double result = 0.0;
   Iterator<Exp> i = exps.iterator();
   while (i.hasNext()) {
     result += i.next().varPenalty(varNames);
   }
   return result;
 }
Example #10
0
 public void allSubExps(Type type, List result) {
   if (type == null || type().equals(type)) result.add(this);
   Exp e;
   Iterator<Exp> i = exps.iterator();
   while (i.hasNext()) {
     e = i.next();
     e.allSubExps(type, result);
   }
 }
Example #11
0
 public void allSubExps(String type, List result) {
   Exp e;
   Iterator<Exp> i = exps.iterator();
   while (i.hasNext()) {
     e = i.next();
     if (e.getClass().getName().equals(type)) result.add(e);
     e.allSubExps(type, result);
   }
 }
Example #12
0
 public void allSubExps(List result) {
   result.add(this);
   Exp e;
   Iterator<Exp> i = exps.iterator();
   while (i.hasNext()) {
     e = i.next();
     e.allSubExps(result);
   }
 }
Example #13
0
 public Exp deleteExp(Exp l) {
   IntSet result = new IntSet();
   Iterator<Exp> i = exps.iterator();
   while (i.hasNext()) {
     Exp e = i.next();
     if (e != l) result.exps.add(e.deleteExp(l));
   }
   return result;
 }
Example #14
0
 public String toString(List varNames) {
   StringBuffer result = new StringBuffer();
   result.append("(intset");
   Iterator<Exp> i = exps.iterator();
   while (i.hasNext()) {
     result.append(" ").append(i.next().toString(varNames));
   }
   result.append(")");
   return result.toString();
 }
Example #15
0
 public int predCount(Object p) {
   int result = 0;
   Exp e;
   Iterator<Exp> i = exps.iterator();
   while (i.hasNext()) {
     e = i.next();
     result += e.predCount(p);
   }
   return result;
 }
Example #16
0
 public int expCount(int eq, Exp e) {
   int count = 0;
   if (equals(eq, e)) count++;
   Iterator<Exp> i = exps.iterator();
   while (i.hasNext()) {
     Exp ex = i.next();
     count += ex.expCount(eq, e);
   }
   return count;
 }
Example #17
0
  public int expCount(int id) {
    int result = 0;
    Exp ex;
    Iterator<Exp> i;

    i = exps.iterator();
    while (i.hasNext()) {
      ex = i.next();
      result += ex.expCount(id);
    }
    return result;
  }
Example #18
0
  public int repeatExpCount(int t, Exp e) {
    int result = 0;
    Exp ex;
    Iterator<Exp> i;

    i = exps.iterator();
    while (i.hasNext()) {
      ex = i.next();
      result += ex.repeatExpCount(t, e);
    }
    return result;
  }
Example #19
0
  public int repeatPredCount(int t, Object p) {
    int result = 0;
    Exp e;
    Iterator<Exp> i;

    i = exps.iterator();
    while (i.hasNext()) {
      e = i.next();
      result += e.repeatPredCount(t, p);
    }
    return result;
  }
Example #20
0
 public boolean wellTyped() {
   Iterator<Exp> i = exps.iterator();
   Exp e;
   while (i.hasNext()) {
     e = i.next();
     if (e == null || !e.wellTyped()) {
       // System.out.println("not well typed:"+e);
       return false;
     }
     // only allow sets of Integers
     if (!PType.I.matches(e.type())) {
       System.out.println("not type T:" + e);
       return false;
     }
     // System.out.println("well typed: "+e);
   }
   // System.out.println("conj well typed");
   return true;
 }
Example #21
0
 public void freeVars(List bound, List free) {
   Iterator<Exp> i = exps.iterator();
   while (i.hasNext()) {
     i.next().freeVars(bound, free);
   }
 }