## Logic Program Schemas, Semi-Unification and Constraints

Venue: | In: N.E. Fuchs (ed), Proc. of LOPSTR'97 (this volume |

Citations: | 2 - 0 self |

### BibTeX

@INPROCEEDINGS{Chasseur_logicprogram,

author = {Eric Chasseur and Yves Deville and Universit'e Catholique De Louvain},

title = {Logic Program Schemas, Semi-Unification and Constraints},

booktitle = {In: N.E. Fuchs (ed), Proc. of LOPSTR'97 (this volume},

year = {}

}

### OpenURL

### Abstract

The use of schemas is a classical way of synthesizing, transforming and analyzing logic programs. Operations on schemas are needed, in particular, the semi-unification of schemas with programs. Since schemas are second-order objects, the related semi-unification is the second-order semi-unification, which is decidable but NP-complete. The non-determinism implied by the NP-completeness slows down the search for a substitution. The present paper expresses the semi-unification process over schemas as rewriting and reduction rules. Global and local constraints are associated to the schema to extend the expressivity of schema description and to fasten the search for a second-order substitution between programs and schemas. CLP techniques and notations are used. 1 Introduction In logic programming, the use of program schemas is a very promising technique. In program synthesis, program schemas can formalize particular resolution methods (divide-and-conquer, generate-and-test approaches...),...

### Citations

11422 |
Computers and Intractability, A Guide to Theory of NP-Completeness
- Garey, Johnson
- 1979
(Show Context)
Citation Context ...ed with programs by means of CLP techniques. The work is based on second-order semi-unification (or matching) of schemas with programs. Second-order semi-unification is decidable [12] but NP-complete =-=[5]-=-. Let S be a schema, and c be the initial constraints set associated to S. Let P be the program with which S has to be semi-unified. The starting pair hS = P ; ci is transformed via successive rewriti... |

346 | An Efficient Unification Algorithm
- Martelli, Montanari
- 1982
(Show Context)
Citation Context ...writing rules examples We only present here a subset of the rewriting rules. We focus on the most significant ones. The set of rewriting rules contains the classical rules for first-order unification =-=[16]-=-. 6.1 Constraints 6.1.1 Commutativity of parameters rule (non-deterministic) X 1 : : : X n 2 SOrdT, X is one of the n! permutations of X 1 : : : X n , t 2 seqterm h[: : : ; J (X 1 : : : X n ); : : : =... |

152 |
Proving and applying program transformations expressed with second order patterns
- Huet, Lang
- 1978
(Show Context)
Citation Context ...he divide-and-conquer schema. For the instantiation of the latter to result in valid divide-and-conquer logic algorithms, constraints are expressed on the induction parameter, for example. Huet, Lang =-=[13]-=- describe a program transformation method based on rewriting rules composed of second-order schemas. Fuchs, Fromherz [4] and Vasconcelos, Fuchs [18, 19] present schema-based transformation formalisms ... |

135 |
The undecidability of the second-order unification problem
- Goldfarb
- 1981
(Show Context)
Citation Context ...and synthesis is not definitive, as said in Deville, Lau [1]. Schemas are defined with second-order variables. Higher-order terms are normally difficult to deal with, since unification is undecidable =-=[9]-=- and there is no most general unifier. When using higher-order terms, one either accepts this and uses, for instance, the pre-unification procedure of Huet [11] which performs a systematic search for ... |

133 |
Higher-order critical pairs
- Nipkow
- 1991
(Show Context)
Citation Context ...of unifiers, or one restricts oneself to a subset of higher-order terms which is tractable. Higherorder patterns form such a subset of higher-order terms which was investigated among others by Nipkow =-=[17]-=-. Higher-order patterns unification is decidable and there exists a most general unifier of unifiable terms. Another alternative is to use decidable subcases of higher-order unification (for instance ... |

61 | Logic program synthesis from incomplete information
- Flener
- 1995
(Show Context)
Citation Context ...hemas is a very promising technique. In program synthesis, program schemas can formalize particular resolution methods (divide-and-conquer, generate-and-test approaches...), as investigated by Flener =-=[2]-=-. Program transformations can advantageously be performed on schemas rather than on their instances (i.e. programs). See Fuchs, Fromherz [4], Vasconcelos, Fuchs [18, 19]. In fact, the distinction betw... |

49 | A logic programming approach to manipulating formulas and programs
- Miller, Nadathur
- 1987
(Show Context)
Citation Context ...traints over schema place-holder instances force to respect properties of schemas, such as recursive or non-recursive parts, parameter form, length, position, and so on. Related work Miller, Nadathur =-=[15]-=- present Prolog which is a higher-order extension of Prolog manipulating objects such as function and predicate variables, formulas and programs. Prolog is a logic programming language in the same way... |

35 | Schema-based transformations of logic programs
- Fuchs, Fromherz
- 1992
(Show Context)
Citation Context ...generate-and-test approaches...), as investigated by Flener [2]. Program transformations can advantageously be performed on schemas rather than on their instances (i.e. programs). See Fuchs, Fromherz =-=[4]-=-, Vasconcelos, Fuchs [18, 19]. In fact, the distinction between transformation and synthesis is not definitive, as said in Deville, Lau [1]. Schemas are defined with second-order variables. Higher-ord... |

31 | Middle-out reasoning for logic program synthesis
- Kraan, Basin, et al.
- 1993
(Show Context)
Citation Context ...gramming language in the same way Prolog is. It is based on secondorder unification. The pre-unification procedure of Huet is used to handle with second-order unification undecidability. Kraan et al. =-=[14]-=- synthesize logic programs as a by-product of the planning of their verification proofs. This is achieved by using higher-order meta-variables at the proof planning level, which become instantiated in... |

28 |
Uses of higher-order unification for implementing program transformers
- Hannan, Miller
(Show Context)
Citation Context ...iated in the course of planning. These higher-order variables can represent functions and predicates applied to bound variables. The formulas containing them are higher-order patterns. Hannan, Miller =-=[10]-=- present source-to-source program transformers as meta-programs that manipulate programs as objects. They expose how simple transformers can be used to specify more sophisticated transformers. They us... |

18 | An Opportunistic Approach for Logic Program Analysis and Optimisation Using Enhanced Schema-Based Transformations
- Vasconcelos, Fuchs
- 1995
(Show Context)
Citation Context ...ches...), as investigated by Flener [2]. Program transformations can advantageously be performed on schemas rather than on their instances (i.e. programs). See Fuchs, Fromherz [4], Vasconcelos, Fuchs =-=[18, 19]-=-. In fact, the distinction between transformation and synthesis is not definitive, as said in Deville, Lau [1]. Schemas are defined with second-order variables. Higher-order terms are normally difficu... |

14 | Logic program transformation through generalization schemata
- Flener, Deville
- 1995
(Show Context)
Citation Context ...y abstract meta-language. In [8], he extends these Prolog program schemas by applying standard programming techniques, introducing additional arguments and combining existing schemas. Flener, Deville =-=[3]-=- show that some logic program generalization techniques can be precompiled at the program schema level so that the corresponding transformation can be fully automated. They also use second-order match... |

13 | Representing logic program schemata in * Prolog
- Gegg-Harrison
- 1995
(Show Context)
Citation Context ...Gegg-Harrison [6] proposes a hierarchy of fourteen logic program schemas which are secondorder logic expressions and generalize classes of programs in the most specific generalization (msg) sense. In =-=[7]-=-, he defines logic program schemas with the help of Prolog to avoid using any abstract meta-language. In [8], he extends these Prolog program schemas by applying standard programming techniques, intro... |

12 | Representing Logic Program Schemata in
- Gegg-Harrison
- 1995
(Show Context)
Citation Context ...ions and generalize classes of programs in the most specific generalization (msg) sense. In [7], he defines logic program schemas with the help of Prolog to avoid using any abstract meta-language. In =-=[8]-=-, he extends these Prolog program schemas by applying standard programming techniques, introducing additional arguments and combining existing schemas. Flener, Deville [3] show that some logic program... |

8 | Exploiting Program Schemata in a Prolog Tutoring System
- Gegg-Harrison
- 1993
(Show Context)
Citation Context ...programs that manipulate programs as objects. They expose how simple transformers can be used to specify more sophisticated transformers. They use the pre-unification algorithm of Huet. Gegg-Harrison =-=[6]-=- proposes a hierarchy of fourteen logic program schemas which are secondorder logic expressions and generalize classes of programs in the most specific generalization (msg) sense. In [7], he defines l... |

7 |
R esolution d' equations dans les langages d'ordre
- Huet
- 1976
(Show Context)
Citation Context ...s unification is decidable and there exists a most general unifier of unifiable terms. Another alternative is to use decidable subcases of higher-order unification (for instance second-order matching =-=[12]-=-) if the problem permits it. Constraints over schema place-holder instances force to respect properties of schemas, such as recursive or non-recursive parts, parameter form, length, position, and so o... |

5 |
A unification algorithm for lambda calculus
- Huet
- 1975
(Show Context)
Citation Context ...l with, since unification is undecidable [9] and there is no most general unifier. When using higher-order terms, one either accepts this and uses, for instance, the pre-unification procedure of Huet =-=[11]-=- which performs a systematic search for determining the existence of unifiers, or one restricts oneself to a subset of higher-order terms which is tractable. Higherorder patterns form such a subset of... |

3 |
Logic program synthesis: A survey
- Deville, Lau
- 1994
(Show Context)
Citation Context ...than on their instances (i.e. programs). See Fuchs, Fromherz [4], Vasconcelos, Fuchs [18, 19]. In fact, the distinction between transformation and synthesis is not definitive, as said in Deville, Lau =-=[1]-=-. Schemas are defined with second-order variables. Higher-order terms are normally difficult to deal with, since unification is undecidable [9] and there is no most general unifier. When using higher-... |

1 | Enhanced Schema-Based Transformations for Logic Programs and their Opportunistic Usage in Program Analysis and Optimisation, technical report, Institut fur Informatik, Universitat
- Vasconcelos, Fuchs
- 1995
(Show Context)
Citation Context ...ches...), as investigated by Flener [2]. Program transformations can advantageously be performed on schemas rather than on their instances (i.e. programs). See Fuchs, Fromherz [4], Vasconcelos, Fuchs =-=[18, 19]-=-. In fact, the distinction between transformation and synthesis is not definitive, as said in Deville, Lau [1]. Schemas are defined with second-order variables. Higher-order terms are normally difficu... |