public static NamedDescription surrogateDgetDescription(Surrogate self) {
    { Stella_Object value = self.surrogateValue;
      ObjectStore store = null;

      if (value != null) {
        { Surrogate testValue000 = Stella_Object.safePrimaryType(value);

          if (Surrogate.subtypeOfP(testValue000, Logic.SGT_LOGIC_NAMED_DESCRIPTION)) {
            { NamedDescription value000 = ((NamedDescription)(value));

              return (value000);
            }
          }
          else if (Surrogate.subtypeOfP(testValue000, Logic.SGT_STELLA_RELATION)) {
            { Relation value000 = ((Relation)(value));

              if (((NamedDescription)(KeyValueList.dynamicSlotValue(value000.dynamicSlots, Logic.SYM_LOGIC_DESCRIPTION, null))) != null) {
                return (((NamedDescription)(KeyValueList.dynamicSlotValue(value000.dynamicSlots, Logic.SYM_LOGIC_DESCRIPTION, null))));
              }
              else {
                return (Logic.createDescriptionForStellaRelation(value000));
              }
            }
          }
          else {
            return (null);
          }
        }
      }
      else if ((store = Logic.homeObjectStore(self)) != null) {
        return (store.fetchRelation(self));
      }
      else {
        return (null);
      }
    }
  }