| OCR Text |
Show 13 An optimizing compiler can eliminate the sequential scan through clause heads at run-time by using a sophisticated pattern matcher that matches a/ I the clauses with the term input to the function in a single pass. Relevant clause inference supplements (but is not subsumed by) such an analysis, as el iminating sequentiality in scanning for the appropriate matching clause does not reduce the size of the function body. In particular, note that relevant clause inference carries through to the recursive calls within the body of the function; including only the potentially reachable clauses through recursive invocations, in the set of clauses relevant for a particular term. In order to carry out relevant clause inference, we need to partition the original domain into "pieces" representing sets of terms and compute the clauses that are relevant for each such "piece." As shown in Figure 3, in place of the type poly used above, we model the original domain by INT (streams over a single point domain) which is abstracted to the domain Con made up of the constructors used in an stream. Functions f : INT ---> INT are mapped to functions from PD[CON] ---> PowerSet[ClauseNumbers]> Computing the graph of a function over this domain yields the relationship between a set of terms S and clauses relevant when the function is applied to a term belonging to S. This information can be used at compile time to removing irrelevant clauses from the function definition, thus reducing the number of clauses that need be examined at run-time. Chapter 2 . presents a framework fn whtch such . abstractions are shown to be well-founded. The framework is used to solve both the relevant clause and the minor signature inference problem. We also discuss the inability of currently available powerdomain constructions in specifying a collecting semantics that models the abstract interpretation of applicative programs defined over lazy domains. |