@Override public ABoxImpl copy(final ATermAppl extraIndividual, final boolean copyIndividuals) { return new ABoxImpl(_kb, this, extraIndividual, copyIndividuals); }
@Override public Individual addFreshIndividual(final Individual parent, final DependencySet ds) { final boolean isNominal = parent == null; final ATermAppl name = createUniqueName(isNominal); final Individual ind = addIndividual(name, parent, ds); if (isNominal) ind.setNominalLevel(1); return ind; }
/** * Add a new literal to the ABox. Literal will be assigned a fresh unique name. * * @param dataValue A literal ATerm which should be constructed with one of ATermUtils.makeXXXLiteral functions * @return Literal object that has been created */ @Override public Literal addLiteral(final ATermAppl dataValue) { final int remember = getBranchIndex(); setBranchIndex(DependencySet.NO_BRANCH); final Literal lit = addLiteral(dataValue, DependencySet.INDEPENDENT); setBranchIndex(remember); return lit; }
@Override public Literal addLiteral(final DependencySet ds) { return createLiteral(ATermUtils.makeLiteral(createUniqueName(false)), ds); }
final boolean emptyConsistencyCheck = initialConsistencyCheck && isEmpty(); c = ATermUtils.TOP; final ABox abox = canUseEmptyABox ? this.copy(x, false) : initialConsistencyCheck ? this : this.copy(x, true); cache(abox.getIndividual(x), c, consistent); if (initialConsistencyCheck && isEmpty()) setComplete(true); final Set<ATermAppl> explanationSet = getExplanationSet(); final boolean removed = explanationSet.remove(tempAxiom); if (!removed) for (final ATermAppl axiom : getExplanationSet())
/** * @return true if this ABox is consistent. Consistent ABox means after applying all the tableau completion rules at least one _branch with no clashes was * found */ @Override public boolean isConsistent() { boolean isConsistent = false; checkAssertedClashes(); isConsistent = isConsistent(Collections.emptySet(), null, false); if (isConsistent) { // put the BOTTOM concept into the _cache which will // also put TOP in there _cache.putSat(ATermUtils.BOTTOM, false); assert isComplete() : "ABox not marked complete!"; } return isConsistent; }
@Override public boolean hasPropertyValue(final ATermAppl s, final ATermAppl p, final ATermAppl o) { final Bool hasObviousValue = hasObviousPropertyValue(s, p, o); if (hasObviousValue.isKnown()) if (hasObviousValue.isFalse() || !doExplanation()) return hasObviousValue.isTrue(); ATermAppl c = null; if (o == null) { if (_kb.isDatatypeProperty(p)) c = ATermUtils.makeMin(p, 1, ATermUtils.TOP_LIT); else c = ATermUtils.makeMin(p, 1, ATermUtils.TOP); } else c = ATermUtils.makeHasValue(p, o); final boolean isType = isType(s, c); return isType; }
c = ATermUtils.normalize(c); if (!doExplanation()) subs = Collections.emptySet(); final Bool type = isKnownType(x, c, subs); if (type.isKnown()) return type.isTrue(); final boolean isType = !isConsistent(SetUtils.singleton(x), notC, false); timer.ifPresent(Timer::stop);
@Override public Individual addIndividual(final ATermAppl x, final DependencySet ds) { final Individual ind = addIndividual(x, null, ds); // update affected inds for this _branch if (getBranchIndex() >= 0 && OpenlletOptions.TRACK_BRANCH_EFFECTS) _branchEffects.add(getBranchIndex(), ind.getName()); return ind; }
@Override public void addType(final ATermAppl x, final ATermAppl c) { final DependencySet ds = OpenlletOptions.USE_TRACING ? new DependencySet(ATermUtils.makeTypeAtom(x, c)) : DependencySet.INDEPENDENT; addType(x, c, ds); }
@Override public Literal addLiteral(final ATermAppl dataValue, final DependencySet ds) { if (dataValue == null || !ATermUtils.isLiteral(dataValue)) throw new InternalReasonerException("Invalid value to create a literal. Value: " + dataValue); return createLiteral(dataValue, ds); }
@Override public ABoxImpl copy() { return copy(_kb); }
final boolean emptyConsistencyCheck = initialConsistencyCheck && isEmpty(); c = ATermUtils.TOP; final ABox abox = canUseEmptyABox ? this.copy(x, false) : initialConsistencyCheck ? this : this.copy(x, true); cache(abox.getIndividual(x), c, consistent); if (initialConsistencyCheck && isEmpty()) setComplete(true); final Set<ATermAppl> explanationSet = getExplanationSet(); final boolean removed = explanationSet.remove(tempAxiom); if (!removed) for (final ATermAppl axiom : getExplanationSet())
/** * @return true if this ABox is consistent. Consistent ABox means after applying all the tableau completion rules at least one _branch with no clashes was * found */ @Override public boolean isConsistent() { boolean isConsistent = false; checkAssertedClashes(); isConsistent = isConsistent(Collections.emptySet(), null, false); if (isConsistent) { // put the BOTTOM concept into the _cache which will // also put TOP in there _cache.putSat(ATermUtils.BOTTOM, false); assert isComplete() : "ABox not marked complete!"; } return isConsistent; }
@Override public boolean hasPropertyValue(final ATermAppl s, final ATermAppl p, final ATermAppl o) { final Bool hasObviousValue = hasObviousPropertyValue(s, p, o); if (hasObviousValue.isKnown()) if (hasObviousValue.isFalse() || !doExplanation()) return hasObviousValue.isTrue(); ATermAppl c = null; if (o == null) { if (_kb.isDatatypeProperty(p)) c = ATermUtils.makeMin(p, 1, ATermUtils.TOP_LIT); else c = ATermUtils.makeMin(p, 1, ATermUtils.TOP); } else c = ATermUtils.makeHasValue(p, o); final boolean isType = isType(s, c); return isType; }
c = ATermUtils.normalize(c); if (!doExplanation()) subs = Collections.emptySet(); final Bool type = isKnownType(x, c, subs); if (type.isKnown()) return type.isTrue(); final boolean isType = !isConsistent(SetUtils.singleton(x), notC, false); timer.ifPresent(Timer::stop);
@Override public Literal addLiteral(final DependencySet ds) { return createLiteral(ATermUtils.makeLiteral(createUniqueName(false)), ds); }
@Override public Individual addIndividual(final ATermAppl x, final DependencySet ds) { final Individual ind = addIndividual(x, null, ds); // update affected inds for this _branch if (getBranchIndex() >= 0 && OpenlletOptions.TRACK_BRANCH_EFFECTS) _branchEffects.add(getBranchIndex(), ind.getName()); return ind; }
@Override public void addType(final ATermAppl x, final ATermAppl c) { final DependencySet ds = OpenlletOptions.USE_TRACING ? new DependencySet(ATermUtils.makeTypeAtom(x, c)) : DependencySet.INDEPENDENT; addType(x, c, ds); }
@Override public Literal addLiteral(final ATermAppl dataValue, final DependencySet ds) { if (dataValue == null || !ATermUtils.isLiteral(dataValue)) throw new InternalReasonerException("Invalid value to create a literal. Value: " + dataValue); return createLiteral(dataValue, ds); }