## Determinacy Analysis for Logic Programs Using Mode and Type Information (2004)

### Cached

### Download Links

- [clip.dia.fi.upm.es]
- [www.clip.dia.fi.upm.es]
- [clip.dia.fi.upm.es]
- [www.clip.dia.fi.upm.es]
- DBLP

### Other Repositories/Bibliography

Venue: | In Proceedings of the 14th International Symposium on Logic-based Program Synthesis and Transformation (LOPSTR’04), number 3573 in LNCS |

Citations: | 12 - 5 self |

### BibTeX

@INPROCEEDINGS{López-garcía04determinacyanalysis,

author = {P. López-garcía and F. Bueno and M. Hermenegildo},

title = {Determinacy Analysis for Logic Programs Using Mode and Type Information},

booktitle = {In Proceedings of the 14th International Symposium on Logic-based Program Synthesis and Transformation (LOPSTR’04), number 3573 in LNCS},

year = {2004},

publisher = {Springer-Verlag}

}

### Years of Citing Articles

### OpenURL

### Abstract

Abstract. We propose an analysis for detecting procedures and goals that are deterministic (i.e. that produce at most one solution), or predicates whose clause tests are mutually exclusive (which implies that at most one of their clauses will succeed) even if they are not deterministic (because they call other predicates that can produce more than one solution). Applications of such determinacy information include detecting programming errors, performing certain high-level program transformations for improving search efficiency, optimizing low level code generation and parallel execution, and estimating tighter upper bounds on the computational costs of goals and data sizes, which can be used for program debugging, resource consumption and granularity control, etc. We have implemented the analysis and integrated it in the CiaoPP system, which also infers automatically the mode and type information that our analysis takes as input. Experiments performed on this implementation show that the analysis is fairly accurate and efficient.

### Citations

10921 |
Computers and Intractability: A Guide to the Theory of NP-Completeness
- Garey, Johnson
(Show Context)
Citation Context ...ogramming problems in this way, it follows that the mutual exclusion problem for linear integer tests is decidable. Since determining whether an integer programming problem is solvable is NP-complete =-=[9]-=-, the following complexity result is immediate: Theorem 3. The mutual exclusion problem for linear arithmetic tests over the integers is co-NP-hard. It should be noted, however, that the vast majority... |

218 |
Unification revisited
- Lassez, Maher, et al.
- 1986
(Show Context)
Citation Context ... set of tuples of terms Den(S) is equal to the set of solutions of τ). 1. Let θ be the substitution associated with the solved form of E (this can be computed by using the techniques of Lassez et al. =-=[19]-=-). 2. Let θi, for 1 ≤ i ≤ n, be the substitution associated with the solved form of E ∧ Ni, where Ni is the negation of Di. 3. S = A ⊗ comp(B1) ⊗ · · · ⊗ comp(Bn), where A = (¯x)θ and Bi = (¯x)θi, for... |

191 | The execution algorithm of Mercury: An efficient purely declarative logic programming language
- Somogyi, Henderson, et al.
- 1996
(Show Context)
Citation Context ...development. If we assume that the programmer has indicated that certain predicates should be deterministic for certain calling patterns (using suitable assertions as those used in Ciao [24], Mercury =-=[27]-=-, or HAL [7]) and a predicate is determined to be non-deterministic in one of those cases then, clearly, a compile-time error has been detected and can be reported [14, 12]. This is quite useful since... |

182 |
A practical algorithm for exact array dependence analysis
- PUGH
- 1992
(Show Context)
Citation Context .... Herbrand mutual exclusion is checked by a naive direct implementation of the analyses presented. Testing of mutual exclusion for linear arithmetic tests is implemented directly using the Omega test =-=[25]-=-. This test determines whether there is an integer solution to an arbitrary set of linear equalities and inequalities, referred to as a problem. We have tested the prototype first on a number of simpl... |

121 |
Deriving descriptions of possible values of program variables by means of abstract interpretation
- Janssens, Bruynooghe
- 1992
(Show Context)
Citation Context ...the result of a previous analysis. A type refers to a set of terms, and can be denoted by using several type representations (e.g. type terms and regular term grammars as in [3], or type graphs as in =-=[17]-=- or simply predicates as in the Ciao system). We include below the definitions of type term, type rule, and deterministic type rule from [3], for a better understanding of the algorithms that we have ... |

117 | Cost Analysis of Logic Programs
- Debray, Lin
- 1993
(Show Context)
Citation Context ...dition, performing data parallelism transformations [13]. Finally, determinacy (and mutual exclusion) information can be used to estimate much tighter upper bounds on the computational costs of goals =-=[5]-=-. Since it is generally not known in advance how many of the solutions generated by a predicate will be demanded, a conservative upper bound on the computational cost of a predicate can be obtained by... |

99 | Waal. Fast and precise regular approximations of logic programs
- Gallagher, de
- 1994
(Show Context)
Citation Context ...the CiaoPP PLAI analyzer to derive mode information, using, for the reported experiments, the Sharing+Freeness domain [22], and an adaptation of Gallagher’s analysis to derive the types of predicates =-=[8]-=-. The resulting type- and mode-annotated programs are then analyzed using the algorithms presented for Herbrand and linear arithmetic tests. Herbrand mutual exclusion is checked by a naive direct impl... |

