Abstract
In program development it is useful to know that a call to a Prolog program will not inadvertently leave a choice-point on the stack. Determinacy inference has been proposed for solving this problem yet the analysis was found to be wanting in that it could not infer determinacy conditions for programs that contained cuts or applied certain tests to select a clause. This paper shows how to remedy these serious deficiencies. It also addresses the problem of identifying those predicates which can be rewritten in a more deterministic fashion. To this end, a radically new form of determinacy inference is introduced, which is founded on ideas in ccp, that is capable of reasoning about the way bindings imposed by a rightmost goal can make a leftmost goal deterministic.
Access this chapter
Tax calculation will be finalised at checkout
Purchases are for personal use only
Preview
Unable to display preview. Download preview PDF.
Similar content being viewed by others
References
Braem, C., Le Charlier, B., Modar, S., Van Hentenryck, P.: Cardinality Analysis of Prolog. In: Bruynooghe, M. (ed.) International Symposium on Logic Programming, pp. 457–471. MIT Press, Cambridge (1994)
Bruynooghe, M., Codish, M., Gallagher, J., Genaim, S., Vanhoof, W.: Termination Analysis through Combination of Type Based Norms. In: ACM Transactions on Programming Languages and Systems (to appear)
Dawson, S., Ramakrishnan, C.R., Ramakrishnan, I.V., Sekar, R.C.: Extracting Determinacy in Logic Programs. In: International Conference on Logic Programming, pp. 424–438. MIT Press, Cambridge (1993)
Genaim, S., King, A.: Goal-Independent Suspension Analysis for Logic Programs with Dynamic Scheduling. In: Degano, P. (ed.) ESOP 2003 and ETAPS 2003. LNCS, vol. 2618, pp. 84–98. Springer, Heidelberg (2003)
King, A., Lu, L.: A Backward Analysis for Constraint Logic Programs. Theory and Practice of Logic Programming 2(4–5), 517–547 (2002)
King, A., Lu, L., Genaim, S.: Determinacy Inference by Suspension Inference. Technical Report 2-05, Computing Laboratory, University of Kent, CT2 7NF (2005), http://www.cs.kent.ac.uk/pubs/2005/2262/
Lagoon, V., Stuckey, P.J.: A Framework for Analysis of Typed Logic Programs. In: Kuchen, H., Ueda, K. (eds.) FLOPS 2001. LNCS, vol. 2024, pp. 296–310. Springer, Heidelberg (2001)
Le Charlier, B., Rossi, S., Van Hentenryck, P.: Sequence-based abstract interpretation of Prolog. Theory and Practice of Logic Programming 2, 25–84 (2002)
Leuschel, M.: Personal Communication on Partial Evaluation (April 2005)
Leuschel, M., Jørgensen, J., Vanhoof, W., Bruynooghe, M.: Offline Specialisation in Prolog Using a Hand-Written Compiler Generator. Theory and Practice of Logic Programming 4(1), 139–191 (2004)
Lloyd, J.W.: Foundations of Logic Programming. Springer, Heidelberg (1987)
López-García, P., Bueno, F., Hermenegildo, M.: Determinacy Analysis for Logic Programs Using Mode and Type Information. In: Etalle, S. (ed.) LOPSTR 2004. LNCS, vol. 3573, pp. 19–35. Springer, Heidelberg (2005)
Lu, L., King, A.: Determinacy Inference for Logic Programs. In: Sagiv, M. (ed.) ESOP 2005. LNCS, vol. 3444, pp. 108–123. Springer, Heidelberg (2005)
Mogensen, T.: A Semantics-Based Determinacy Analysis for Prolog with Cut. In: Bjorner, D., Broy, M., Pottosin, I.V. (eds.) PSI 1996. LNCS, vol. 1181, pp. 374–385. Springer, Heidelberg (1996)
Müller, M., Glaß, T., Stroetmann, K.: Pan - The Prolog Analyzer (Short system description). In: Cousot, R., Schmidt, D.A. (eds.) SAS 1996. LNCS, vol. 1145, pp. 387–388. Springer, Heidelberg (1996)
Sahlin, D.: Determinacy Analysis for Full Prolog. Partial Evaluation and Semantics Based Program Manipulation. SIGPLAN Notices 26(9), 23–30 (1991)
Santos Costa, V., Warren, D.H.D., Yang, R.: Andorra-I Compilation. New Generation Computing 14(1), 3–30 (1996)
Saraswat, V.A., Rinard, M.C., Panangaden, P.: Semantic Foundations of Concurrent Constraint Programming. In: Principles of Programming Languages, pp. 333–352. ACM Press, New York (1991)
Shapiro, E., Sterling, L.: The Art of Prolog. MIT Press, Cambridge (1994)
Zobel, J.: Analysis of Logic Programs. PhD thesis, Department of Computer Science, University of Melbourne, Parkville, Victoria 3052 (1990)
Author information
Authors and Affiliations
Editor information
Editors and Affiliations
Rights and permissions
Copyright information
© 2006 Springer-Verlag Berlin Heidelberg
About this paper
Cite this paper
King, A., Lu, L., Genaim, S. (2006). Detecting Determinacy in Prolog Programs. In: Etalle, S., Truszczyński, M. (eds) Logic Programming. ICLP 2006. Lecture Notes in Computer Science, vol 4079. Springer, Berlin, Heidelberg. https://doi.org/10.1007/11799573_12
Download citation
DOI: https://doi.org/10.1007/11799573_12
Publisher Name: Springer, Berlin, Heidelberg
Print ISBN: 978-3-540-36635-5
Online ISBN: 978-3-540-36636-2
eBook Packages: Computer ScienceComputer Science (R0)