Operational Semantic Meaning For
Operational Semantic Meaning For
-1-
4.
(5 points) Show, using the technique for finding loop invariants via the table
approach described in class, whether the following program is correct.
{ n > 0 }
index = 0;
sum = 0;
while (index < n) {
sum = sum + A[index];
index = index + 1;
}
{ sum = A[0] + A[1] + ... + A[n-1] }
5.
(5 points) Write a denotational semantics mapping function for a
C/C++/Java if-statement:
M if (if(B) S 1 ; else S 2 ;, s).
6.
7.
(1 point) In what way are reserved keywords better than non-reserved
keywords?
-2-