Ejemplo n.º 1
0
 public Hypothesis subsume(Hypothesis otherHypothesis) {
   LinkedList<Literal> newLiterals = new LinkedList<Literal>();
   for (Literal otherLiteral : otherHypothesis.literalMap.values()) {
     Literal correspondingLiteral = literalMap.get(otherLiteral.getAttribute());
     if (correspondingLiteral == null) {
       continue;
     }
     if (otherLiteral.equals(correspondingLiteral)) {
       newLiterals.add(otherLiteral);
       continue;
     }
     if (otherLiteral.contradicts(literalMap.get(otherLiteral.getAttribute()))) {
       return null;
     }
   }
   return new Hypothesis(newLiterals);
 }