Created
November 5, 2010 08:49
-
-
Save ldunn/663835 to your computer and use it in GitHub Desktop.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| data Expr = Expr Bool | |
| | Conjunction Expr Expr | |
| | Negation Expr | |
| | Disjunction Expr Expr | |
| | Implication Expr Expr | |
| deriving (Eq, Show) | |
| nnf :: Expr -> Expr | |
| nnf (Expr expr) = Expr expr | |
| nnf (Negation (Negation expr)) = nnf expr | |
| nnf (Negation (Conjunction expr1 expr2)) = (Disjunction (Negation (nnf expr1)) (Negation (nnf expr2))) | |
| nnf (Negation (Disjunction expr1 expr2)) = (Conjunction (Negation (nnf expr1)) (Negation (nnf expr2))) | |
| nnf (Implication expr1 expr2) = Disjunction (Negation (nnf expr1)) (nnf expr2) |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment