Skip to main content

Preventing Arithmetic Overflows in Alloy

  • Conference paper
Abstract State Machines, Alloy, B, VDM, and Z (ABZ 2012)

Part of the book series: Lecture Notes in Computer Science ((LNTCS,volume 7316))

Abstract

In a bounded analysis, arithmetic operators become partial, and a different semantics becomes necessary. One approach, mimicking programming languages, is for overflow to result in wrap-around. Although easy to implement, wrap-around produces unexpected counterexamples that do not correspond to cases that would arise in the unbounded setting. This paper describes a new approach, implemented in the latest version of the Alloy Analyzer, in which instances that would involve overflow are suppressed, and consequently, spurious counterexamples are eliminated. The key idea is to interpret quantifiers so that bound variables range only over values that do not cause overflow.

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

Access this chapter

Chapter
USD 29.95
Price excludes VAT (USA)
  • Available as PDF
  • Read on any device
  • Instant download
  • Own it forever
eBook
USD 39.99
Price excludes VAT (USA)
  • Available as PDF
  • Read on any device
  • Instant download
  • Own it forever
Softcover Book
USD 54.99
Price excludes VAT (USA)
  • Compact, lightweight edition
  • Dispatched in 3 to 5 business days
  • Free shipping worldwide - see info

Tax calculation will be finalised at checkout

Purchases are for personal use only

Institutional subscriptions

Preview

Unable to display preview. Download preview PDF.

Unable to display preview. Download preview PDF.

References

  1. Alloy: A language and tool for relational models, http://alloy.mit.edu/alloy

  2. User posts about arithmetic overflows on Alloy community forum, http://alloy.mit.edu/community/search/node/overflow

  3. Abrial, J.R., Hoare, A.: The B-Book: Assigning Programs to Meanings. Cambridge University Press (2005)

    Google Scholar 

  4. Abrial, J.-R., Butler, M.J., Hallerstede, S., Hoang, T.S., Mehta, F., Voisin, L.: Rodin: an open toolset for modelling and reasoning in Event-B. STTT 12(6) (2010)

    Google Scholar 

  5. Arthan, R., Road, L.: Undefinedness in Z: Issues for Specification and Proof. In: CADE-13 Workshop on Mechanization of Partial Functions. Springer (1996)

    Google Scholar 

  6. Barrett, C., Stump, A., Tinelli, C.: The SMT-LIB Standard: Version 2.0. Technical report, Department of Computer Science, The University of Iowa (2010)

    Google Scholar 

  7. Cormen, T.H., Stein, C., Rivest, R.L., Leiserson, C.E.: Introduction to Algorithms, 2nd edn. McGraw-Hill Higher Education (2001)

    Google Scholar 

  8. Farmer, W.M.: Reasoning about partial functions with the aid of a computer. Erkenntnis 43 (1995)

    Google Scholar 

  9. Gries, D., Schneider, F.: A logical approach to discrete math. Texts and monographs in computer science. Springer (1993)

    Google Scholar 

  10. Jackson, D.: Software Abstractions: Logic, language, and analysis. MIT Press (2006)

    Google Scholar 

  11. Girard, J.-Y.: Linear logic. Theoretical Computer Science 50(1) (1987)

    Google Scholar 

  12. Jones, C.B.: Systematic software development using VDM, 2nd edn. Prentice-Hall, Inc., Upper Saddle River (1990)

    MATH  Google Scholar 

  13. Jones, C.B.: Reasoning about partial functions in the formal development of programs. Electron. Notes Theor. Comput. Sci. 145 (January 2006)

    Google Scholar 

  14. Jones, C.B., Lovert, M.J.: Semantic Models for a Logic of Partial Functions. Int. J. Software and Informatics 5(1-2) (2011)

    Google Scholar 

  15. Kang, E., Jackson, D.: Formal Modeling and Analysis of a Flash Filesystem in Alloy. In: Börger, E., Butler, M., Bowen, J.P., Boca, P. (eds.) ABZ 2008. LNCS, vol. 5238, pp. 294–308. Springer, Heidelberg (2008)

    Chapter  Google Scholar 

  16. Leino, K.R.M.: Dafny: An Automatic Program Verifier for Functional Correctness. In: Clarke, E.M., Voronkov, A. (eds.) LPAR-16 2010. LNCS, vol. 6355, pp. 348–370. Springer, Heidelberg (2010)

    Chapter  Google Scholar 

  17. Parnas, D.L.: Predicate logic for software engineering. IEEE Trans. Softw. Eng. 19 (September 1993)

    Google Scholar 

  18. Spivey, J.M.: Understanding Z: a specification language and its formal semantics. Cambridge Tracts in Theoretical Computer Science. Cambridge University Press (1988)

    Google Scholar 

  19. Stoddart, B., Dunne, S., Galloway, A.: Undefined Expressions and Logic in Z and B. Formal Methods in System Design 15 (1999)

    Google Scholar 

  20. Torlak, E.: A Constraint Solver for Software Engineering: Finding Models and Cores of Large Relational Specifications. PhD thesis, MIT (2008)

    Google Scholar 

  21. Torlak, E., Jackson, D.: Kodkod: A Relational Model Finder. In: Grumberg, O., Huth, M. (eds.) TACAS 2007. LNCS, vol. 4424, pp. 632–647. Springer, Heidelberg (2007)

    Chapter  Google Scholar 

Download references

Author information

Authors and Affiliations

Authors

Editor information

Editors and Affiliations

Rights and permissions

Reprints and permissions

Copyright information

© 2012 Springer-Verlag Berlin Heidelberg

About this paper

Cite this paper

Milicevic, A., Jackson, D. (2012). Preventing Arithmetic Overflows in Alloy. In: Derrick, J., et al. Abstract State Machines, Alloy, B, VDM, and Z. ABZ 2012. Lecture Notes in Computer Science, vol 7316. Springer, Berlin, Heidelberg. https://doi.org/10.1007/978-3-642-30885-7_8

Download citation

  • DOI: https://doi.org/10.1007/978-3-642-30885-7_8

  • Publisher Name: Springer, Berlin, Heidelberg

  • Print ISBN: 978-3-642-30884-0

  • Online ISBN: 978-3-642-30885-7

  • eBook Packages: Computer ScienceComputer Science (R0)

Publish with us

Policies and ethics