ATermAppl A = ATermUtils.makeTermAppl( "A" );
ATermAppl B = ATermUtils.makeTermAppl( "B" );
ATermAppl C = ATermUtils.makeTermAppl( "C" );
ATermAppl x = ATermUtils.makeTermAppl( "x" );
KnowledgeBase kb = new KnowledgeBase();
kb.addClass( A );
kb.addClass( B );
kb.addClass( C );
kb.addIndividual( x );
kb.addSubClass( C, A );
kb.addType( x, C );
kb.addType( x, B );
Set<Set<ATermAppl>> expectedTypes = new HashSet<Set<ATermAppl>>();
expectedTypes.add( Collections.singleton( ATermUtils.TOP ) );
expectedTypes.add( Collections.singleton( A ) );
expectedTypes.add( Collections.singleton( B ) );
expectedTypes.add( Collections.singleton( C ) );
assertTrue( kb.isConsistent() );
Set<Set<ATermAppl>> actualTypes = kb.getTypes( x );
assertEquals( expectedTypes, actualTypes );
kb.addDisjointClass( A, B );
assertFalse( kb.isConsistent() );
assertTrue( kb.removeAxiom( ATermUtils.makeDisjoint( A, B ) ) );
assertTrue( kb.isConsistent() );
actualTypes = kb.getTypes( x );
assertEquals( expectedTypes, actualTypes );
} finally {
PelletOptions.setOptions( savedOptions );
}