Going about creating a Truth Table Generator

Nov 12, 2020 at 6:42pm
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!
Nov 12, 2020 at 6:48pm
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 Nov 12, 2020 at 6:48pm
Nov 13, 2020 at 8:05pm
Last edited on Nov 13, 2020 at 11:05pm
Nov 13, 2020 at 11:38pm
Topic archived. No new replies allowed.