public static void linkStellaRelationAndDescription(Relation self, NamedDescription description) {
    KeyValueList.setDynamicSlotValue(self.dynamicSlots, Logic.SYM_LOGIC_DESCRIPTION, description, null);
    description.nativeRelationSetter(self);
    { Surrogate testValue000 = Stella_Object.safePrimaryType(self);

      if (Surrogate.subtypeOfClassP(testValue000)) {
        { Stella_Class self000 = ((Stella_Class)(self));

          description.surrogateValueInverse = Logic.classLogicalType(self000);
        }
      }
      else if (Surrogate.subtypeOfP(testValue000, Logic.SGT_STELLA_SLOT)) {
        { Slot self000 = ((Slot)(self));

          description.surrogateValueInverse = self000.slotSlotref;
        }
      }
      else {
        { OutputStringStream stream000 = OutputStringStream.newOutputStringStream();

          stream000.nativeStream.print("`" + testValue000 + "' is not a valid case option");
          throw ((StellaException)(StellaException.newStellaException(stream000.theStringReader()).fillInStackTrace()));
        }
      }
    }
    if (Logic.polymorphicRelationP(self)) {
      Description.createBaseRelationForPolymorphicDescription(description);
    }
    return;
  }