|
ABSTRACT
Semantic analysis of programs is essential in optimizing
compilers and program verification systems. It encompasses data
flow analysis, data type determination, generation of approximate
invariant assertions, etc.
Several recent papers (among others Cousot & Cousot[77a],
Graham & Wegman[76], Kam & Ullman[76], Kildall[73],
Rosen[78], Tarjan[76], Wegbreit[75]) have introduced abstract
approaches to program analysis which are tantamount to the use of a
program analysis framework (A,t,ã) where A is a
lattice of (approximate) assertions, t is an (approximate)
predicate transformer and ã is an often implicit function
specifying the meaning of the elements of A. This paper is devoted
to the systematic and correct design of program analysis frameworks
with respect to a formal semantics.
Preliminary definitions are given in Section 2 concerning the
merge over all paths and (least) fixpoint program-wide analysis
methods. In Section 3 we briefly define the (forward and backward)
deductive semantics of programs which is later used as a formal
basis in order to prove the correctness of the approximate program
analysis frameworks. Section 4 very shortly recall the main
elements of the lattice theoretic approach to approximate semantic
analysis of programs.
The design of a space of approximate assertions A is studied in
Section 5. We first justify the very reasonable assumption that A
must be chosen such that the exact invariant assertions of any
program must have an upper approximation in A and that the
approximate analysis of any program must be performed using a
deterministic process. These assumptions are shown to imply that A
is a Moore family, that the approximation operator (wich defines
the least upper approximation of any assertion) is an upper closure
operator and that A is necessarily a complete lattice. We next show
that the connection between a space of approximate assertions and a
computer representation is naturally made using a pair of isotone
adjoined functions. This type of connection between two complete
lattices is related to Galois connections thus making available
classical mathematical results. Additional results are proved, they
hold when no two approximate assertions have the same meaning.
In Section 6 we study and examplify various methods which can be
used in order to define a space of approximate assertions or
equivalently an approximation function. They include the
characterization of the least Moore family containing an arbitrary
set of assertions, the construction of the least closure operator
greater than or equal to an arbitrary approximation function, the
definition of closure operators by composition, the definition of a
space of approximate assertions by means of a complete join
congruence relation or by means of a family of principal
ideals.
Section 7 is dedicated to the design of the approximate
predicate transformer induced by a space of approximate assertions.
First we look for a reasonable definition of the correctness of
approximate predicate transformers and show that a local
correctness condition can be given which has to be verified for
every type of elementary statement. This local correctness
condition ensures that the (merge over all paths or fixpoint)
global analysis of any program is correct. Since isotony is not
required for approximate predicate transformers to be correct it is
shown that non-isotone program analysis frameworks are manageable
although it is later argued that the isotony hypothesis is natural.
We next show that among all possible approximate predicate
transformers which can be used with a given space of approximate
assertions there exists a best one which provides the maximum
information relative to a program-wide analysis method. The best
approximate predicate transformer induced by a space of approximate
assertions turns out to be isotone. Some interesting consequences
of the existence of a best predicate transformer are examined. One
is that we have in hand a formal specification of the programs
which have to be written in order to implement a program analysis
framework once a representation of the space of approximate
assertions has been chosen. Examples are given, including ones
where the semantics of programs is formalized using Hoare[78]'s
sets of traces.
In Section 8 we show that a hierarchy of approximate analyses
can be defined according to the fineness of the approximations
specified by a program analysis framework. Some elements of the
hierarchy are shortly exhibited and related to the relevant
literature.
In Section 9 we consider global program analysis methods. The
distinction between "distributive" and "non-distributive" program
analysis frameworks is studied. It is shown that when the best
approximate predicate transformer is considered the coincidence or
not of the merge over all paths and least fixpoint global analyses
of programs is a consequence of the choice of the space of
approximate assertions. It is shown that the space of approximate
assertions can always be refined so that the merge over all paths
analysis of a program can be defined by means of a least fixpoint
of isotone equations.
Section 10 is devoted to the combination of program analysis
frameworks. We study and examplify how to perform the "sum",
"product" and "power" of program analysis frameworks. It is shown
that combined analyses lead to more accurate information than the
conjunction of the corresponding separate analyses but this can
only be achieved by a new design of the approximate predicate
transformer induced by the combined program analysis
frameworks.
REFERENCES
Note: OCR errors may be found in this Reference List extracted from the full text article. ACM has opted to expose the complete List rather than only correct and linked references.
| |
1
|
|
| |
2
|
Birkhoff G. {1967}, Lattice theory, AMS Colloquium Pub., XXV, Third ed., Providence, R.I., (1967).
|
| |
3
|
Cousot P. {1977}, Asynchronous iterative methods for solving a fixed point system of motone equations in a complete lattice, Rapport de Recherche no88, Laboratoire IMAG, Grenoble, (Sept. 1977).
|
 |
