# Extensible logic program schemata

## Abstract

Schema-based transformational systems maintain a library of logic program schemata which capture large classes of logic programs. One of the shortcomings of schema-based transformation approaches is their reliance on a large (possibly incomplete) set of logic program schemata that is required in order to capture all of the minor syntactic differences between semantically similar logic programs. By defining a set of extensible logic program schemata and an associated set of logic program transformations, it is possible to reduce the size of the schema library while maintaining the robustness of the transformational system. In our transformational system, we have defined a set of extensible logic program schemata in *λ*Prolog. Because *λ*Prolog is a higher-order logic programming language, it can be used as the representation language for both the logic programs and the extensible logic program schemata. In addition to the instantiation of predicate variables, extensible logic program schemata can be extended by applying standard programming techniques (e.g., accumulating results), introducing additional arguments (e.g., a second list to append to the end of the primary list), combining logic program schemata which share a common primary input, and connecting logic program schemata which are connected via a result of one schema being an input to the other schema. These extensions increase the robustness of logic program schemata and enhance traditional schema-based transformational systems.

## Keywords

Logic Program Additional Argument List Result Predicate Variable Input List## Preview

Unable to display preview. Download preview PDF.

## References

- [1]D. Barker-Plummer. Cliché Programming in Prolog. In M. Bruynooghe, editor,
*Proceedings of the 2*^{nd}*Workshop on Meta-Programming in Logic*, Leuven, Belgium, pages 247–256, 1990.Google Scholar - [2]P. Brna, A. Bundy, A. Dodd, M. Eisenstadt, C. Looi, H. Pain, D. Robertson, B. Smith, and M. van Someren. Prolog Programming Techniques.
*Instructional Science*, 20: 111–133, 1991.Google Scholar - [3]P. Flener.
*Logic Program Synthesis from Incomplete Information*. Kluwer Academic Publishers, 1995.Google Scholar - [4]P. Flener and Y. Deville. Logic Program Synthesis from Incomplete Specifications.
*Journal of Symbolic Computation*, 15: 775–805, 1993.Google Scholar - [5]P. Flener and Y. Deville. Logic Program Transformation Through Generalization Schemata. In M. Proietti, editor,
*Proceedings of the 5*^{th}*International Workshop on Logic Program Synthesis and Transformation*, Utrecht, The Netherlands, pages 171–173, Springer-Verlag, 1995.Google Scholar - [6]N.E. Fuchs and M.P.J. Fromhertz. Schema-Based Transformations of Logic Programs. In T.P. Clement and K. Lau, editors,
*Proceedings of the 1*^{st}*International Workshop on Logic Program Synthesis and Transformation*, Manchester, England, pages 111–125, Springer-Verlag, 1991.Google Scholar - [7]T.S. Gegg-Harrison.
*Basic Prolog Schemata*. Technical Report CS-1989-20, Department of Computer Science, Duke University, Durham, North Carolina, 1989.Google Scholar - [8]T.S. Gegg-Harrison. Learning Prolog in a Schema-Based Environment.
*Instructional Science*, 20: 173–190, 1991.Google Scholar - [9]T.S. Gegg-Harrison. Adapting Instruction to the Student's Capabilities.
*Journal of Artificial Intelligence in Education*, 3: 169–181, 1992.Google Scholar - [10]T.S. Gegg-Harrison. Exploiting Program Schemata in an Automated Program Debugger.
*Journal of Artificial Intelligence in Education*, 5: 255–278, 1994.Google Scholar - [11]T.S. Gegg-Harrison. Representing Logic Program Schemata in
*λ*Prolog. In L. Sterling, editor,*Proceedings of the 12*^{th}*International Conference on Logic Programming*, Kanagawa, Japan, pages 467–481, MIT Press, 1995.Google Scholar - [12]A. Hamfelt and J. Fischer Nilsson. Declarative Logic Programming with Primitive Recursive Relations on Lists. In M. Maher, editor,
*Proceedings of the 13*^{th}*Joint International Conference and Symposium on Logic Programming*, Bonn, Germany, pages 230–243, MIT Press, 1996.Google Scholar - [13]M. Kirschenbaum and L.S. Sterling. Applying Techniques to Skeletons. In J. Jacquet, editor,
*Constructing Logic Programs*, pages 127–140, MIT Press, 1993.Google Scholar - [14]E. Marakakis and J.P. Gallagher. Schema-Based Top-Down Design of Logic Programs using Abstract Data Types. In L. Fribourg and F. Turini, editors,
*Proceedings of the 4*^{th}*International Workshops on Logic Program Synthesis and Transformation and Meta-Programming in Logic*, Pisa, Italy, pages 138–153, Springer-Verlag, 1994.Google Scholar - [15]G. Nadathur and D. Miller. An Overview of
*λ*Prolog. In R.A. Kowalski and K.A. Bowen, editors,*Proceedings of the 5*^{th}*International Conference and Symposium on Logic Programming*, Seattle, Washington, pages 810–827, MIT Press, 1988.Google Scholar - [16]W.W. Vasconcelos and N.E. Fuchs. An Opportunistic Approach for Logic Program Analysis and Optimisation Using Enhanced Schema-Based Transformations. In M. Proietti, editor,
*Proceedings of the 5*^{th}*International Workshop on Logic Program Synthesis and Transformation*, Utrecht, The Netherlands, pages 174–188, Springer-Verlag, 1995.Google Scholar