I want to write a truth table evaluator for a given formula like in this site. http://jamie-wong.com/experiments/truthtabler/SLR1/ Operators are:
- (negation)
& (and)
| (or)
> (implication)
= (equivalence)
So far I made this
-(-(a& b) > ( -((a|-s)| c )| d))
given this formula my output is
abdsR
TTTT
TTTF
TTFT
TTFF
TFTT
TFTF
TFFT
TFFF
FTTT
FTTF
FTFT
FTFF
FFTT
FFTF
FFFT
FFFF
I am having difficulties with the evaluating part. I created an array which in I stored indises of parenthesis if it helps,namely 7-3, 17-12, 20-11, 23-9, 24-1 I also checked the code in http://www.stenmorten.com/English/llc/source/turth_tables_ass4.c ,however I didn't get it.