Fixed the implication
This commit is contained in:
parent
903ae349b2
commit
ca9165a861
1 changed files with 3 additions and 3 deletions
|
@ -70,10 +70,10 @@ table = [
|
||||||
Prefix (m_reservedOp "~" >> return (Unary LogicalNot))
|
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
|
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)
|
evaluate vs (Binary LogicalImplication l r) = implication (evaluate vs l) (evaluate vs r)
|
||||||
where
|
where
|
||||||
implication :: Bool -> Bool -> Bool
|
implication :: Bool -> Bool -> Bool
|
||||||
implication False True = False
|
implication True False = False
|
||||||
implication _ _ = True
|
implication _ _ = True
|
||||||
evaluate vs (Variable name) = maybe False id (Map.lookup name vs)
|
evaluate vs (Variable name) = maybe False id (Map.lookup name vs)
|
||||||
|
|
Loading…
Reference in a new issue