The objective of control generation in logic programming is to automatically derive a computation... more The objective of control generation in logic programming is to automatically derive a computation rule for a program that is efficient and yet does not compromise program correctness. Progress in solving this important problem has been slow and, to date, only partial solutions have been proposed where the generated programs are either incorrect or inefficient. We show how the control generation problem can be tackled with a simple automatic transformation that relies on information about the depths of SLD-trees. To prove correctness of our transform we introduce the notion of a semi delay recurrent program which generalises previous ideas in the termination literature for reasoning about logic programs with dynamic selection rules.
A programming tactic involving polyhedra is reported that has been widely applied in the polyhedr... more A programming tactic involving polyhedra is reported that has been widely applied in the polyhedral analysis of (constraint) logic programs. The method enables the computations of convex hulls that are required for polyhedral analysis to be coded with linear constraint solving machinery that is available in many Prolog systems.
This paper explores the spatial domain of sets of inequalities where each inequality contains at ... more This paper explores the spatial domain of sets of inequalities where each inequality contains at most two variables — a domain that is richer than intervals and more tractable than general polyhedra. We present a complete suite of efficient domain operations for linear systems with two variables per inequality with unrestricted coefficients. We exploit a tactic in which a system of inequalities with at most two variables per inequality is decomposed into a series of projections — one for each two dimensional plane. The decomposition enables all domain operations required for abstract interpretation to be expressed in terms of the two dimensional case. The resulting operations are efficient and include a novel planar convex hull algorithm. Empirical evidence suggests that widening can be applied effectively, ensuring tractability.
Def, the domain of definite Boolean functions, expresses (sure) dependencies between the program ... more Def, the domain of definite Boolean functions, expresses (sure) dependencies between the program variables of, say, a constraint program. Share, on the other hand, captures the (possible) variable sharing between the variables of a logic program. The connection between these domains has been explored in the domain comparison and decomposition literature. We develop this link further and show how the meet (as well as the join) of Def can be modelled with efficient (quadratic) operations on Share. Further, we show how by compressing and widening Share and by rescheduling meet operations, we can construct a dependency analysis that is surprisingly fast and precise, and comes with time and space-performance guarantees. Unlike some other approaches, our analysis can be coded straightforwardly in Prolog.
The domain of definite Boolean functions, Def, can be used to express the groundness of, and trac... more The domain of definite Boolean functions, Def, can be used to express the groundness of, and trace grounding dependencies between, program variables in (constraint) logic programs. In this paper, previously unexploited computational properties of Def are utilised to develop an efficient and succinct groundness analyser that can be coded in Prolog. In particular, entailment checking is used to prevent unnecessary least upper bound calculations. It is also demonstrated that join can be defined in terms of other operations, thereby eliminating code and removing the need for preprocessing formulae to a normal form. This saves space and time. Furthermore, the join can be adapted to straightforwardly implement the downward closure operator that arises in set sharing analyses. Experimental results indicate that the new Def implementation gives favourable results in comparison with BDD-based groundness analyses.
Precise mode information is important for compiler optimisations and in program development tools... more Precise mode information is important for compiler optimisations and in program development tools. Within the framework of abstract compilation, the precision of a mode analysis depends, in part, on the expressiveness of the abstract domain and its associated abstraction function. This paper considers abstract domains for polymorphically typed logic programs and shows how specialised domains may be constructed for each type in the program. These domains capture the degree of instantiation to a high level of precision. By providing a generic definition of abstract unification, the abstraction of a program using these domains is formalised. The domain construction procedure is fully implemented using the Gödel language and tested on a number of example programs to demonstrate the viability of the approach. Note: Some proofs have been omitted for space reasons. They can be found in the full version of this paper [17].
The domain of positive Boolean functions, Pos, is by now well established for the analysis of the... more The domain of positive Boolean functions, Pos, is by now well established for the analysis of the variable dependencies that arise within logic programs. Analyses based on Pos that use binary decision diagrams have been shown to be efficient for a wide range of practical programs. However, independent of the representation, assuming that P != NP , an (unwidened) Pos
263 safety has been formally proved through abstract interpretation. In more pragmatic terms it m... more 263 safety has been formally proved through abstract interpretation. In more pragmatic terms it means that the thresholding conditions inferred by the analysis guarantee that fine-grained processes are never spawned. Note, however, that not spawning fine-grained processes ...
One recurring problem in program development is that of understanding how to re-use code develope... more One recurring problem in program development is that of understanding how to re-use code developed by a third party. In the context of (constraint) logic programming, part of this problem reduces to figuring out how to query a program. If the logic program does not come with any documentation, then the programmer is forced to either experiment with queries in an ad hoc fashion or trace the control-flow of the program (backward) to infer the modes in which a predicate must be called so as to avoid an instantiation error. This paper presents an abstract interpretation scheme that automates the latter technique. The analysis presented in this paper can infer moding properties which if satisfied by the initial query, come with the guarantee that the program and query can never generate any moding or instantiation errors. Other applications of the analysis are discussed. The paper explains how abstract domains with certain computational properties (they condense) can be used to trace control-flow backward (right-to-left) to infer useful properties of initial queries. A correctness argument is presented and an implementation is reported.
Ьг вижг й и в анз з згб вги и гв в дж а б в жн Ќв и гвз ж ж ей ж К Ь ж ж з ззйб иг б а ж л и и зи... more Ьг вижг й и в анз з згб вги и гв в дж а б в жн Ќв и гвз ж ж ей ж К Ь ж ж з ззйб иг б а ж л и и зи в ж гвЙ зижй из йз в аг джг ж бб в НН зй з йв к жз г аа к ж а з Дй к ОЕ Эк ж и з и г и жбз Ди ОЕ Ь жб гжб жгб и з и г йв игжз Д ОЕ йв Дг и ЌжзиЙгж ж а в й йв жан в и джг ж бЕ в и з и ...
As typed logic programming becomes more mainstream, system building tools like partial deduction ... more As typed logic programming becomes more mainstream, system building tools like partial deduction systems will need to be mapped from untyped languages to typed ones. It is important, however, when mapping techniques across that the new techniques should exploit the type system as much as possible. In this paper, we show how norms, which play a crucial role in termination analysis, can be generated from the prescribed types of a logic program. Interestingly, the types highlight restrictions of earlier norms and suggest how these norms can be extended to obtain some very general and powerful notions of norm which can be used to measure any term in an almost arbitrary way. We see our work on norm derivation as a contribution to the termination analysis of typed logic programs which, in particular, forms an essential part of offline partial deduction systems.
Schedule Analysis of Concurrent Logic Programs [Andy King and Paul Soper Pepartment of Electronic... more Schedule Analysis of Concurrent Logic Programs [Andy King and Paul Soper Pepartment of Electronics and Computer Science, university of Southampton, Southampton, S09 5NH, UK| ^[email protected], [email protected] LA.bstract A compilation technique is proposed ...
The objective of control generation in logic programming is to automatically derive a computation... more The objective of control generation in logic programming is to automatically derive a computation rule for a program that is efficient and yet does not compromise program correctness. Progress in solving this important problem has been slow and, to date, only partial solutions have been proposed where the generated programs are either incorrect or inefficient. We show how the control generation problem can be tackled with a simple automatic transformation that relies on information about the depths of SLD-trees. To prove correctness of our transform we introduce the notion of a semi delay recurrent program which generalises previous ideas in the termination literature for reasoning about logic programs with dynamic selection rules.
A programming tactic involving polyhedra is reported that has been widely applied in the polyhedr... more A programming tactic involving polyhedra is reported that has been widely applied in the polyhedral analysis of (constraint) logic programs. The method enables the computations of convex hulls that are required for polyhedral analysis to be coded with linear constraint solving machinery that is available in many Prolog systems.
This paper explores the spatial domain of sets of inequalities where each inequality contains at ... more This paper explores the spatial domain of sets of inequalities where each inequality contains at most two variables — a domain that is richer than intervals and more tractable than general polyhedra. We present a complete suite of efficient domain operations for linear systems with two variables per inequality with unrestricted coefficients. We exploit a tactic in which a system of inequalities with at most two variables per inequality is decomposed into a series of projections — one for each two dimensional plane. The decomposition enables all domain operations required for abstract interpretation to be expressed in terms of the two dimensional case. The resulting operations are efficient and include a novel planar convex hull algorithm. Empirical evidence suggests that widening can be applied effectively, ensuring tractability.
Def, the domain of definite Boolean functions, expresses (sure) dependencies between the program ... more Def, the domain of definite Boolean functions, expresses (sure) dependencies between the program variables of, say, a constraint program. Share, on the other hand, captures the (possible) variable sharing between the variables of a logic program. The connection between these domains has been explored in the domain comparison and decomposition literature. We develop this link further and show how the meet (as well as the join) of Def can be modelled with efficient (quadratic) operations on Share. Further, we show how by compressing and widening Share and by rescheduling meet operations, we can construct a dependency analysis that is surprisingly fast and precise, and comes with time and space-performance guarantees. Unlike some other approaches, our analysis can be coded straightforwardly in Prolog.
The domain of definite Boolean functions, Def, can be used to express the groundness of, and trac... more The domain of definite Boolean functions, Def, can be used to express the groundness of, and trace grounding dependencies between, program variables in (constraint) logic programs. In this paper, previously unexploited computational properties of Def are utilised to develop an efficient and succinct groundness analyser that can be coded in Prolog. In particular, entailment checking is used to prevent unnecessary least upper bound calculations. It is also demonstrated that join can be defined in terms of other operations, thereby eliminating code and removing the need for preprocessing formulae to a normal form. This saves space and time. Furthermore, the join can be adapted to straightforwardly implement the downward closure operator that arises in set sharing analyses. Experimental results indicate that the new Def implementation gives favourable results in comparison with BDD-based groundness analyses.
Precise mode information is important for compiler optimisations and in program development tools... more Precise mode information is important for compiler optimisations and in program development tools. Within the framework of abstract compilation, the precision of a mode analysis depends, in part, on the expressiveness of the abstract domain and its associated abstraction function. This paper considers abstract domains for polymorphically typed logic programs and shows how specialised domains may be constructed for each type in the program. These domains capture the degree of instantiation to a high level of precision. By providing a generic definition of abstract unification, the abstraction of a program using these domains is formalised. The domain construction procedure is fully implemented using the Gödel language and tested on a number of example programs to demonstrate the viability of the approach. Note: Some proofs have been omitted for space reasons. They can be found in the full version of this paper [17].
The domain of positive Boolean functions, Pos, is by now well established for the analysis of the... more The domain of positive Boolean functions, Pos, is by now well established for the analysis of the variable dependencies that arise within logic programs. Analyses based on Pos that use binary decision diagrams have been shown to be efficient for a wide range of practical programs. However, independent of the representation, assuming that P != NP , an (unwidened) Pos
263 safety has been formally proved through abstract interpretation. In more pragmatic terms it m... more 263 safety has been formally proved through abstract interpretation. In more pragmatic terms it means that the thresholding conditions inferred by the analysis guarantee that fine-grained processes are never spawned. Note, however, that not spawning fine-grained processes ...
One recurring problem in program development is that of understanding how to re-use code develope... more One recurring problem in program development is that of understanding how to re-use code developed by a third party. In the context of (constraint) logic programming, part of this problem reduces to figuring out how to query a program. If the logic program does not come with any documentation, then the programmer is forced to either experiment with queries in an ad hoc fashion or trace the control-flow of the program (backward) to infer the modes in which a predicate must be called so as to avoid an instantiation error. This paper presents an abstract interpretation scheme that automates the latter technique. The analysis presented in this paper can infer moding properties which if satisfied by the initial query, come with the guarantee that the program and query can never generate any moding or instantiation errors. Other applications of the analysis are discussed. The paper explains how abstract domains with certain computational properties (they condense) can be used to trace control-flow backward (right-to-left) to infer useful properties of initial queries. A correctness argument is presented and an implementation is reported.
Ьг вижг й и в анз з згб вги и гв в дж а б в жн Ќв и гвз ж ж ей ж К Ь ж ж з ззйб иг б а ж л и и зи... more Ьг вижг й и в анз з згб вги и гв в дж а б в жн Ќв и гвз ж ж ей ж К Ь ж ж з ззйб иг б а ж л и и зи в ж гвЙ зижй из йз в аг джг ж бб в НН зй з йв к жз г аа к ж а з Дй к ОЕ Эк ж и з и г и жбз Ди ОЕ Ь жб гжб жгб и з и г йв игжз Д ОЕ йв Дг и ЌжзиЙгж ж а в й йв жан в и джг ж бЕ в и з и ...
As typed logic programming becomes more mainstream, system building tools like partial deduction ... more As typed logic programming becomes more mainstream, system building tools like partial deduction systems will need to be mapped from untyped languages to typed ones. It is important, however, when mapping techniques across that the new techniques should exploit the type system as much as possible. In this paper, we show how norms, which play a crucial role in termination analysis, can be generated from the prescribed types of a logic program. Interestingly, the types highlight restrictions of earlier norms and suggest how these norms can be extended to obtain some very general and powerful notions of norm which can be used to measure any term in an almost arbitrary way. We see our work on norm derivation as a contribution to the termination analysis of typed logic programs which, in particular, forms an essential part of offline partial deduction systems.
Schedule Analysis of Concurrent Logic Programs [Andy King and Paul Soper Pepartment of Electronic... more Schedule Analysis of Concurrent Logic Programs [Andy King and Paul Soper Pepartment of Electronics and Computer Science, university of Southampton, Southampton, S09 5NH, UK| ^[email protected], [email protected] LA.bstract A compilation technique is proposed ...
Uploads
Papers by Andy King