Truth Table Generator

I wrote a simple truth table generator for propositional logic in Python and then decided to port it to the web. You can find my application here.

To turn my script into a web app, I used the google app engine and the packaged google webapp framework. The source for my project can be found here.

Essentially, my app checks its given input string for illegal characters and syntax, replaces the given connectives “->”, “v” and “<->” with overloaded truth variable operators, defines truth variables based on the input string, and then tries to eval() the resulting string. I understand how poor of a solution using eval() to parse the input is, especially in respect to code injection. In the future, I will try to implement my own parser, but for now, Python’s parser will suffice.