public static void assignPropositionWeight(Proposition self, double weight) {
    { TruthValue tv = ((TruthValue)(Stella_Object.accessInContext(self.truthValue, self.homeContext, false)));

      if (weight == 1.0) {
        Proposition.assignTruthValue(self, Stella.TRUE_WRAPPER);
      }
      else if (weight == 0.0) {
        Proposition.assignTruthValue(self, Stella.FALSE_WRAPPER);
      }
      else if ((tv == Logic.TRUE_TRUTH_VALUE) ||
          ((tv == Logic.FALSE_TRUTH_VALUE) ||
           (tv == null))) {
        { TruthValue self000 = TruthValue.newTruthValue();

          self000.positiveScore = weight;
          { Proposition object000 = self;
            TruthValue value000 = self000;
            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;
            }
          }
        }
      }
      else {
        ((TruthValue)(Stella_Object.accessInContext(self.truthValue, self.homeContext, false))).positiveScore = weight;
      }
    }
  }