Skip to main content
Log in

Termination of Floating-Point Computations

  • Published:
Journal of Automated Reasoning Aims and scope Submit manuscript

Abstract

Numerical computations form an essential part of almost any real-world program. Traditional approaches to termination of logic programs are restricted to domains isomorphic to (ℕ,>); more recent works study termination of integer computations where the lack of well-foundedness of the integers has to be taken into account. Termination of computations involving floating-point numbers can be counterintuitive because of rounding errors and implementation conventions. We present a novel technique that allows us to prove termination of such computations. Our approach extends the previous work on termination of integer computations.

This is a preview of subscription content, log in via an institution to check access.

Access this article

Price excludes VAT (USA)
Tax calculation will be finalised during checkout.

Instant access to the full article PDF.

Similar content being viewed by others

References

  • Aggoun, A., Chan, D., Dufresne, P., Falvey, E., Grant, H., Harvey, W., Herold, A., Geoffrey, M., Meier, M., Miller, D., Mudambi, S., Novello, S., Perez, B., van Rossum, E., Schimpf, J., Shen, K., Tsahageas, P. A. and de Villeneuve, D. H. (2001) ECLiPSe User Manual. Release 5.3, European Computer-Industry Research Centre, Munich and Centre for Planning and Resource Control, London.

  • Aït Ameur, Y. (1999) Refinement of rational end-points real numbers by means of floating-point numbers, Sci. Comput. Programming 33(2), 133–162.

    MATH  MathSciNet  Google Scholar 

  • Aït Ameur, Y., Cros, P., Falcón, J. J. and Gómez, A. (1992) An application of abstract interpretation to floating point arithmetic, in M. Billaud, P. Castéran, M.-M. Corsini, K. Musumbu and A. Rauzy (eds.), Actes WSA'92 Workshop on Static Analysis, Vols. 81/82 of Bigre, Atelier Irisa, IRISA, Campus de Beaulieu, pp. 205–212.

  • Apt, K. R. (1997) From Logic Programming to Prolog, Prentice-Hall Internat. Series in Comput. Sci., Prentice-Hall, Englewood Cliffs, NJ.

    Google Scholar 

  • Apt, K. R., Marchiori, E. and Palamidessi, C. (1994) A declarative approach for first-order built-in's in Prolog, Appl. Algebra Engrg. Comm. Comput. 5(3/4), 159–191.

    MathSciNet  Google Scholar 

  • Apt, K. R. and Pedreschi, D. (1990) Studies in Pure Prolog: Termination, in J. W. Lloyd (ed.), Proc. Esprit Symp. on Comp. Logic, Springer-Verlag, Berlin, pp. 150–176.

    Google Scholar 

  • Bagnara, R. (1999) Is ISO Prolog standard taken seriously?, Association for Logic Programming Newsletter 12(1), 10–12.

    Google Scholar 

  • Benhamou, F., Bouvier, P., Colmerauer, A., Garetta, H., Giletta, B., Massat, J. L., Narboni, G. A., N'Dong, S., Pasero, R., Pique, J. F., Touravane abd Van Canegheme, M. and Vétillard, E. (1996) Le manuel de Prolog IV. PrologIA.

  • BIM (1995) ProLog by BIM, Release 4.1.0.

  • Blanchet, B., Cousot, P., Cousot, R., Feret, J., Mauborgne, L., Miné, A., Monniaux, D. andRival, X. (2003) A static analyzer for large safety-critical software, in Proc. of the ACM SIGPLAN SIGSOFT Conf. on Programming Language Design and Implementation, ACM, pp. 196–207.

  • Bossi, A., Cocco, N. and Fabris, M. (1991) Proving termination of logic programs by exploiting term properties, in Proc. of CCPSD-TAPSOFT'91, Lecture Notes in Comput. Sci. 494, Springer-Verlag, Berlin, pp. 153–180.

    Google Scholar 

  • Bruynooghe, M., Codish, M., Genaim, S. and Vanhoof, W. (2002) Reuse of results in termination analysis of typed logic programs, in M. V. Hermenegildo and G. Puebla (eds.), Static Analysis, 9th Internat. Symposium, Lecture Notes in Comput. Sci. 2477, Springer-Verlag, Berlin, pp. 477–492.

    Google Scholar 

  • Bruynooghe, M., Vanhoof, W. and Codish, M. (2001) Pos(T): Analyzing dependencies in typed logic programs, in D. Bjørner, M. Broy and A. V. Zamulin (eds.), Perspectives of System Informatics, 4th Internat. Andrei Ershov Memorial Conference, PSI 2001, Akademgorodok, Novosibirsk, Russia, 2–6 July 2001, Revised Papers, Lecture Notes in Comput. Sci. 2244, Springer-Verlag, Berlin.

    Google Scholar 

  • Bueno, F., Cabeza Gras, D., Carro, M., Hermenegildo, M. V., López-García, P. and Puebla, G. (1997) The Ciao Prolog system. Reference manual, Technical Report CLIP3/97.1, Technical University of Madrid.

  • Colón, M. A. and Sipma, H. B. (2001) Synthesis of linear ranking functions, in T. Margaria and W. Yi (eds.), Tools and Algorithms for the Construction and Analysis of Systems, 7th Internat. Conference, Lecture Notes in Comput. Sci. 2031, Springer-Verlag, Berlin, pp. 67–81.

    Google Scholar 

  • Colussi, L., Marchiori, E. and Marchiori, M. (1995) On termination of constraint logic programs, in U. Montanari and F. Rossi (eds.), Principles and Practice of Constraint Programming – CP'95, Lecture Notes in Comput. Sci. 976, Springer-Verlag, Berlin, pp. 431–448.

    Google Scholar 

  • Cousot, P. and Cousot, R. (1976) Static determination of dynamic properties of programs, in Proc. of the Second Internat. Symposium on Programming, Dunod, Paris, France, pp. 106–130.

    Google Scholar 

  • Cousot, P. and Cousot, R. (1977) Abstract interpretation: A unified lattice model for static analysis of programs by construction or approximation of fixpoints, in Conf. Record of the Fourth Annual ACM SIGPLAN-SIGACT Symposium on Principles of Programming Languages, Los Angeles, CA, ACM Press, New York, pp. 238–252.

    Google Scholar 

  • Cousot, P. and Cousot, R. (2001) Verification of embedded software: Problems and perspectives, in: T. A. Henzinger and C. Meyer Kirsch (eds.), Embedded Software, Proc. of the First Internat. Workshop, EMSOFT 2001, Tahoe City, CA, USA, 8–10 October, 2001, Lecture Notes in Comput. Sci. 2211, Springer-Verlag, Berlin, pp. 97–113.

    Google Scholar 

  • De Schreye, D. and Decorte, S. (1994) Termination of logic programs: The never-ending story, J. Logic Programming 19/20, 199–260.

    Google Scholar 

  • De Schreye, D., Verschaetse, K. and Bruynooghe, M. (1992) A framework for analyzing the termination of definite logic programs with respect to call patterns, in I. Staff (ed.), Proc. of the Internat. Conf. on Fifth Generation Computer Systems, IOS Press, Amsterdam, pp. 481–488.

    Google Scholar 

  • de Vries, F.-J. and Yamada, J. (1994) On termination of rewriting with real numbers, in M. Takeichi (ed.), Functional Programming II, Proc. of the 11th Annual Conference, Japan Society of Software Science and Technology, Kindai-kagaku-sya, pp. 233–247.

  • Decorte, S. and De Schreye, D. (1998) Termination analysis: Some practical properties of the norm and level mapping space, in J. Jaffar (ed.), Proc. of the 1998 Joint Internat. Conf. and Symposium on Logic Programming, MIT Press, Cambridge, MA, pp. 235–249.

    Google Scholar 

  • Decorte, S., De Schreye, D. and Vandecasteele, H. (1999) Constraint-based termination analysis of logic programs, ACM TOPLAS 21(6), 1137–1195.

    Article  Google Scholar 

  • Demmel, J. W. and Li, X. S. (1993) Faster numerical algorithms via exception handling, in E. E. Swartzlander, M. J. Irwin and J. Jullien (eds.), Proc. of the 11th IEEE Symposium on Computer Arithmetic, Windsor, Canada, IEEE Computer Soc. Press, Los Alamitos, CA, pp. 234–241.

    Google Scholar 

  • Dershowitz, N., Lindenstrauss, N., Sagiv, Y. and Serebrenik, A. (2001) A general framework for automatic termination analysis of logic programs, Appl. Algebra Engrg. Comm. Comput. 12(1/2), 117–156.

    MathSciNet  Google Scholar 

  • Escardó, M. H. (1996) PCF extended with real numbers, Theoret. Comput. Sci. 162(1), 79–115.

    Article  MATH  MathSciNet  Google Scholar 

  • Feret, J. (2004) Static analysis of digital filters, in D. A. Schmidt (ed.), Programming Languages and Systems, 13th European Symposium on Programming, ESOP 2004, Lecture Notes in Comput. Sci. 2986, Springer-Verlag, Berlin, pp. 33–48.

    Google Scholar 

  • Flynn, M. and Oberman, S. (2001) Advanced Computer Arithmetic Design, Wiley, New York.

    Google Scholar 

  • Fraley, R. and Walther, S. (1979) Proposal to eliminate denormalized numbers, ACM SIGNUM Newsletter 14(3S) (Special issue), 22–23.

    Google Scholar 

  • Frühwirth, T. W. (1998) Theory and practice of constraint handling rules. J. Logic Programming 37(1–3), Special Issue on Constraint Logic Programming, 95–138.

    MATH  MathSciNet  Google Scholar 

  • Frühwirth, T. W. (2000) Proving termination of constraint solver programs, in K. R. Apt, A. C. Kakas, E. Monfroy and F. Rossi (eds.), New Trends in Constraints, Papers from the Joint ERCIM/Compulog-Net Workshop, Cyprus, Lecture Notes in Artificial Intelligence 1865, Springer-Verlag, Berlin.

    Google Scholar 

  • Goldberg, D. (1991) What every computer scientist should know about floating point arithmetic, ACM Computing Surveys 23(1), 5–48; corrigendum: ACM Computing Surveys 23(3) (1991) 413.

    Article  Google Scholar 

  • Goubault, E. (2001) Static analyses of the precision of floating-point operations, in P. Cousot (ed.), Static Analysis, 8th Internat. Symposium, Lecture Notes in Comput. Sci. 2126, Springer-Verlag, Berlin, pp. 234–259.

    Google Scholar 

  • Goubault, E., Martel, M. and Putot, S. (2002) Asserting the precision of floating-point computations: A simple abstract interpreter, in D. Le Métayer (ed.), Programming Languages and Systems, 11th European Symposium on Programming, Lecture Notes in Comput. Sci. 2305, Springer-Verlag, Berlin, pp. 209–212.

    Google Scholar 

  • Hauser, J. R. (1996) Handling floating-point exceptions in numeric programs, ACM Trans. Programming Languages Systems 18(2), 139–174.

    Google Scholar 

  • Holzbaur, C. (1995) OFAI CLP(Q,R) Manual, Technical Report TR-95-09, Austrian Research Institute for Artificial Intelligence, Vienna.

  • IEEE Standards Committee 754. (1985) IEEE Standard for binary floating-point arithmetic, ANSI/IEEE Standard 754-1985, Institute of Electrical and Electronics Engineers, New York. Reprinted in SIGPLAN Notices 22(2) (1987) 9–25.

  • ILOG. (2001) ILOG Solver 5.1 User's Manual, ILOG s.a., http://www.ilog.com/.

  • ISO/IEC 10967 Committee. (1994) ISO/IEC 10967-1: 1994 Information technology – Language independent arithmetic – Part 1: Integer and floating point arithmetic, ISO/IEC.

  • ISO/IEC 10967 Committee. (2001) ISO/IEC 10967-2:2001 Information technology – Language independent arithmetic – Part 2: Elementary numerical functions, ISO/IEC.

  • ISO/IEC 13211 Committee. (1995) Information technology – Programming languages – Prolog – Part 1: General core, ISO/IEC.

  • IT Masters. (2000) MasterProLog Programming Environment, available at http://www.itmasters.com/.

  • Janssens, G. and Bruynooghe, M. (1992) Deriving descriptions of possible values of program variables by means of abstract interpretation, J. Logic Programming 13(2/3), 205–258.

    MathSciNet  Google Scholar 

  • Janssens, G., Bruynooghe, M. and Englebert, V. (1994) Abstracting numerical values in CLP(H,N), in M. V. Hermenegildo and J. Penjam (eds.), Programming Language Implementation and Logic Programming, 6th Internat. Symposium, PLILP'94, Lecture Notes in Comput. Sci. 844, Springer-Verlag, Berlin, pp. 400–414.

    Google Scholar 

  • Jones, N. D., Gomard, C. K. and Sestoft, P. (1993) Partial Evaluation and Automatic Program Generation, Prentice-Hall International, Englewood, Cliffs, NJ; available at http://www.dina.dk/~sestoft/pebook/.

    Google Scholar 

  • Kowalski, R. A. and Kuehner, D. (1971) Linear resolution with selection function, Artificial Intelligence 2(3/4), 227–260 (Imperial College, London).

    MathSciNet  Google Scholar 

  • Leuschel, M., Martens, B. and De Schreye, D. (1998) Controlling generalisation and polyvariance in partial deduction of normal logic programs, ACM Trans. Programming Languages Systems 20(1), 208–258.

    Google Scholar 

  • Lindenstrauss, N. and Sagiv, Y. (1997) Automatic termination analysis of logic programs, in L. Naish (ed.), Proc. of the Fourteenth Internat. Conf. on Logic Programming, MIT Press, Cambridge, MA, pp. 63–77.

    Google Scholar 

  • Lindenstrauss, N., Sagiv, Y. and Serebrenik, A. (1998) Unfolding the mystery of Mergesort, in N. Fuchs (ed.), Proc. of the 7th Internat. Workshop on Logic Program Synthesis and Transformation, Lecture Notes in Comput. Sci. 1463, Springer-Verlag, Berlin, pp. 206–225.

    Google Scholar 

  • Lloyd, J. W. (1987) Foundations of Logic Programming, Symbolic Computation, 2nd edn., Springer-Verlag, Berlin.

    Google Scholar 

  • Martelli, A. and Monatanari, U. (1982) An efficient unification algorithm, ACM Trans. Programming Languages Systems (TOPLAS) 4(2), 258–282.

    Google Scholar 

  • Martin, J. C. and King, A. (2004) On the inference of natural level mappings, in M. Bruynooghe and K.-K. Lau (eds.), Program Development in Computational Logic, Lecture Notes in Comput. Sci. 3049, Springer-Verlag, Berlin.

    Google Scholar 

  • MathWorks, T. (1999) MatLab Version 5.3.0.10183, The MathWorks http://www.mathworks.com/.

  • Mesnard, F. (1996) Inferring left-terminating classes of queries for constraint logic programs, in M. Maher (ed.), Proc. of the 1996 Joint Internat. Conf. and Syposium on Logic Programming, MIT Press, Cambridge, MA, pp. 7–21.

    Google Scholar 

  • Mesnard, F., Neumerkel, U. and Payet, E. (2001) cTI: Un outil pour l'inférence de conditions optimales de terminaison pour Prolog, in P. Codognet (ed.), Dixièmes Journées Franco-phone de Programmation en Logique et Programmation par Contraintes, Hermés; available at http://www.univ-reunion.fr/~gcc/papers.

  • Mesnard, F. and Ruggieri, S. (2003) On proving left termination of constraint logic programs, ACM Trans. Comput. Logic 4(2), 207–259.

    Article  MathSciNet  Google Scholar 

  • Miné, A. (2004) Relational abstract domains for the detection of floating-point run-time errors, in D. A. Schmidt (ed.), Programming Languages and Systems, 13th European Symposium on Programming, ESOP 2004, Lecture Notes in Comput. Sci. 2986, Springer-Verlag, Berlin, pp. 3–17.

    Google Scholar 

  • Monniaux, D. (2001) An abstract analysis of the probabilistic termination of programs, in P. Cousot (ed.), 8th Internat. Static Analysis Symposium (SAS'01), Springer-Verlag, Berlin, pp. 111–126.

    Google Scholar 

  • Moore, R. E. (1966) Interval Analysis, Prentice-Hall, Englewood, Cliffs, NJ.

    Google Scholar 

  • Older, W. and Benhamou, F. (1993) Programming in CLP(BNR), in Principles and Practice of Constraint Programming.

  • Payne, M. H. and Strecker, W. (1979) Draft proposal for a binary normalized floating point standard, ACM SIGNUM Newsletter 14(3S) (Special issue), 24–28.

    Google Scholar 

  • Pedreschi, D., Ruggieri, S. and Smaus, J.-G. (2002) Classes of terminating logic programs, Theory and Practice of Logic Programming 2(3), 369–418.

    MathSciNet  Google Scholar 

  • Plümer, L. (1991) Automatic termination proofs for prolog programs operating on nonground terms, in Internat. Logic Programming Symposium, MIT Press, Cambridge, MA.

    Google Scholar 

  • Potts, P. J., Edalat, A. and Escardó, M. H. (1997) Semantics of exact real arithmetic, in Proc. of the 12th Annual IEEE Symposium on Logic in Computer Science, IEEE Computer Soc. Press, pp. 248–257.

  • Puebla, G. and Hermenegildo, M. V. (1999) Abstract multiple specialization and its application to program parallelization, J. Logic Programming 41(2/3), 279–316.

    MathSciNet  Google Scholar 

  • Randimbivololona, F., Jones, N., Ferdinand, C., Wilhelm, R., Sagiv, M., Cousot, P., Goubault, E., Cousot, R., Deutsch, A. and Seidl, H. (2001) DAEDALUS: ValiDAtion of Critical softwarE by stAtic anaLysis and abstract teSting, available at http://dbs.cordis.lu/cordis-cgi/srchidadb?ACTION=D&SESSION=243382002-5-6&DOC=3&TBL=EN_PROJ&RCN=EP_RCN:60858&CALLER=PROJLINK_EN.

  • Robinson, J. A. (1965) A machine-oriented logic based on the resolution principle, J. ACM 12(1), 23–41.

    Article  MATH  Google Scholar 

  • Ruggieri, S. (1997) Termination of constraint logic programs, in P. Degano, R. Gorrieri and A. Marchetti-Spaccamela (eds.), Automata, Languages and Programming, 24th Internat. Colloquium, ICALP'97, Lecture Notes in Comput. Sci. 1256, Springer-Verlag, Berlin, pp. 838–848.

    Google Scholar 

  • Sahlin, D. (1993) Mixtus: An automatic partial evaluator for full Prolog, New Generation Computing 12(1), 7–51.

    MATH  Google Scholar 

  • Serebrenik, A. and De Schreye, D. (2001a) Inference of termination conditions for numerical loops in Prolog, in R. Nieuwenhuis and A. Voronkov (eds.), Logic for Programming, Artificial Intelligence, and Reasoning, 8th Internat. Conf., Proceedings, Lecture Notes in Comput. Sci. 2250, Springer-Verlag, Berlin, pp. 654–668.

    Google Scholar 

  • Serebrenik, A. and De Schreye, D. (2001b) Non-transformational termination analysis of logic programs, based on general term-orderings, in K.-K. Lau (ed.), Logic Based Program Synthesis and Transformation, 10th Internat. Workshop, Selected Papers, Lecture Notes in Comput. Sci. 2042, Springer-Verlag, Berlin, pp. 69–85.

    Google Scholar 

  • Serebrenik, A. and De Schreye, D. (2004) Inference of termination conditions for numerical loops in Prolog, Theory and Practice of Logic Programming 4(5/6), Special issue on Verification and Computational Logic, 719–751.

    MathSciNet  Google Scholar 

  • SICS. (2004) SICStus User Manual, Version 3.11.1, Swedish Institute of Computer Science.

  • Skeel, R. (1992) Roundoff error and the patriot missile, SIAM News 25(4), 11.

    Google Scholar 

  • Sohn, K. and Van Gelder, A. (1991) Termination detection in logic programs using argument sizes, in Proc. of the Tenth ACM SIGACT-SIGART-SIGMOD Symposium on Principles of Database Systems, ACM Press, New York, pp. 216–226.

    Google Scholar 

  • Ullman, J. D. and Van Gelder, A. (1988) Efficient tests for top-down termination of logical rules, J. ACM 35(2), 345–373.

    Article  MathSciNet  Google Scholar 

  • United States General Accounting Office. (1992) Patriot Missile Defence. Software problem led to system failure at Dhahran, Saudi Arabia, No. 92-26 in GAO/IMTEC; also available at http://klabs.org/richcontent/Reports/Failure_Reports/patriot/patriot_gao_145960.pdf.

  • Van Hentenryck, P., Michel, L. and Deville, Y. (1997) Numerica: A Modeling Language for Global Optimization, MIT Press, Cambridge, MA.

    Google Scholar 

  • Vanhoof, W. and Bruynooghe, M. (2002) When size does matter – Termination analysis for typed logic programs, in A. Pettorossi (ed.), Logic-based Program Synthesis and Transformation, 11th Internat. Workshop, LOPSTR 2001, Selected Papers, Lecture Notes in Comput. Sci. 2372, Springer-Verlag, Berlin, pp. 129–147.

    Google Scholar 

  • Vellino, A. and Older, W. (1990) Extending Prolog with constraint arithmetic on real intervals, in IEEE Canadian Conf. on Electrical and Computer Engineering.

  • Verschaetse, K. and De Schreye, D. (1991) Deriving termination proofs for logic programs, using abstract procedures, in K. Furukawa (ed.), Logic Programming, Proc. of the Eigth Internat. Conference, MIT Press, Cambridge, MA, pp. 301–315.

    Google Scholar 

  • Vuillemin, J. (1990) Exact real computer arithmetic with continued fractions, IEEE Trans. Comput. 39(8), 1087–1105.

    Article  MathSciNet  Google Scholar 

  • Waterloo Maple, I. (2001) Maple 7, Consult http://www.maplesoft.com/.

  • Winsborough, W. (1992) Multiple specialization using minimal-function graph semantics, J. Logic Programming 13(2/3), 259–290.

    MATH  MathSciNet  Google Scholar 

Download references

Author information

Authors and Affiliations

Authors

Corresponding author

Correspondence to Alexander Serebrenik.

Additional information

Alexander Serebrenik: This research has been carried out during the first author's stay at the Department of Computer Science, K.U. Leuven, Belgium and STIX, École Polytechnique, France.

Rights and permissions

Reprints and permissions

About this article

Cite this article

Serebrenik, A., De Schreye, D. Termination of Floating-Point Computations. J Autom Reasoning 34, 141–177 (2005). https://doi.org/10.1007/s10817-005-6546-z

Download citation

  • Published:

  • Issue Date:

  • DOI: https://doi.org/10.1007/s10817-005-6546-z

Keywords

Navigation