// Path: src/main/java/org/semanticweb/owl/explanation/api/ExplanationException.java
// public class ExplanationException extends OWLRuntimeException {
// 
// 
//     public ExplanationException(Throwable cause) {
//         super(cause);
//     }
// 
// 
//     public ExplanationException(String message) {
//         super(message);
//     }
// 
// 
//     public ExplanationException(String message, Throwable cause) {
//         super(message, cause);
//     }
// }
// 
// Path: src/main/java/org/semanticweb/owl/explanation/api/ExplanationGeneratorInterruptedException.java
// public class ExplanationGeneratorInterruptedException extends ExplanationException {
// 
//     public ExplanationGeneratorInterruptedException() {
//         super("Explanation generator interrupted");
//     }
// }
// 
// Path: src/main/java/org/semanticweb/owl/explanation/impl/blackbox/EntailmentChecker.java
// public interface EntailmentChecker<E> {
// 
//     int getCounter();
// 
//     void resetCounter();
// 
//     E getEntailment();
// 
//     Set<OWLEntity> getEntailmentSignature();
// 
//     Set<OWLEntity> getSeedSignature();
// 
//     boolean isEntailed(Set<OWLAxiom> axiom);
// 
//     Set<OWLAxiom> getEntailingAxioms(Set<OWLAxiom> axioms);
// 
//     Set<OWLAxiom> getModule(Set<OWLAxiom> axioms);
// 
//     String getModularisationTypeDescription();
// 
//     boolean isUseModularisation();
// }


import org.semanticweb.owl.explanation.api.ExplanationException;
import org.semanticweb.owl.explanation.api.ExplanationGeneratorInterruptedException;
import org.semanticweb.owl.explanation.telemetry.DefaultTelemetryInfo;
import org.semanticweb.owl.explanation.telemetry.TelemetryInfo;
import org.semanticweb.owl.explanation.telemetry.TelemetryTimer;
import org.semanticweb.owl.explanation.telemetry.TelemetryTransmitter;
import org.semanticweb.owlapi.apibinding.OWLManager;
import org.semanticweb.owl.explanation.impl.blackbox.EntailmentChecker;
import org.semanticweb.owlapi.model.*;
import org.semanticweb.owlapi.reasoner.*;
import uk.ac.manchester.cs.owlapi.modularity.SyntacticLocalityModuleExtractor;
import uk.ac.manchester.cs.owlapi.modularity.ModuleType;
import java.io.File;
import java.io.FileNotFoundException;
import java.io.FileOutputStream;
import java.net.URL;
import java.util.Collections;
import java.util.HashSet;
import java.util.Set;
            OWLClass namingCls = man.getOWLDataFactory().getOWLClass(IRI.create(clsName));
            OWLAxiom namingAxiom = man.getOWLDataFactory().getOWLSubClassOfAxiom(namingCls, unsatDesc);
            man.addAxiom(ont, namingAxiom);
            for (OWLEntity freshEntity : freshEntities) {
                man.addAxiom(ont, man.getOWLDataFactory().getOWLDeclarationAxiom(freshEntity));
            }

            // Do the actual entailment check
            counter++;
            entailmentCheckTimer.start();
            OWLReasoner reasoner = reasonerFactory.createReasoner(ont, new SimpleConfiguration(new NullReasonerProgressMonitor(), FreshEntityPolicy.ALLOW, timeOutMS, IndividualNodeSetPolicy.BY_SAME_AS));
            entailed = !reasoner.isSatisfiable(unsatDesc);
            entailmentCheckTimer.stop();


            reasoner.dispose();
            man.removeOntology(ont);
            if (entailed) {
                lastEntailingAxioms.remove(namingAxiom);
                lastEntailingAxioms.addAll(ont.getLogicalAxioms());
            }
            return entailed;
        }
        catch (OWLOntologyCreationException e) {
            throw new ExplanationException(e);
        }
        catch (TimeOutException e) {
            transmitter.recordMeasurement(info, "reasoner time out", true);
            throw e;
        }
