예제 #1
0
  public Expr dropNoncompArgs(Context ctxt) {
    if (ctxt.getFlag("debug_drop_noncomp")) {
      ctxt.w.println("Dropping non-comp arguments from term-app " + toString(ctxt));
      ctxt.w.flush();
    }
    ArrayList nX = new ArrayList();
    ArrayList no = new ArrayList();
    boolean changed = false;
    Boolean b = new Boolean(false);
    for (int i = 0, iend = X.length; i < iend; i++) {
      if (X[i].isProof(ctxt) || specarg[i]) changed = true;
      else {
        nX.add(X[i]);
        no.add(b);
      }
    }

    Expr ret = this;
    if (changed) {
      if (nX.size() == 0) ret = head;
      else ret = new TermApp(head, Parser.toExprArray(nX), Parser.toBooleanArray(no));
    }

    if (ctxt.getFlag("debug_drop_noncomp")) {
      ctxt.w.println("Returning " + ret.toString(ctxt));
      ctxt.w.flush();
    }

    return ret;
  }