Location via proxy:   [ UP ]  
[Report a bug]   [Manage cookies]                
skip to main content
research-article

Program Partition and Logic Program Analysis

Published: 01 December 1995 Publication History

Abstract

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.

References

[1]
A.V. Aho, J.E. Hopcroft, and J.D. 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. Cambridge, Mass.: MIT Press, 1991.
[4]
K.R. Apt, “Logic programming,” Handbook of Theoretical Computer Science. J. van Leeuwen, ed., vol. B . Amsterdam: North Holland, pp. 493-574, 1990.
[5]
K.R Apt, H. Blair, and A. Walker, “Toward a theory of declarative knowledge,” J. Minker, ed., Foundations of Deductive Databases and Logic Programming. San Mateo, Calif.: Morgan Kaufman, pp. 89-148, 1988.
[6]
F. Bancilhon, D. Maier, Y. Sagiv, and J.D. Ullman, “Magic sets and other strange ways to implement logic programs,” Proc. 5th ACM SIGACT-SIGMOD Symp. on 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, “Logic foundations of object-oriented and frame-based languages,” to appear in J. ACM.
[15]
J.W. Lloyd, Foundations of Logic Programming, 2nd 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.F. Naughton, R. Ramakrishnan, Y. Sagiv, and J.D. Ullman, “Efficient evaluation of right-, left-, and multi-linear rules,” Proc. ACM-SIGMOD Int’l Conf. on 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.D. Ullman, Principles of Database and Knowledge-base Systems, vol. 1 . Rockville, Md.: Computer Science Press, 1988.
[21]
J.D. Ullman, Principles of Database and Knowledge-base Systems, vol. 2 . Rockville, Md.: 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, 1976.
[23]
A. van Gelder, K.A. Ross, and J.S. Schlipf, “Well founded semantics for general logic programs,” J. ACM, vol. 38, no. 3, pp. 620-650, 1991.
[24]
D.H.D. Warren, An Abstract Prolog Instruction Set, Technical Note 309, SRI International, Menlo Park, Calif., Oct. 1983.

Cited By

View all
  • (2005)Automatically partitioning packet processing applications for pipelined architecturesProceedings of the 2005 ACM SIGPLAN conference on Programming language design and implementation10.1145/1065010.1065039(237-248)Online publication date: 12-Jun-2005
  • (2005)Automatically partitioning packet processing applications for pipelined architecturesACM SIGPLAN Notices10.1145/1064978.106503940:6(237-248)Online publication date: 12-Jun-2005
  • (1996)A front-end to deductive database systems for multiparadigm programmingProceedings of the 1996 International Conference on Software Engineering: Education and Practice (SE:EP '96)10.5555/829500.829916Online publication date: 24-Jan-1996

Recommendations

Comments

Information & Contributors

Information

Published In

cover image IEEE Transactions on Software Engineering
IEEE Transactions on Software Engineering  Volume 21, Issue 12
December 1995
83 pages

Publisher

IEEE Press

Publication History

Published: 01 December 1995

Author Tags

  1. Declarative programming
  2. deductive databases
  3. logic programming
  4. program partitions
  5. program verifications.
  6. query optimization
  7. semantic analysis

Qualifiers

  • Research-article

Contributors

Other Metrics

Bibliometrics & Citations

Bibliometrics

Article Metrics

  • Downloads (Last 12 months)0
  • Downloads (Last 6 weeks)0
Reflects downloads up to 03 Oct 2024

Other Metrics

Citations

Cited By

View all
  • (2005)Automatically partitioning packet processing applications for pipelined architecturesProceedings of the 2005 ACM SIGPLAN conference on Programming language design and implementation10.1145/1065010.1065039(237-248)Online publication date: 12-Jun-2005
  • (2005)Automatically partitioning packet processing applications for pipelined architecturesACM SIGPLAN Notices10.1145/1064978.106503940:6(237-248)Online publication date: 12-Jun-2005
  • (1996)A front-end to deductive database systems for multiparadigm programmingProceedings of the 1996 International Conference on Software Engineering: Education and Practice (SE:EP '96)10.5555/829500.829916Online publication date: 24-Jan-1996

View Options

View options

Media

Figures

Other

Tables

Share

Share

Share this Publication link

Share on social media