Abstract

Ground Prolog (as described by Kluzniak [2, 3]) is a restriction of Prolog that, enables a very good data flow analysis, and thereby compilation to efficient object code. Two important restrictions are: (1) Directionality {mode} declarations for every predicate must be provided by the programmer, i.e, all argument positions for all predicates must be defined as either “in” or “out” arguments. (2) The groundness restriction: whenever a call is executed, all its parameters at “in” argument positions must be ground, and when it succeeds all “out” parameters must be ground. These restrictions exclude some common programming techniques used in (standard) Prolog programs, such as open-ended lists. To compensate for this a high quality dataflow analysis is essential. Kluźniak defined a method for data flow analysis of Ground Prolog programs and described how the result can be used for type synthesis and compile time garbage collection. Kluźniak constructed a graph with the program variables as nodes and with edges between variables occurring in corresponding formal and actual argument positions. In principle, the transitive closure of the graph then represents the result of the dataflow analysis, This produces an over approximation of the dataflow ill that there might be edges between variables that will not pass data between them. The approach is however unnecessarily imprecise. We improve the approach by putting “constraints” on the edges. These can prevent some pairs of edges from producing new transitive edges that are obviously wrong. This is an extension of [1], and shows more clearly the problems with Kluzniak's method, and in a more formal way describes how it can be considerably improved.

Full Text
Paper version not known

Talk to us

Join us for a 30 min session where you can share your feedback and ask us any queries you have

Schedule a call

Disclaimer: All third-party content on this website/platform is and will remain the property of their respective owners and is provided on "as is" basis without any warranties, express or implied. Use of third-party content does not indicate any affiliation, sponsorship with or endorsement by them. Any references to third-party content is to identify the corresponding services and shall be considered fair use under The CopyrightLaw.