Abstract
If we want to take WHILE-programs as effective procedures we better make sure we understand exactly how to execute each command and ensure it can be executed using finite resources. Normally programs in high-level languages like WHILE are not directly executed on a machine like Turing machine programs are. They are interpreted by a special program, an interpreter, that can then be executed on any given computer’s hardware. We want to abstract away from all the details of hardware, but still ensure that WHILE-programs qualify as effective procedures, so in this chapter we assign WHILE a formal semantics that withstands any scrutiny. In order to describe the operational effect of commands we use relations involving stores that record current values of variables. The semantics of a WHILE-program is then its behaviour which describes the result of the program given any input.
What is the exact meaning of our programming language? Do its programs qualify as effective procedures?
Access this chapter
Tax calculation will be finalised at checkout
Purchases are for personal use only
Notes
- 1.
“Imperative” here is to be understood literally, referring to “command” (as in “imperative mood”). This means that programs of an imperative language consist of commands.
- 2.
In PHP, for instance, one writes array(key1=>value1,...,keyN=>valueN) or in Javascript array={’key1’: ’value1’,...,’keyN’:’valueN’} for such associative arrays.
- 3.
See also Exercise 5.
References
Cenciarelli, P., Knapp, A., Reus, B., Wirsing, M.: A structural operational semantics for multi-threaded Java. In Alves-Foss, J. (ed.) Formal Syntax and Semantics of Java. LNCS, vol. 1523, pp. 157–200. Springer (1999)
Fernández, M.: Programming Languages and Operational Semantics—A Concise Overview, UTiCS Series. Springer, Heidelberg (2014)
Streicher, T.: Domain-Theoretic Foundations of Functional Programming. World Scientific, Singapore (2006)
Winskel, G.: Formal Semantics of Programming Languages Paperback. MIT Press, Cambridge (1993)
Author information
Authors and Affiliations
Corresponding author
Rights and permissions
Copyright information
© 2016 Springer International Publishing Switzerland
About this chapter
Cite this chapter
Reus, B. (2016). Semantics of WHILE . In: Limits of Computation. Undergraduate Topics in Computer Science. Springer, Cham. https://doi.org/10.1007/978-3-319-27889-6_4
Download citation
DOI: https://doi.org/10.1007/978-3-319-27889-6_4
Published:
Publisher Name: Springer, Cham
Print ISBN: 978-3-319-27887-2
Online ISBN: 978-3-319-27889-6
eBook Packages: Computer ScienceComputer Science (R0)