Beispiel #1
0
  public Term getCanonicalVersion() {
    if ((f instanceof FixedFunction) && getFreeVars().isEmpty()) {
      Object value = getValueIfNonRandom();
      if (value != null) {
        Term canonical = getType().getCanonicalTerm(value);
        if (canonical != null) {
          return canonical;
        }
      }
    }

    List<Term> newArgs = new ArrayList<Term>();
    for (int i = 0; i < args.length; ++i) {
      if (args[i] instanceof Term) {
        Term arg = (Term) args[i];
        newArgs.add(arg.getCanonicalVersion());
      }
    }

    FuncAppTerm canonical = new FuncAppTerm(f, newArgs);
    canonical.setLocation(location);
    return canonical;
  }