Skip to content

Commit

Permalink
ascii characters for showing formulas to support more terminals
Browse files Browse the repository at this point in the history
  • Loading branch information
pmbittner committed Jul 11, 2022
1 parent 8cf85f6 commit eb0b0c4
Showing 1 changed file with 14 additions and 5 deletions.
19 changes: 14 additions & 5 deletions proofs/src/Feature/Propositions.hs
Original file line number Diff line number Diff line change
Expand Up @@ -83,13 +83,22 @@ isLiteral (PNot f) = isLiteral f
isLiteral _ = False

-- | UTF-8 characters for printing propositional operators.
-- instance Show a => Show (PropositionalFormula a) where
-- show PTrue = "⊤"
-- show PFalse = "⊥"
-- show (PVariable v) = show v
-- show (PNot p) = "¬"++show p
-- show (PAnd cs) = "("++(intercalate " ∧ " $ map show cs)++")"
-- show (POr cs) = "("++(intercalate " ∨ " $ map show cs)++")"

-- | ASCII characters for printing propositional operators.
instance Show a => Show (PropositionalFormula a) where
show PTrue = ""
show PFalse = ""
show PTrue = "true"
show PFalse = "false"
show (PVariable v) = show v
show (PNot p) = "¬"++show p
show (PAnd cs) = "("++(intercalate " " $ map show cs)++")"
show (POr cs) = "("++(intercalate " " $ map show cs)++")"
show (PNot p) = "!"++show p
show (PAnd cs) = "("++(intercalate " & " $ map show cs)++")"
show (POr cs) = "("++(intercalate " | " $ map show cs)++")"

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

0 comments on commit eb0b0c4

Please sign in to comment.