public static ATermAppl min(final ATermAppl r, final int n, final ATermAppl c) { return ATermUtils.makeMin(r, n, c); }
public static ATermAppl min(final ATermAppl r, final int n, final ATermAppl c) { return ATermUtils.makeMin(r, n, c); }
final static public ATermAppl makeMin(final ATerm r, final int n, final ATerm c) { // comment out built-in simplification so that clashExplanation // axioms will come out right // if( n == 0 ) // return TOP; return makeMin(r, factory.makeInt(n), c); }
final static public ATermAppl makeMin(final ATerm r, final int n, final ATerm c) { // comment out built-in simplification so that clashExplanation // axioms will come out right // if( n == 0 ) // return TOP; return makeMin(r, factory.makeInt(n), c); }
final static public ATermAppl makeNormalizedMax(final ATermAppl r, final int n, final ATermAppl c) { assertTrue(n >= 0); return makeNot(makeMin(r, n + 1, c)); }
final static public ATermAppl makeNormalizedMax(final ATermAppl r, final int n, final ATermAppl c) { assertTrue(n >= 0); return makeNot(makeMin(r, n + 1, c)); }
final static public ATermAppl makeExactCard(final ATerm r, final ATermInt n, final ATerm c) { final ATermAppl max = makeMax(r, n, c); if (n.getInt() == 0) return max; final ATermAppl min = makeMin(r, n, c); return makeAnd(min, max); }
final static public ATermAppl makeExactCard(final ATerm r, final ATermInt n, final ATerm c) { final ATermAppl max = makeMax(r, n, c); if (n.getInt() == 0) return max; final ATermAppl min = makeMin(r, n, c); return makeAnd(min, max); }
@Override public void visit(final OWLDataMinCardinality restriction) { restriction.getProperty().accept(this); final ATerm p = _term; final int n = restriction.getCardinality(); restriction.getFiller().accept(this); final ATermAppl desc = _term; _term = ATermUtils.makeMin(p, n, desc); }
@Override public void visit(final OWLDataMinCardinality restriction) { restriction.getProperty().accept(this); final ATerm p = _term; final int n = restriction.getCardinality(); restriction.getFiller().accept(this); final ATermAppl desc = _term; _term = ATermUtils.makeMin(p, n, desc); }
@Override public void visit(final OWLDataMinCardinality restriction) { restriction.getProperty().accept(this); final ATerm p = _term; final int n = restriction.getCardinality(); restriction.getFiller().accept(this); final ATermAppl desc = _term; _term = ATermUtils.makeMin(p, n, desc); }
@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; }
@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; }
@Override public void visit(final OWLObjectMinCardinality restriction) { addSimpleProperty(restriction.getProperty()); restriction.getProperty().accept(this); final ATerm p = _term; final int n = restriction.getCardinality(); restriction.getFiller().accept(this); final ATermAppl desc = _term; _term = ATermUtils.makeMin(p, n, desc); }
@Override public void visit(final OWLObjectMinCardinality restriction) { addSimpleProperty(restriction.getProperty()); restriction.getProperty().accept(this); final ATerm p = _term; final int n = restriction.getCardinality(); restriction.getFiller().accept(this); final ATermAppl desc = _term; _term = ATermUtils.makeMin(p, n, desc); }
@Override public void visit(final OWLObjectMinCardinality restriction) { addSimpleProperty(restriction.getProperty()); restriction.getProperty().accept(this); final ATerm p = _term; final int n = restriction.getCardinality(); restriction.getFiller().accept(this); final ATermAppl desc = _term; _term = ATermUtils.makeMin(p, n, desc); }
return ATermUtils.makeMin(pt, cardinality, c); else if (restrictionType.equals(OWL.maxCardinality.asNode()) || restrictionType.equals(OWL2.maxQualifiedCardinality.asNode()))
@Test public void testMaxOneDataProp() { _kb.addClass(person); _kb.addDatatypeProperty(ssn); final ATermAppl max1ssn = ATermUtils.makeMax(ssn, 1, ATermUtils.TOP_LIT); _kb.addSubClass(person, max1ssn); _kb.addSubClass(person, ATermUtils.makeMin(ssn, 1, ATermUtils.TOP_LIT)); _kb.addIndividual(robert); _kb.addType(robert, person); final ATermAppl ssn1 = ATermUtils.makePlainLiteral("012345678"); final ATermAppl ssn2 = ATermUtils.makePlainLiteral("123456789"); _kb.addPropertyValue(ssn, robert, ssn1); _kb.addPropertyValue(ssn, robert, ssn2); assertFalse(_kb.isConsistent()); final Set<ATermAppl> explanation = _kb.getExplanationSet(); assertIteratorValues(explanation.iterator(), new Object[] { ATermUtils.makePropAtom(ssn, robert, ssn1), ATermUtils.makePropAtom(ssn, robert, ssn2), ATermUtils.makeSub(person, max1ssn), ATermUtils.makeTypeAtom(robert, person), }); }