Given a Boolean expression B and two commands and
, the command
will be the same as when started in a state where B is true and
otherwise,
that is :
A (complex) command built from assignments using only sequencing and
conditionals is called a ``straight line program''.
Note, that in the case of a finite set A every map ,
(more generally, every operation on A) can be realized with a straight-line
program P : If
, and the desired map is given as
, let P be the straight line program
With straight line programs we therefore go beyond evaluation of terms, i.e. the computational mechanism afforded by Universal Algebra, unless there is an ``if-then-else'' at the term level. Such algebras are well studied, they are called functionally complete. A term simulating the if-then-else is usually introduced as