Generic cut actions for external Prolog predicates

3Citations
Citations of this article
4Readers
Mendeley users who have this article in their library.
Get full text

Abstract

An interesting feature of current Prolog systems is the ability to define external Prolog predicates that can be written in other languages. However, an important drawback of these interfaces is the fact that they lack some important features necessary to improve both the efficiency and the transparent integration of the Prolog system and the external predicates. Such an example is the cut operation. This operation is used quite often in Prolog programs, both for efficiency and semantic preservation. However, its use after a call to an externally defined predicate can have undesired effects. For example, if we have a pending connection to another application, or if we have memory blocks allocated by an external predicate, when a cut operation occurs, we may not be able to perform generic destruct actions, such as closing the pending connection or freeing the unnecessary memory. In this work, we propose an extension of the interface architecture that allows to associate generic user-defined functions with external predicates, in such a way that the Prolog engine transparently executes them when a cut operation occurs. We describe the implementation details of our proposal in the context of the Yap Prolog system. © Springer-Verlag Berlin Heidelberg 2006.

Cite

CITATION STYLE

APA

Soares, T., Rocha, R., & Ferreira, M. (2005). Generic cut actions for external Prolog predicates. In Lecture Notes in Computer Science (including subseries Lecture Notes in Artificial Intelligence and Lecture Notes in Bioinformatics) (Vol. 3819 LNCS, pp. 16–30). Springer Verlag. https://doi.org/10.1007/11603023_2

Register to see more suggestions

Mendeley helps you to discover research relevant for your work.

Already have an account?

Save time finding and organizing research with Mendeley

Sign up for free