public static Keyword logicDialect(Stella_Object self) {
    { Surrogate testValue000 = Stella_Object.safePrimaryType(self);

      if (Surrogate.subtypeOfP(testValue000, Logic.SGT_STELLA_RELATION)) {
        { Relation self000 = ((Relation)(self));

          return (Logic.logicDialect(self000.homeModule()));
        }
      }
      else if (Surrogate.subtypeOfP(testValue000, Logic.SGT_STELLA_MODULE)) {
        { Module self000 = ((Module)(self));

          { Keyword dialect = ((Keyword)(KeyValueList.dynamicSlotValue(self000.dynamicSlots, Logic.SYM_LOGIC_MODULE_LOGIC_DIALECT, null)));

            if (dialect != null) {
              return (dialect);
            }
            else {
              return (Logic.KWD_KIF);
            }
          }
        }
      }
      else {
        { OutputStringStream stream000 = OutputStringStream.newOutputStringStream();

          stream000.nativeStream.print("`" + testValue000 + "' is not a valid case option");
          throw ((StellaException)(StellaException.newStellaException(stream000.theStringReader()).fillInStackTrace()));
        }
      }
    }
  }