This Article 
   
 Share 
   
 Bibliographic References 
   
 Add to: 
 
Digg
Furl
Spurl
Blink
Simpy
Google
Del.icio.us
Y!MyWeb
 
 Search 
   
Program Partition and Logic Program Analysis
December 1995 (vol. 21 no. 12)
pp. 959-968
A program partition scheme for stratified programs introduced by Apt, Blair, and Walker is used to study efficient computation of logic programs. We consider three types of program partitions and their corresponding graph representations: 1) the natural partition, 2) stratified partitions, and 3) the reduced partition. The natural (program) partition consists of definitions of relations, each definition being a subprogram. Subprograms of a program partition may consist of several relations. A partition graph is introduced for a program partion, each node of which corresponds to a subprogram. The partition graph for a stratified partition is a directed acyclic graph (DAG). A stratified partition decomposes a program into modules. The stratified partition with the maximum number of modules is the reduced partition. The cost to achieve a reduced partition is linear in the program size, using well known graph algorithms. We introduce the modular interpretations, which are equivalent in semantics to the standard interpretation. The modular interpretations offer encapsulation and may reduce the computation cost for some modules significantly. The modular approach can play an important role in query optimization, efficient termination, programming design, and software engineering. We classify query types and answer types then discuss query optimization for some query types. Many efficient query processing strategies are applicable to restricted subclasses of programs. The program partition method allows us to select the most efficient strategy for each module. For example, if a module is a uniformly bounded recursion, then the module can be terminated efficiently. If a module defines the transitive closure, then efficient program transformations may be applied to this module.

[1] A. Aho, J. Hopcroft, and J. Ullman, Data Structures and Algorithms.Reading, Mass: Addison-Wesley, 1983.
[2] A.V. Aho,M.R. Garey,, and J.D. Ullman,“The transitive reduction of a directed graph,” SIAM J. Comput. vol. 1, no. 2, pp. 131-137, 1972.
[3] H. Aït-Kaci,Warren’s Abstract Machine, A Tutorial Reconstruction, MIT Press, Series on Logic Programming, Cambridge, Mass., 1991.
[4] K. Apt, "Logic Programming," Handbook of Theoretical Computer Science, vol. B, J. van Leeuven, ed., pp. 493-574.Cambridge, Mass.: MIT Press, 1990.
[5] K. Apt, H.A. Blair, and A. Walker, "Towards a Theory of Declarative Knowledge," Foundations of Deductive Databases and Logic Programming, J. Minker, ed., pp. 89-148. Morgan Kaufmann, 1988.
[6] F. Bancilhon, D. Maier, Y. Sagiv, and J.D. Ullman, "Magic Sets and Other Strange Ways to Implement Logic Programs," Proc. Fifth ACM PODS Symp. Principles of Database Systems, pp. 1-15, 1986.
[7] J.L. Han,“Preventing infinite looping in Prolog,” Proc. IEEE Int’l Conf. on Tools for Artificial Intelligence,San Jose, Calif., pp. 524-525, Nov. 1991.
[8] J.L. Han,“On constraints in recursive rules,” in preparation. A preliminary report, B. Srinivasan and J. Zeleznikow, eds., “Handling constants and/or repeated variables in linear recursive programs,” Research and Practical Issues in Databases.Singapore: World Scientific, pp. 113-123, Feb. 1992.
[9] J.L. Han,“On optimizing uniformly bounded datalog program,” Advances in Database Research, M. Orlowska and M. Papazoglou, eds., Singapore: World Scientific, pp. 250-261, Feb. 1993.
[10] J.L. Han,“On termination of single rule recursions in Prolog,” Faculty of Sciences Working Paper Series, Sc-MC-9301, Univ. ofSouthern Queensland, Australia, Feb. 1993. An abstract appeared in [7].
[11] J.L. Han and S.-S. Chen,“Graphic representation of linear recursive rules,” Int’l J. of Intelligent Systems, vol. 7, no. 4, pp. 317-337, 1992.
[12] Y.E. Ioannidis,“A time bound on the materialization of some recursively defined views,” Algorithmica, vol. 1, no. 4, pp. 361-385, 1986. Also in Proc. 11th Int’l Conf. on Very Large Data Bases,Stockholm, Sweden, pp. 219-226, Aug. 1985.
[13] D.B. Kemp,K. Ramamohanarao,, and Z. Somogyi,“Right-, left-, and multi-linear rule transformations that maintain context information,” Proc. of the 16th Int’l Conf. on Very Large Data Bases,Brisbane, Australia, pp. 380-391, 1990.
[14] M. Kifer, G. Lausen, and J. Wu, "Logical Foundations of Object-Oriented and Frame-Based Languages," J. ACM, vol. 42, pp. 741-843, 1995.
[15] J.W. Lloyd, Foundations of Logic Programming, Springer Series in Symbolic Computation, second ed. New York: Springer-Verlag, 1987.
[16] I.S. Mumick and H. Pirahesh,“Overbound and right-linear queries,” Proc. 10th ACM SIGACT-SIGMOD-SIGART Symp. on Principles of Database Systems, pp. 127-141, 1991.
[17] J. Naughton, R. Ramakrisnhan, Y. Sagiv, and J.F. Ullman, “Efficient Evaluation of Right-, Left-, and Multi-Linear Rules,” Proc. ACM SIGMOD Int'l Conf. Management of Data, pp. 235-242, 1989.
[18] Y. Sagiv,“Is there anything better than magic?” Proc. North Am. Conf. on Logic Programming,Cambridge Mass.: MIT Press, pp. 235-254, 1990.
[19] R.E. Tarjan,“Depth first search and linear graph algorithms,” SIAM J. Computing, vol. 1, no. 2, pp. 146-160, 1972.
[20] J. Ullman, Principles of Database and Knowledge-Base Systems, vol. 1. Computer Science Press, 1988.
[21] J.D. Ullman, Principles of Database and Knowledge-Base Systems, vol. II: The New Tech nologies. New York: Computer Science Press, 1989.
[22] M.H. van Emden and R.A. Kowalski, “The Semantics of Predicate Logic as a Programming Language,” J. ACM, vol. 23, no. 4, pp. 733-742, Oct. 1976.
[23] A. van Gelder,K. Ross, and J.S. Schlipf,"The well-founded semantics for general logic programs," J. ACM, vol. 38, no. 3, pp. 620-650, July 1991.
[24] D.H.D. Warren,An Abstract Prolog Instruction Set, Technical Note 309, SRI International, Menlo Park, Calif., Oct. 1983.

Index Terms:
Declarative programming, program partitions, semantic analysis, logic programming, query optimization, deductive databases, program verifications.
Citation:
Jia Liang Han, "Program Partition and Logic Program Analysis," IEEE Transactions on Software Engineering, vol. 21, no. 12, pp. 959-968, Dec. 1995, doi:10.1109/32.489072
Usage of this product signifies your acceptance of the Terms of Use.