public static Stella_Object consifyArgument(Stella_Object arg) {
    { Surrogate testValue000 = Stella_Object.safePrimaryType(arg);

      if (Surrogate.subtypeOfP(testValue000, Logic.SGT_LOGIC_PROPOSITION)) {
        { Proposition arg000 = ((Proposition)(arg));

          return (Proposition.propositionToCons(arg000));
        }
      }
      else if (Surrogate.subtypeOfP(testValue000, Logic.SGT_LOGIC_PATTERN_VARIABLE)) {
        { PatternVariable arg000 = ((PatternVariable)(arg));

          if (((QueryIterator)(Logic.$QUERYITERATOR$.get())) == null) {
            return (Symbol.internSymbol(Skolem.getSkolemPrintName(arg000)));
          }
          else {
            return (Logic.getArgumentBinding(arg000));
          }
        }
      }
      else if (Surrogate.subtypeOfP(testValue000, Logic.SGT_LOGIC_NAMED_DESCRIPTION)) {
        { NamedDescription arg000 = ((NamedDescription)(arg));

          return (Symbol.internSymbol(arg000.surrogateValueInverse.symbolName));
        }
      }
      else if (Surrogate.subtypeOfP(testValue000, Logic.SGT_LOGIC_DESCRIPTION)) {
        { Description arg000 = ((Description)(arg));

          throw ((LogicException)(LogicException.newLogicException("Can't consify").fillInStackTrace()));
        }
      }
      else if (Surrogate.subtypeOfSurrogateP(testValue000)) {
        { Surrogate arg000 = ((Surrogate)(arg));

          return (Symbol.internSymbol(((Surrogate)(arg000)).symbolName));
        }
      }
      else if (Surrogate.subtypeOfP(testValue000, Logic.SGT_LOGIC_SKOLEM)) {
        { Skolem arg000 = ((Skolem)(arg));

          if (((Stella_Object)(Stella_Object.accessInContext(arg000.variableValue, arg000.homeContext, false))) != null) {
            return (Logic.consifyArgument(((Stella_Object)(Stella_Object.accessInContext(arg000.variableValue, arg000.homeContext, false)))));
          }
          else {
            if (arg000.definingProposition != null) {
              { Proposition prop = arg000.definingProposition;
                Vector skArgs = prop.arguments;
                Cons consArgs = Stella.NIL;

                { int i = Stella.NULL_INTEGER;
                  int iter000 = 0;
                  int upperBound000 = skArgs.length() - 2;
                  Cons collect000 = null;

                  for (;iter000 <= upperBound000; iter000 = iter000 + 1) {
                    i = iter000;
                    if (collect000 == null) {
                      {
                        collect000 = Cons.cons(Logic.consifyArgument((skArgs.theArray)[i]), Stella.NIL);
                        if (consArgs == Stella.NIL) {
                          consArgs = collect000;
                        }
                        else {
                          Cons.addConsToEndOfConsList(consArgs, collect000);
                        }
                      }
                    }
                    else {
                      {
                        collect000.rest = Cons.cons(Logic.consifyArgument((skArgs.theArray)[i]), Stella.NIL);
                        collect000 = collect000.rest;
                      }
                    }
                  }
                }
                return (Cons.cons(Symbol.internSymbol(Proposition.stringifiedKifOperator(prop)), consArgs));
              }
            }
            else {
              return (arg000);
            }
          }
        }
      }
      else if (Surrogate.subtypeOfP(testValue000, Logic.SGT_LOGIC_LOGIC_OBJECT)) {
        { LogicObject arg000 = ((LogicObject)(arg));

          return (Symbol.internSymbol(arg000.surrogateValueInverse.symbolName));
        }
      }
      else {
        return (arg);
      }
    }
  }