protected boolean findTarget(ATermAppl term, ATermAppl target, Set<ATermAppl> seen) { List<ATermAppl> queue = new ArrayList<ATermAppl>(); queue.add( term ); while( !queue.isEmpty() ) { kb.timers.checkTimer( "preprocessing" ); ATermAppl current = queue.remove( queue.size() - 1 ); if( !seen.add( current ) ) { continue; } if( current.equals( target ) ) { return true; } TermDefinition td = this.getTD( current ); if( td != null ) { // Shortcut if( td.getDependencies().contains( target ) ) { return true; } queue.addAll( td.getDependencies() ); } } return false; }
protected boolean findTarget(ATermAppl term, ATermAppl target, Set<ATermAppl> seen) { List<ATermAppl> queue = new ArrayList<ATermAppl>(); queue.add( term ); while( !queue.isEmpty() ) { kb.timers.checkTimer( "preprocessing" ); ATermAppl current = queue.remove( queue.size() - 1 ); if( !seen.add( current ) ) { continue; } if( current.equals( target ) ) { return true; } TermDefinition td = this.getTD( current ); if( td != null ) { // Shortcut if( td.getDependencies().contains( target ) ) { return true; } queue.addAll( td.getDependencies() ); } } return false; }
public void absorb() { log.fine( "Absorption started" ); if( log.isLoggable( Level.FINE ) ) { log.fine( "Tg.size was " + termhash.size() + " Tu.size was " + tbox.Tu.size() ); } Collection<TermDefinition> terms = termhash.values(); termhash = new HashMap<ATermAppl, TermDefinition>(); for( TermDefinition def : terms ) { kb.timers.checkTimer( "preprocessing" ); for( ATermAppl subClassAxiom : def.getSubClassAxioms() ) { ATermAppl c1 = (ATermAppl) subClassAxiom.getArgument( 0 ); ATermAppl c2 = (ATermAppl) subClassAxiom.getArgument( 1 ); absorbSubClass( c1, c2, tbox.getAxiomExplanation( subClassAxiom ) ); } for( ATermAppl eqClassAxiom : def.getEqClassAxioms() ) { ATermAppl c1 = (ATermAppl) eqClassAxiom.getArgument( 0 ); ATermAppl c2 = (ATermAppl) eqClassAxiom.getArgument( 1 ); absorbSubClass( c1, c2, tbox.getAxiomExplanation( eqClassAxiom ) ); absorbSubClass( c2, c1, tbox.getAxiomExplanation( eqClassAxiom ) ); } } if( log.isLoggable( Level.FINE ) ) { log.fine( "Tg.size is " + termhash.size() + " Tu.size is " + tbox.Tu.size() ); } log.fine( "Absorption finished" ); }
public void absorb() { log.fine( "Absorption started" ); if( log.isLoggable( Level.FINE ) ) { log.fine( "Tg.size was " + termhash.size() + " Tu.size was " + tbox.Tu.size() ); } Collection<TermDefinition> terms = termhash.values(); termhash = new HashMap<ATermAppl, TermDefinition>(); for( TermDefinition def : terms ) { kb.timers.checkTimer( "preprocessing" ); for( ATermAppl subClassAxiom : def.getSubClassAxioms() ) { ATermAppl c1 = (ATermAppl) subClassAxiom.getArgument( 0 ); ATermAppl c2 = (ATermAppl) subClassAxiom.getArgument( 1 ); absorbSubClass( c1, c2, tbox.getAxiomExplanation( subClassAxiom ) ); } for( ATermAppl eqClassAxiom : def.getEqClassAxioms() ) { ATermAppl c1 = (ATermAppl) eqClassAxiom.getArgument( 0 ); ATermAppl c2 = (ATermAppl) eqClassAxiom.getArgument( 1 ); absorbSubClass( c1, c2, tbox.getAxiomExplanation( eqClassAxiom ) ); absorbSubClass( c2, c1, tbox.getAxiomExplanation( eqClassAxiom ) ); } } if( log.isLoggable( Level.FINE ) ) { log.fine( "Tg.size is " + termhash.size() + " Tu.size is " + tbox.Tu.size() ); } log.fine( "Absorption finished" ); }