Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Making truthTable function to generate string without colour #6

Open
wants to merge 1 commit into
base: master
Choose a base branch
from

Conversation

psibi
Copy link

@psibi psibi commented Aug 6, 2014

Making the truthTable function to generate string without color as it seems the sensible default. (although it's debatable)

Added a function truthTablewithColor which will handle the coloured situations.

The primary motivation was for cases something like this:

import Data.Logic.Propositional
import System.IO

p = Variable (Var 'p')
q = Variable (Var 'q')

exp1 = (Negation p) `Disjunction` q
exp1T = truthTable exp1

main = writeFile "Table.txt" exp1T

The output produced earlier was like this:

p q | (¬p ∨ q)

�[92mT�[0m �[92mT�[0m | �[92mT�[0m
�[92mT�[0m �[91mF�[0m | �[91mF�[0m
�[91mF�[0m �[92mT�[0m | �[92mT�[0m
�[91mF�[0m �[91mF�[0m | �[92mT�[0m

After the patch, it will produce like this:

p q | (¬p ∨ q)

T T | T
T F | F
F T | T
F F | T

seems the sensible default. (although it's debatable)

Added a function truthTablewithColor which will handle the coloured
situations.

The primary motivation was for cases something like this:

import Data.Logic.Propositional
import System.IO

p = Variable (Var 'p')
q = Variable (Var 'q')

exp1 = (Negation p) `Disjunction` q
exp1T = truthTable exp1

main = writeFile "Table.txt" exp1T

The output produced earlier was like this:

p q | (¬p ∨ q)
--------------
�[92mT�[0m �[92mT�[0m | �[92mT�[0m
�[92mT�[0m �[91mF�[0m | �[91mF�[0m
�[91mF�[0m �[92mT�[0m | �[92mT�[0m
�[91mF�[0m �[91mF�[0m | �[92mT�[0m

After the patch, it will produce like this:

p q | (¬p ∨ q)
--------------
T T | T
T F | F
F T | T
F F | T
@beastaugh
Copy link
Owner

Thanks, this looks like a sensible change. I'll try to find some time this week to merge it and publish a new version.

@psibi
Copy link
Author

psibi commented Aug 12, 2015

Ping @beastaugh

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants