Development software
Compound Statements or Expressions

Boolean logic

Boolean expressions have one of two possible values: True or False. They are used in conditional expressions.

eg. while (Index <= Limit) and not Done do ...

The Boolean expression consists of everything between the keywords while and do, and presumes that Done is a variable (or possibly a function) of type boolean.

Compound Statements or Expressions

In the study of logic, a statement is an assertion to which we can assign a truth value (T for true, F for False). By this definition, "2+3" is not a statement because we cannot say it is true or false. However, "2+3=6" is a statement because we can label it as true or false: we can assign the truth value F to it.

We can use connectives ("AND", "OR" and "NOT") to build compound statements from given statements. For instance, from the statements

we can build the statements

as well as the statements

[Rev 21/9/98]24/6/97 © 1997-98 V/2-Com (Verhaart), P O Box 8415, Havelock North, New Zealand.