Weighted Graphs: A Tool for Studying the Halting Problem and Time Complexity in Term Rewriting Systems and Logic Programming

This study is based on the halting and complexity problems for a simple class of logic programs in PROLOG-like languages. Any Prolog program can be expressed in the form of an overlap of some simpler programs whose structures are basic and can be studied formally. The simplest recursive rules are studied here and the weighted graph is introduced to characterise their behaviour. This new syntactic object, the weighted graph, generalises the directed graph. Unfoldings of directed graphs generate infinite regular trees that I generalise by weighting the arrows and putting periods on the variables. The weights along a branch are added during unfolding and the result (modulo of the period) indexes variables. Hence, their interpretations are non-regular trees because of the infinity of variables. This paper presents some of the formal properties of these graphs, finite and infinite interpretation and unification. Although they have a consistency apart from all possible applications, weighted graphs characterise the behaviour of recursive rules in the form L:-R. They express themost general fixpoint of these rules and range across a finite sequence of recursive rewritings. Within global rewriting systems and logic programming, the halting problem and the existence of solutions are proved to be decidable for this simple recursive rule with linear goals and facts, and the complexity is shown to be at most linear. Although these problems are undecidable for slightly more complex schemes, it is hoped that from the weighted graphs of each recursive sub-structure of a Prolog program, the whole behaviour of the program will be understandable. Then, the weighted graphs would be the nucleus of an efficient and methodological logic programming, which could be called Structured Logic Programming.

[1]  Corrado Böhm,et al.  Flow diagrams, turing machines and languages with only two formation rules , 1966, CACM.

[2]  B. Courcelle Fundamental properties of infinite trees , 1983 .

[3]  Richard J. Lipton,et al.  On the Halting of Tree Replacement Systems. , 1977 .

[4]  J. Lloyd Foundations of Logic Programming , 1984, Symbolic Computation.

[5]  Philippe Devienne,et al.  WEIGHTED GRAPHS, A Tool for Expressing the Behavious of Recursive Rules in Logic Programming , 1988, FGCS.

[6]  Philippe Devienne,et al.  Weighted Graphs: A Tool for Logic Programming , 1986, CAAP.

[7]  Bruno Courcelle,et al.  Equivalences and Transformations of Regular Systems-Applications to Recursive Program Schemes and Grammars , 1986, Theor. Comput. Sci..

[8]  Philippe Devienne,et al.  Les graphes orientés pondérés : un outil pour l'étude de la terminaison et de la complexité dans les systèmes de réécritures et en programmation logique , 1987 .

[9]  Michael J. Maher,et al.  Unification Revisited , 1988, Foundations of Deductive Databases and Logic Programming..

[10]  Jeffrey F. Naughton,et al.  Data independent recursion in deductive databases , 1985, J. Comput. Syst. Sci..

[11]  Jeffrey D. Ullman,et al.  Principles of Database Systems , 1980 .

[12]  Elmar Eder,et al.  Properties of Substitutions and Unifications , 1983, J. Symb. Comput..

[13]  Moshe Y. Vardi Decidability and undecidability results for boundedness of linear recursive queries , 1988, PODS.

[14]  Patrick Lebègue,et al.  Contribution à l'étude de la programmation logique par les graphes orientés pondérés , 1988 .

[15]  Max Dauchet Simulation of Turning Machines by a Left-Linear Rewrite Rule , 1989, RTA.

[16]  Nachum Dershowitz,et al.  Termination of Rewriting , 1987, J. Symb. Comput..

[17]  Gerard Huet,et al.  Conflunt reductions: Abstract properties and applications to term rewriting systems , 1977, 18th Annual Symposium on Foundations of Computer Science (sfcs 1977).

[18]  Gérard Huet,et al.  On the Uniform Halting Problem for Term Rewriting Systems , 1978 .

[19]  Gérard P. Huet,et al.  Confluent Reductions: Abstract Properties and Applications to Term Rewriting Systems , 1980, J. ACM.