83 |
Combined determination of sharing and freeness of program variables through abstract interpretation
- Muthukumar, Hermenegildo
(Show Context)
Citation Context ...e and mode analysis (including the intervening type definitions). The system uses the CiaoPP PLAI analyzer to derive mode information, using, for the reported experiments, the Sharing+Freeness domain =-=[22]-=-, and an adaptation of Gallagher’s analysis to derive the types of predicates [8]. The resulting type- and mode-annotated programs are then analyzed using the algorithms presented for Herbrand and lin... |

82 |
Andorra-I: A Parallel Prolog System that Transparently Exploits both And- and Or-Parallelism
- Costa, Warren, et al.
- 1991
(Show Context)
Citation Context ...rch efficiency. In particular, literals can be reordered so that deterministic goals are executed ahead of possibly non-deterministic goals where possible, improving the efficiency of parallel search =-=[26]-=-. Determinacy information is also very useful during program specialization. In addition, the implementation of (and-)parallelism is greatly simplified in presence of determinacy information: knowing ... |

64 | Strict and Non-Strict Independent And-Parallelism
- Hermenegildo, Rossi
- 1995
(Show Context)
Citation Context ...entation of (and-)parallelism is greatly simplified in presence of determinacy information: knowing that a goal is deterministic allows one to eliminate significant run-time overhead (due to markers) =-=[15, 11, 23]-=- and, in addition, performing data parallelism transformations [13]. Finally, determinacy (and mutual exclusion) information can be used to estimate much tighter upper bounds on the computational cost... |

63 |
A Regular Type Language for Logic Programs
- Dart, Zobel
- 1992
(Show Context)
Citation Context ...ilable, generally also as the result of a previous analysis. A type refers to a set of terms, and can be denoted by using several type representations (e.g. type terms and regular term grammars as in =-=[3]-=-, or type graphs as in [17] or simply predicates as in the Ciao system). We include below the definitions of type term, type rule, and deterministic type rule from [3], for a better understanding of t... |

61 | Parallel Execution of Prolog Programs: a Survey
- Gupta, Pontelli, et al.
- 2001
(Show Context)
Citation Context ...entation of (and-)parallelism is greatly simplified in presence of determinacy information: knowing that a goal is deterministic allows one to eliminate significant run-time overhead (due to markers) =-=[15, 11, 23]-=- and, in addition, performing data parallelism transformations [13]. Finally, determinacy (and mutual exclusion) information can be used to estimate much tighter upper bounds on the computational cost... |

61 | A Methodology for Granularity Based Control of Parallelism in Logic Programs
- López-García, Hermenegildo, et al.
- 1996
(Show Context)
Citation Context ...the clauses is the sum of the cost of all literals in it, which simplifies the cost estimation (as explained in [5]). These upper bounds can be used for improved granularity control of parallel tasks =-=[20]-=- and for better performance/complexity debugging and verification of programs [14]. In this paper we propose a method whereby, given (upper approximations of) mode and type information, we can detect ... |

52 | Functional computations in logic programs
- Debray
- 1989
(Show Context)
Citation Context ...tic). There has been much interest on determinacy detection in the literature (see [16] and its references), using several different forms of determinism. The line of work closest to ours starts with =-=[6]-=-, in which functional computations are detected and exploited. However, the notion of mutual exclusion in this work is not based on constraint satisfaction. This concept is used in the analysis presen... |

50 |
An Assertion Language for Constraint Logic Programs
- Puebla, Bueno, et al.
- 1870
(Show Context)
Citation Context ...xt of program development. If we assume that the programmer has indicated that certain predicates should be deterministic for certain calling patterns (using suitable assertions as those used in Ciao =-=[24]-=-, Mercury [27], or HAL [7]) and a predicate is determined to be non-deterministic in one of those cases then, clearly, a compile-time error has been detected and can be reported [14, 12]. This is quit... |

49 | 1983–1993: The wonder years of sequential Prolog implementation
- Roy
- 1994
(Show Context)
Citation Context ...ile time, determinacy inference can obviously be used to verify (i.e., prove correct) such determinacy assertions [14].sDeterminacy information can also be used for performing low-level optimizations =-=[28, 21, 27]-=- as well higher-level program transformations for improving search efficiency. In particular, literals can be reordered so that deterministic goals are executed ahead of possibly non-deterministic goa... |

44 | An overview of HAL
- Demoen, Banda, et al.
- 1999
(Show Context)
Citation Context ...If we assume that the programmer has indicated that certain predicates should be deterministic for certain calling patterns (using suitable assertions as those used in Ciao [24], Mercury [27], or HAL =-=[7]-=-) and a predicate is determined to be non-deterministic in one of those cases then, clearly, a compile-time error has been detected and can be reported [14, 12]. This is quite useful since certain cla... |

