JMU
Inferential Transformations
A Programming Pattern


Prof. David Bernstein
James Madison University

Computer Science Department
bernstdh@jmu.edu


Review
Motivation
Eliminating Empty Blocks
Negating Boolean Expressions
Negating Boolean Expressions (cont.)
Simplifying Nested if Statements
images/railroad_nested-if.gif images/railroad_nested-if-inference.gif
Simplifying Nested if Statements (cont.)
Simplifying Sequential if Statements
Expanding Boolean Expressions Involving ||
Expanding Boolean Expressions Involving ||
images/railroad_or-if-if.gif images/railroad_or-if-else-if.gif
Expanding Boolean Expressions Involving ||(cont.)
Short Circuits
Short Circuits (cont.)