vix.ing · top · new · best · stats · spec

Transformations of Logic Programs with Goals as Arguments

2003/07/09 by Alberto Pettorossi, Pettorossi, Alberto, Maurizio Proietti +1
Computer Science · #D.1.2 #D.1.6 #F.3.1 #FOS: Computer and information sciences #I.2.2 #Logic in Computer Science (cs.LO) #Programming Languages (cs.PL) #cs.LO #cs.PL

paper · pdf · doi:10.48550/arxiv.cs/0307022

51 pages. Full version of a paper that will appear in Theory and Practice of Logic Programming, Cambridge University Press, UK

arxiv created 2004/02/20 · arxiv updated 2009/12/01

Abstract

We consider a simple extension of logic programming where variables may range over goals and goals may be arguments of predicates. In this language we can write logic programs which use goals as data. We give practical evidence that, by exploiting this capability when transforming programs, we can improve program efficiency. We propose a set of program transformation rules which extend the familiar unfolding and folding rules and allow us to manipulate clauses with goals which occur as arguments of predicates. In order to prove the correctness of these transformation rules, we formally define the operational semantics of our extended logic programming language. This semantics is a simple variant of LD-resolution. When suitable conditions are satisfied this semantics agrees with LD-resolution and, thus, the programs written in our extended language can be run by ordinary Prolog systems. Our transformation rules are shown to preserve the operational semantics and termination.

Related