Abstract. The basic idea behind improving the quality of a monovariant control flow analysis such as 0CFA is the concept of polyvariant analyses such as Agesen's Cartesian Product Algorithm (CPA) and Shivers' nCFA. In this paper we develop a novel framework for polyvariant flow analysis based on AikenWimmers constrained type theory. We develop instantiations of our framework to formalize various polyvariant algorithms, including nCFA and CPA. With our CPA formalization, we show the call-graph based termination condition for CPA will not always guarantee termination. We then develop a novel termination condition and prove it indeed leads to a terminating algorithm. Additionally, we show how data polymorphism can be modeled in the framework, by defining a simple extension to CPA that incorporates data polymorphism.
Scott F. Smith, Tiejun Wang