Book contents
- Frontmatter
- Contents
- Preface
- 1 Introduction
- 2 State constraints
- 3 Subprogram simplification
- 4 Program set
- 5 Pathwise decomposition
- 6 Tautological constraints
- 7 Program recomposition
- 8 Discussion
- 9 Automatic generation of symbolic traces
- Appendix A Examples
- Appendix B Logico-mathematical background
- References
- Index
6 - Tautological constraints
Published online by Cambridge University Press: 03 September 2009
- Frontmatter
- Contents
- Preface
- 1 Introduction
- 2 State constraints
- 3 Subprogram simplification
- 4 Program set
- 5 Pathwise decomposition
- 6 Tautological constraints
- 7 Program recomposition
- 8 Discussion
- 9 Automatic generation of symbolic traces
- Appendix A Examples
- Appendix B Logico-mathematical background
- References
- Index
Summary
As demonstrated in the preceding chapters, inserting certain state constraints into a program often allows the resulting program to be simplified. The program so produced, however, is in general a subprogram of the original program. To simplify a program, therefore, one needs to simplify a set of its subprograms, and then recompose the program from the simplified subprograms. Now, if the inserted constraint is tautological (see Definition 3.9), the resulting program is equivalent to the original. Therefore, we may be able to simplify a program directly by using tautological constraints. The ability to find tautological constraints is important in that, when we work with a loop construct, we often need to find its loop invariants that may allow us to simplify the loop body. Because a loop invariant is a condition that is true just before the loop is entered, the tautological constraints that immediately precede the loop construct often give us the clues as to what might be the invariant of that loop. Subsequently given is a set of relations that can be used for this purpose.
Corollary 6.1
/\Q; x := E ⇔ /\Q; x := E;/\(Q′ ⋀ x = E′)x′→E−1
where (Q′ ⋀ x = E′)x′→E−1 is a predicate we construct by following the subsequent steps:
We obtain Q′ and E′ from Q and E, respectively, by replacing every occurrence of x with x′, and then replacing every occurrence of x′ with E−1.
- Type
- Chapter
- Information
- Path-Oriented Program Analysis , pp. 55 - 68Publisher: Cambridge University PressPrint publication year: 2007