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

      if (testValue000 == Logic.SGT_STELLA_CONS) {
        { Cons tree000 = ((Cons)(tree));

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

          return (Logic.surrogateDbuildProposition(tree000));
        }
      }
      else if (Surrogate.subtypeOfSymbolP(testValue000)) {
        { Symbol tree000 = ((Symbol)(tree));

          return (Logic.symbolDbuildProposition(tree000));
        }
      }
      else if (Surrogate.subtypeOfP(testValue000, Logic.SGT_LOGIC_PATTERN_VARIABLE)) {
        { PatternVariable tree000 = ((PatternVariable)(tree));

          return (tree000);
        }
      }
      else if (Surrogate.subtypeOfP(testValue000, Logic.SGT_LOGIC_PROPOSITION)) {
        { Proposition tree000 = ((Proposition)(tree));

          return (tree000);
        }
      }
      else {
        { OutputStringStream stream000 = OutputStringStream.newOutputStringStream();

          { Object old$PrintreadablyP$000 = Stella.$PRINTREADABLYp$.get();

            try {
              Native.setBooleanSpecial(Stella.$PRINTREADABLYp$, true);
              stream000.nativeStream.println("ERROR: Illegal logical sentence: `" + tree + "'.");
              Logic.helpSignalPropositionError(stream000, Logic.KWD_ERROR);

            } finally {
              Stella.$PRINTREADABLYp$.set(old$PrintreadablyP$000);
            }
          }
          throw ((PropositionError)(PropositionError.newPropositionError(stream000.theStringReader()).fillInStackTrace()));
        }
      }
    }
  }