Skip to content

Generates a truth table of symbols and logical operations. A bonus hw of Discrete Mathematics in 2021 Fall.

License

Notifications You must be signed in to change notification settings

yzhhr/TruthTable

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

13 Commits
 
 
 
 
 
 
 
 

Repository files navigation

TruthTable

Generates a truth table of symbols and logical operations. A bonus hw of Discrete Mathematics in 2021 Fall.

play.cpp is a too-long cpp code, while ttable.nb provides a neat mathematica implementation. However, the latter is not expected to be accepted by the teacher.

Compile play.cpp using g++ play.cpp -o play -std=c++11. Then type expressions like (pvq>r^p)=(q=r). You'll figure out what's going on.

To use the Mathematica code, call the function using TruthTable[(p&&q)~Implies~(r||p)==(q==r), {p, q, r}].

My cpp is good because I tried to do OOP (at an unprofessional level)! And the code presents the truth in prefix notation format, which is flat but never plain!

About

Generates a truth table of symbols and logical operations. A bonus hw of Discrete Mathematics in 2021 Fall.

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published