Path-Sensitive and Path-Insensitive Analysis

See how merging two feasible paths loses correlations and use branch conditions to recover a claim about edge cases.

Source
Anbloq
Language
English
Created
Updated
Chapters
2
Reading time
1 min
In this article2 chapters
  1. A join can forget which assignments occurred together
  2. Keep selected distinctions within a budget

A join can forget which assignments occurred together

A Boolean branch assigns either \((x,y)=(0,4)\) or \((4,0)\). Tracking one interval per variable after the join gives \(x,y\in[0,4]\). That state admits the impossible pair \((4,4)\), so the estimated sum is \([0,8]\), although every actual sum is four. Both interval transfers are sound. The extra possibilities were introduced by the join.

Keep selected distinctions within a budget

An analysis could retain the two path conditions and their respective values until it computes the sum. This derives exactly four. Keeping every path can require exponentially many states across independent branches and unbounded distinctions around loops. Merging selected contexts, recording a relational invariant or partitioning only on relevant predicates controls the cost. Symbolic execution makes path conditions explicit. Counterexample-guided refinement adds distinctions when a coarse model creates a spurious witness.[1][2]

References

  1. Benjamin C. Pierce et al., Software Foundations ↩
  2. Anders Møller and Michael I. Schwartzbach, Static Program Analysis ↩