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.
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
Alloy: A language and tool for relational models, http://alloy.mit.edu/alloy
User posts about arithmetic overflows on Alloy community forum, http://alloy.mit.edu/community/search/node/overflow
Abrial, J.R., Hoare, A.: The B-Book: Assigning Programs to Meanings. Cambridge University Press (2005)
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)
Arthan, R., Road, L.: Undefinedness in Z: Issues for Specification and Proof. In: CADE-13 Workshop on Mechanization of Partial Functions. Springer (1996)
Barrett, C., Stump, A., Tinelli, C.: The SMT-LIB Standard: Version 2.0. Technical report, Department of Computer Science, The University of Iowa (2010)
Cormen, T.H., Stein, C., Rivest, R.L., Leiserson, C.E.: Introduction to Algorithms, 2nd edn. McGraw-Hill Higher Education (2001)
Farmer, W.M.: Reasoning about partial functions with the aid of a computer. Erkenntnis 43 (1995)
Gries, D., Schneider, F.: A logical approach to discrete math. Texts and monographs in computer science. Springer (1993)
Jackson, D.: Software Abstractions: Logic, language, and analysis. MIT Press (2006)
Girard, J.-Y.: Linear logic. Theoretical Computer Science 50(1) (1987)
Jones, C.B.: Systematic software development using VDM, 2nd edn. Prentice-Hall, Inc., Upper Saddle River (1990)
Jones, C.B.: Reasoning about partial functions in the formal development of programs. Electron. Notes Theor. Comput. Sci. 145 (January 2006)
Jones, C.B., Lovert, M.J.: Semantic Models for a Logic of Partial Functions. Int. J. Software and Informatics 5(1-2) (2011)
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)
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)
Parnas, D.L.: Predicate logic for software engineering. IEEE Trans. Softw. Eng. 19 (September 1993)
Spivey, J.M.: Understanding Z: a specification language and its formal semantics. Cambridge Tracts in Theoretical Computer Science. Cambridge University Press (1988)
Stoddart, B., Dunne, S., Galloway, A.: Undefined Expressions and Logic in Z and B. Formal Methods in System Design 15 (1999)
Torlak, E.: A Constraint Solver for Software Engineering: Finding Models and Cores of Large Relational Specifications. PhD thesis, MIT (2008)
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)
Author information
Authors and Affiliations
Editor information
Editors and Affiliations
Rights 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)