(e: Expression)
| 672 | } |
| 673 | // For n-ary Xor negation, first convert Xor to binary, then negate |
| 674 | return toNNF(ce._fn('Not', [toNNF(inner, ce)]), ce); |
| 675 | } |
| 676 | |
| 677 | // Negation of Nand: ¬NAND(A, B) ≡ A ∧ B |
| 678 | if (innerOp === 'Nand') { |
| 679 | return toNNF(ce._fn('And', fnOps(inner)!), ce); |
| 680 | } |
| 681 | |
| 682 | // Negation of Nor: ¬NOR(A, B) ≡ A ∨ B |
| 683 | if (innerOp === 'Nor') { |
| 684 | return toNNF(ce._fn('Or', fnOps(inner)!), ce); |
| 685 | } |
| 686 | |
| 687 | // Literal: ¬x stays as is |
| 688 | return expr; |
| 689 | } |
| 690 | |
| 691 | // Handle Implies: A → B ≡ ¬A ∨ B |
| 692 | if (op === 'Implies') { |
| 693 | const a = fnOp1(expr)!; |
no test coverage detected