Questions

Length: 30 min.

Let’s say we’re in a simple imperative language with arithmetic and conditional expressions (think IMP!). Specifically, we have numbers, arithmetic expressions, and variables.

  • Write the operational semantics for the operation.
  • Now, write the operational semantics for chained comparison, à la Python: .
    • How could we preserve short-circuiting semantics with this?
  • Let’s say our language also has side effecting functions.
    • Does your semantics have potentially surprising interactions with side effects? Why or why not?

Board