MrSpidey can also explain the derivation of each value set invariant, or type. This explanation describes how the flow of values through the program yields a particular value set invariant. The collection of all potential data-flow paths forms the program's data-flow graph. MrSpidey describes each edge in the data-flow graph as an arrow overlaid on the program text that connects the relevant points of the program. Because a large number of arrows would clutter the program text, these arrows are presented in a demand-driven fashion. Each expression's popup menu provides facilities for inspecting relevant portions of the value flow graph.
All of the above options can be customized to only show the flow of
certain values by simply selecting the appropriate set of values from
the Filter menu. This option is particularly useful in
conjunction with the Path to Source facility for inspecting the
flow of an unexpected value through the program. For example, in the
program sum, the unexpected value for tree is
nil. Setting the filter to this value, and then selecting Path
to Source for tree results in the explanation described in
figure
.
Clicking on the head or tail of an arrow with the left mouse button moves the current focus to the term at the other end of the arrow, which can be useful for following the flow of values through large programs. Clicking on the head or tail of an arrow with the right mouse button deletes the arrow. Alternatively, selecting Clear|Arrows deletes all arrows in the buffer.