Abstract

Abstract Even though computations on finite integer representations are as old as computers themselves, there is one problem that has been inexcusably neglected: integer computations in programming languages do not operate on the ring [inline-graphic not available: see fulltext] of integer numbers but only on finite subsets of it. Changing the size of integer representations may change the results of operations performed on them in unexpected ways. In particular, increasing the representation size of intermediate results during computation may lead to incorrect final results. In this paper, we develop an algebraic foundation for integer arithmetic under changing representation sizes and, in particular, a criterion for safely replacing one finite integer arithmetic by another. This safety criterion has also been verified in the theorem prover Isabelle/HOL. Based on this formal development, we not only reveal and explain an inconsistency in the Java Card integer arithmetic but also propose an optimization for Java Card integer expressions and their safe transformation into Java Card bytecode. We also discuss the application of this safety criterion to constant folding, a standard compiler optimization, for Java and C compilers.

Full Text
Paper version not known

Talk to us

Join us for a 30 min session where you can share your feedback and ask us any queries you have

Schedule a call

Disclaimer: All third-party content on this website/platform is and will remain the property of their respective owners and is provided on "as is" basis without any warranties, express or implied. Use of third-party content does not indicate any affiliation, sponsorship with or endorsement by them. Any references to third-party content is to identify the corresponding services and shall be considered fair use under The CopyrightLaw.