skip to main content
article
Open access

Side effects and aliasing can have simple axiomatic descriptions

Published: 01 October 1985 Publication History

Abstract

We present a different style of axiomatic definition for programming languages. It is oriented toward imperative languages, such as Algol 68, that do not distinguish between statements and expressions. Rather than basing the logic on a notion of pre- or postcondition, we use the value of a programming language expression as the underlying primitive.
A number of language constructs are examined in this framework. We argue that this style of definition gives us a significantly different view of the notion of “easy axiomatixability.” Side effects in expressions as well as aliasing between variables are shown to be “easily axiomatizable” in our system.

References

[1]
BOEHM, H.-J. A logic for expressions with side effects. In Proceedings of the 9th Annual ACM Symposium on Principles o{ Programming Languages (Jan. 1982), ACM, New York, 268-280.
[2]
BOEHM, H.-J. A logic for the Russell programming language. Ph.D. thesis, Cornell Univ., Jan. 1984. (Also available as Computer Science Tech. Rep. TR84-593.)
[3]
BOEHM, H.-J., DEMERS, A., AND DONAHUE, J. A programmer's introduction to Russell. Tech. Rep. 85-16, Dept. of Computer Science, Rice Univ., 1985. See also {12}.
[4]
BOYER, R. S., ANO STROTHER MOORE, J. A Computational Logic. Academic Press, New York, 1979.
[5]
BROOKES, S.D. A fully abstract semantics and a proof system for an Algol-like language with sharing. Tech. Rep. CMU-CS-84-118A, Dept. of Computer Science, Carnegie-Mellon Univ., Feb. 1985.
[6]
CARTWRIGHT, R., AND OPPEN, D. The logic of aliasing. Acta Inf. 15 (1981), 365-384.
[7]
CLARKE, E. M., JR. Programming language constructs for which it is impossible to obtain good Hoare axioms. J. ACM 26, 1 (Jan. 1979), 129-147.
[8]
CONSTABLE, R.L. On the theory of programming logics. In Proceedings o{ the 9th Annual ACM Symposium on Theory of Computing (May 1977), ACM, New York.
[9]
CONSTABLE, R. L., AND O'DONNELL, M.J. A Programming Logic. Winthrop, Cambridge, 1978.
[10]
COOK, S. Soundness and completeness of an axiom system for program verification. Tech. Rep. 95, Dept. of Computer Science, Univ. of Toronto, June 1976.
[11]
CUNNINGHAM, R. J., ANO GILFORD, M. E.J. A note on the semantic definition of side effects. Inf. Process. Lett. 4, 5 (Feb. 1976), 118-120.
[12]
DEMERS, A. J., ANO DONAHUE, J. E. Data types are values. Tech. Rep. 79-393, Dept. of Computer Science, Cornell Univ., 1979.
[13]
DIJKSTRA, E.W. A Discipline of Programming. Prentice-Hall, Englewood Cliffs, N.J., 1976.
[14]
GRIES, D, ANO LEVlN, G. Assignment and procedure call proof rules. ACM Trans. Program. Lang. Syst. 2, 4 (Oct. 1980), 564-579. See also {15}.
[15]
GRIES, D. The Science of Programming. Springer Verlag, New York, 1981.
[16]
HAREL, D. First-Order Dynamic Logic. Springer Verlag, New York, 1979.
[17]
HEHNER, E. C.R. Predicative programming: Part I. Commun ACM 27, 2 (Feb. 1984).
[18]
HOARE, C. A. R. An axiomatic basis for computer programming. Commun. ACM 12, 10 (Oct. 1969), 576-580.
[19]
JENSEN, K., ANO WIRTH, N. Pascal User Manual and Report. Springer Verlag, New York, 1974.
[20]
KOWALTOWSKI, T. Axiomatic approach to side effects and general jumps. Acta Inf. 7, 4 (1977), 357-360.
[21]
McCARTHY, J. A basis for a mathematical theory of computation. In Computer Programming and Formal Systems, P. Braffort and D. Hirschberg, Eds., North-Holland, Amsterdam, 1963. See also {24}.
[22]
MIRKOWSKA, G. On formalized systems of algorithmic logic. Bull. de L'Academie Polonaise des Sciences, Serie des Sciences Math., Astr. et Phys. 19, 6 (1971), 421-428.
[23]
O'DONNELL, M.J. A critique of the foundations of Hoare-style programming logics. Commun. ACM 25, 12 (Dec. 1982).
[24]
PARK, D. Fixpoint induction and proofs of program properties. Mach. lntell. 5, American Elsevier, New York, 1970, 59-78.
[25]
POPEK, G. J., HORN{NG, J. J., LAMPSON, B. W., MITCHELL, J. G., AND LONOON, R.L. Notes on the design of Euclid. In Proceedings of the ACM Conference on Language Design for Reliable Software. SIGPLAN Not. 12, 3 (Mar. 1977), 11-18.
[26]
PRITCHARD, P. Program proving--expression languages. In Information Processing 77, North- Holland, Amsterdam, 1977, 727-731. For more details see: An axiomatic semantics for expression languages. Thesis, Australian National Univ., Nov. 1979. Available as a joint technical report from the Computer Science Depts. at the Australian National Univ. (TR-CS-80-11) and the Univ. of Queensland (TR-20).
[27]
SCHWARTZ, R.L. An axiomatic treatment of asynchronous processes in Algol 68. Preliminary draft. More details can be found in: An axiomatic semantic definition of Algol 68, Computer Science Dept., UCLA-34P214-75, Univ. of California, Los Angeles, July 1978.
[28]
VAN WIJNGAARDEN, A., MAILLOUX, B. J., PECK, J. E. L., KOSTER, C. H. A., SINTZOr~, M., LINDSEY, C. H., MEERTENS, L. G. L. T., AND FISKER, R.G. Revised report on the algorithmic language Algol 68. Acta Inf. 5, 1-3 (1975), 1-236.
[29]
WULr, W. A., ET AL. BLISS-11 Programmer's Manual. Digital Equipment Corp., Maynard, Mass., 1972.

Cited By

View all
  • (2022)Proof obligations for blocks and proceduresFormal Aspects of Computing10.1007/BF018882322:1(312-330)Online publication date: 2-Jan-2022
  • (2010)A generic complete dynamic logic for reasoning about purity and effectsFormal Aspects of Computing10.1007/s00165-010-0153-422:3(363-384)Online publication date: 1-May-2010
  • (2008)A generic complete dynamic logic for reasoning about purity and effectsProceedings of the Theory and practice of software, 11th international conference on Fundamental approaches to software engineering10.5555/1792838.1792858(199-214)Online publication date: 29-Mar-2008
  • Show More Cited By

Recommendations

Reviews

Frank George Pagan

The axiomatic approach to the formal definition of programming language semantics was founded by Hoare [1] and has been extended and refined over the years by numerous people. The author argues that the well-known difficulties pertaining to the axiomatizability of various language features are a result of keeping too close to Hoare's (precondition/postcondition) style of specification. He proposes an alternative style which is applicable to “expression-oriented” languages such as ALGOL 68, where any construct can both yield a value (like an expression) and cause a side effect (like a statement). The proposed method is based on a metalinguistic primitive for talking about the value of an expression; viz., &angl0; a &angr0; denotes the value of the expression a. The notation &angl0; a &angr0; t, where t is a metaexpression, represents the value of t after executing a. The semantics of each kind of expression is defined by a “value axiom” and an “effect axiom.” For example, the value axiom &angl0; a+ b &angr0; = &angl0; a &angr0; + &angl0; a; b &angr0; states that, for any subexpressions a and b, the value of a+ b in the current state is the value of a in the current state plus the value of b in the state that will exist after a is executed. The effect axiom &angl0; a+ b &angr0; t= &angl0; a; b &angr0; t states that the side effects of a+ b consist of the side effects caused by first executing a and then executing b. The paper develops the formal system in some detail and describes how it can be used to verify the correctness of programs. In the conclusion, the author lists the weaknesses of the system as (1) lack of a firm notion of completeness, and (2) inability to deal with nondeterminism (which implies that the method could not actually be used to define ALGOL 68). He suggests that different axiomatic formalisms should be used with different kinds of programming languages. The reviewer would add that the biggest weakness seems to be the restriction to expression-oriented languages (a rather small minority of languages) and the consequent inability to ameliorate the difficulties of axiomatically characterizing the more common languages. The paper implicitly assumes a knowledge of axiomatic semantics and will be of definite interest to scholars in that area. Although the mathematical difficulty is not excessive, this reviewer did find certain parts of the discussion to be overly terse and hard to follow.

Access critical reviews of Computing literature here

Become a reviewer for Computing Reviews.

Comments

Information & Contributors

Information

Published In

cover image ACM Transactions on Programming Languages and Systems
ACM Transactions on Programming Languages and Systems  Volume 7, Issue 4
Oct. 1985
185 pages
ISSN:0164-0925
EISSN:1558-4593
DOI:10.1145/4472
Issue’s Table of Contents

Publisher

Association for Computing Machinery

New York, NY, United States

Publication History

Published: 01 October 1985
Published in TOPLAS Volume 7, Issue 4

Permissions

Request permissions for this article.

Check for updates

Qualifiers

  • Article

Contributors

Other Metrics

Bibliometrics & Citations

Bibliometrics

Article Metrics

  • Downloads (Last 12 months)60
  • Downloads (Last 6 weeks)10
Reflects downloads up to 10 Nov 2024

Other Metrics

Citations

Cited By

View all
  • (2022)Proof obligations for blocks and proceduresFormal Aspects of Computing10.1007/BF018882322:1(312-330)Online publication date: 2-Jan-2022
  • (2010)A generic complete dynamic logic for reasoning about purity and effectsFormal Aspects of Computing10.1007/s00165-010-0153-422:3(363-384)Online publication date: 1-May-2010
  • (2008)A generic complete dynamic logic for reasoning about purity and effectsProceedings of the Theory and practice of software, 11th international conference on Fundamental approaches to software engineering10.5555/1792838.1792858(199-214)Online publication date: 29-Mar-2008
  • (2008)Equivalence in functional languages with effectsJournal of Functional Programming10.1017/S09567968000001251:03(287-327)Online publication date: 7-Nov-2008
  • (2008)A Generic Complete Dynamic Logic for Reasoning About Purity and EffectsFundamental Approaches to Software Engineering10.1007/978-3-540-78743-3_15(199-214)Online publication date: 2008
  • (2006)Roadmap for enhanced languages and methods to aid verificationProceedings of the 5th international conference on Generative programming and component engineering10.1145/1173706.1173740(221-236)Online publication date: 22-Oct-2006
  • (2005)A complete transformational toolkit for compilersProgramming Languages and Systems — ESOP '9610.1007/3-540-61055-3_31(92-107)Online publication date: 2-Jun-2005
  • (2005)Observable properties of higher order functions that dynamically create local names, or: What's new?Mathematical Foundations of Computer Science 199310.1007/3-540-57182-5_8(122-141)Online publication date: 30-May-2005
  • (2005)Semantically based axiomaticsMathematical Foundations of Programming Language Semantics10.1007/3-540-19020-1_16(312-330)Online publication date: 26-May-2005
  • (2001)Side-effect removal transformationProceedings 9th International Workshop on Program Comprehension. IWPC 200110.1109/WPC.2001.921741(310-319)Online publication date: 2001
  • Show More Cited By

View Options

View options

PDF

View or Download as a PDF file.

PDF

eReader

View online with eReader.

eReader

Get Access

Login options

Full Access

Media

Figures

Other

Tables

Share

Share

Share this Publication link

Share on social media