Abstract
Specification based on Floyd-Hoare logic, using pre- and post-conditions, is common in languages aimed at high integrity software. Such pre/postcondition specifications are geared towards verification of code. While this specification technique has proven quite successful in the past 40 years, it has limitations when applied to API specification, particularly specification of generic interfaces.
API-oriented design and genericity is of particular importance in modern large-scale software development. In this situation, algebraic specification techniques have a significant advantage. Unlike pre/post-based specification, which deals with the inputs and outputs of one operation at a time, algebraic specification deals with the relationships between the different operations in an API, which is needed in the specification of generic APIs.
- A. L. Ambler, D. I. Good, J. C. Browne, W. F. Burger, R. M. Cohen, C. G. Hoch, and R. E. Wells. Gypsy: A language for specification and implementation of verifiable programs. In Proceedings of an ACM conference on Language design for reliable software, pages 1--10, New York, NY, USA, 1977. ACM. Google Scholar
Digital Library
- A. H. Bagge, V. David, and M. Haveraaen. Testing with axioms in C++n2011. Journal of Object Technology, 10:10:1--32, 2011.Google Scholar
Cross Ref
- A. H. Bagge and M. Haveraaen. Axiom-based transformations: Optimisation and testing. In J. J. Vinju and A. Johnstone, editors, Eighth Workshop on Language Descriptions, Tools and Applications (LDTA 2008), volume 238 of Electronic Notes in Theoretical Computer Science, pages 17--33, Budapest, Hungary, 2009. Elsevier. Google Scholar
Digital Library
- A. H. Bagge and M. Haveraaen. Interfacing concepts: Why declaration style shouldn't matter. In T. Ekman and J. J. Vinju, editors, Proceedings of the Ninth Workshop on Language Descriptions, Tools and Applications (LDTA '09), volume 253 of Electronic Notes in Theoretical Computer Science, pages 37--50, York, UK, 2010. Elsevier. Google Scholar
Digital Library
- J. Barnes. SPARK - The Proven Approach to High Integrity Software. Altran Praxis Ltd, 2012. Google Scholar
Digital Library
- M. Barnett, D. A. Naumann, W. Schulte, and Q. Sun. 99.44% pure: Useful abstractions in specifications. In 6th Workshop on Formal Techniques for Java-like Programs (FTfJP'2004), 2004.Google Scholar
- K. Claessen and J. Hughes. QuickCheck: A lightweight tool for random testing of Haskell programs. In ICFP '00: Proceedings of the fifth ACM SIGPLAN international conference on Functional programming, pages 268--279, New York, NY, USA, 2000. ACM Press. Google Scholar
Digital Library
- R.-K. Doong and P. G. Frankl. The ASTOOT approach to testing object-oriented programs. ACM Trans. Softw. Eng. Methodol., 3(2):101--130, 1994. Google Scholar
Digital Library
- H. Ehrig and B. Mahr. Fundamentals of Algebraic Specification 1: Equations und Initial Semantics, volume 6 of EATCS Monographs on Theoretical Computer Science. Springer, 1985. Google Scholar
Digital Library
- C. Flanagan, K. R. M. Leino, M. Lillibridge, G. Nelson, J. B. Saxe, and R. Stata. Extended static checking for java. In Proceedings of the ACM SIGPLAN 2002 Conference on Programming Language Design and Implementation, PLDI '02, pages 234--245, New York, NY, USA, 2002. ACM. Google Scholar
Digital Library
- R. W. Floyd. Assigning meanings to programs. In Mathematical Aspects of Computer Science, volume 19 of Proceedings of Symposia in Applied Mathematics, pages 19--32. American Mathematical Society, 1967.Google Scholar
- J. D. Gannon, P. R. McMullin, and R. G. Hamlet. Data-abstraction implementation, specification, and testing. ACM Trans. Program. Lang. Syst., 3(3):211--223, 1981. Google Scholar
Digital Library
- J. Goguen, J. Thatcher, and E. Wagner. An initial algebra approach to the specification, correctness and implementation of abstract data types. In R. Yeh, editor, Current Trends in Programming Methodology, volume 4, pages 80--149. Prentice Hall, 1978.Google Scholar
- J. Gosling, B. Joy, G. Steele, and G. Bracha. Java™ Language Specification, The (3rd Edition). Addison-Wesley Professional, 2005. Google Scholar
Digital Library
- P. Gottschling and A. Lumsdaine. Integrating semantics and compilation: Using C++ concepts to develop robust and efficient reusable libraries. In Y. Smaragdakis and J. G. Siek, editors, GPCE, pages 67--76. ACM, 2008. Google Scholar
Digital Library
- D. Gregor, J. Järvi, J. Siek, B. Stroustrup, G. Dos Reis, and A. Lumsdaine. Concepts: linguistic support for generic programming in C++. In OOPSLA '06: Proceedings of the 21st annual ACM SIGPLAN conference on Object-oriented programming systems, languages, and applications, pages 291--310, New York, NY, USA, 2006. ACM. Google Scholar
Digital Library
- J. V. Guttag, J. J. Horning, and J. M. Wing. The Larch family of specification languages. IEEE Softw., 2(5):24--36, 1985. Google Scholar
Digital Library
- M. Haveraaen and K. T. Kalleberg. JAxT and JDI: the simplicity of JUnit applied to axioms and data invariants. In OOPSLA Companion '08: Companion to the 23rd ACM SIGPLAN conference on Object-oriented programming systems languages and applications, pages 731--732, New York, NY, USA, 2008. ACM. Google Scholar
Digital Library
- M. Haveraaen and E. G. Wagner. Guarded algebras: Disguising partiality so you won't know whether it's there. In Recent Trends In Algebraic Development Techniques, volume 1827 of Lecture Notes in Computer Science, pages 3--11. Springer-Verlag, 2000. Google Scholar
Digital Library
- C. A. R. Hoare. An axiomatic basis for computer programming. Commun. ACM, 12(10):576--580, 1969. Google Scholar
Digital Library
- D. Kapur, D. R. Musser, and A. A. Stepanov. Tecton: A language for manipulating generic objects. In J. Staunstrup, editor, Program Specification, Proceedings of a Workshop, Lecture Notes in Computer Science, pages 402--414, Aarhus, Denmark, Aug. 1981. Springer-Verlag. Google Scholar
Digital Library
- G. T. Leavens, A. L. Baker, and C. Ruby. Preliminary design of JML: A behavioral interface specification language for Java. SIGSOFT Software Engineering Notes, 31(3):1--38, 2006. Google Scholar
Digital Library
- K. R. M. Leino. Dafny: An automatic program verifier for functional correctness. In E. M. Clarke and A. Voronkov, editors, Logic for Programming, Artificial Intelligence, and Reasoning - 16th International Conference, LPAR-16, Dakar, Senegal, April 25-May 1, 2010, Revised Selected Papers, volume 6355 of Lecture Notes in Computer Science, pages 348--370. Springer, 2010. Google Scholar
Digital Library
- B. Liskov, R. R. Atkinson, T. Bloom, J. E. B. Moss, J. C. Schaffert, R. Scheifler, and A. Snyder. CLU Reference Manual, volume 114 of Lecture Notes in Computer Science. Springer-Verlag, 1981. Google Scholar
Digital Library
- B. Liskov and S. Zilles. Specification techniques for data abstractions. In Proceedings of the international conference on Reliable software, pages 72--87, New York, NY, USA, 1975. ACM. Google Scholar
Digital Library
- B. Meyer. Eiffel: The language. Prentice-Hall, Inc., Upper Saddle River, NJ, USA, 1992. Google Scholar
Digital Library
- P. D. Mosses. The use of sorts in algebraic specifications. In M. Bidoit and C. Choppy, editors, COMPASS/ADT, volume 655 of Lecture Notes in Computer Science, pages 66--92. Springer, 1991. Google Scholar
Digital Library
- D. R. Musser and A. A. Stepanov. Generic programming. In P. M. Gianni, editor, Symbolic and Algebraic Computation, International Symposium ISSAC'88, Rome, Italy, July 4-8, 1988, Proceedings, volume 358 of Lecture Notes in Computer Science, pages 13--25. Springer, 1988. Google Scholar
Digital Library
- G. J. Popek, J. J. Horning, B. W. Lampson, J. G. Mitchell, and R. L. London. Notes on the design of Euclid. In Proceedings of an ACM conference on Language design for reliable software, pages 11--18, 1977. Google Scholar
Digital Library
- D. Sannella and A. Tarlecki. Extended ML: An institution-independent framework for formal program development. In Proceedings of the Tutorial and Workshop on Category Theory and Computer Programming, pages 364--389, London, UK, 1986. Springer-Verlag. Google Scholar
Digital Library
- D. Sannella and A. Tarlecki. Algebraic methods for specification and formal development of programs. ACM Comput. Surv., page 10, 1999. Google Scholar
Digital Library
- M. Shaw, W. A. Wulf, and R. L. London. Abstraction and verification in Alphard: Defining and specifying iteration and generators. Commun. ACM, 20(8):553--564, 1977. Google Scholar
Digital Library
- SPARK Team. SPARK Generics - A User View. Technical Report S.P0468.42.25, Altran, January 2012. Draft.Google Scholar
- A. Stepanov and P. McJones. Elements of Programming. Addison-Wesley Professional, 1st edition, 2009. Google Scholar
Digital Library
- S. T. Taft, R. A. Duff, R. Brukardt, E. Plödereder, P. Leroy, and E. Schonberg. Ada 2012 Reference Manual. Language and Standard Libraries - International Standard ISO/IEC 8652/2012 (E), volume 8339 of Lecture Notes in Computer Science. Springer, 2013.Google Scholar
- X. Tang and J. Järvi. Concept-based optimization. In LCSD '07: Proceedings of the 2007 Symposium on Library-Centric Software Design, pages 97--108, New York, NY, USA, 2007. ACM. Google Scholar
Digital Library
Index Terms
Specification of generic APIs, or: why algebraic may be better than pre/post
Recommendations
Specification of generic APIs, or: why algebraic may be better than pre/post
HILT '14: Proceedings of the 2014 ACM SIGAda annual conference on High integrity language technologySpecification based on Floyd-Hoare logic, using pre- and post-conditions, is common in languages aimed at high integrity software. Such pre/postcondition specifications are geared towards verification of code. While this specification technique has ...
Meta-evaluation as a tool for program understanding
IJCAI'77: Proceedings of the 5th international joint conference on Artificial intelligence - Volume 1Formal program specifications are difficult to write. They are always constructed from an informal precursor. We are exploring the technology required to aid in the construction of the formal specification from the informal version.
An informal ...
Design patterns for annotation-based APIs
SugarLoafPLoP '16: Proceedings of the 11th Latin-American Conference on Pattern Languages of ProgrammingWith the introduction of code annotations in popular languages like Java and C#, several frameworks and platforms adopted a metadata-based API (Application Programming Interface). By using this approach, instead of extending classes, implementing ...







Comments