Theory Solved_Table
theory Solved_Table
imports "Voblint_Domain.Nonrelational_Reachability" "Voblint_CFG.CFG_Def"
begin
section ‹Solved analysis results›
text ‹
The canonical, domain-generic shape of a finished analysis: a set of covered
@{typ "pp × 'ctx"} keys together with a total lookup into a per-point
abstract state. Checks, reports, and rendering are downstream consumers of
this table, not siblings of it.
The datatype constrains neither the key set nor the payloads. What the rest
of this text describes --- finitely many keys, and canonical payloads --- is
‹wf_solved_table›, stated at the end of this theory. Its two halves are
not established alike: an adapter canonicalizes every payload it publishes,
so canonicality is unconditional, while finiteness holds only for those
context policies whose whole context space is bounded in advance, and is
carried as a hypothesis everywhere else.
\<^const>‹Bot› means ``the solver's canonical result at this key is an
outer \<^const>‹Bot›'', or the key is absent from ‹covered_keys› altogether;
‹Lifted a› means ``the canonical result is \<^const>‹Lifted›'', with the
local unknown projected to the abstract state ‹a›. This is a structural
reading, not a semantic-emptiness test: raw solver values are
canonicalized -- a witness-bottom \<^const>‹Lifted› payload collapsed to
\<^const>‹Bot› -- ∗‹before› they reach this boundary (every public result
adapter routes through ‹canonicalize_lift›), so by the time a value
reaches ‹lookup_table› here, \<^const>‹Bot› denotes no store. The converse
does not hold: the emptiness test is sound and need not be complete, so a
\<^const>‹Lifted› state may still denote no store (a product whose interval
field says ‹x = 2› and whose parity field says ‹x› is odd stays
\<^const>‹Lifted›).
›
subsection ‹Per-point reachability›
text ‹
Per-point reachability is \<^typ>‹'a lifted› itself
(\<^theory>‹Voblint_Domain.Reachability_Lift›), not a nominal copy of it: the
reachability reading is fixed below rather than
left to the caller, and stated directly in terms of \<^const>‹Bot›/
\<^const>‹Lifted›. \<^const>‹map_lift› is the functorial map (payload
rewriting that leaves reachability alone).
›
text ‹
A point of an abstract-store table concretizes through the reachability
lift: \<^const>‹Bot› to nothing, a \<^const>‹Lifted› store to its concretization.
It is the lift at \<^const>‹gamma_state›, so a result generic in its published
value reads back to exactly this at an abstract-store instance.
›
lemma gamma_state_of_reachable_env [simp]:
"γ (case p of Bot ⇒ bot | Lifted st ⇒ st) = γ⇩⊥ p"
for p :: "'a::numeric_domain abs_state lifted"
by (cases p) simp_all
subsection ‹The result table›
text ‹
‹covered_keys› is the authoritative coverage surface --- the keys the
solver actually reached --- while ‹table_at› is merely a total
lookup function, defined everywhere but meaningful only on the key set.
‹lookup_table› keeps that distinction explicit rather than trusting
‹table_at› to answer sensibly off the key set.
\<^typ>‹'ctx› carries no ordering or enumeration constraint: real context
types include interval-vector and call-string contexts, which have
neither.
›