Theory Voblint_Analysis_Sign.Sign_Transfer
theory Sign_Transfer
imports
Sign_Special
Sign_Numeric_Queries
"Voblint_Nonrelational.Nonrelational_Transfer"
begin
section ‹What each kind of CFG edge does to a sign store›
text ‹
A sign store maps every variable to one of the seven signs. How an edge of a
compiled graph moves such a store is not a Sign question: an assignment
re-evaluates its right-hand side and overwrites the target, a guard runs the
backward branch, a return writes into the return variable, procedure entry
resets the callee frame and binds the formals, and skip, body entry and check
observation leave the store alone. That is \<^locale>‹sound_nonrelational_ops›,
proved sound and monotone once for any domain that gives one abstract value per
variable.
So this theory only states Sign's bundle of primitive choices and certifies it.
‹sign_ops› collects \<^const>‹aval_sign›, the comparison queries
\<^const>‹sign_less›/\<^const>‹sign_eq›, \<^const>‹sign_refine_ops›,
\<^const>‹sign_special_ops› and \<^const>‹STop›; each capability is already
certified in the theory that introduces it. The guard filters, the branch, the
check classifier and every transfer function are derived from the bundle by the
one interpretation below, which names the results Sign's callers apply.
‹Sign_Exec›'s executable mirror runs on the same bundle.
\<^const>‹special_sign› is the one name that does not come from the interpretation.
It is Sign's own ‹fun› in \<^theory>‹Voblint_Analysis_Sign.Sign_Special›, written
out case by case because a reader wants to see the three special calls, so the
interpretation rewrites the locale's dispatch to it rather than introducing a
second name for the same function.
›
lemma sign_check_domain: "sound_check_query sign_less sign_eq gamma_state aval_sign"
by unfold_locales (rule sign_arith.aval_abs_sound)
definition sign_ops :: "sign nonrelational_ops" where
"sign_ops = ⦇ n_aval = aval_sign, n_query = ⦇q_less = sign_less, q_eq = sign_eq⦈,
n_refine = sign_refine_ops, n_special = sign_special_ops ⦈"
lemma sign_ops_simps [simp]:
"n_aval sign_ops = aval_sign"
"q_less (n_query sign_ops) = sign_less"
"q_eq (n_query sign_ops) = sign_eq"
"n_refine sign_ops = sign_refine_ops"
"n_special sign_ops = sign_special_ops"
by (simp_all add: sign_ops_def)