This question evaluates understanding of parsing, boolean expression semantics, and algorithmic enumeration, including tokenization, operator precedence, exhaustive evaluation over variable assignments, and handling of invalid inputs.
Implement a function that, given a string boolean expression, outputs a complete truth table. The expression syntax is: variables are single uppercase letters A–Z; operators are '!' (unary NOT), adjacency (implicit AND), and '+' (binary OR); parentheses '()' are allowed; spaces are ignored. Use precedence: '!' > AND > '+', with left-associative AND and OR. Requirements: (