$ $ ./boolexp -i ([] , f | t & f | ~ t) ((f | (t & f)) | (~t)) is false. ([p], f | t & f | ~p) ((f | (t & f)) | (~p)) is false. ([] , f | t | f & t | f | t & t & t | ~ t) (((((f | t) | (f & t)) | f) | ((t & t) & t)) | (~t)) is true. ^D $ $ ./boolexp ([p, q], ~t | p | ~e & ~f & t & ~q | r) ((((~t) | p) | ((((~e) & (~f)) & t) & (~q))) | r) is true. ([] , t & f & t | ~ t & ~ f & ~ f | f & t & ~ t) ((((t & f) & t) | (((~t) & (~f)) & (~f))) | ((f & t) & (~t))) is false. ([] , t & f | t & f | t & f | f & ~ t | f) (((((t & f) | (t & f)) | (t & f)) | (f & (~t))) | f) is false. ([], t & t & ~ f | f & ~ t | ~ t & f) ((((t & t) & (~f)) | (f & (~t))) | ((~t) & f)) is true. ^D $ $ cat 1.cpp #include using namespace std; main() { bool p = true; bool q = true; bool e = false; bool r = false; bool result = !true || p || !e && !false & true && !q || r; cout << "The result is "; if (result) cout << "true"; else cout << "false"; cout << "." << endl; } $ $ cat 4.cpp #include using namespace std; main() { bool result = true && true && !false || false && !true || !true & false; cout << "The result is "; if (result) cout << "true"; else cout << "false"; cout << "." << endl; } $ $ ./boolexp ([ ], t & t | ~ f & ~ f | t & f | ~ t) ((((t & t) | ((~f) & (~f))) | (t & f)) | (~t)) is true. ([a,b,c], a & ~ f & ~ f & b | ~ t | c) (((((a & (~f)) & (~f)) & b) | (~t)) | c) is true. ([], t & ~ f & ~ t | ~ f & ~ t & t) (((t & (~f)) & (~t)) | (((~f) & (~t)) & t)) is false. ([], t & ~ f | t & ~ f) ((t & (~f)) | (t & (~f))) is true. ([], t | f | t & f | t | ~ t & t | f) (((((t | f) | (t & f)) | t) | ((~t) & t)) | f) is true. ([], ~ f & t & ~ t | ~ f | t & ~ f) (((((~f) & t) & (~t)) | (~f)) | (t & (~f))) is true. ([],~ t | ~ f | ~ t & ~ f & f & ~ t) (((~t) | (~f)) | ((((~t) & (~f)) & f) & (~t))) is true. ^D $ $ ./boolexp -c ([x,y], ~x | t | ~z & ~f & y & ~y | f) $ $ ./boolexp -ci ([],~t|~f&~t|~t&~f|~t&~t) ((((~t) | ((~f) & (~t))) | ((~t) & (~f))) | ((~t) & (~t))) is false. ^D $ $ cat 1.cpp #include using namespace std; main() { bool result = !true || !false && !true || !true && !false || !true && !true; cout << "The result is "; if (result) cout << "true"; else cout << "false"; cout << "." << endl; }