Building High Integrity Applications with Spark by McCormick John W. & Chapin Peter C
Author:McCormick, John W. & Chapin, Peter C.
Language: eng
Format: epub
Publisher: Cambridge University Press
Published: 2015-08-30T16:00:00+00:00
The only change relative to the earlier Shapes3 package is that the condition on the circle being in the workspace has been moved from being a precondition of Inside_Circle and a postcondition of Make_Circle to being an invariant of the Circle private type. Notice that in the expression used for the type invariant the name of the type itself, Circle , is used as a stand-in for the object of that type being checked.
Type invariants can only be applied to private types. The condition they assert is only enforced at the “boundary” of the package that implements the type. Inside that package, objects may go through intermediate states where the invariant is temporarily false. However, the invariant is checked whenever a public subprogram returns to ensure that objects seen by the clients of the package are always in a proper state. In this respect, type invariants are somewhat like postconditions that are automatically applied to all public subprograms. Because SPARK does not currently support type invariants, their effect could be simulated, in large measure, by tediously defining appropriate postconditions.
Package Shapes4 as currently defined provides no default initialization for a Circle object. Merely declaring a Circle may cause the type invariant to fail as type invariants are also checked after default initialization and the initial values of the components of a Circle are indeterminate.
Sensible default initialization can be specified by simply adding appropriate initializers to the components of the record defining Circle :
Download
This site does not store any files on its server. We only index and link to content provided by other sites. Please contact the content providers to delete copyright contents if any and email us, we'll remove relevant links or contents immediately.
Coding Theory | Localization |
Logic | Object-Oriented Design |
Performance Optimization | Quality Control |
Reengineering | Robohelp |
Software Development | Software Reuse |
Structured Design | Testing |
Tools | UML |
Deep Learning with Python by François Chollet(12569)
Hello! Python by Anthony Briggs(9914)
OCA Java SE 8 Programmer I Certification Guide by Mala Gupta(9795)
The Mikado Method by Ola Ellnestam Daniel Brolund(9777)
Dependency Injection in .NET by Mark Seemann(9337)
Algorithms of the Intelligent Web by Haralambos Marmanis;Dmitry Babenko(8296)
Test-Driven iOS Development with Swift 4 by Dominik Hauser(7763)
Grails in Action by Glen Smith Peter Ledbrook(7696)
The Well-Grounded Java Developer by Benjamin J. Evans Martijn Verburg(7557)
Becoming a Dynamics 365 Finance and Supply Chain Solution Architect by Brent Dawson(7064)
Microservices with Go by Alexander Shuiskov(6824)
Practical Design Patterns for Java Developers by Miroslav Wengner(6744)
Test Automation Engineering Handbook by Manikandan Sambamurthy(6687)
Secrets of the JavaScript Ninja by John Resig Bear Bibeault(6413)
Angular Projects - Third Edition by Aristeidis Bampakos(6090)
The Art of Crafting User Stories by The Art of Crafting User Stories(5617)
NetSuite for Consultants - Second Edition by Peter Ries(5556)
Demystifying Cryptography with OpenSSL 3.0 by Alexei Khlebnikov(5360)
Kotlin in Action by Dmitry Jemerov(5062)
