Browse Source

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

master
RD 1 year ago
parent
commit
3b1c190543
  1. 13
      codego/aussagenlogik/recursion/recursion_nnf.go

13
codego/aussagenlogik/recursion/recursion_nnf.go

@ -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!")
}

Loading…
Cancel
Save