* @param localP
   * @return Iterator
   */
  public static Iterator allUnnamedTerms(Module module, boolean localP) {
    { Cons terms = Stella.NIL;
      Cons termswithduplicates = Stella.NIL;
      LogicObject term = null;

      { Proposition proposition = null;
        Iterator iter000 = Logic.allPropositions(module, localP);

        while (iter000.nextP()) {
          proposition = ((Proposition)(iter000.value));
          { Stella_Object arg = null;
            Vector vector000 = proposition.arguments;
            int index000 = 0;
            int length000 = vector000.length();

            loop001 : for (;index000 < length000; index000 = index000 + 1) {
              arg = (vector000.theArray)[index000];
              if ((arg != null) &&
                  (Stella_Object.isaP(arg, Logic.SGT_LOGIC_LOGIC_OBJECT) &&
                   (!arg.deletedP()))) {
                term = ((LogicObject)(arg));
                if ((!LogicObject.visibleTermP(term, module, localP)) ||
                    (term.surrogateValueInverse != null)) {
                  continue loop001;
                }
                { Surrogate testValue000 = Stella_Object.safePrimaryType(term);

                  if (Surrogate.subtypeOfP(testValue000, Logic.SGT_LOGIC_PATTERN_VARIABLE)) {
                    { PatternVariable term000 = ((PatternVariable)(term));

                    }
                  }
                  else if (Surrogate.subtypeOfP(testValue000, Logic.SGT_LOGIC_SKOLEM)) {
                    { Skolem term000 = ((Skolem)(term));

                      if (term000.definingProposition != null) {
                        if (term000.definingProposition == proposition) {
                          terms = Cons.cons(term000, terms);
                        }
                      }
                      else {
                        termswithduplicates = Cons.cons(term000, termswithduplicates);
                      }
                    }
                  }
                  else {
                    termswithduplicates = Cons.cons(term, termswithduplicates);
                  }
                }
              }
            }
          }
        }
      }
      return (terms.concatenate(termswithduplicates.removeDuplicates(), Stella.NIL).allocateIterator());
    }
  }