Analysis of Pointer Programs and Inference of Loop-Invariant Shape Graphs
- Author
- LiuGang
- Advisor
- ChenYiYun
- School
- University of Science and Technology of China
- Major
- Computer Software and Theory
- Classification
- TP311.1 Programming
- Degree
- Master's thesis
- Year
- 2011
- Downloads
- 31
- Citations
- 0
Abstract
In recent years, software systems are becoming more and more important for everyday life and work while the scale of software systems is larger and larger. Therefore, people must pay more attention to the properties such as correctness, safety and security of complicated software systems. It is necessary to use high-confidence software in some areas of safety-critical. Formal verification is a major method to improve the dependability of the software. However, in the phase of typical formal verification, it is inconvenient for programmers that they usually provide pre-/post-conditions and loop invariants manually. At the same time, there is not a prefect method for loop invariant inference. Thus, it is slowly that the product of formal verification be applied in the industry yet.It is of significance to find a method to inference loop invariant automatically for program analysis and program verification. To the programs dealing with pointers, we can obtain much useful information for loop invariant inference and program verification by shape analysis.This paper uses a new method to solve the problems of Analysis and verification of programs dealing with pointers and loop invariant inference. We have designed a system named shape system for the PointerC programming language. Programmers must declare the shapes that the recursive data structures intend to build, and the shapes that pointer variables point to. Compilers or other tools can use shape inference rules to infer shapes constructed by the programs via dynamically allocated structures, and then do shape checking to judge whether the shape confirms to what the programmer has declared, according to shape checking rules. At the same time, we have designed a method for shape analysis based on the shape graph logic. According this method, we can obtain the pre-/post-conditions and loop invariant shape graphs associated with pointers.Shape graphs are used to express the point-to relations of statically declared pointer variables and the pointer-typed fields in the dynamically allocated data structures. The shape graph precisely expresses the equalities between various pointers, and can provide other useful information, e.g. the alias of the given access path. Loop invariant shape graphs are the shape graphic description of loop invariant associated with pointers. The shape graph logic is an extension to Hoare logic from the viewpoint that the shape graph is a graphical expression of the assertions on pointers, and it and can be used in the program analysis and verification of programs manipulating mutable data structures.Based on the shape graph logic, we have implemented a program verifier for the PointerC language. It can verify programs dealing shapes defined in this paper. Programmers need not to provide pre-/post-conditions and loop-invariants concerning about shapes. The specifications about the structures are required. And, in some extent, the method which has been designed and implemented in this paper can be used to solve the difficult problem of loop invariant inference. It also can be used to alleviate burdens of program verification.
Table of contents
Summary 4-5
Abstract 5-10
Chapter 1 Introduction 10-18
1.1 Background and Significance 10-11
1.1.1 in the form of program verification 10-11
1.1.2 Shape Analysis 11
1.2 Research Status 11-13
1.2.1 Pointer procedures related research and analysis 11-13
research
1.2.2 loop invariant inference 13
1.3 This article outlines 13-18
1.3.1 research 14-15
1.3.2 The main contribution and characteristics 15
1.3.3 chapters arranged 15-18
Chapter 2 Figure logic diagram and shape 18-38
2.1 PointerC Language Introduction 18-22
syntax definition nbsp 2.1.1 PointerC language ; 18
2.1.2 source code examples 18-22
2.2 Shape Figure 22-24
define the shape of Figure 2.2.1 vertices and edges 22-23
2.2.2 shape of the graph constraints 23-24
2.3 Pictured shape -based assertion language 24-29
2.3.1 diagram defines the shape of common data structures 25-26
2.3.2 assertion calculus 26-29
2.4 specifications and procedures based on the program rules of inference shape graph 29-32
2.4.1 pointer type assignment u = v 29-30
2.4.2 allocate space statement u = malloc (t) 30-31
2.4.3 release space statement free (u) 31
2.4.4 and function construction -related statements 31-32
2.4.5 complex , conditional and looping statements rules 32
2.4.6 Points rule 32
2.4.7 structural rules (frame rule) 32
2.5 full shape of a logical 32-35
Contact 2.5.1 shape between diagrams and symbols assertion 32-33
supplement nbsp 2.5.2 program inference rules ; 33-34
Reliability Analysis
2.5.3 shape diagram logic 34-35
2.6 Summary 35-38
Chapter 3 based on the shape of the shape of a logical analysis 38-46
3.1 shape system 38-41
3.1.1 shape inference rules 38-39
3.1.2 shape inspection rules 39-40
difference
3.1.3 and type systems 40-41
build nbsp 3.2 points each program shape graph ; 41-45
3.2.1 function diagram shape before conditions 41
3.2.2 local variable declaration statement Shape Figure 41-42
3.2.3 pointer type assignment shape figure 42
3.2.4 and release the space allocated space sentence statement Shape Figure 42-43
3.2.5 conditional statement Shape Figure 43-44
3.2.6 compound statement Shape Figure 44
3.2.7 return statement ( after the function condition ) Shape Figure 44-45
3.2.8 function call statement Shape Figure 45
3.3 Summary 45-46
Chapter 4 Figure inferred loop invariant shape 46-54
4.1 Common loop analysis 46-47
4.2 loop invariant shape diagram inference method 47-50
4.2.1 expand and collapse 47-48
4.2.2 abstract method 48-49
(?)
4.2.3 implication G_ (i 1) G_0 ... G_i 49
4.2.4 loop invariant shape figure G_0 ... G_i 49-50
shape of the loop statement checks nbsp 4.3 ; 50-51
4.4 algorithm termination analysis 51-52
4.5 Summary 52-54
Chapter 5 prototype and experimental verification program evaluation 54-62
5.1 program verification system prototype 54-55
5.1.1 System components 54
5.1.2 system processes 54-55
5.2 Experimental evaluation 55-61
5.2.1 Experiment one : Remove the binary sort tree node 56-57
5.2.2 Experiment II : Insert a single node in the ordered list of 57
5.2.3 Experiment III : merge two ordered singly linked list 57-59
5.2.4 statistics and analysis of experimental data 59-61
5.3 summarizes the experimental 61-62
Chapter 6 Conclusion 62-64
6.1 Thesis summary 62-63
6.2 further research directions 63-64
References 64-68
Thanks 68-70
research papers published during the read and made ?? 70
Related dissertations
- Study on Program Verification Based on Symbolic Computation
- A program verification tool design and implementation
- Study on the Automatic Identification Technology for Pavement Distress Image Based on Multi-features Fusion
- Research on Novel Shape Analysis Techniques and Their Applications in Image Retrieval
- Research on Key Problems of Shape Representation and Analysis
- Key Technology Research on Motion Capture Based on Videos
- Shape Analysis Based on Curvature Scale-Space
- Shape Correspondence Based on HKS and Iterative Closest Point
- The 3D shape based on graph matching
- An Integration of Several Data Flow Analysis Techniques for Program Verification
- Research on Generation of Loop Invariants
- Target Recognition of Coherent Ladar Range Image for Small Samples
- Unearthed Luan Ling Research of Western Zhou Dynasty
- The Extension and Shape Analysis of a Class of Trigonometric Polynomial Curves
- Research on Planar Footprint Shape Analysis and Footprint-based Identity Verification
- Certifying Compilation in an Infrastructure for Developing Trustable Software
- Shape analysis method and its application
- The Conformation Theories of Tensility Structures and the Structure Analysis of Flexible Antennae
- A Pointer Logic for Safety Verification of Pointer Programs
- Constraint Based Prolog Semantics and Its Applications in the Testing, Analysis and Verification of Prolog Programs