INSS 510
MIDTERM 2001 TERM 4
Each
problem 4 scores
Your Name:
1. Explain the different aspects of the cost of
programming language.
2. What major features would a perfect programming
language include, in your opinion?
3. Are there any logic programming languages, other
than Prolog?
4. Do you think language design by committee is a good
idea? Support your opinion.
5. Using the grammar of Example 3.4 from the textbook , show a parse tree and a
leftmost derivation for each of the following statements:
a. A := A * (B + (C * A))
b. B := B + C + A
c. A := A * (B +C)
6. Compute the weakest precondition for each of the
following assignment statements and postconditions:
a. a := 2* (b - 1) - 1 ß a > 0 ß
b. b :=
(c + 10) / 3 ß
b > 6 ß
7. Describe the situation when a history-sensitive
variable in a subprogram is useful.
8. Why does a decimal value waste memory space?
9. What are the arguments for and against representing
Boolean values as single bits memory?
_10. Compare the tombstones and locks-and-keys method
of avoiding dangling pointers, from the points of view of safety and
implementation cost.