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.
Access this chapter
Tax calculation will be finalised at checkout
Purchases are for personal use only
Preview
Unable to display preview. Download preview PDF.
References
Aspvall, B., Shiloach, Y.: A polynomial time algorithm for solving systems of linear inequalities with two variables per inequality. In: Proc. 20th ACM Symposium on Foundations of Computer Science, October 1979, pp. 205–217 (1979)
Braem, C., Le Charlier, B., Modart, S., Van Hentenryck, P.: Cardinality analysis of prolog. In: Proc. International Symposium on Logic Programming, Ithaca, NY, pp. 457–471. MIT Press, Cambridge (1994)
Dart, P.W., Zobel, J.: A Regular Type Language for Logic Programs. In: Types in Logic Programming, pp. 157–187. MIT Press, Cambridge (1992)
Dawson, S., Ramakrishnan, C.R., Ramakrishnan, I.V., Sekar, R.C.: Extracting Determinacy in Logic Programs. In: 1993 International Conference on Logic Programming, pp. 424–438. MIT Press, Cambridge (1993)
Debray, S.K., Lin, N.W.: Cost analysis of logic programs. ACM Transactions on Programming Languages and Systems 15(5), 826–875 (1993)
Debray, S.K., Warren, D.S.: Functional computations in logic programs. ACM Transactions on Programming Languages and Systems 11(3), 451–481 (1989)
Demoen, B., Garcia de la Banda, M., Harvey, W., Marriott, K., Stuckey, P.: An overview of HAL. In: PPCP1999: Principles and Practice of Constraint Programming, pp. 174–178 (1999)
Gallagher, J.P., de Waal, D.A.: Fast and precise regular approximations of logic programs. In: Van Hentenryck, P. (ed.) Proc. of the 11th International Conference on Logic Programming, pp. 599–613. MIT Press, Cambridge (1994)
Garey, M.R., Johnson, D.S.: Computers and Intractability: A Guide to the Theory of NP-Completeness. W.H. Freeman, New York (1979)
Giacobazzi, R., Ricci, L.: Detecting determinate computations by bottom-up abstract interpretation. In: Symposium proceedings on 4th European symposium on programming, pp. 167–181. Springer, Heidelberg (1992)
Gupta, G., Pontelli, E., Ali, K., Carlsson, M., Hermenegildo, M.: Parallel Execution of Prolog Programs: a Survey. ACM Transactions on Programming Languages and Systems 23(4), 472–602 (2001)
Henderson, F., Somogyi, Z., Conway, T.: Determinism analysis in the Mercury compiler. In: Proc. Australian Computer Science Conference, Melbourne, Australia, January 1996, pp. 337–346 (1996)
Hermenegildo, M., Carro, M.: Relating Data–Parallelism and (And–) Parallelism in Logic Programs. The Computer Languages Journal 22(2/3), 143–163 (1996)
Hermenegildo, M., Puebla, G., Bueno, F., López-García, P.: Program Development Using Abstract Interpretation (and The Ciao System Preprocessor). In: Cousot, R. (ed.) SAS 2003. LNCS, vol. 2694, pp. 127–152. Springer, Heidelberg (2003)
Hill, P.M., King, A.: Determinacy and determinacy analysis. Journal of Programming Languages 5(1), 135–171 (1997)
Janssens, G., Bruynooghe, M.: Deriving Descriptions of Possible Values of Program Variables by means of Abstract Interpretation. Journal of Logic Programming 13(2 and 3), 205–258 (1992)
Kunen, K.: Answer Sets and Negation as Failure. In: Proc. of the Fourth International Conference on Logic Programming, pp. 219–228. MIT Press, Cambridge (1987)
Lassez, J.-L., Maher, M., Marriott, K.: Unification Revisited. In: Minker, J. (ed.) Foundations of Deductive Databases and Logic Programming, pp. 587–626. Morgan Kaufmann, San Francisco (1988)
López-García, P., Bueno, F., Hermenegildo, M.: Towards Determinacy Analysis for Logic Programs Using Mode and Type Information. Technical Report CLIP4/2005.0, Technical University of Madrid (UPM), School of Computer Science, UPM (April 2005)
López-García, P., Hermenegildo, M., Debray, S.K.: A Methodology for Granularity Based Control of Parallelism in Logic Programs. Journal of Symbolic Computation, Special Issue on Parallel Symbolic Computation 22, 715–734 (1996)
Morales, J., Carro, M., Hermenegildo, M.: Improving the Compilation of Prolog to C Using Moded Types and Determinism Information. In: Crestani, F., Ruthven, I. (eds.) CoLIS 2005. LNCS, vol. 3507, pp. 86–103. Springer, Heidelberg (2005)
Muthukumar, K., Hermenegildo, M.: Combined Determination of Sharing and Freeness of Program Variables Through Abstract Interpretation. In: 1991 International Conference on Logic Programming, June 1991, pp. 49–63. MIT Press, Cambridge (1991)
Pugh, W.: A Practical Algorithm for Exact Array Dependence Analysis. Communications of the ACM 35(8), 102–114 (1992)
Santos-Costa, V., Warren, D.H.D., Yang, R.: Andorra-I: A Parallel Prolog System that Transparently Exploits both And- and Or-parallelism. In: Proceedings of the 3rd. ACM SIGPLAN Symposium on Principles and Practice of Parallel Programming, July 1991, vol. 7, pp. 83–93. ACM, New York (1991); SIGPLAN Notices vol 26(7) (July 1991)
Somogyi, Z., Henderson, F., Conway, T.: The execution algorithm of Mercury: an efficient purely declarative logic programming language. JLP 29(1-3) (1996)
Author information
Authors and Affiliations
Editor information
Editors and Affiliations
Rights and permissions
Copyright information
© 2005 Springer-Verlag Berlin Heidelberg
About this paper
Cite this paper
López-García, P., Bueno, F., Hermenegildo, M. (2005). Determinacy Analysis for Logic Programs Using Mode and Type Information. In: Etalle, S. (eds) Logic Based Program Synthesis and Transformation. LOPSTR 2004. Lecture Notes in Computer Science, vol 3573. Springer, Berlin, Heidelberg. https://doi.org/10.1007/11506676_2
Download citation
DOI: https://doi.org/10.1007/11506676_2
Publisher Name: Springer, Berlin, Heidelberg
Print ISBN: 978-3-540-26655-6
Online ISBN: 978-3-540-31683-1
eBook Packages: Computer ScienceComputer Science (R0)