Exercise 1

Show by structural induction that rules of abstract machine allow us to find a value for any boolean expression in SIMP.

Boolean expressions in SIMP:

Base case:

  • : valid as there are transition rules to prove this
  • : there is a situation where bop ends up at the top of the stack; which leads us to a boolean; hence valid as there are transition rules to prove this

Induction case:

  • implies that ; there is a transition rule
  • and implies ; holds as base case holds

Exercise 2

If is an integer expression, holds for a unique value .

Axioms:

  • Transition rule is valid.
  • is a function that we assume has location

Rule:

  • Break down into cases and .
  • Use the first axiom to prove that they evaluate to and .
  • Hence is equivalent to and evaluates to as .

Exercise 3

Exercise 4

The memory doesn’t change in the new rule, this means that the expressions cannot mutate the memory but this isn’t possible anyways with the current rules, to prove this; We prove that if then .

Base cases:

Inductive step:

We look at the original big step semantics rule and substitute our equations into it to arrive at the second rule.

Exercise 5

We use the rules :

We know that Hence, we apply the command to the rule:

Exercise 6

Start with the rule for :

We also have the rule :

We want to prove that we can’t use these rules to show . We use proof by contradiction, assume we can use the rules to show this.

We cannot use the third rule in hence it will never terminate as will never evaluate to false.