}
}
public Bool isKnownType(Individual pNode, ATermAppl concept, Collection<ATermAppl> subs) {
// Timer t = kb.timers.startTimer( "isKnownType" );
Bool isType = isType( pNode, concept );
if( isType.isUnknown() ) {
Set<ATermAppl> concepts = ATermUtils.isAnd( concept )
? ATermUtils.listToSet( (ATermList) concept.getArgument( 0 ) )
: SetUtils.singleton( concept );
isType = Bool.TRUE;
for( ATermAppl c : concepts ) {
Bool type = pNode.hasObviousType( c );
if( type.isUnknown() && pNode.hasObviousType( subs ) ) {
type = Bool.TRUE;
}
if( type.isKnown() ) {
isType = isType.and( type );
}
else {
isType = Bool.UNKNOWN;
// boolean justSC = true;
Collection<ATermAppl> axioms = kb.getTBox().getAxioms( c );
LOOP: for( ATermAppl axiom : axioms ) {
ATermAppl term = (ATermAppl) axiom.getArgument( 1 );
// final AFun afun = axiom.getAFun();
//
// if( !afun.equals( ATermUtils.SUBFUN ) ) {
// justSC = false;
// }
boolean equivalent = axiom.getAFun().equals( ATermUtils.EQCLASSFUN );
if( equivalent ) {
Iterator<ATermAppl> i = ATermUtils.isAnd( term )
? new MultiListIterator( (ATermList) term.getArgument( 0 ) )
: Collections.singleton( term ).iterator();
Bool knownType = Bool.TRUE;
while( i.hasNext() && knownType.isTrue() ) {
term = i.next();
knownType = isKnownType( pNode, term, SetUtils.<ATermAppl>emptySet() );
}
if( knownType.isTrue() ) {
isType = Bool.TRUE;
break LOOP;
}
}
}