# Class 31: Semantics of Assignment (2)

Back to Semantics of Assignment (1). On to Early Break.

Held: Wednesday, 12 March 2003

Notes:

• Reminder: Extra credit for attending tomorrow's convo.
• Have a great break!
• Are there questions on exam 1?

## Review

• What is a weakest precondition?
• What is substitution?
• How do we define assignment
• Notation: How should we write substitution in ASCII? How about E[x->e] for Eex or substitute e for x in E.

## Some Problems

• wp("x = x + 1", x = x + 1)
• wp("x = a[x]", x = a[x])
• Can we simply apply the substitution rule?

## Simultaneous Assignment

• Gries also defines simultaneous assignment.
• The definition looks astoundingly like that for regular assignment, except that we have vectors of variables and replacements.
• Note that we'll need to think about how to define this kind of substitution.
• Why would we want simulataneous assignment?
• Can we redefine simultaneous assignment in terms of individual assignment?

## Array Assignment

• Fairly straightforward
• Def: wp("a[x] := e", R) = x in validSubscripts(a) cand domain(e) cand R(a; x:e)x

## History

Tuesday, 7 January 2003 [Samuel A. Rebelsky]

• Created generic version to set up course.

Back to Semantics of Assignment (1). On to Early Break.

Disclaimer: I usually create these pages on the fly, which means that I rarely proofread them and they may contain bad grammar and incorrect details. It also means that I tend to update them regularly (see the history for more details). Feel free to contact me with any suggestions for changes.

This document was generated by Siteweaver on Fri May 2 14:20:48 2003.
The source to the document was last modified on Mon Jan 20 12:41:04 2003.
This document may be found at `http://www.cs.grinnell.edu/~rebelsky/Courses/CS195/2003S/Outlines/outline.31.html`.

You may wish to validate this document's HTML ; ; Check with Bobby

Samuel A. Rebelsky, rebelsky@grinnell.edu