Computing More Specific Versions of Conditional Rewriting Systems

  • Naoki Nishida
  • Germán Vidal
Part of the Lecture Notes in Computer Science book series (LNCS, volume 7844)


Rewrite systems obtained by some automated transformation often have a poor syntactic structure even if they have good properties from a semantic point of view. For instance, a rewrite system might have overlapping left-hand sides even if it can only produce at most one constructor normal form (i.e., value). In this paper, we propose a method for computing “more specific” versions of deterministic conditional rewrite systems (i.e., typical functional programs) by replacing a given rule (e.g., an overlapping rule) with a finite set of instances of this rule. In some cases, the technique is able to produce a non-overlapping system from an overlapping one. We have applied the transformation to improve the systems produced by a previous technique for function inversion with encouraging results (all the overlapping systems were successfully transformed to non-overlapping systems).


Logic Program Logic Programming Successful Derivation Function Inversion Fresh Variable 
These keywords were added by machine and not by the authors. This process is experimental and the keywords may be updated as the learning algorithm improves.


Unable to display preview. Download preview PDF.

Unable to display preview. Download preview PDF.


  1. 1.
    Albert, E., Vidal, G.: The narrowing-driven approach to functional logic program specialization. New Generation Computing 20(1), 3–26 (2002)MathSciNetzbMATHCrossRefGoogle Scholar
  2. 2.
    Almendros-Jiménez, J.M., Vidal, G.: Automatic partial inversion of inductively sequential functions. In: Horváth, Z., Zsók, V., Butterfield, A. (eds.) IFL 2006. LNCS, vol. 4449, pp. 253–270. Springer, Heidelberg (2007)CrossRefGoogle Scholar
  3. 3.
    Antoy, S., Hanus, M.: Overlapping rules and logic variables in functional logic programs. In: Etalle, S., Truszczyński, M. (eds.) ICLP 2006. LNCS, vol. 4079, pp. 87–101. Springer, Heidelberg (2006)CrossRefGoogle Scholar
  4. 4.
    Baader, F., Nipkow, T.: Term Rewriting and All That. Cambridge University Press (1998)Google Scholar
  5. 5.
    Bertling, H., Ganzinger, H.: Completion-time optimization of rewrite-time goal solving. In: Dershowitz, N. (ed.) RTA 1989. LNCS, vol. 355, pp. 45–58. Springer, Heidelberg (1989)CrossRefGoogle Scholar
  6. 6.
    Bockmayr, A., Werner, A.: LSE narrowing for decreasing conditional term rewrite systems. In: Dershowitz, N., Lindenstrauss, N. (eds.) CTRS 1994. LNCS, vol. 968, pp. 51–70. Springer, Heidelberg (1995)CrossRefGoogle Scholar
  7. 7.
    Bondorf, A.: Towards a self-applicable partial evaluator for term rewriting systems. In: Bjørner, D., Ershov, A., Jones, N. (eds.) Proceedings of the International Workshop on Partial Evaluation and Mixed Computation, pp. 27–50. North-Holland, Amsterdam (1988)Google Scholar
  8. 8.
    Bondorf, A.: A self-applicable partial evaluator for term rewriting systems. In: Díaz, J., Orejas, F. (eds.) TAPSOFT 1989. LNCS, vol. 352, pp. 81–95. Springer, Heidelberg (1989)Google Scholar
  9. 9.
    Bosco, P., Giovannetti, E., Moiso, C.: Narrowing vs. SLD-resolution. Theoretical Computer Science 59, 3–23 (1988)MathSciNetzbMATHCrossRefGoogle Scholar
  10. 10.
    Dershowitz, N.: Termination of rewriting. Journal of Symbolic Computation 3(1&2), 69–115 (1987)MathSciNetzbMATHCrossRefGoogle Scholar
  11. 11.
    Dershowitz, N., Jouannaud, J.-P.: Rewrite systems. In: van Leeuwen, J. (ed.) Handbook of Theoretical Computer Science. Formal Models and Semantics, vol. B, pp. 243–320. Elsevier, Amsterdam (1990)Google Scholar
  12. 12.
    Fribourg, L.: SLOG: a logic programming language interpreter based on clausal superposition and rewriting. In: Proceedings of the Symposium on Logic Programming, pp. 172–185. IEEE Press (1985)Google Scholar
  13. 13.
    Ganzinger, H.: Order-sorted completion: The many-sorted way. Theoretical Computer Science 89(1), 3–32 (1991)MathSciNetzbMATHCrossRefGoogle Scholar
  14. 14.
    Glück, R., Kawabe, M.: A program inverter for a functional language with equality and constructors. In: Ohori, A. (ed.) APLAS 2003. LNCS, vol. 2895, pp. 246–264. Springer, Heidelberg (2003)CrossRefGoogle Scholar
  15. 15.
    Glück, R., Kawabe, M.: A method for automatic program inversion based on LR(0) parsing. Fundamenta Informaticae 66(4), 367–395 (2005)MathSciNetzbMATHGoogle Scholar
  16. 16.
    Hanus, M.: The integration of functions into logic programming: From theory to practice. Journal of Logic Programming 19&20, 583–628 (1994)Google Scholar
  17. 17.
    Harrison, P.G.: Function inversion. In: Proceedings of the International Workshop on Partial Evaluation and Mixed Computation, pp. 153–166. North-Holland, Amsterdam (1988)Google Scholar
  18. 18.
    Hölldobler, S.: Foundations of Equational Logic Programming. LNCS (LNAI), vol. 353. Springer, Heidelberg (1989)zbMATHCrossRefGoogle Scholar
  19. 19.
    Hullot, J.-M.: Canonical forms and unification. In: Bibel, W., Kowalski, R.A. (eds.) Automated Deduction. LNCS, vol. 87, pp. 318–334. Springer, Heidelberg (1980)Google Scholar
  20. 20.
    Kawabe, M., Futamura, Y.: Case studies with an automatic program inversion system. In: Proceedings of the 21st Conference of Japan Society for Software Science and Technology, 6C-3, 5 pages (2004)Google Scholar
  21. 21.
    Kawabe, M., Glück, R.: The program inverter LRinv and its structure. In: Hermenegildo, M.V., Cabeza, D. (eds.) PADL 2004. LNCS, vol. 3350, pp. 219–234. Springer, Heidelberg (2005)CrossRefGoogle Scholar
  22. 22.
    Khoshnevisan, H., Sephton, K.M.: InvX: An automatic function inverter. In: Dershowitz, N. (ed.) RTA 1989. LNCS, vol. 355, pp. 564–568. Springer, Heidelberg (1989)CrossRefGoogle Scholar
  23. 23.
    Marchiori, M.: On deterministic conditional rewriting. Technical Report MIT-LCS-TM-405, MIT Laboratory for Computer Science (1997),
  24. 24.
    Marriott, K., Naish, L., Lassez, J.-L.: Most specific logic programs. Annals of Mathematics and Artificial Intelligence 1, 303–338 (1990), zbMATHCrossRefGoogle Scholar
  25. 25.
    Middeldorp, A., Hamoen, E.: Completeness results for basic narrowing. Applicable Algebra in Engineering, Communication and ComputingGoogle Scholar
  26. 26.
    Nishida, N., Sakai, M.: Completion after program inversion of injective functions. Electronic Notes in Theoretical Computer Science 237, 39–56 (2009)CrossRefGoogle Scholar
  27. 27.
    Nishida, N., Sakai, M., Sakabe, T.: Generation of inverse computation programs of constructor term rewriting systems. IEICE Transactions on Information and Systems J88-D-I(8), 1171–1183 (2005) (in Japanese)Google Scholar
  28. 28.
    Nishida, N., Sakai, M., Sakabe, T.: Partial inversion of constructor term rewriting systems. In: Giesl, J. (ed.) RTA 2005. LNCS, vol. 3467, pp. 264–278. Springer, Heidelberg (2005)CrossRefGoogle Scholar
  29. 29.
    Nishida, N., Vidal, G.: Program inversion for tail recursive functions. In: Schmidt-Schauß, M. (ed.) Proceedings of the 22nd International Conference on Rewriting Techniques and Applications. Leibniz International Proceedings in Informatics, vol. 10, pp. 283–298. Schloss Dagstuhl - Leibniz-Zentrum für Informatik (2011)Google Scholar
  30. 30.
    Nishida, N., Vidal, G.: Conversion to first-order tail recursion for improving program inversion (2012) (submitted for publication)Google Scholar
  31. 31.
    Nishida, N., Vidal, G.: More specific term rewriting systems. In: The 21st International Workshop on Functional and (Constraint) Logic Programming, Nagoya, Japan (2012), Informal proceedings
  32. 32.
    Ohlebusch, E.: Advanced topics in term rewriting. Springer, UK (2002)zbMATHCrossRefGoogle Scholar
  33. 33.
    Pfenning, F.: Unification and anti-unification in the calculus of constructions. In: Proceedings of the Sixth Annual Symposium on Logic in Computer Science, pp. 74–85. IEEE Computer Society (1991)Google Scholar
  34. 34.
    Plotkin, G.: Building-in equational theories. Machine Intelligence 7, 73–90 (1972)MathSciNetzbMATHGoogle Scholar
  35. 35.
    Ramos, J.G., Silva, J., Vidal, G.: Fast Narrowing-Driven Partial Evaluation for Inductively Sequential Systems. In: Danvy, O., Pierce, B.C. (eds.) Proceedings of the 10th ACM SIGPLAN International Conference on Functional Programming, pp. 228–239. ACM Press (2005)Google Scholar
  36. 36.
    Slagle, J.R.: Automated theorem-proving for theories with simplifiers, commutativity and associativity. Journal of the ACM 21(4), 622–642 (1974)MathSciNetzbMATHCrossRefGoogle Scholar

Copyright information

© Springer-Verlag Berlin Heidelberg 2013

Authors and Affiliations

  • Naoki Nishida
    • 1
  • Germán Vidal
    • 2
  1. 1.Graduate School of Information ScienceNagoya UniversityNagoyaJapan
  2. 2.MiST, DSICUniversitat Politècnica de ValènciaValenciaSpain

Personalised recommendations