S. Dawson et al., PRACTICAL PROGRAM ANALYSIS USING GENERAL-PURPOSE LOGIC PROGRAMMING SYSTEMS - A CASE-STUDY, ACM SIGPLAN NOTICES, 31(5), 1996, pp. 117-126
Many analysis problems can be cast in the form of evaluating minimal m
odels of a logic program. Although such formulations are appealing due
to their simplicity and declarativeness, they have not been widely us
ed in practice because, either existing logic programming systems do n
ot guarantee completeness, or those that do have been viewed as too in
efficient for integration into a compiler. The objective of this paper
is to re-examine this issue in the context of recent advances in impl
ementation technologies of logic programming systems. We find that suc
h declarative formulations can indeed be used in practical systems, wh
en combined with the appropriate tool for evaluation. We use existing
formulations of analysis problems - groundness analysis of logic progr
ams, and strictness analysis of functional programs - in this case stu
dy, and the XSB system, a table-based logic programming system, as the
evaluation tool of choice. We give experimental evidence that the res
ultant groundness and strictness analysis systems are practical in ter
ms of both time and space. In terms of implementation effort, the anal
yzers took less than 2 man-weeks (in total), to develop, optimize and
evaluate. The analyzer itself consists of about 100 lines of tabled Pr
olog code and the entire system, including the components to read and
preprocess input programs and to collect the analysis results, consist
s of about 500 lines of code.