Beispiel #1
0
 /**
  * Check if the literal can be used to explain this clause. It checks it against the unit literal
  * that should be explained by a unit clause. If the given literal "lit" has a lower stack
  * position than the unit literal for which the unit clause is generated, it may not be used in
  * the explanation.
  *
  * @param lit The literal that we would like to include in the explanation clause.
  * @return true if the literal may appear in the clause.
  */
 public boolean canExplainWith(Literal lit) {
   DPLLAtom atom = lit.getAtom();
   return atom.getStackPosition() >= 0
       && (mExplainedLiteral == null
           || mExplainedLiteral.getAtom().getStackPosition() == -1
           || atom.getStackPosition() < mExplainedLiteral.getAtom().getStackPosition());
 }
Beispiel #2
0
 /**
  * Get the decide level on which all literals must live if they are allowed to appear in the
  * explained clause.
  *
  * @return the decide level of the explained unit literal or the current decide level if a
  *     conflict is explained.
  */
 public int getDecideLevel() {
   return mExplainedLiteral == null
       ? mSolver.mEngine.getDecideLevel()
       : mExplainedLiteral.getAtom().getDecideLevel();
 }