Fast strictness analysis based on demand propagation
ACM Transactions on Programming Languages and Systems (TOPLAS)
Functional Programming and Parallel Graph Rewriting
Functional Programming and Parallel Graph Rewriting
Efficient Type Inference for Higher-Order Binding-Time Analysis
Proceedings of the 5th ACM Conference on Functional Programming Languages and Computer Architecture
PLILP '93 Proceedings of the 5th International Symposium on Programming Language Implementation and Logic Programming
Evaluation Annotations for Hope+
Proceedings of the 1989 Glasgow Workshop on Functional Programming
Hi-index | 0.00 |
It has become popular to express dataflow analyses in logical form. In this paper we investigate a new approach to the analysis of functional programs, based on synthesis of constraint logic programs. We sketch how the language Toupie, originally designed with logic program analysis as one objective, lends itself also to sophisticated strictness analysis. Strictness analysis is straightforward in the simplest case, that of analysing a FIrst-order functional language using just two strictness values, namely divergence and "don't know". Mycroft's classical translation immediately yields perfectly valid Boolean constraint logic programs, which, when run, provide the desired strictness information. However, more sophisticated analysis requires more complex domains of strictness values. We recast Wadler's classical analysis over a 2n-point domain as FInite-domain constraint solving. This approach has several advantages. First, the translation is relatively simple. We translate a recursive function deFInition into one or two constraint program clauses, in a manner which naturally extends Mycroft's translation for the 2-point case, where the classical approach translate the definition of an n-place function over lists into 4n mutually recursive equations. Second, the resulting program produces relational information, allowing for example to ask which combinations of properties of input will produce a given output. Third, the approach allows us to leverage from established technology, for solving FInite-domain constraints, as well as for FInding FIxed points. Finally, the use of (disjunctive) constraints can yield a higher precision in the analysis of some programs.