Skip to content
Snippets Groups Projects
Commit 3d739eb7 authored by Régis Blanc's avatar Régis Blanc
Browse files

fix bug in eval DNF and CNF

parent 6aef2c4d
No related branches found
No related tags found
No related merge requests found
......@@ -26,12 +26,12 @@ object SatFun {
def evalCnf(clauses: ClauseList, trueVars: Set[Int]): Boolean = clauses match {
case ClauseCons(cl, cls) => evalClauseCnf(cl, trueVars) && evalCnf(cls, trueVars)
case ClauseNil() => false
case ClauseNil() => true
case ClauseLit(b) => b
}
def evalDnf(clauses: ClauseList, trueVars: Set[Int]): Boolean = clauses match {
case ClauseCons(cl, cls) => evalClauseDnf(cl, trueVars) || evalDnf(cls, trueVars)
case ClauseNil() => true
case ClauseNil() => false
case ClauseLit(b) => b
}
def evalClauseCnf(clause: VarList, trueVars: Set[Int]): Boolean = clause match {
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment