proposition table generator
This program will become a commandline tool
the user will type the commandName (tableprop) followed by a string as an argument
the program will print out comma separated values for the proposition you gave.
this output can be saved to a file if specified as second argument
C:/>tableprop "p and q" "and_table.csv"
I will use the lark parser to parse the proposition given to the program.
The different variables will be taken out of the syntax tree the lark parser gave.
InnerPropositions are given and ordered by length
The proposition is worked out complete with inner values for inner propositions comma separated.
output: p,(¬p) 0,1 1,0
output: p,q,(p ∧ q) 0,0,0 0,1,0 1,0,0 1,1,1
output: p,q,(p ∨ q) 0,0,0 0,1,1 1,0,1 1,1,1
output: p,q,r,(p ∧ q),((p ∧ q) ∧ r) 0,0,0,0,0 0,0,1,0,0 0,1,0,0,0 0,1,1,0,0 1,0,0,0,0 1,0,1,0,0 1,1,0,1,0 1,1,1,1,1
output: p,q,r,(¬p),((¬p) ∧ q),(((¬p) ∧ q) ∧ r) 0,0,0,1,0,0 0,0,1,1,0,0 0,1,0,1,1,0 0,1,1,1,1,1 1,0,0,0,0,0 1,0,1,0,0,0 1,1,0,0,0,0 1,1,1,0,0,0
output: p,q,r,(p ∧ q),((p ∧ q) ∨ r) 0,0,0,0,0 0,0,1,0,1 0,1,0,0,0 0,1,1,0,1 1,0,0,0,0 1,0,1,0,1 1,1,0,1,1 1,1,1,1,1
output: p,q,r,(q ∨ r),(p ∧ ((q ∨ r))) 0,0,0,0,0 0,0,1,1,0 0,1,0,1,0 0,1,1,1,0 1,0,0,0,0 1,0,1,1,1 1,1,0,1,1 1,1,1,1,1
output: p,q,r,(q -> r),(p -> (q -> r)) 0,0,0,1,1 0,0,1,1,1 0,1,0,0,1 0,1,1,1,1 1,0,0,1,1 1,0,1,1,1 1,1,0,0,0 1,1,1,1,1
output: p,q,(p <=> q) 0,0,1 0,1,0 1,1,1
output: p,q,r,(q <=> r),(p <=> (q <=> r)) 0,0,0,1,0 0,0,1,0,1 0,1,0,0,1 0,1,1,1,0 1,0,0,1,1 1,0,1,0,0 1,1,0,0,0 1,1,1,1,1