Lectures onType Theory
Symbolic execution and information-flow rules
appendix sectionrules

Symbolic execution and information-flow rules

SymImp-DL

Concrete configurations contain a command, store, fixed input oracle, and cursor. Besides the congruence rules for sequence, the rules are Xinput x,s,I,ncskip,s[xI(n)],I,n+1CInput Xx:=a,s,I,ncskip,s[x[[a]]s],I,nCAssign [[g]]s=trueif g then c1 else c2,s,I,ncc1,s,I,nCIfT [[g]]s=falseif g then c1 else c2,s,I,ncc2,s,I,nCIfF. [[g]]s=trueassert g,s,I,ncskip,s,I,nCAssertT [[g]]s=falseassert g,s,I,ncfail(s,I,n)CAssertF. Put unroll(g,c)=if g then(c;while g do c) elseskip. Then Xwhile g do c,s,I,ncunroll(g,c),s,I,nCWhile c1,s,I,ncc1,s,I,nc1;c2,s,I,ncc1;c2,s,I,nCSeqStep Xskip;c,s,I,ncc,s,I,nCSeqSkip. Failure propagates through a surrounding sequence. The symbolic input, assignment, and branch rules are

input x,σ,Φ,nsskip,σ[xαn],Φ,n+1
S-Input
x:=a,σ,Φ,nsskip,σ[x[[a]]σ],Φ,n
S-Assign
if g then c1 else c2,σ,Φ,nsc1,σ,Φ[[g]]σ,n
S-If-T
if g then c1 else c2,σ,Φ,nsc2,σ,Φ¬[[g]]σ,n
S-If-F

Symbolic conditionals fork and conjoin [g]σ or its integer complement; assertions fork into skip and a failure obligation; while unfolds exactly as C-While and then uses those conditional forks. Symbolic sequencing mirrors C-Seq-Step and C-Seq-Skip. No symbolic rule contains a satisfiability premise.

The graph representation maps uvk to vku. A checked negative-cycle certificate verifies that every selected edge occurs in the path condition, endpoints compose and close, and the weight sum is strictly negative. Models are accepted only after every atom and deterministic replay are checked; unknown retains the path.

Imperative information flow

Expressions have the join of the labels of their free variables. Commands use the program-counter judgment ΓpIFc. Its assignment, sequence, branch, and loop rules are

Γe:psecΓ(x)
ΓpIFx:=e
IF-Assign
ΓpIFc1ΓpIFc2
ΓpIFc1;c2
IF-Seq
Γb:ΓpIFc1ΓpIFc2
ΓpIFif b then c1 else c2
IF-If
Γb:ΓpIFc
ΓpIFwhile b do c
IF-While

Skip is always admissible. The terminating evaluation rules are Xskip,sIFsESkip Xx:=e,sIFs[x[[e]]s]EAssign c1,sIFs1c2,s1IFs2c1;c2,sIFs2ESeq [[b]]s=truec1,sIFsif b then c1 else c2,sIFsEIfT [[b]]s=falsec2,sIFsif b then c1 else c2,sIFsEIfF. For w=while b do c, the two loop rules are [[b]]s=falsew,sIFsEWhileF [[b]]s=truec,sIFs1w,s1IFs2w,sIFs2EWhileT. TINI quantifies over two derivations of this relation. It makes no conclusion when either derivation is absent.

Delete the input oracle and cursor from C-Assign, C-If-T, and C-If-F to obtain the assignment and branch rules of IF. Its sequence rules arise from C-Seq-Step and C-Seq-Skip; its loop rule arises from C-While. Those are all its rules; it has no input, assertion, or failure state.

Search the book

Type to search the local edition.