// Path: src/main/java/org/semanticweb/owl/explanation/api/ExplanationException.java
// public class ExplanationException extends OWLRuntimeException {
// 
// 
//     public ExplanationException(Throwable cause) {
//         super(cause);
//     }
// 
// 
//     public ExplanationException(String message) {
//         super(message);
//     }
// 
// 
//     public ExplanationException(String message, Throwable cause) {
//         super(message, cause);
//     }
// }
// 
// Path: src/main/java/org/semanticweb/owl/explanation/api/ExplanationGeneratorInterruptedException.java
// public class ExplanationGeneratorInterruptedException extends ExplanationException {
// 
//     public ExplanationGeneratorInterruptedException() {
//         super("Explanation generator interrupted");
//     }
// }
// 
// Path: src/main/java/org/semanticweb/owl/explanation/impl/blackbox/EntailmentChecker.java
// public interface EntailmentChecker<E> {
// 
//     int getCounter();
// 
//     void resetCounter();
// 
//     E getEntailment();
// 
//     Set<OWLEntity> getEntailmentSignature();
// 
//     Set<OWLEntity> getSeedSignature();
// 
//     boolean isEntailed(Set<OWLAxiom> axiom);
// 
//     Set<OWLAxiom> getEntailingAxioms(Set<OWLAxiom> axioms);
// 
//     Set<OWLAxiom> getModule(Set<OWLAxiom> axioms);
// 
//     String getModularisationTypeDescription();
// 
//     boolean isUseModularisation();
// }


// Path: src/main/java/org/semanticweb/owl/explanation/impl/blackbox/checker/SatisfiabilityEntailmentChecker.java
import org.semanticweb.owl.explanation.api.ExplanationException;
import org.semanticweb.owl.explanation.api.ExplanationGeneratorInterruptedException;
import org.semanticweb.owl.explanation.telemetry.DefaultTelemetryInfo;
import org.semanticweb.owl.explanation.telemetry.TelemetryInfo;
import org.semanticweb.owl.explanation.telemetry.TelemetryTimer;
import org.semanticweb.owl.explanation.telemetry.TelemetryTransmitter;
import org.semanticweb.owlapi.apibinding.OWLManager;
import org.semanticweb.owl.explanation.impl.blackbox.EntailmentChecker;
import org.semanticweb.owlapi.model.*;
import org.semanticweb.owlapi.reasoner.*;
import uk.ac.manchester.cs.owlapi.modularity.SyntacticLocalityModuleExtractor;
import uk.ac.manchester.cs.owlapi.modularity.ModuleType;
import java.io.File;
import java.io.FileNotFoundException;
import java.io.FileOutputStream;
import java.net.URL;
import java.util.Collections;
import java.util.HashSet;
import java.util.Set;

            OWLClass namingCls = man.getOWLDataFactory().getOWLClass(IRI.create(clsName));
            OWLAxiom namingAxiom = man.getOWLDataFactory().getOWLSubClassOfAxiom(namingCls, unsatDesc);
            man.addAxiom(ont, namingAxiom);
            for (OWLEntity freshEntity : freshEntities) {
                man.addAxiom(ont, man.getOWLDataFactory().getOWLDeclarationAxiom(freshEntity));
            }

            // Do the actual entailment check
            counter++;
            entailmentCheckTimer.start();
            OWLReasoner reasoner = reasonerFactory.createReasoner(ont, new SimpleConfiguration(new NullReasonerProgressMonitor(), FreshEntityPolicy.ALLOW, timeOutMS, IndividualNodeSetPolicy.BY_SAME_AS));
            entailed = !reasoner.isSatisfiable(unsatDesc);
            entailmentCheckTimer.stop();


            reasoner.dispose();
            man.removeOntology(ont);
            if (entailed) {
                lastEntailingAxioms.remove(namingAxiom);
                lastEntailingAxioms.addAll(ont.getLogicalAxioms());
            }
            return entailed;
        }
        catch (OWLOntologyCreationException e) {
            throw new ExplanationException(e);
        }
        catch (TimeOutException e) {
            transmitter.recordMeasurement(info, "reasoner time out", true);
            throw e;
        }
        catch (ExplanationGeneratorInterruptedException e) {