Пример #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);
   }
 }
Пример #2
0
 public int hashCode() {
   int ret = 0;
   Iterator i = exps.iterator();
   while (i.hasNext()) {
     ret += i.next().hashCode();
   }
   return ret;
 }
Пример #3
0
 public void extractPTypeExps(List l) {
   Exp e;
   Iterator<Exp> i = exps.iterator();
   while (i.hasNext()) {
     e = i.next();
     e.extractPTypeExps(l);
   }
 }
Пример #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);
   }
 }
Пример #5
0
 public double complexity() {
   Iterator<Exp> i = exps.iterator();
   double result = 0.0;
   while (i.hasNext()) {
     result += i.next().complexity();
   }
   return result;
 }
Пример #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);
   }
 }
Пример #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;
 }
Пример #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;
 }
Пример #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;
 }
Пример #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);
   }
 }
Пример #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);
   }
 }
Пример #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);
   }
 }
Пример #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;
 }
Пример #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();
 }
Пример #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;
 }
Пример #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;
 }
Пример #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;
  }
Пример #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;
  }
Пример #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;
  }
Пример #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;
 }
Пример #21
0
 public void freeVars(List bound, List free) {
   Iterator<Exp> i = exps.iterator();
   while (i.hasNext()) {
     i.next().freeVars(bound, free);
   }
 }