public static void assignTruthValue(Proposition self, Stella_Object truthvalue) {
    { TruthValue oldtruthvalue = ((TruthValue)(Stella_Object.accessInContext(self.truthValue, self.homeContext, false)));
      TruthValue newtruthvalue = null;

      if (truthvalue == Stella.TRUE_WRAPPER) {
        newtruthvalue = Logic.TRUE_TRUTH_VALUE;
      }
      else if (truthvalue == Stella.FALSE_WRAPPER) {
        newtruthvalue = Logic.FALSE_TRUTH_VALUE;
      }
      else {
        newtruthvalue = ((TruthValue)(truthvalue));
      }
      if (oldtruthvalue == newtruthvalue) {
      }
      else if (oldtruthvalue != null) {
        if ((self == Logic.TRUE_PROPOSITION) ||
            (self == Logic.FALSE_PROPOSITION)) {
          Proposition.signalTruthValueClash(self);
        }
        else if (oldtruthvalue == Logic.INCONSISTENT_TRUTH_VALUE) {
        }
        else if (newtruthvalue == Logic.TRUE_TRUTH_VALUE) {
          if (oldtruthvalue == Logic.DEFAULT_TRUE_TRUTH_VALUE) {
            { Proposition object000 = self;
              TruthValue value000 = null;
              Stella_Object oldValue001 = object000.truthValue;
              Stella_Object newValue000 = Stella_Object.updateInContext(oldValue001, value000, object000.homeContext, false);

              if (!((oldValue001 != null) &&
                  (oldValue001.primaryType() == Logic.SGT_STELLA_CS_VALUE))) {
                object000.truthValue = newValue000;
              }
            }
            Proposition.assignTruthValue(self, newtruthvalue);
          }
          else if (oldtruthvalue == Logic.DEFAULT_FALSE_TRUTH_VALUE) {
            Proposition.deassignTruthValue(self, Logic.KWD_RETRACT_FALSE);
            Proposition.assignTruthValue(self, newtruthvalue);
          }
          else if (oldtruthvalue == Logic.FALSE_TRUTH_VALUE) {
            Proposition.signalTruthValueClash(self);
          }
        }
        else if (newtruthvalue == Logic.FALSE_TRUTH_VALUE) {
          if (oldtruthvalue == Logic.DEFAULT_FALSE_TRUTH_VALUE) {
            { Proposition object001 = self;
              TruthValue value001 = null;
              Stella_Object oldValue002 = object001.truthValue;
              Stella_Object newValue001 = Stella_Object.updateInContext(oldValue002, value001, object001.homeContext, false);

              if (!((oldValue002 != null) &&
                  (oldValue002.primaryType() == Logic.SGT_STELLA_CS_VALUE))) {
                object001.truthValue = newValue001;
              }
            }
            Proposition.assignTruthValue(self, newtruthvalue);
          }
          else if (oldtruthvalue == Logic.DEFAULT_TRUE_TRUTH_VALUE) {
            Proposition.deassignTruthValue(self, Logic.KWD_RETRACT_TRUE);
            Proposition.assignTruthValue(self, newtruthvalue);
          }
          else if (oldtruthvalue == Logic.TRUE_TRUTH_VALUE) {
            Proposition.signalTruthValueClash(self);
          }
        }
        else if (newtruthvalue == Logic.DEFAULT_TRUE_TRUTH_VALUE) {
          if (((Boolean)(Logic.$DEFERINGDEFAULTFORWARDINFERENCESp$.get())).booleanValue()) {
            Logic.getPropagationEnvironment(((Context)(Stella.$CONTEXT$.get()))).deferDefaultProposition(self);
            return;
          }
          else if ((oldtruthvalue == Logic.TRUE_TRUTH_VALUE) ||
              (oldtruthvalue == Logic.FALSE_TRUTH_VALUE)) {
          }
          else if (oldtruthvalue == Logic.DEFAULT_FALSE_TRUTH_VALUE) {
            Proposition.deassignTruthValue(self, Logic.KWD_RETRACT_FALSE);
          }
        }
        else if (newtruthvalue == Logic.DEFAULT_FALSE_TRUTH_VALUE) {
          if (((Boolean)(Logic.$DEFERINGDEFAULTFORWARDINFERENCESp$.get())).booleanValue()) {
            Logic.getPropagationEnvironment(((Context)(Stella.$CONTEXT$.get()))).deferDefaultProposition(self);
            return;
          }
          else if ((oldtruthvalue == Logic.FALSE_TRUTH_VALUE) ||
              (oldtruthvalue == Logic.TRUE_TRUTH_VALUE)) {
          }
          else if (oldtruthvalue == Logic.DEFAULT_TRUE_TRUTH_VALUE) {
            Proposition.deassignTruthValue(self, Logic.KWD_RETRACT_TRUE);
          }
        }
        else if (newtruthvalue == Logic.INCONSISTENT_TRUTH_VALUE) {
          if ((oldtruthvalue == Logic.TRUE_TRUTH_VALUE) ||
              (oldtruthvalue == Logic.DEFAULT_TRUE_TRUTH_VALUE)) {
            Proposition.deassignTruthValue(self, Logic.KWD_RETRACT_TRUE);
          }
          else if ((oldtruthvalue == Logic.FALSE_TRUTH_VALUE) ||
              (oldtruthvalue == Logic.DEFAULT_FALSE_TRUTH_VALUE)) {
            Proposition.deassignTruthValue(self, Logic.KWD_RETRACT_FALSE);
          }
          Proposition.assignTruthValue(self, newtruthvalue);
        }
        else {
          Proposition.signalTruthValueClash(self);
        }
      }
      else if (self.kind == Logic.KWD_FUNCTION) {
        { Proposition object002 = self;
          TruthValue value002 = Logic.TRUE_TRUTH_VALUE;
          Stella_Object oldValue003 = object002.truthValue;
          Stella_Object newValue002 = Stella_Object.updateInContext(oldValue003, value002, object002.homeContext, false);

          if (!((oldValue003 != null) &&
              (oldValue003.primaryType() == Logic.SGT_STELLA_CS_VALUE))) {
            object002.truthValue = newValue002;
          }
        }
      }
      else if (newtruthvalue == Logic.INCONSISTENT_TRUTH_VALUE) {
        { Proposition object003 = self;
          TruthValue value003 = newtruthvalue;
          Stella_Object oldValue004 = object003.truthValue;
          Stella_Object newValue003 = Stella_Object.updateInContext(oldValue004, value003, object003.homeContext, false);

          if (!((oldValue004 != null) &&
              (oldValue004.primaryType() == Logic.SGT_STELLA_CS_VALUE))) {
            object003.truthValue = newValue003;
          }
        }
      }
      else {
        { Proposition object004 = self;
          TruthValue value004 = newtruthvalue;
          Stella_Object oldValue005 = object004.truthValue;
          Stella_Object newValue004 = Stella_Object.updateInContext(oldValue005, value004, object004.homeContext, false);

          if (!((oldValue005 != null) &&
              (oldValue005.primaryType() == Logic.SGT_STELLA_CS_VALUE))) {
            object004.truthValue = newValue004;
          }
        }
        Logic.handleOutOfDateInferenceCache(Logic.KWD_ASSERT, self);
        if (newtruthvalue == Logic.TRUE_TRUTH_VALUE) {
          Proposition.updateLinksAndTimestamps(self, Logic.KWD_ASSERT_TRUE);
        }
        else if (newtruthvalue == Logic.FALSE_TRUTH_VALUE) {
          Proposition.updateLinksAndTimestamps(self, Logic.KWD_ASSERT_FALSE);
        }
        else if (newtruthvalue == Logic.DEFAULT_TRUE_TRUTH_VALUE) {
          Proposition.updateLinksAndTimestamps(self, Logic.KWD_PRESUME_TRUE);
        }
        else if (newtruthvalue == Logic.DEFAULT_FALSE_TRUTH_VALUE) {
          Proposition.updateLinksAndTimestamps(self, Logic.KWD_PRESUME_FALSE);
        }
        Logic.reactToKbUpdate(((Context)(Stella.$CONTEXT$.get())), self);
      }
    }
  }