Boolean logic is used throughout programming. It is an
essential part of conditional statements (i.e., if then,
if then else statements) and
iterative statements (i.e., for, while do,
repeat until statements).
Example: if ( ($part_start[$y] > $desired_week) || ($desired_week>$part_end[$y]))
Example: if ($fields[8] eq " " || $fields[9] eq " ")
Example: if (($early_time[$m] > 0) && ($n < $low_slot))
Complex problems are generally segmented via Boolean values
that break the problem into distinct smaller problems or conditions.
One of the most common causes of programming errors is the
misstatement and/or misinterpretation of Boolean expressions.
The "proof" of a program as a solution to a problem involves
testing each combination of Boolean values possible in the problem; this is
a essentially tracing through a giant truth table to be sure that we have
properly handled every possible situation.