monitor.setProgressLength( kb.getIndividuals().size() );
monitor.taskStarted();
Iterator<Individual> i = kb.getABox().getIndIterator();
for( int count = 0; i.hasNext(); count++ ) {
Individual x = i.next();
monitor.incrementProgress();
kb.timers.getTimer( "realize" ).check();
if( monitor.isCanceled() ) {
return false;
}
if( log.isLoggable( Level.FINER ) ) {
log.finer( count + ") Realizing " + format( x.getName() ) + " " );
}
Map<ATermAppl, Boolean> marked = new HashMap<ATermAppl, Boolean>();
List<ATermAppl> obviousTypes = new ArrayList<ATermAppl>();
List<ATermAppl> obviousNonTypes = new ArrayList<ATermAppl>();
kb.getABox().getObviousTypes( x.getName(), obviousTypes, obviousNonTypes );
for( ATermAppl c : obviousTypes ) {
// since nominals can be returned by getObviousTypes
// we need the following check
if( !taxonomy.contains( c ) ) {
continue;
}
mark( taxonomy.getAllEquivalents( c ), marked, Boolean.TRUE );
mark( taxonomy.getFlattenedSupers( c, /* direct = */true ), marked, Boolean.TRUE );
// FIXME: markToldDisjoints operates on a map key'd with
// TaxonomyNodes, not ATermAppls
// markToldDisjoints( c, false );
}
for( ATermAppl c : obviousNonTypes ) {
mark( taxonomy.getAllEquivalents( c ), marked, Boolean.FALSE );
mark( taxonomy.getFlattenedSubs( c, /* direct = */true ), marked, Boolean.FALSE );
}
realizeByIndividual( x.getName(), ATermUtils.TOP, marked );
}
monitor.taskFinished();
return true;