40 |
A polynomial time algorithm for solving systems of linear inequalities with two variables per inequality
- Aspvall, Shiloach
- 1980
(Show Context)
Citation Context ...where each inequality involves at most two variables, i.e., is of the form ax+by ≤ c, can be decided efficiently in polynomial time by examining the loops in a graph constructed from the inequalities =-=[1]-=-. The integer programming problems that arise in practice, in the context of mutual exclusion analysis, are therefore efficiently decidable. The ideas explained in this section for linear arithmetic o... |

33 | Determinism analysis in the mercury compiler
- Henderson, Somogyi, et al.
(Show Context)
Citation Context ...hose used in Ciao [24], Mercury [27], or HAL [7]) and a predicate is determined to be non-deterministic in one of those cases then, clearly, a compile-time error has been detected and can be reported =-=[14, 12]-=-. This is quite useful since certain classes of programming errors often result in turning predicates intended to be deterministic into nondeterministic ones. Also, in addition to detecting programmin... |

32 | Hentenryck. Cardinality Analysis of Prolog
- Braem, Charlier, et al.
- 1994
(Show Context)
Citation Context ...re defined for the detection of mutual exclusion. The cut is not taken into account, either. In [10] a combined analysis of modes, types, and determinacy is presented, as well as in the more accurate =-=[2]-=-. As we will show, our analysis improves on these proposals. Several programming systems also make use of determinacy, e.g., Mercury [16] and HAL [7]. The Mercury and HAL systems allow the programmer ... |

31 | Program development using abstract interpretation (and the ciao system preprocessor
- Hermenegildo, Puebla, et al.
- 2003
(Show Context)
Citation Context ...hose used in Ciao [24], Mercury [27], or HAL [7]) and a predicate is determined to be non-deterministic in one of those cases then, clearly, a compile-time error has been detected and can be reported =-=[14, 12]-=-. This is quite useful since certain classes of programming errors often result in turning predicates intended to be deterministic into nondeterministic ones. Also, in addition to detecting programmin... |

25 |
Answer Sets and Negation as Failure
- Kunen
- 1987
(Show Context)
Citation Context ...etic tests on integer variables. 4.1 Checking Mutual Exclusion in the Herbrand Domain We present a decision procedure for checking mutual exclusion of tests that is inspired by a result, due to Kunen =-=[18]-=-, that the emptiness problem is decidable for Boolean combinations of (notations for) certain “basic” subsets of the Herbrand universe of a program. It also uses straightforward adaptations of some op... |

20 | Extracting Determinacy in Logic Programs - Dawson, Ramakrishnan, et al. - 1993 |

13 | Detecting Determinate Computation by Bottom-Up Abstract Interpretation
- Giacobazzi, Ricci
- 1992
(Show Context)
Citation Context ...satisfaction. This concept is used in the analysis presented in [4], where, nonetheless, no algorithms are defined for the detection of mutual exclusion. The cut is not taken into account, either. In =-=[10]-=- a combined analysis of modes, types, and determinacy is presented, as well as in the more accurate [2]. As we will show, our analysis improves on these proposals. Several programming systems also mak... |

13 | Improving the Compilation of Prolog to C Using Moded Types and Determinism Information
- Morales, Carro, et al.
- 2004
(Show Context)
Citation Context ...ile time, determinacy inference can obviously be used to verify (i.e., prove correct) such determinacy assertions [14].sDeterminacy information can also be used for performing low-level optimizations =-=[28, 21, 27]-=- as well higher-level program transformations for improving search efficiency. In particular, literals can be reordered so that deterministic goals are executed ahead of possibly non-deterministic goa... |

11 | Relating Data–Parallelism and (And–) Parallelism in Logic Programs
- Hermenegildo, Carro
- 1996
(Show Context)
Citation Context ...acy information: knowing that a goal is deterministic allows one to eliminate significant run-time overhead (due to markers) [15, 11, 23] and, in addition, performing data parallelism transformations =-=[13]-=-. Finally, determinacy (and mutual exclusion) information can be used to estimate much tighter upper bounds on the computational costs of goals [5]. Since it is generally not known in advance how many... |

7 |
Improving the Efficiency of Nondeterministic And–parallel Systems
- Pontelli, Gupta, et al.
- 1996
(Show Context)
Citation Context ...entation of (and-)parallelism is greatly simplified in presence of determinacy information: knowing that a goal is deterministic allows one to eliminate significant run-time overhead (due to markers) =-=[15, 11, 23]-=- and, in addition, performing data parallelism transformations [13]. Finally, determinacy (and mutual exclusion) information can be used to estimate much tighter upper bounds on the computational cost... |

5 | Determinacy and determinacy analysis
- Hill, King
- 1997
(Show Context)
Citation Context ...eterministic because they call other predicates that can produce more than one solution (i.e. that are not deterministic). There has been much interest on determinacy detection in the literature (see =-=[16]-=- and its references), using several different forms of determinism. The line of work closest to ours starts with [6], in which functional computations are detected and exploited. However, the notion o... |