@Override public void foundExplanation(ExplanationGenerator<OWLAxiom> owlAxiomExplanationGenerator, Explanation<OWLAxiom> owlAxiomExplanation, Set<Explanation<OWLAxiom>> allFoundExplanations) { System.out.println("\tFound " + allFoundExplanations.size() + " OPlus Justifications"); numberOfOPlusJustificationsFound = allFoundExplanations.size(); if (isCancelled()) { throw new ExplanationGeneratorInterruptedException(); } }
@Override public void foundExplanation(ExplanationGenerator<OWLAxiom> owlAxiomExplanationGenerator, Explanation<OWLAxiom> owlAxiomExplanation, Set<Explanation<OWLAxiom>> allFoundExplanations) { System.out.println("\tFound " + allFoundExplanations.size() + " OPlus Justifications"); numberOfOPlusJustificationsFound = allFoundExplanations.size(); if(isCancelled()) { throw new ExplanationGeneratorInterruptedException(); } }
@Override public void constructTree(HittingSetTree<E> hittingSetTree, int limit, ExplanationGeneratorMediator<E> handler) { if (hittingSetTree.getProgressMonitor().isCancelled()) { throw new ExplanationGeneratorInterruptedException(); } List<HittingSetTreeNode<E>> queue = new ArrayList<>(); queue.add(hittingSetTree.getRoot()); boolean b = true; while (b) { b = buildHittingSetTree(hittingSetTree, limit, handler, queue); if (hittingSetTree.getProgressMonitor().isCancelled()) { throw new ExplanationGeneratorInterruptedException(); } } }
public List<OWLAxiom> extract(List<OWLAxiom> listS, List<OWLAxiom> listO, EntailmentChecker<E> checker, ExplanationProgressMonitor<?> progressMonitor) { if(progressMonitor.isCancelled()) { throw new ExplanationGeneratorInterruptedException(); } if(listO.size() == 1) { return listO; } ListHalves halves = getHalves(listO); if(isEntailed(listS, halves.getS1(), checker)) { return extract(listS, halves.getS1(), checker, progressMonitor); } if(isEntailed(listS, halves.getS2(), checker)) { return extract(listS, halves.getS2(), checker, progressMonitor); } List<OWLAxiom> listSWithS2 = new ArrayList<>(listS); listSWithS2.addAll(halves.getS2()); List<OWLAxiom> listS1Prime = extract(listSWithS2, halves.getS1(), checker, progressMonitor); List<OWLAxiom> listSWithS1Prime = new ArrayList<>(listS); listSWithS1Prime.addAll(listS1Prime); List<OWLAxiom> listS2Prime = extract(listSWithS1Prime, halves.getS2(), checker, progressMonitor); List<OWLAxiom> listS1PrimeWithS2Prime = new ArrayList<>(listS1Prime); listS1PrimeWithS2Prime.addAll(listS2Prime); return listS1PrimeWithS2Prime; }
throw new ExplanationGeneratorInterruptedException(); for (Explanation<OWLAxiom> expl : oplusExpls) { if (progressMonitor.isCancelled()) { throw new ExplanationGeneratorInterruptedException();
public boolean buildHittingSetTree(HittingSetTree<E> hittingSetTree, int limit, ExplanationGeneratorMediator<E> handler, List<HittingSetTreeNode<E>> queue) { while (!queue.isEmpty()) { if (hittingSetTree.getProgressMonitor().isCancelled()) { throw new ExplanationGeneratorInterruptedException(); for (OWLAxiom ax : nodeAxioms) { if (hittingSetTree.getProgressMonitor().isCancelled()) { throw new ExplanationGeneratorInterruptedException();
for (Explanation<OWLAxiom> expl : oplusExpls) { if(progressMonitor.isCancelled()) { throw new ExplanationGeneratorInterruptedException();