5 research outputs found

    Static analysis of functional languages

    Get PDF
    Static analysis is the name given to a number of compile time analysis techniques used to automatically generate information which can lead to improvements in the execution performance of function languages. This thesis provides an introduction to these techniques and their implementation. The abstract interpretation framework is an example of a technique used to extract information from a program by providing the program with an alternate semantics and evaluating this program over a non-standard domain. The elements of this domain represent certain properties of interest. This framework is examined in detail, as well as various extensions and variants of it. The use of binary logical relations and program logics as alternative formulations of the framework , and partial equivalence relations as an extension to it, are also looked at. The projection analysis framework determines how much of a sub-expression can be evaluated by examining the context in which the expression is to be evaluated, and provides an elegant method for finding particular types of information from data structures. This is also examined. The most costly operation in implementing an analysis is the computation of fixed points. Methods developed to make this process more efficient are looked at. This leads to the final chapter which highlights the dependencies and relationships between the different frameworks and their mathematical disciplines.KMBT_22

    Abstract Interpretation of Polymorphic Higher-Order Functions

    Get PDF
    This thesis describes several abstract interpretations of polymorphic functions. In all the interpretations, information about any instance of a polymorphic function is obtained from that of the smallest, thus avoiding the computation of the instance directly. This is useful in the case of recursive functions, because it avoids the expensive computation of finding fixed points of functionals corresponding to complex instances. We define an explicitly typed polymorphic language with the Hindley-Milner type system to illustrate our ideas, and provide two semantics of polymorphism that relate separate instances of any polymorphic function. The choice of which semantics to use depends on the particular program analysis we want to study. For studying strictness analysis and binding-time analysis, we introduce a semantics based on embedding-closure pairs. We see how the abstract function of the smallest instance of a polymorphic function is used in building an approximation to that of any instance. Furthermore, we extend the language to include lists, and describe both strictness analysis and binding-time analysis of lists. Thus, this work extends previous work by others, on analyses of polymorphic first-order functions and also of monomorphic higher-order functions, to polymorphic higher-order functions. In relating distinct instances of a polymorphic function, the approximate abstract function is expressed as the greatest lower bound of a set of functions. This may not be very cheap to compute. However, there are often ways of obtaining the same result by considering a smaller set of functions. Another issue concerns how close the approximations are to the exact values. In the first-order case, it is shown that the approximate values coincide with the exact values. In general this is not the case, but experimental results on strictness analysis indicate that good approximations are obtained. Embedding-projection pairs are used to provide a semantics that is convenient for termination analysis of polymorphic functions. We show that the abstract interpretation of an instance can be approximated by the least upper bound of a set of functions that are built from that of the smallest

    Static analysis of Martin-Löf's intuitionistic type theory

    Get PDF
    Martin-Löf's intuitionistic type theory has been under investigation in recent years as a potential source for future functional programming languages. This is due to its properties which greatly aid the derivation of provably correct programs. These include the Curry-Howard correspondence (whereby logical formulas may be seen as specifications and proofs of logical formulas as programs) and strong normalisation (i.e. evaluation of every proof/program must terminate). Unfortunately, a corollary of these properties is that the programs may contain computationally irrelevant proof objects: proofs which are not to be printed as part of the result of a program. We show how a series of static analyses may be used to improve the efficiency of type theory as a lazy functional programming language. In particular we show how variants of abstract interpretation may be used to eliminate unnecessary computations in the object code that results from a type theoretic program. After an informal treatment of the application of abstract interpretation to type theory (where we discuss the features of type theory which make it particularly amenable to such an approach), we give formal proofs of correctness of our abstract interpretation techniques, with regard to the semantics of type theory. We subsequently describe how we have implemented abstract interpretation techniques within the Ferdinand functional language compiler. Ferdinand was developed as a lazy functional programming system by Andrew Douglas at the University of Kent at Canterbury. Finally, we show how other static analysis techniques may be applied to type theory. Some of these techniques use the abstract interpretation mechanisms previously discussed
    corecore