Undefined decision examples

Consider the following sequence of statements:

<source lang="c" line> bool foo(int a_parameter) { while (true) { //An infinite loop a_parameter = 0; } }

if (x < y and foo(y)) { compute(x, y); } </source>

The condition inside the if statement on line 6 will remain undefined because the loop at lines 2-4 will never end. Thus, the decision on line 7 evaluates to undefined.

References

  • <bib>mathur:2008, 419</bib>