From: <lor...@us...> - 2014-01-21 12:49:26
|
Revision: 4212 http://sourceforge.net/p/dl-learner/code/4212 Author: lorenz_b Date: 2014-01-21 12:49:22 +0000 (Tue, 21 Jan 2014) Log Message: ----------- Fixed bug in refinement operator when negation is disabled. Modified Paths: -------------- trunk/components-core/src/main/java/org/dllearner/refinementoperators/RhoDRDown.java Modified: trunk/components-core/src/main/java/org/dllearner/refinementoperators/RhoDRDown.java =================================================================== --- trunk/components-core/src/main/java/org/dllearner/refinementoperators/RhoDRDown.java 2014-01-12 16:56:24 UTC (rev 4211) +++ trunk/components-core/src/main/java/org/dllearner/refinementoperators/RhoDRDown.java 2014-01-21 12:49:22 UTC (rev 4212) @@ -608,11 +608,13 @@ int number = ((ObjectCardinalityRestriction)description).getCardinality(); if(description instanceof ObjectMaxCardinalityRestriction) { // rule 1: <= x r.C => <= x r.D - tmp = refine(description.getChild(0), maxLength-3, null, range); - - for(Description d : tmp) { - refinements.add(new ObjectMaxCardinalityRestriction(number,role,d)); - } + if(useNegation || number > 0){ + tmp = refine(description.getChild(0), maxLength-3, null, range); + + for(Description d : tmp) { + refinements.add(new ObjectMaxCardinalityRestriction(number,role,d)); + } + } // rule 2: <= x r.C => <= (x-1) r.C ObjectMaxCardinalityRestriction max = (ObjectMaxCardinalityRestriction) description; @@ -1033,7 +1035,7 @@ // zero fillers: <= -1 r.C does not make sense // one filler: <= 0 r.C is equivalent to NOT EXISTS r.C, // but we still keep it, because ALL r.NOT C may be difficult to reach - if(maxFillers > 0) + if((useNegation && maxFillers > 0) || (!useNegation && maxFillers > 1)) m4.add(new ObjectMaxCardinalityRestriction(maxFillers-1, r, new Thing())); } } This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |