Going about creating a Truth Table Generator

closed account (26q2b7Xj)
I am having trouble thinking about how to make it. I'll like the user to enter a compound proposition, base on valid logical operators, and create a truth table of all possible combinations of T and F values. Looking for insights on this personal project. Thanks!
I would start by defining the language that will be accepted and then writing a parser for it.
E.g. a & b | !(foo => a)
Once you can produce a symbolic representation of the expression the user entered, you can extract all the variables used and know how big the necessary truth table is.
Last edited on
Last edited on
Topic archived. No new replies allowed.