Theory Analysis_Run
theory Analysis_Run
imports
Arithmetic_Diagnostics
MCP_Split
"HOL-Library.Code_Target_Numeral"
"HOL-Library.Code_Abstract_Char"
begin
section ‹Running one configuration once›
text ‹
The public analysis operation. A caller hands over the three choices that
decide what gets solved and a program, and receives the solve as a report:
every covered point-and-context state, the contexts each call enters, the check
column and the arithmetic diagnostics. One solve stands behind all of them. The
report holds semantic states, never their rendering; text, graphs and report
pages are built from it by a projection outside the theorems.
Nothing outside this theory decides which analyser runs: the one function below
that reads the context policy names the registration that policy solves with.
›
subsection ‹The rows of a report›
text ‹
Points are CFG nodes and contexts are indices into the report's context list, so
a consumer never has to infer which states belong together from displayed text.
A row's state is the type parameter ‹'s›: the semantic state in a report, its
rendering after a presentation has been applied.
A route lists every callee context a call enters from one caller context: an
entry specification may offer several alternatives, and each may land in its own
context. The empty list is a call the caller context does not take.
A state also lists, for every edge leaving its point, that edge's target and what
the edge's own step makes of the state. Where the target is a join of several
incoming edges -- a loop head, the point after a branch -- this is the only place
the effect of one statement survives.
›
record 's result_state =
state_point :: pp
state_context :: nat
state_value :: "'s lifted"
state_checks :: "(exp × contextual_verdict) list"
state_diagnostics :: "(arithmetic_obligation × contextual_verdict) list"
state_steps :: "(pp × 's lifted) list"
record call_route =
route_point :: pp
route_context :: nat
route_callee :: pname
route_targets :: "nat list"
record result_check =
check_point :: pp
check_label :: check_label
check_exp :: exp
check_verdict :: contextual_verdict
text ‹
A global unknown is a program global kept at its own unknown, or the seed of a
procedure entry, named by the procedure and the index of the context it was
entered at; a seed without a context belongs to a procedure the solve never
entered.
›