Ab. Matos, A MATRIX MODEL FOR THE FLOW OF CONTROL IN PROLOG PROGRAMS WITH APPLICATIONS TO PROFILING, Software, practice & experience, 24(8), 1994, pp. 729-746
In Prolog the flow of control is relatively complex; four counts (whic
h we call currents)-call, fail, succeed and redo-and two intrinsic pro
perties-the failure and the 'alternative' probabilities-can be associa
ted with every literal in a clause body. In this work we describe a ne
w matrix model where those currents and properties are related at the
literal, clause and predicate definition levels. This model is useful
for predicate classification, execution profiling and program debuggin
g. The application to profilers is discussed in detail.