Evaluation Sequence

We will classify evaluation sequences in three categories:

  • Terminating: if the sequence eventually reaches a terminal non-blocked configuration, i.e. where is integer, where is boolean, or . e.g.
  • Blocked: if the sequence eventually reaches a blocked configuration, i.e. where . e.g. is stuck if does not contain
  • Divergent: if the sequence is infinite. e.g.

Big-Step Semantics

Big-Step Semantics

The goal is to define a binary relation between configurations, which associates a configuration with its corresponding terminal one if it exists. That is, define by induction the binary relation such that is terminal.

The usual notation for this is . In other words: where is terminal.

Link to original

Big-Step Semantics for SIMP

Below are all the big-step semantics required for SIMP.

Example Proof

Consider the program and a state such that:

We can prove that where is a state such that:

First notice that:

Using this we can prove: $$\large \frac{ {\large \left< z := !x; x:= !y, s \right> \Downarrow \left< skip, s \begin{bmatrix} z \mapsto 1 \ x \mapsto 2 \end{bmatrix} \right>}

\frac{
	\overline{
		\left< !z, s \begin{bmatrix} z \mapsto 1 \\ x \mapsto 2 \end{bmatrix} \right> \Downarrow \left< 1, s \begin{bmatrix} z \mapsto 1 \\ x \mapsto 2 \end{bmatrix} \right>
	}
}{
	\left< y:= !z, s \begin{bmatrix} z \mapsto 1 \\ x \mapsto 2 \end{bmatrix} \right> \Downarrow \left< skip, s \begin{bmatrix} z \mapsto 1 \\ x \mapsto 2 \\ y \mapsto 1 \end{bmatrix} \right>
}

}{ \large \left< P,s \right> \Downarrow \left< skip, s’ \right> }$$

Adding Variable Declarations

We want to introduce the syntax: We add the following big-step semantics rule:

Where , that is is a fresh name. Where is the program where all occurrences of are replaced by .

Example: swap two variables using local variable

begin
	loc z := !x;
	x := !y;
	y != z
end

To show program is correct, we first prove: (refer to previous examples)

Let be the store , then: