B
last is an automatic verification tool for checking temporal safety properties of C programs. Given a C program and a temporal
safety property, B
last either statically proves that the program satisfies the safety property, or provides an execution path that exhibits a violation
of the property (or, since the problem is undecidable, does not terminate). B
last constructs, explores, and refines abstractions of the program state space based on lazy predicate abstraction and interpolation-based
predicate discovery. This paper gives an introduction to B
last and demonstrates, through two case studies, how it can be applied to program verification and test-case generation. In the
first case study, we use B
last to statically prove memory safety for C programs. We use CC
ured, a type-based memory-safety analyzer, to annotate a program with run-time assertions that check for safe memory operations.
Then, we use B
last to remove as many of the run-time checks as possible (by proving that these checks never fail), and to generate execution
scenarios that violate the assertions for the remaining run-time checks. In our second case study, we use B
last to automatically generate test suites that guarantee full coverage with respect to a given predicate. Given a C program and
a target predicate
p, B
last determines the program locations
q for which there exists a program execution that reaches
q with
p true, and automatically generates a set of test vectors that cause such executions. Our experiments show that B
last can provide automated, precise, and scalable analysis for C programs.