private int createDisjunctionsFromBinding(VariableBinding binding, Rule rule, DependencySet ds) {
List<RuleAtom> atoms = new ArrayList<RuleAtom>();
for( RuleAtom atom : rule.getBody() ) {
DependencySet atomDS = atomTester.isAtomTrue( atom, binding );
if( atomDS != null ) {
ds = ds.union( atomDS, abox.doExplanation() );
}
else {
atoms.add( atom );
}
}
// all the atoms in the body are true
if( atoms.isEmpty() ) {
if( rule.getHead().isEmpty() ) {
if( log.isLoggable( Level.FINE ) )
log.fine( "Empty head for rule " + rule );
abox.setClash( Clash.unexplained( null, ds ) );
}
else {
for( RuleAtom atom : rule.getHead() ) {
ruleAtomAsserter.assertAtom( atom, binding, ds, false, abox, this );
}
}
return -1;
}
int bodyAtomCount = atoms.size();
for( RuleAtom atom : rule.getHead() ) {
DependencySet atomDS = atomTester.isAtomTrue( atom, binding );
if( atomDS == null ) {
atoms.add( atom );
}
}