public void testDisjointPropertiesCache() {
// test case for issue #336 to verify AbstractConceptCache.isMergable does
// not return incorrect results.
KnowledgeBase kb = new KnowledgeBase();
ATermAppl p1 = term( "p1" );
ATermAppl p2 = term( "p2" );
ATermAppl a = term( "a" );
ATermAppl b = term( "b" );
ATermAppl c = term( "c" );
kb.addObjectProperty( p1 );
kb.addObjectProperty( p2 );
kb.addDisjointProperty( p1, p2 );
kb.addIndividual( a );
kb.addIndividual( b );
kb.addIndividual( c );
kb.addPropertyValue( p1, a, c );
kb.addPropertyValue( p2, b, a );
ATermAppl notp1a = ATermUtils.makeNot( ATermUtils.makeHasValue( p1, a ) );
// no caching so consistency checking will be used here
assertFalse( kb.isType( a, notp1a ) );
assertTrue( kb.isType( b, notp1a ) );