77 research outputs found
Coinductive subtyping for abstract compilation of object-oriented languages into Horn formulas
In recent work we have shown how it is possible to define very precise type
systems for object-oriented languages by abstractly compiling a program into a
Horn formula f. Then type inference amounts to resolving a certain goal w.r.t.
the coinductive (that is, the greatest) Herbrand model of f.
Type systems defined in this way are idealized, since in the most interesting
instantiations both the terms of the coinductive Herbrand universe and goal
derivations cannot be finitely represented. However, sound and quite expressive
approximations can be implemented by considering only regular terms and
derivations. In doing so, it is essential to introduce a proper subtyping
relation formalizing the notion of approximation between types.
In this paper we study a subtyping relation on coinductive terms built on
union and object type constructors. We define an interpretation of types as set
of values induced by a quite intuitive relation of membership of values to
types, and prove that the definition of subtyping is sound w.r.t. subset
inclusion between type interpretations. The proof of soundness has allowed us
to simplify the notion of contractive derivation and to discover that the
previously given definition of subtyping did not cover all possible
representations of the empty type
Link-time static analysis for efficient separate compilation of object-oriented languages
International audienc
A Correspondence between Two Approaches to Interprocedural Analysis in the Presence of Join
Many interprocedural static analyses perform a lossy join for
reasons of termination or efficiency. We study the relationship between
two predominant approaches to interprocedural analysis, the summary-
based (or functional) approach and the call-strings (or k-CFA) approach,
in the presence of a lossy join. Despite the use of radically different ways
to distinguish procedure contexts by these two approaches, we prove
that post-processing their results using a form of garbage collection ren-
ders them equivalent. Our result extends the classic result by Sharir and
Pnueli that showed the equivalence between these two approaches in the
setting of distributive analysis, wherein the join is lossless.
We also empirically compare these two approaches by applying them to a
pointer analysis that performs a lossy join. Our experiments on ten Java
programs of size 400K{900K bytecodes show that the summary-based
approach outperforms an optimized implementation of the k-CFA approach: the
k-CFA implementation does not scale beyond k=2, while the summary-based approach proves up to 46% more pointer analysis client queries than 2-CFA. The summary-based approach thus enables, via our equivalence result, to measure the precision of k-CFA with unbounded k, for the class of interprocedural analyses that perform a lossy join
Shape Analysis in the Absence of Pointers and Structure
discover properties of dynamic and/or mutable structures. We ask, “Is there an equivalent to shape analysis for purely functional programs, and if so, what ‘shapes ’ does it discover? ” By treating binding environments as dynamically allocated structures, by treating bindings as addresses, and by treating value environments as heaps, we argue that we can analyze the “shape ” of higher-order functions. To demonstrate this, we enrich an abstract-interpretive control-flow analysis with principles from shape analysis. In particular, we promote “anodization ” as a way to generalize both singleton abstraction and the notion of focusing, and we promote “binding invariants ” as the analog of shape predicates. Our analysis enables two optimizations known to be beyond the reach of control-flow analysis (globalization and super-β inlining) and one previously unknown optimization (higher-order rematerialization).
- …