From ca9165a8615e3f7e1355ee4b651670cea5db5f3c Mon Sep 17 00:00:00 2001 From: VegOwOtenks Date: Tue, 22 Oct 2024 13:53:46 +0200 Subject: [PATCH] Fixed the implication --- src/Lib.hs | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/src/Lib.hs b/src/Lib.hs index 9eaeb94..87a24da 100644 --- a/src/Lib.hs +++ b/src/Lib.hs @@ -70,10 +70,10 @@ table = [ Prefix (m_reservedOp "~" >> return (Unary LogicalNot)) ], [ - Infix (m_reservedOp "&" >> return (Binary LogicalAnd)) AssocLeft + Infix (m_reservedOp "|" >> return (Binary LogicalOr)) AssocLeft ], [ - Infix (m_reservedOp "|" >> return (Binary LogicalOr)) AssocLeft + Infix (m_reservedOp "&" >> return (Binary LogicalAnd)) AssocLeft ], [ Infix (m_reservedOp "->" >> return (Binary LogicalImplication)) AssocLeft @@ -109,6 +109,6 @@ evaluate vs (Binary LogicalEquality l r) = evaluate vs l == evaluate vs r evaluate vs (Binary LogicalImplication l r) = implication (evaluate vs l) (evaluate vs r) where implication :: Bool -> Bool -> Bool - implication False True = False + implication True False = False implication _ _ = True evaluate vs (Variable name) = maybe False id (Map.lookup name vs)