Skip to content

Commit eb0b0c4

Browse files
committed
ascii characters for showing formulas to support more terminals
1 parent 8cf85f6 commit eb0b0c4

File tree

1 file changed

+14
-5
lines changed

1 file changed

+14
-5
lines changed

proofs/src/Feature/Propositions.hs

Lines changed: 14 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -83,13 +83,22 @@ isLiteral (PNot f) = isLiteral f
8383
isLiteral _ = False
8484

8585
-- | UTF-8 characters for printing propositional operators.
86+
-- instance Show a => Show (PropositionalFormula a) where
87+
-- show PTrue = "⊤"
88+
-- show PFalse = "⊥"
89+
-- show (PVariable v) = show v
90+
-- show (PNot p) = "¬"++show p
91+
-- show (PAnd cs) = "("++(intercalate " ∧ " $ map show cs)++")"
92+
-- show (POr cs) = "("++(intercalate " ∨ " $ map show cs)++")"
93+
94+
-- | ASCII characters for printing propositional operators.
8695
instance Show a => Show (PropositionalFormula a) where
87-
show PTrue = ""
88-
show PFalse = ""
96+
show PTrue = "true"
97+
show PFalse = "false"
8998
show (PVariable v) = show v
90-
show (PNot p) = "¬"++show p
91-
show (PAnd cs) = "("++(intercalate " " $ map show cs)++")"
92-
show (POr cs) = "("++(intercalate " " $ map show cs)++")"
99+
show (PNot p) = "!"++show p
100+
show (PAnd cs) = "("++(intercalate " & " $ map show cs)++")"
101+
show (POr cs) = "("++(intercalate " | " $ map show cs)++")"
93102

94103
-- -- | This visualisation is for debugging as it shows the exact expression tree.
95104
-- instance Show a => Show (PropositionalFormula a) where

0 commit comments

Comments
 (0)