4
|
|
| |
5
|
Cousot P. & Cousot R. {1977b}, Static determination of dynamic properties of recursive procedures, IFIP WG.2.2 Working Conf. on Formal Description of Programming Concepts, St-Andrews, Canada, North-Holland Pub. Co., (Aug. 1977).
|
 |
6
|
|
| |
7
|
|
| |
8
|
Floyd R. W. {1967}, Assigning meaning to programs, Proc. Symp. in Applied Math., vol.19, AMS, Providence, R.I., (1967), 19-32.
|
 |
9
|
|
| |
10
|
Grätzer G. {1971}, Lattice theory, first concepts and distributive lattices, W.H. Freeman and Co., San Francisco, Calif., (1971).
|
| |
11
|
Grätzer G. & Schmidt E. T. {1958}, Ideals and congruence relations in lattices, Acta Math. Acad. Sci. Hungar., 9(1958), 137-175.
|
 |
12
|
|
 |
13
|
|
 |
14
|
|
 |
15
|
|
| |
16
|
Kam J. B. & Ullman J. D. {1977}, Monotone data flow analysis frameworks, Acta Informatica, 7 (1977), 305-317.
|
 |
17
|
|
| |
18
|
|
| |
19
|
Monteiro A. & Ribeiro H. {1942}, L'opéération de fermeture et ses invariants dans les systèmes partiellement ordonnés, Portugal. Math. 3, 171-184.
|
| |
20
|
Ore O. {1943}, Combination of closure relations, Ann. of Math., 44(1943), 514-533.
|
| |
21
|
Ore O. {1944}, Galois connections, Trans. AMS, 55 (1944), 493-513.
|
| |
22
|
Pickert G. {1952}, Bemerkungen über Galois-verbindungen, Archv. Math. J. 3(1952), 285-289.
|
 |
