public static Stella_Object generateOneVariable(PatternVariable self, boolean typedP) {
    { Stella_Object value = null;

      if (((Justification)(Logic.$CURRENTJUSTIFICATION$.get())) != null) {
        value = Logic.justificationArgumentBoundTo(self, null);
      }
      if (value == null) {
        value = Logic.safeArgumentBoundTo(self);
      }
      if ((value != null) &&
          (!(value == self))) {
        return (Logic.generateTerm(value));
      }
      else {
        { Symbol name = PatternVariable.generateNameOfVariable(self);

          if (typedP &&
              (!(Logic.logicalType(self) == Logic.SGT_STELLA_THING))) {
            return (Cons.cons(name, Cons.cons(Surrogate.symbolize(Logic.logicalType(self)), Stella.NIL)));
          }
          else {
            return (name);
          }
        }
      }
    }
  }