public static Stella_Object conceiveFormula(Stella_Object tree) {
    { Surrogate testValue000 = Stella_Object.safePrimaryType(tree);

      if (Surrogate.subtypeOfStringP(testValue000)) {
        { StringWrapper tree000 = ((StringWrapper)(tree));

          return (Logic.conceiveFormula(Stella.readSExpressionFromString(tree000.wrapperValue)));
        }
      }
      else if (testValue000 == Logic.SGT_STELLA_CONS) {
        { Cons tree000 = ((Cons)(tree));

          if (Stella_Object.symbolP(tree000.value)) {
            { GeneralizedSymbol testValue001 = ((GeneralizedSymbol)(tree000.value));

              if ((testValue001 == Logic.SYM_LOGIC_KAPPA) ||
                  ((testValue001 == Logic.SYM_LOGIC_LAMBDA) ||
                   ((testValue001 == Logic.SYM_LOGIC_SETOFALL) ||
                    ((testValue001 == Logic.SYM_PL_KERNEL_KB_SETOF) ||
                     ((testValue001 == Logic.SYM_PL_KERNEL_KB_LISTOF) ||
                      (testValue001 == Logic.SYM_LOGIC_BAGOF)))))) {
                return (Logic.conceiveTerm(tree000));
              }
              else {
              }
            }
          }
          return (Logic.conceiveSentence(tree000));
        }
      }
      else if (Surrogate.subtypeOfSymbolP(testValue000)) {
        { Symbol tree000 = ((Symbol)(tree));

          return (Logic.conceiveTerm(tree000));
        }
      }
      else if (Surrogate.subtypeOfSurrogateP(testValue000)) {
        { Surrogate tree000 = ((Surrogate)(tree));

          return (Logic.conceiveTerm(Symbol.internSymbolInModule(tree000.symbolName, ((Module)(tree000.homeContext)), true)));
        }
      }
      else {
        return (Logic.conceiveSentence(tree));
      }
    }
  }