Concepts of Programming Languages

(Sean Pound) #1

162 Chapter 3 Describing Syntax and Semantics


The technique of using preconditions and postconditions during the devel-
opment of programs is described (and advocated) by Dijkstra (1976) and also
discussed in detail in Gries (1981).
Good introductions to denotational semantics can be found in Gordon
(1979) and Stoy (1977). Introductions to all of the semantics description methods
discussed in this chapter can be found in Marcotty et al. (1976). Another good
reference for much of the chapter material is Pagan (1981). The form of the deno-
tational semantic functions in this chapter is similar to that found in Meyer (1990).

REVIEW QUESTIONS



  1. Define syntax and semantics.

  2. Who are language descriptions for?

  3. Describe the operation of a general language generator.

  4. Describe the operation of a general language recognizer.

  5. What is the difference between a sentence and a sentential form?

  6. Define a left-recursive grammar rule.

  7. What three extensions are common to most EBNFs?

  8. Distinguish between static and dynamic semantics.

  9. What purpose do predicates serve in an attribute grammar?

  10. What is the difference between a synthesized and an inherited attribute?

  11. How is the order of evaluation of attributes determined for the trees of a
    given attribute grammar?

  12. What is the primary use of attribute grammars?

  13. Explain the primary uses of a methodology and notation for describing
    the semantics of programming languages.

  14. Why can machine languages not be used to define statements in opera-
    tional semantics?

  15. Describe the two levels of uses of operational semantics.

  16. In denotational semantics, what are the syntactic and semantic domains?

  17. What is stored in the state of a program for denotational semantics?

  18. Which semantics approach is most widely known?

  19. What two things must be defined for each language entity in order to
    construct a denotational description of the language?

  20. Which part of an inference rule is the antecedent?

  21. What is a predicate transformer function?

  22. What does partial correctness mean for a loop construct?

  23. On what branch of mathematics is axiomatic semantics based?

  24. On what branch of mathematics is denotational semantics based?

Free download pdf