TY - JOUR

T1 - On the design of a correct freeness analysis for logic programs

AU - Codish, Michael

AU - Dams, Dennis

AU - Filé, Gilberto

AU - Bruynooghe, Maurice

N1 - Funding Information:
PROOF. E is in solved form, so by Lemma A.1, g describes mgu(E). Suppose X is free in 8, but not free in mgu(E), then mgu(E) contains an equation X = f(tl,..., tn). This equation is described via some # by an equation 71 = T2 in g (7-1,72 E .ATerm). So 7-2 must be of the form f(7-2,1,... ,v2,,~) or of the form ±\[V\] with/z(i\[V\]) = f(tl,..., t~). Vl is either X (it cannot be a meta-variable as the fact that X is free in $ implies X E vats(g)) or of the form ±\[V\] with X E V. All of these possibilities contradict the assumption that X is free in the solved form g. \[\] This work was funded in part by the ESPRIT Project 5246 PRINCE and by "Prog. Fin. Sistemi informatici e Calcolo Parallelo" of CNR, Grant 91.00026.69. The work was initiated while Michael Codish and Dennis Dams were visiting the University of Padova. During the course of the work, Michael Codish was supported by a fellowship from KU Leuven. Maurice Bruynooghe is supported by the Belgian National Fund for Scientific Research. We thank A. Cortesi, M. Garcia de la Banda, Manuel Hermenegildo, and Renga Sundararajan for useful discussions. The constructive criticism of the anonymous referees is appreciated.

PY - 1996/1/1

Y1 - 1996/1/1

N2 - Several proposals for computing freeness information for logic programs have been put forward in the recent literature. The availability of such information has proven useful in a variety of applications, including parallelization of Prolog programs, optimizations in Prolog compilers, as well as for improving the precision of other analyses. While these proposals have illustrated the importance of such analyses, they lack formal justification. Moreover, several have been found incorrect. This paper introduces a novel domain of abstract equation systems describing possible sharing and definite freeness of terms in a system of equations. A simple and intuitive abstract unification algorithm is presented, providing the core of a correct and precise sharing and freeness analysis for logic programs. Our contribution is not only a correct algorithm, but perhaps primarily, the application of a systematic approach in which it is derived by mimicking each step in a suitable concrete unification algorithm. Consequently, the abstract algorithm is intuitive - as it resembles the concrete algorithm. It is amenable to formal justification - as the proof of correctness is reduced to showing that each step in the concrete algorithm is mimicked by a corresponding step in the abstract algorithm. Finally, it is precise -as each step mimics only those situations which can arise in the concrete algorithm.

AB - Several proposals for computing freeness information for logic programs have been put forward in the recent literature. The availability of such information has proven useful in a variety of applications, including parallelization of Prolog programs, optimizations in Prolog compilers, as well as for improving the precision of other analyses. While these proposals have illustrated the importance of such analyses, they lack formal justification. Moreover, several have been found incorrect. This paper introduces a novel domain of abstract equation systems describing possible sharing and definite freeness of terms in a system of equations. A simple and intuitive abstract unification algorithm is presented, providing the core of a correct and precise sharing and freeness analysis for logic programs. Our contribution is not only a correct algorithm, but perhaps primarily, the application of a systematic approach in which it is derived by mimicking each step in a suitable concrete unification algorithm. Consequently, the abstract algorithm is intuitive - as it resembles the concrete algorithm. It is amenable to formal justification - as the proof of correctness is reduced to showing that each step in the concrete algorithm is mimicked by a corresponding step in the abstract algorithm. Finally, it is precise -as each step mimics only those situations which can arise in the concrete algorithm.

UR - http://www.scopus.com/inward/record.url?scp=0030241548&partnerID=8YFLogxK

U2 - 10.1016/0743-1066(95)00120-4

DO - 10.1016/0743-1066(95)00120-4

M3 - Article

AN - SCOPUS:0030241548

SN - 0743-1066

VL - 28

SP - 181

EP - 206

JO - Journal of Logic Programming

JF - Journal of Logic Programming

IS - 3

ER -