master > master: codego - nnf für implies, iff

This commit is contained in:
RD 2021-05-15 00:05:42 +02:00
parent 6d774a6a4c
commit 3b1c190543

View File

@ -64,9 +64,20 @@ func NNF(fml formulae.Formula) formulae.Formula {
}
} else if fml.IsImplication() {
return formulae.FormulaPair{
Pos: formulae.Implies(prevPos[0], prevPos[1]),
Pos: formulae.Disjunction2(prevNeg[0], prevPos[1]),
Neg: formulae.Conjunction2(prevPos[0], prevNeg[1]),
}
} else if fml.IsDoubleImplication() {
return formulae.FormulaPair{
Pos: formulae.Conjunction2(
formulae.Disjunction2(prevNeg[0], prevPos[1]),
formulae.Disjunction2(prevNeg[1], prevPos[0]),
),
Neg: formulae.Disjunction2(
formulae.Conjunction2(prevPos[0], prevNeg[1]),
formulae.Conjunction2(prevPos[1], prevNeg[0]),
),
}
} else {
panic("Could not evaluate expression!")
}