public static Proposition updateBinaryValue(Surrogate relation, Stella_Object self, Stella_Object value, Keyword updatemode) {
    { Object old$ClippingenabledP$000 = Logic.$CLIPPINGENABLEDp$.get();

      try {
        Native.setBooleanSpecial(Logic.$CLIPPINGENABLEDp$, true);
        if (NamedDescription.functionDescriptionP(Logic.getDescription(relation))) {
          { Proposition value000 = null;

            { Proposition p = null;
              Iterator iter000 = Logic.unfilteredDependentPropositions(self, relation).allocateIterator();

              loop000 : while (iter000.nextP()) {
                p = ((Proposition)(iter000.value));
                if (((Surrogate)(p.operator)) == relation) {
                  value000 = p;
                  break loop000;
                }
              }
            }
            { Proposition proposition = value000;

              if ((proposition == null) ||
                  Logic.skolemP(value)) {
                return (Logic.updateTuple(relation, Cons.consList(Cons.cons(self, Cons.cons(value, Stella.NIL))), updatemode));
              }
              { Stella_Object skolemoutput = (proposition.arguments.theArray)[(proposition.arguments.length() - 1)];

                if (updatemode == Logic.KWD_ASSERT_TRUE) {
                  if (Logic.clipValueP(skolemoutput, value)) {
                  }
                  else {
                    Proposition.equateValues(proposition, Logic.valueOf(skolemoutput), Logic.valueOf(value));
                  }
                }
                else if (updatemode == Logic.KWD_RETRACT_TRUE) {
                  Logic.unequateValuesP(skolemoutput, value);
                }
                else {
                  { OutputStringStream stream000 = OutputStringStream.newOutputStringStream();

                    stream000.nativeStream.print("`" + updatemode + "' is not a valid case option");
                    throw ((StellaException)(StellaException.newStellaException(stream000.theStringReader()).fillInStackTrace()));
                  }
                }
                return (proposition);
              }
            }
          }
        }
        else {
          return (Logic.updateTuple(relation, Cons.consList(Cons.cons(self, Cons.cons(value, Stella.NIL))), updatemode));
        }

      } finally {
        Logic.$CLIPPINGENABLEDp$.set(old$ClippingenabledP$000);
      }
    }
  }