用表达式建立真值表的小程序
truthtable的Python项目详细描述
真实性
Usage:
./truthtable.py [-hbn] [--help] [--bool|--numeric]
-h | --help Print this message
-b | --bool Use boolean values to fill the table
-n | --numeric Use numeric values to fill the table(defualt)
-d | --debug For printing intermediate representation of expression
Expression syntax:
Variable name:
[a-zA-Z]+
Operations:
&& - conjunction
|| - disjunction
-> - implication
<- - converse implication
<=> - biconditional
^ - exclusive disjunction
~ - negation
Examples:
A && B ^ ~(~A || (A<=>C))
A && B <=> ~(~A -> ~(~B <=> A))
BC -> A -> C <=> ~(A || (BC && C))