Theory VIMP_Proc
theory VIMP_Proc
imports VIMP_Special "HOL-IMP.Star"
begin
section ‹Procedure commands and activation frames›
text ‹
A call evaluates its actuals in the caller store, binds them in a fresh
activation, and pushes a frame holding the caller store and the optional
destination. ‹Restore› and ‹Unwind› never occur in source programs:
‹Restore› marks the activation boundary inside sequential syntax, and
‹Unwind› is the state after a ‹Return› has published its value through
‹ret_var›, discarding pending commands up to the nearest ‹Restore›.
A check carries a label naming where it was written. The semantics never reads
it; compilation copies it onto the check's edge, and the analysis result lists
each check under it, so a report can be matched to its source check by label
instead of by position in a list. The CLI parser writes the line and column of
the check's ▩‹__voblint_check› keyword; a program written in Isabelle
notation carries the placeholder ‹(0, 0)›.
›
type_synonym check_label = "nat × nat"
text ‹Every statement carries an annotation ‹'a›. Source programs written by hand or
produced by the parser carry ‹()›; elaboration replaces it with a statement identity.
The semantics never reads it: a step copies the annotation of the command it reduces
onto what it leaves behind, so a residual still names the statement it came from. The
variable and expression payloads are parameters too, so a later resolved or typed
front end instantiates the same command syntax.›