23
|
|
| |
24
|
Scott D. {1972}, Continuous lattices, Lect. Notes in Math. 274, Springer Verlag, 97-136.
|
| |
25
|
Scott D. {1976}, Data types as lattices, SIAM Comp. 5, 3(Sept. 1976), 522-587.
|
| |
26
|
|
| |
27
|
Tarjan R. E. {1976}, Iterative algorithms for global analysis, in Algorithms and complexity, new directions and recent results, (J. F. Traub ed.), Acad. Press Inc., (1976), 71-101.
|
| |
28
|
Tenenbaum A. M. {1974}, Type determination for very high level languages, Rep. NSO-3, Comp. Sci. Dept., N.Y. Univ., (Oct. 1974).
|
| |
29
|
Ward M. {1942}, The closure operators of a lattice, Annals Math., 43(1942), 191-196.
|
| |
30
|
Wegbreit B. {1975}, Property extraction in well-founded property sets, IEEE Trans. on Soft. Eng., SE-1, 3(Sept. 1975), 270-285.
|
CITED BY 184
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
Keshav Pingali , Micah Beck , Richard Johnson , Mayan Moudgill , Paul Stodghill, Dependence flow graphs: an algebraic approach to program dependencies, Proceedings of the 18th ACM SIGPLAN-SIGACT symposium on Principles of programming languages, p.67-78, January 21-23, 1991, Orlando, Florida, United States
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
M. Codish , A. Mulkers , M. Bruynooghe , M. García de la Banda , M. Hermenegildo, Improving abstract interpretations by combining domains, Proceedings of the 1993 ACM SIGPLAN symposium on Partial evaluation and semantics-based program manipulation, p.194-205, June 14-16, 1993, Copenhagen, Denmark
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
Patrick Cousot , Radhia Cousot, Inductive definitions, semantics and abstract interpretations, Proceedings of the 19th ACM SIGPLAN-SIGACT symposium on Principles of programming languages, p.83-94, January 19-22, 1992, Albuquerque, New Mexico, United States
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
Nevin Heintze , Joxan Jaffar , Răzvan Voicu, A framework for combining analysis and verification, Proceedings of the 27th ACM SIGPLAN-SIGACT symposium on Principles of programming languages, p.26-39, January 19-21, 2000, Boston, MA, USA
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
Patrick Cousot , Radhia Cousot, Formal language, grammar and set-constraint-based program analysis by abstract interpretation, Proceedings of the seventh international conference on Functional programming languages and computer architecture, p.170-181, June 26-28, 1995, La Jolla, California, United States
|
|
|
|
|
|
|
|
|
|
|
|
Mooly Sagiv , Thomas Reps , Reinhard Wilhelm, Parametric shape analysis via 3-valued logic, Proceedings of the 26th ACM SIGPLAN-SIGACT symposium on Principles of programming languages, p.105-118, January 20-22, 1999, San Antonio, Texas, United States
|
|
|
|
|
|
|
|
|
|
|
|
M. Garcia de la Banda , M. Hermenegildo , M. Bruynooghe , V. Dumortier , G. Janssens , W. Simoens, Global analysis of constraint logic programs, ACM Transactions on Programming Languages and Systems (TOPLAS), v.18 n.5, p.564-614, Sept. 1996
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
Bruno Blanchet , Patrick Cousot , Radhia Cousot , Jérôme Feret , Laurent Mauborgne , Antoine Miné , David Monniaux , Xavier Rival, Design and implementation of a special-purpose static program analyzer for safety-critical real-time embedded software, The essence of computation: complexity, analysis, transformation, Springer-Verlag New York, Inc., New York, NY, 2002
|
|
|
Agostino Cortesi , Baudouin Le Charlier , Pascal Van Hentenryck, Combinations of abstract domains for logic programming, Proceedings of the 21st ACM SIGPLAN-SIGACT symposium on Principles of programming languages, p.227-239, January 16-19, 1994, Portland, Oregon, United States
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
Michael Codish , Harald Søndergaard, Meta-circular abstract interpretation in prolog, The essence of computation: complexity, analysis, transformation, Springer-Verlag New York, Inc., New York, NY, 2002
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
Bruno Blanchet , Patrick Cousot , Radhia Cousot , Jérome Feret , Laurent Mauborgne , Antoine Miné , David Monniaux , Xavier Rival, A static analyzer for large safety-critical software, ACM SIGPLAN Notices, v.38 n.5, May 2003
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
Stephen Fink , Eran Yahav , Nurit Dor , G. Ramalingam , Emmanuel Geay, Effective typestate verification in the presence of aliasing, Proceedings of the 2006 international symposium on Software testing and analysis, July 17-20, 2006, Portland, Maine, USA
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
Alexey Loginov , Eran Yahav , Satish Chandra , Stephen Fink , Noam Rinetzky , Mangala Nanda, Verifying dereference safety via expanding-scope analysis, Proceedings of the 2008 international symposium on Software testing and analysis, July 20-24, 2008, Seattle, WA, USA
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
Mason Chang , Edwin Smith , Rick Reitmaier , Michael Bebenita , Andreas Gal , Christian Wimmer , Brendan Eich , Michael Franz, Tracing for web 3.0: trace compilation for the next generation web applications, Proceedings of the 2009 ACM SIGPLAN/SIGOPS international conference on Virtual execution environments, March 11-13, 2009, Washington, DC, USA
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|