Next: The primitive data type Up: Unit 04 Previous: Boolean algebra: domain and

## Boolean expressions with variables: truth tables

We can obtain the value of a boolean expression with variables by substituting each variable with its truth value, and simplifying according to the meaning of the operators. To characterize the meaning of a boolean expression, we can construct a table in which, for each possible combination of truth values for the variables, we specify the truth value of the whole expression. Such a table is called a truth table.

Truth tables for the boolean operators

true false true a b a and b true true true false false false false false

true false true a b a or b true true true true false true false false

not a a false true

Example:
true false true false a b c (a and (not b)) or c true true true true true true false true true false true true true false false true false false false false true false false false

Next: The primitive data type Up: Unit 04 Previous: Boolean algebra: domain and