Can Dynamic Analysis Make Prolog Fast

Andrew Taylor · 1994

This paper explores the possibility of using observations of sample program executions as the basis of a high performance Prolog implementation. We suggest that this approach may be a viable alternative to the extensively explored approach of static analysis. Introduction There is a large efficiency gap between most widely used Prolog implementations and implementations of imperative languages such as C. Often a Prolog program will run roughly an order of magnitude slower than an equivalent program in an imperative language. The underlying cause is lack of information. A Prolog predicate can not be implemented efficiently without knowledge of the context in which it will be used. For example, the unification of two predicate arguments, in the absence of other information, is such an expensive operation that it requires a call to an out-of-line routine. This will involve the execution of many machine instructions. If instead it is known that these arguments will always be atoms it is ...

Read the paper · More papers on PaperTik