Abstract

The memory management rules for abstract data type calculus presented by Rouson, Morris & Xu [15] are recast as formal statements in the Object Constraint Language (OCL) and applied to the design of a thermal energy equation solver. One set of constraints eliminates memory leaks observed in composite overloaded expressions with three current Fortran 95/2003 compilers. A second set of constraints ensures economical memory recycling. The constraints are preconditions, postconditions and invariants on overloaded operators and the objects they receive and return. It is demonstrated that systematic run-time assertion checking inspired by the formal constraints facilitated the pinpointing of an exceptionally hard-to-reproduce compiler bug. It is further demonstrated that the interplay between OCL's modeling capabilities and Fortran's programming capabilities led to a conceptual breakthrough that greatly improved the readability of our code by facilitating operator overloading. The advantages and disadvantages of our memory management rules are discussed in light of other published solutions [11,19]. Finally, it is demonstrated that the run-time assertion checking has a negligible impact on performance.

Highlights

  • Formal methods form an important branch of software engineering that has apparently been applied to the design of only a small percentage of scientific simulation programs [3,8]

  • We have analyzed intermediate code received from the Numerical Algorithms Group (NAG) and found that the NAG compiler carries along all the memory allocated at intermediate steps in the call tree, performing deallocations only after the final assignment at the top of the tree

  • Subsequent to the publication of the RMX memory management rules, we found an informal report by Markus [11] and Stewart [19] describing a strategy that, at its core, is algorithmically equivalent to ours

Read more

Summary

Introduction

Formal methods form an important branch of software engineering that has apparently been applied to the design of only a small percentage of scientific simulation programs [3,8]. Two pillars of formalization are specification and verification – that is specifying mathematically what a program must do and verifying the correctness of an algorithm with respect to the specification. Formal methods developers often cite a motivation of seeking correctness standards for non-scientific codes as rigorous as those for scientific codes [13]. This ignores, the non-numerical aspects of scientific programs that could benefit from greater rigor. The current paper specifies formal constraints on memory allocations in a Fortran 95/2003 program for simulating thermal conduction and convection

Objectives
Methods
Discussion
Conclusion
Full Text
Published version (Free)

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