ATermAppl av = i.next();
ATerm p = av.getArgument( 0 );
ATermAppl c = (ATermAppl) av.getArgument( 1 );
ATermList roleChain = ATermUtils.EMPTY_LIST;
Role s = null;
if( p.getType() == ATerm.LIST ) {
roleChain = (ATermList) p;
s = strategy.getABox().getRole( roleChain.getFirst() );
roleChain = roleChain.getNext();
}
else
s = strategy.getABox().getRole( p );
if ( s.isTop() && s.isObjectRole() ) {
applyAllValuesTop( av, c, ds );
if( strategy.getABox().isClosed() )
return;
continue;
}
if( pred.isSubRoleOf( s ) ) {
DependencySet finalDS = subj.getDepends( av );
finalDS = finalDS.union( ds, strategy.getABox().doExplanation() );
finalDS = finalDS.union( s.getExplainSubOrInv( pred ), strategy.getABox().doExplanation() );
if( roleChain.isEmpty() )
applyAllValues( subj, s, obj, c, finalDS );
else if (obj.isIndividual()) {
ATermAppl allRC = ATermUtils.makeAllValues( roleChain, c );
strategy.addType( obj, allRC, finalDS );
}
if( strategy.getABox().isClosed() )
return;
}
if( !s.isSimple() ) {
DependencySet finalDS = subj.getDepends( av ).union( ds, strategy.getABox().doExplanation() );
Set<ATermList> subRoleChains = s.getSubRoleChains();
for( Iterator<ATermList> it = subRoleChains.iterator(); it.hasNext(); ) {
ATermList chain = it.next();
// if( !pred.getName().equals( chain.getFirst() ) )
Role firstRole = strategy.getABox().getRole(chain.getFirst());
if( !pred.isSubRoleOf( firstRole ) )
continue;
ATermAppl allRC = ATermUtils.makeAllValues( chain.getNext(), c );
applyAllValues( subj, pred, obj, allRC, finalDS.union(
firstRole.getExplainSub(pred.getName()), strategy.getABox().doExplanation()).union(
s.getExplainSub(chain), strategy.getABox().doExplanation() ) );