The incorporation of global program analysis into recent compilers for
Constraint Logic Programming (CLP) languages has greatly improved the
efficiency of compiled programs. We present a global analyser based o
n abstract interpretation. Unlike traditional optimizers, whose design
s tend to be ad hoc, the analyser has been designed with flexibility i
n mind. The analyser is incremental, allowing substantial program tran
sformations by a compiler without requiring redundant re-computation o
f analysis data. The analyser is also generic in that it can perform a
large number of different program analyses. Furthermore, the analyser
has an object-oriented design, enabling it to be adapted to different
applications easily and allowing it to be used with various CLP langu
ages with simple modifications. As an example of this generality, we s
ketch the use of the analyser in two different applications involving
two distinct CLP languages: an optimizing compiler for CLP(R) programs
and an application for detecting occur-check problems in Prolog progr
ams. (C) 1998 by John Whey & Sons Ltd.