@Override public <C extends Context> Proof<EntailmentInference> getEvidence( final boolean atMostOne, final SaturationState<C> saturationState, final SaturationConclusion.Factory conclusionFactory) throws ElkQueryException { final Collection<Proof<EntailmentInference>> proofs = new ArrayList<Proof<EntailmentInference>>(); for (final P premise : premises_) { proofs.add(premise.getEvidence(atMostOne, saturationState, conclusionFactory)); } proofs.add(new Proof<EntailmentInference>() { @Override public Collection<? extends EntailmentInference> getInferences( final Object conclusion) { if (!getQuery().equals(conclusion)) { return Collections.emptyList(); } // else return getEntailmentInference(); } }); return Proofs.union(proofs); }
@Override public Collection<? extends IndexedContextRoot> getPositivelyIndexed() { final Collection<IndexedContextRoot> result = new ArrayList<IndexedContextRoot>( premises_.size()); for (final P subsumption : premises_) { result.addAll(subsumption.getPositivelyIndexed()); } return result; }
@Override public Entailment getEntailment() throws ElkQueryException { if (indexed == null) { throw new ElkQueryException( "Query was not indexed: " + getQuery()); } // else return indexed.getQuery(); }
@Override public Entailment getEntailment() throws ElkQueryException { if (indexed == null) { throw new ElkQueryException( "Query was not indexed: " + getQuery()); } // else return indexed.getQuery(); }
@Override public Collection<? extends IndexedContextRoot> getPositivelyIndexed() { final Collection<IndexedContextRoot> result = new ArrayList<IndexedContextRoot>( premises_.size()); for (final P subsumption : premises_) { result.addAll(subsumption.getPositivelyIndexed()); } return result; }
@Override public <C extends Context> Proof<EntailmentInference> getEvidence( final boolean atMostOne, final SaturationState<C> saturationState, final SaturationConclusion.Factory conclusionFactory) throws ElkQueryException { final Collection<Proof<EntailmentInference>> proofs = new ArrayList<Proof<EntailmentInference>>(); for (final P premise : premises_) { proofs.add(premise.getEvidence(atMostOne, saturationState, conclusionFactory)); } proofs.add(new Proof<EntailmentInference>() { @Override public Collection<? extends EntailmentInference> getInferences( final Object conclusion) { if (!getQuery().equals(conclusion)) { return Collections.emptyList(); } // else return getEntailmentInference(); } }); return Proofs.union(proofs); }
@Override public Entailment getEntailment() throws ElkQueryException { if (indexed == null) { throw new ElkQueryException( "Query was not indexed: " + getQuery()); } // else return indexed.getQuery(); }
@Override public Collection<? extends IndexedContextRoot> getPositivelyIndexed() { final Collection<IndexedContextRoot> result = new ArrayList<IndexedContextRoot>( premises_.size()); for (final P subsumption : premises_) { result.addAll(subsumption.getPositivelyIndexed()); } return result; }
@Override public <C extends Context> Proof<EntailmentInference> getEvidence( final boolean atMostOne, final SaturationState<C> saturationState, final SaturationConclusion.Factory conclusionFactory) throws ElkQueryException { final Collection<Proof<EntailmentInference>> proofs = new ArrayList<Proof<EntailmentInference>>(); for (final P premise : premises_) { proofs.add(premise.getEvidence(atMostOne, saturationState, conclusionFactory)); } proofs.add(new Proof<EntailmentInference>() { @Override public Collection<? extends EntailmentInference> getInferences( final Object conclusion) { if (!getQuery().equals(conclusion)) { return Collections.emptyList(); } // else return getEntailmentInference(); } }); return Proofs.union(proofs); }
@Override public boolean isEntailed() throws ElkQueryException { if (indexed == null) { throw new ElkQueryException( "Query was not indexed: " + getQuery()); } // else final boolean result = Proofs.isDerivable(getEvidence(true), indexed.getQuery()); if (!result) { incompleteness_.log(incompleteness_ .getIncompletenessMonitorForEntailmentQuery( getOccurrenceStore(this))); } // If the query is entailed, the result is complete. return result; }
/** * @return {@link IndexedContextRoot} that are needed to answer the * registered entailment queries and not saturated. */ Collection<IndexedContextRoot> getNotSaturatedPositivelyIndexedRoots() { int sizeUpper = 0; for (final QueryState state : queried_.values()) { if (state.indexed != null) { sizeUpper += state.indexed.getPositivelyIndexed().size(); } } final Iterable<IndexedContextRoot> result = Operations .concat(Operations.map(queried_.values(), POSITIVELY_INDEXED)); return Operations.getCollection(result, sizeUpper); }
@SuppressWarnings("unchecked") @Override public Proof<EntailmentInference> getEvidence(final boolean onlyOne) throws ElkQueryException { if (indexed == null) { throw new ElkQueryException( "Query was not indexed: " + getQuery()); } // else incompleteness_.log( incompleteness_.getIncompletenessMonitorForEntailmentQuery( getOccurrenceStore(this))); final Proof<EntailmentInference> inconsistencyEvidence = new InconsistencyProofWrapper( consistencyCheckingState_.getEvidence(onlyOne)); if (consistencyCheckingState_.isInconsistent() && onlyOne) { return inconsistencyEvidence; } // else final Proof<EntailmentInference> entailmentEvidence = indexed .getEvidence(onlyOne, saturationState_, conclusionFactory_); return Proofs.union(inconsistencyEvidence, entailmentEvidence); }
@Override public boolean isEntailed() throws ElkQueryException { if (indexed == null) { throw new ElkQueryException( "Query was not indexed: " + getQuery()); } // else final boolean result = Proofs.isDerivable(getEvidence(true), indexed.getQuery()); if (!result) { incompleteness_.log(incompleteness_ .getIncompletenessMonitorForEntailmentQuery( getOccurrenceStore(this))); } // If the query is entailed, the result is complete. return result; }
/** * @return {@link IndexedContextRoot} that are needed to answer the * registered entailment queries and not saturated. */ Collection<IndexedContextRoot> getNotSaturatedPositivelyIndexedRoots() { int sizeUpper = 0; for (final QueryState state : queried_.values()) { if (state.indexed != null) { sizeUpper += state.indexed.getPositivelyIndexed().size(); } } final Iterable<IndexedContextRoot> result = Operations .concat(Operations.map(queried_.values(), POSITIVELY_INDEXED)); return Operations.getCollection(result, sizeUpper); }
@SuppressWarnings("unchecked") @Override public Proof<EntailmentInference> getEvidence(final boolean onlyOne) throws ElkQueryException { if (indexed == null) { throw new ElkQueryException( "Query was not indexed: " + getQuery()); } // else incompleteness_.log( incompleteness_.getIncompletenessMonitorForEntailmentQuery( getOccurrenceStore(this))); final Proof<EntailmentInference> inconsistencyEvidence = new InconsistencyProofWrapper( consistencyCheckingState_.getEvidence(onlyOne)); if (consistencyCheckingState_.isInconsistent() && onlyOne) { return inconsistencyEvidence; } // else final Proof<EntailmentInference> entailmentEvidence = indexed .getEvidence(onlyOne, saturationState_, conclusionFactory_); return Proofs.union(inconsistencyEvidence, entailmentEvidence); }
@Override public boolean isEntailed() throws ElkQueryException { if (indexed == null) { throw new ElkQueryException( "Query was not indexed: " + getQuery()); } // else final boolean result = Proofs.isDerivable(getEvidence(true), indexed.getQuery()); if (!result) { incompleteness_.log(incompleteness_ .getIncompletenessMonitorForEntailmentQuery( getOccurrenceStore(this))); } // If the query is entailed, the result is complete. return result; }
/** * @return {@link IndexedContextRoot} that are needed to answer the * registered entailment queries and not saturated. */ Collection<IndexedContextRoot> getNotSaturatedPositivelyIndexedRoots() { int sizeUpper = 0; for (final QueryState state : queried_.values()) { if (state.indexed != null) { sizeUpper += state.indexed.getPositivelyIndexed().size(); } } final Iterable<IndexedContextRoot> result = Operations .concat(Operations.map(queried_.values(), POSITIVELY_INDEXED)); return Operations.getCollection(result, sizeUpper); }
@SuppressWarnings("unchecked") @Override public Proof<EntailmentInference> getEvidence(final boolean onlyOne) throws ElkQueryException { if (indexed == null) { throw new ElkQueryException( "Query was not indexed: " + getQuery()); } // else incompleteness_.log( incompleteness_.getIncompletenessMonitorForEntailmentQuery( getOccurrenceStore(this))); final Proof<EntailmentInference> inconsistencyEvidence = new InconsistencyProofWrapper( consistencyCheckingState_.getEvidence(onlyOne)); if (consistencyCheckingState_.isInconsistent() && onlyOne) { return inconsistencyEvidence; } // else final Proof<EntailmentInference> entailmentEvidence = indexed .getEvidence(onlyOne, saturationState_, conclusionFactory_); return Proofs.union(inconsistencyEvidence, entailmentEvidence); }