public InferenceWorker getInferenceWorkerWithSubstitutions(CycAccess access,
          CycDenotationalTerm kbq, Map<CycVariable, Object> substitutions, long timeoutMsecs,
          boolean sync) throws CycApiException, IOException {
    final CycFormulaSentence sentence = loadKBQSentence(access, kbq);
    final ELMt elmt = loadKBQELMt(access, kbq);
    final InferenceParameters properties = loadKBQProperties(access, kbq);
    if (substitutions != null) {
      sentence.applySubstitutionsDestructive(substitutions);
    }
    return (sync) ? new DefaultInferenceWorkerSynch(sentence, elmt, properties, access, timeoutMsecs)
            : new DefaultInferenceWorker(sentence, elmt, properties, access, timeoutMsecs);
  }