A Note on Coding for Efficiency

The SB-Prolog system tends to favour programs that are relatively pure. Thus, for example, asserts tend to be quite expensive, encouraging the user to avoid them if possible. This section points out some syntactic constructs that lead to the generation of efficient code. These involve (i) avoiding the creation of backtrack points; and (ii) minimizing data movement between registers. Optimization of logic programs is an area of ongoing research, and we expect to enhance the capabilities of the system further in future versions.



Subsections