public static NamedDescription createPrimitiveDescription(List iovariablenames, List iovariabletypes, boolean variablearityP, boolean classP, boolean functionP, Module module) {
    if (iovariabletypes.length() > Logic.SYSTEM_DEFINED_ARGUMENT_NAMES.length()) {
      { OutputStringStream stream000 = OutputStringStream.newOutputStringStream();

        stream000.nativeStream.println("PowerLoom can't handle relations with arity > `" + Logic.SYSTEM_DEFINED_ARGUMENT_NAMES.length() + "'");
        throw ((StellaException)(StellaException.newStellaException(stream000.theStringReader()).fillInStackTrace()));
      }
    }
    { Object old$Module$000 = Stella.$MODULE$.get();
      Object old$Context$000 = Stella.$CONTEXT$.get();

      try {
        Native.setSpecial(Stella.$MODULE$, module);
        Native.setSpecial(Stella.$CONTEXT$, ((Module)(Stella.$MODULE$.get())));
        { NamedDescription description = ((NamedDescription)(Logic.createDescription(Stella.NULL_INTEGER, true)));

          description.ioVariableNames = iovariablenames;
          description.ioVariableTypes = iovariabletypes;
          description.surrogateValueInverse = Logic.SGT_LOGIC_UNFINALIZED;
          { Object old$FillingconstraintpropagationqueuesP$000 = Logic.$FILLINGCONSTRAINTPROPAGATIONQUEUESp$.get();
            Object old$Evaluationmode$000 = Logic.$EVALUATIONMODE$.get();

            try {
              Native.setBooleanSpecial(Logic.$FILLINGCONSTRAINTPROPAGATIONQUEUESp$, false);
              Native.setSpecial(Logic.$EVALUATIONMODE$, Logic.KWD_EXTENSIONAL_ASSERTION);
              if (classP) {
                Logic.linkOriginatedProposition(description, Logic.assertIsaProposition(description, Logic.SGT_PL_KERNEL_KB_CONCEPT));
              }
              else if (functionP) {
                Logic.linkOriginatedProposition(description, Logic.assertIsaProposition(description, Logic.SGT_PL_KERNEL_KB_FUNCTION));
              }
              else {
                Logic.linkOriginatedProposition(description, Logic.assertIsaProposition(description, Logic.SGT_PL_KERNEL_KB_RELATION));
              }
              if (variablearityP) {
                Logic.linkOriginatedProposition(description, LogicObject.assertProperty(description, Logic.SGT_PL_KERNEL_KB_VARIABLE_ARITY));
              }
              description.surrogateValueInverse = null;
              return (description);

            } finally {
              Logic.$EVALUATIONMODE$.set(old$Evaluationmode$000);
              Logic.$FILLINGCONSTRAINTPROPAGATIONQUEUESp$.set(old$FillingconstraintpropagationqueuesP$000);
            }
          }
        }

      } finally {
        Stella.$CONTEXT$.set(old$Context$000);
        Stella.$MODULE$.set(old$Module$000);
      }
    }
  }