Theory Activation_Trace_Def
theory Activation_Trace_Def
imports CFG_Transfer
begin
section ‹Activation traces›
text ‹
An ‹activation_trace› represents one procedure activation of a sequential run and its
concrete ancestry. Its own path contains ‹(cfg_node, store)› pairs; structural constructors record the
suspended caller and, after resumption, the completed callee. Activation contexts
are projections of this structure rather than fields stored in the trace.
Local flow follows ‹intra›, including ‹EA_Ret› into the matching
‹FunctionResult›. A ‹calls› tuple supplies the call site, callee entry, and
continuation. The call rule builds the parameter-bound entered store with
\<^const>‹call_enter›. The resume rule combines caller locals, callee globals,
and the return value with \<^const>‹combine_collect›.
The shape is adapted from the local traces of Schwarz et al., ∗‹Improving Thread-Modular
Abstract Interpretation› (SAS 2021), and Schwarz and Erhard, ∗‹Data Race Detection
by Digest-Driven Abstract Interpretation› (arXiv:2511.11055, 2025). Theirs is a
multithreaded semantics: a local trace is one thread's view, in which operations of different
threads are only partially ordered. An activation trace is one activation of a sequential run,
and a return composes the completed callee into its suspended caller.
›
subsection ‹The datatype›
text ‹
▪ ‹Root p› --- the main activation, with local path ‹p›.
▪ ‹Call caller p› --- a callee whose local path ‹p› starts at the entered store;
‹caller› is the exact suspended caller, frozen at the call node.
▪ ‹Resume current callee p› --- the activation continued past a completed call.
‹current› is that activation frozen at its call node (the value that spawned ‹callee›);
‹callee› is the retained completed callee subtree; ‹p› is the continued path.
›
text ‹An ‹activation_path› lists the nodes one activation passed and the store it held at
each. An activation trace carries the path of its own activation, with the surrounding activations beside it rather than on it.›
type_synonym activation_path = "(cfg_node × store) list"