/** * @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; }
/** * @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; }
public void reset() if (!isComplete()) return;
public void reset() if (!isComplete()) return;
public boolean isIncConsistent() assert isComplete() : "Initial consistency check has not been performed!";
public boolean isIncConsistent() assert isComplete() : "Initial consistency check has not been performed!";
@Override public void getObviousTypes(final ATermAppl x, final List<ATermAppl> types, final List<ATermAppl> nonTypes) { assert isComplete() : "Initial consistency check has not been performed!"; Individual pNode = getIndividual(x); if (!pNode.getMergeDependency(true).isIndependent()) pNode = getIndividual(x); else pNode = pNode.getSame(); pNode.getObviousTypes(types, nonTypes); }
@Override public void getObviousTypes(final ATermAppl x, final List<ATermAppl> types, final List<ATermAppl> nonTypes) { assert isComplete() : "Initial consistency check has not been performed!"; Individual pNode = getIndividual(x); if (!pNode.getMergeDependency(true).isIndependent()) pNode = getIndividual(x); else pNode = pNode.getSame(); pNode.getObviousTypes(types, nonTypes); }
@Override public void getObjectPropertyValues(final ATermAppl s, final Role role, final Set<ATermAppl> knowns, final Set<ATermAppl> unknowns, final boolean getSames) { assert isComplete() : "Initial consistency check has not been performed!"; Individual subj = getIndividual(s); boolean isIndependent = true; if (subj.isMerged()) { isIndependent = subj.getMergeDependency(true).isIndependent(); subj = subj.getSame(); } if (role.isSimple()) getSimpleObjectPropertyValues(subj, role, knowns, unknowns, getSames); else if (!role.hasComplexSubRole()) getTransitivePropertyValues(subj, role, knowns, unknowns, getSames, new HashMap<Individual, Set<Role>>(), true); else { final TransitionGraph<Role> tg = role.getFSM(); getComplexObjectPropertyValues(subj, tg.getInitialState(), tg, knowns, unknowns, getSames, new HashMap<Individual, Set<State<Role>>>(), true); } if (!isIndependent) { unknowns.addAll(knowns); knowns.clear(); } }
@Override public void getObjectPropertyValues(final ATermAppl s, final Role role, final Set<ATermAppl> knowns, final Set<ATermAppl> unknowns, final boolean getSames) { assert isComplete() : "Initial consistency check has not been performed!"; Individual subj = getIndividual(s); boolean isIndependent = true; if (subj.isMerged()) { isIndependent = subj.getMergeDependency(true).isIndependent(); subj = subj.getSame(); } if (role.isSimple()) getSimpleObjectPropertyValues(subj, role, knowns, unknowns, getSames); else if (!role.hasComplexSubRole()) getTransitivePropertyValues(subj, role, knowns, unknowns, getSames, new HashMap<Individual, Set<Role>>(), true); else { final TransitionGraph<Role> tg = role.getFSM(); getComplexObjectPropertyValues(subj, tg.getInitialState(), tg, knowns, unknowns, getSames, new HashMap<Individual, Set<State<Role>>>(), true); } if (!isIndependent) { unknowns.addAll(knowns); knowns.clear(); } }
@Override public Bool isKnownType(final ATermAppl x, final ATermAppl c, final Collection<ATermAppl> subs) { assert isComplete() : "Initial consistency check has not been performed!"; Individual pNode = getIndividual(x); boolean isIndependent = true; if (pNode.isMerged()) { isIndependent = pNode.getMergeDependency(true).isIndependent(); pNode = pNode.getSame(); } final Bool isType = isKnownType(pNode, c, subs); if (isIndependent) return isType; else if (isType.isTrue()) return Bool.UNKNOWN; else return isType; }
@Override public Bool isKnownType(final ATermAppl x, final ATermAppl c, final Collection<ATermAppl> subs) { assert isComplete() : "Initial consistency check has not been performed!"; Individual pNode = getIndividual(x); boolean isIndependent = true; if (pNode.isMerged()) { isIndependent = pNode.getMergeDependency(true).isIndependent(); pNode = pNode.getSame(); } final Bool isType = isKnownType(pNode, c, subs); if (isIndependent) return isType; else if (isType.isTrue()) return Bool.UNKNOWN; else return isType; }
@Override public List<ATermAppl> getDataPropertyValues(final ATermAppl s, final Role role, final ATermAppl datatype, final boolean onlyObvious) assert isComplete() : "Initial consistency check has not been performed!";
@Override public List<ATermAppl> getDataPropertyValues(final ATermAppl s, final Role role, final ATermAppl datatype, final boolean onlyObvious) assert isComplete() : "Initial consistency check has not been performed!";
@Override public Bool hasObviousDataPropertyValue(final ATermAppl s, final ATermAppl p, final Object value) { assert isComplete() : "Initial consistency check has not been performed!"; Individual subj = getIndividual(s); final Role prop = getRole(p); if (prop.isTop()) return Bool.TRUE; else if (prop.isBottom()) return Bool.FALSE; // if onlyPositive is set then the answer returned is sound but not // complete so we cannot return negative answers boolean onlyPositive = false; if (!subj.getMergeDependency(true).isIndependent()) { onlyPositive = true; subj = getIndividual(s); } else subj = subj.getSame(); final Bool hasValue = subj.hasDataPropertyValue(prop, value); if (onlyPositive && hasValue.isFalse()) return Bool.UNKNOWN; return hasValue; }
@Override public Bool hasObviousDataPropertyValue(final ATermAppl s, final ATermAppl p, final Object value) { assert isComplete() : "Initial consistency check has not been performed!"; Individual subj = getIndividual(s); final Role prop = getRole(p); if (prop.isTop()) return Bool.TRUE; else if (prop.isBottom()) return Bool.FALSE; // if onlyPositive is set then the answer returned is sound but not // complete so we cannot return negative answers boolean onlyPositive = false; if (!subj.getMergeDependency(true).isIndependent()) { onlyPositive = true; subj = getIndividual(s); } else subj = subj.getSame(); final Bool hasValue = subj.hasDataPropertyValue(prop, value); if (onlyPositive && hasValue.isFalse()) return Bool.UNKNOWN; return hasValue; }