## Strictness and Totality Analysis (1994)

Venue: | In Static Analysis, LNCS 864 |

Citations: | 11 - 1 self |

### BibTeX

@INPROCEEDINGS{Solberg94strictnessand,

author = {Kirsten Lackner Solberg and Hanne Riis Nielson and Flemming Nielson},

title = {Strictness and Totality Analysis},

booktitle = {In Static Analysis, LNCS 864},

year = {1994},

pages = {408--422},

publisher = {Springer-Verlag}

}

### OpenURL

### Abstract

We definea novel inference system for strictness and totality analysis for the simplytyped lazy lambda-calculus with constants and fixpoints. Strictness information identifies those terms that definitely denote bottom (i.e. do not evaluate to WHNF) whereas totality information identifies those terms that definitely do not denote bottom (i.e. do evaluate to WHNF). The analysis is presented as an annotated type system allowing conjunctions only at "top-level". We give examples of its use and prove the correctness with respect to a natural-style operational semantics. 1 Introduction Strictness analysis has proved useful in the implementation of lazy functional languages as Miranda, Lazy ML and Haskell: when a function is strict it is safe to evaluate its argument before performing the function call. Totality analysis is equally useful but has not be adopted so widely: if the argument to a function is known to terminate then it is safe to evaluate it before performing the function call [1...

### Citations

1286 | A structural approach to operational semantics - Plotkin - 1981 |

397 | LCF considered as a programming language - Plotkin - 1977 |

160 |
A non-strict functional language with polymorphic types
- Miranda
- 1985
(Show Context)
Citation Context ... is that if (u, v) 2 meaning(c) then c u = v; e.g. (2, + 2 ) 2 meaning(+) and (1, 3) 2 meaning(+ 2 ). As mentioned in the introduction the semantics is faithful to current lazy languages like Miranda =-=[20]-=- and this is unlike other approaches (e.g. [4]) where terms are evaluated to HNF rather than WHNF. As usual we shall regard ff-equivalent terms to be equal. Two closed terms are semantically equivalen... |

150 | The type and effect discipline
- Talpin, Jouvelot
- 1994
(Show Context)
Citation Context ...ication is often by means of an annotated types system and comes in one of two flavours. In the effect systems only type constructors are annotated and examples of analyses specified in this vain are =-=[17, 18, 19, 23]-=-. Our analysis belongs to the other group where subcomponents of types are annotated; further analyses in this group are [2, 8, 9, 10]. Inference based methods have also been used for variations of st... |

143 | Miranda: a non-strict functional language with polymorphic types - Turner - 1985 |

120 | Polymorphic type, region and effect inference
- Talpin, Jouvelot
- 1992
(Show Context)
Citation Context ...ication is often by means of an annotated types system and comes in one of two flavours. In the effect systems only type constructors are annotated and examples of analyses specified in this vain are =-=[17, 18, 19, 23]-=-. Our analysis belongs to the other group where subcomponents of types are annotated; further analyses in this group are [2, 8, 9, 10]. Inference based methods have also been used for variations of st... |

96 | Projections for Strictness Analysis
- Wadler, Hughes
- 1987
(Show Context)
Citation Context ...before performing the function call [11]. In the literature there are several approaches to the specification of strictness analysis: abstract interpretation (e.g. [12, 4]), projection analysis (e.g. =-=[22]-=-) and inference based methods (e.g. [2, 8, 9, 10, 23]). Totality analysis has received much less attention and has primarily been specified using abstract interpretation [12, 1]. It can be regarded as... |

91 |
Abstract Interpretation and Optimising Transformations for Applicative Programs
- MYCROFT
- 1981
(Show Context)
Citation Context ...nate then it is safe to evaluate it before performing the function call [11]. In the literature there are several approaches to the specification of strictness analysis: abstract interpretation (e.g. =-=[12, 4]-=-), projection analysis (e.g. [22]) and inference based methods (e.g. [2, 8, 9, 10, 23]). Totality analysis has received much less attention and has primarily been specified using abstract interpretati... |

90 | A Theory of Type Polymorphism - Milner - 1978 |

75 |
The theory and practice of transforming call-by-need into call-by-value
- Mycroft
- 1980
(Show Context)
Citation Context ...tion call. Totality analysis is equally useful but has not be adopted so widely: if the argument to a function is known to terminate then it is safe to evaluate it before performing the function call =-=[11]-=-. In the literature there are several approaches to the specification of strictness analysis: abstract interpretation (e.g. [12, 4]), projection analysis (e.g. [22]) and inference based methods (e.g. ... |

70 |
S.: Strictness analysis for higher-order functions
- Burn, Hankin, et al.
- 1986
(Show Context)
Citation Context ...nate then it is safe to evaluate it before performing the function call [11]. In the literature there are several approaches to the specification of strictness analysis: abstract interpretation (e.g. =-=[12, 4]-=-), projection analysis (e.g. [22]) and inference based methods (e.g. [2, 8, 9, 10, 23]). Totality analysis has received much less attention and has primarily been specified using abstract interpretati... |

65 | Higher-order abstract interpretation (and application to comportment analysis generalizing strictness, termination, projection and PER analysis of functional languages), invited paper - Cousot, Cousot |

57 |
Strictness Analysis: a New Perspective Based on Type Inference
- Kuo, Mishra
- 1989
(Show Context)
Citation Context .... In the literature there are several approaches to the specification of strictness analysis: abstract interpretation (e.g. [12, 4]), projection analysis (e.g. [22]) and inference based methods (e.g. =-=[2, 8, 9, 10, 23]-=-). Totality analysis has received much less attention and has primarily been specified using abstract interpretation [12, 1]. It can be regarded as an approximation to time complexity analysis; most l... |

53 |
Abstract interpretation, logical relations and Kan extensions
- Abramsky
- 1990
(Show Context)
Citation Context ...projection analysis (e.g. [22]) and inference based methods (e.g. [2, 8, 9, 10, 23]). Totality analysis has received much less attention and has primarily been specified using abstract interpretation =-=[12, 1]-=-. It can be regarded as an approximation to time complexity analysis; most literature performing such developments consider eager languages but [15] considers lazy languages. In this paper we present ... |

53 | Strictness analysis on non-flat domains (by abstract interpretation over finite domains
- Wadler
- 1987
(Show Context)
Citation Context ...es: the type system only includes the b and ? annotated part of our system. An open problem is the meaningful integration of lists and other data-types. For the strictness part one may be inspired by =-=[21]-=-. Consider the type A list where A is a base type. The totality type (! n A)list might then describe the finite lists with no bottom elements, the type (! b A)list might describe the infinite lists or... |

47 | Complexity analysis for a lazy higher-order language
- Sands
- 1990
(Show Context)
Citation Context ...ily been specified using abstract interpretation [12, 1]. It can be regarded as an approximation to time complexity analysis; most literature performing such developments consider eager languages but =-=[15]-=- considers lazy languages. In this paper we present an inference system for performing strictness and totality analysis. We restrict our attention to a simply typed lambda-calculus with constants and ... |

44 | Strictness Analysis in Logical Form
- Jensen
- 1991
(Show Context)
Citation Context .... In the literature there are several approaches to the specification of strictness analysis: abstract interpretation (e.g. [12, 4]), projection analysis (e.g. [22]) and inference based methods (e.g. =-=[2, 8, 9, 10, 23]-=-). Totality analysis has received much less attention and has primarily been specified using abstract interpretation [12, 1]. It can be regarded as an approximation to time complexity analysis; most l... |

42 | Proof of translation in natural semantics - Despeyroux - 1986 |

31 | Abstract Interpretation in Logical Form - Jensen - 1992 |

26 | Deriving Algorithms from Type Inference Systems: Application to Strictness Analysis
- Hankin, MÃ©tayer
- 1994
(Show Context)
Citation Context ...ational semantics. A promising approach towards the construction of an inference algorithm for strictness and totality types is to construct an abstract machine as suggested by Hankin and Le M etayer =-=[6, 7]-=-. We plan to investigate this in our future work and compare it with constraint based techniques. We have briefly compared the results obtained by our analysis to those obtained by e.g. [2, 8, 9, 10, ... |

21 |
A new technique for strictness analysis
- Wright
- 1991
(Show Context)
Citation Context .... In the literature there are several approaches to the specification of strictness analysis: abstract interpretation (e.g. [12, 4]), projection analysis (e.g. [22]) and inference based methods (e.g. =-=[2, 8, 9, 10, 23]-=-). Totality analysis has received much less attention and has primarily been specified using abstract interpretation [12, 1]. It can be regarded as an approximation to time complexity analysis; most l... |

19 | Disjunctive strictness analysis - Jensen - 1992 |

19 | Annotated Type Systems for Program Analysis - Solberg - 1995 |

16 | Discovering Needed Reductions Using Type Theory
- Gardner
- 1994
(Show Context)
Citation Context ...ubcomponents of types are annotated; further analyses in this group are [2, 8, 9, 10]. Inference based methods have also been used for variations of strictness and totality analysis; examples include =-=[5] that uses-=- a type system with intersection types to determine "neededness" of redexes and [3] that studies liveness properties. Overview Section 2 presents the natural-style operational semantics and ... |

15 |
Strong Abstract Interpretation using Power Domains
- Mycroft, Nielson
- 1983
(Show Context)
Citation Context ...fferent: the strictness analysis is based on downward closed sets and the totality analysis on upward closed sets. We believe that the two analyses could be combined using the convex power-domains of =-=[13]-=- but this will be untractable for two reasons. One is that the mathematical foundations will be rather complicated and extensions to richer languages would not be easy. Another reason is that implemen... |

9 | pruning" simply typed -terms - Berardi - 1993 |

7 | Strictness and Totality Analysis with Conjunction - Solberg - 1995 |

6 |
Data region inference for polymorphic functional languages
- Tofte, Talpin
- 1992
(Show Context)
Citation Context ...ication is often by means of an annotated types system and comes in one of two flavours. In the effect systems only type constructors are annotated and examples of analyses specified in this vain are =-=[17, 18, 19, 23]-=-. Our analysis belongs to the other group where subcomponents of types are annotated; further analyses in this group are [2, 8, 9, 10]. Inference based methods have also been used for variations of st... |

4 |
Strictness Analysis of Functional Programs
- Benton
- 1993
(Show Context)
Citation Context |

4 | Lazy type inference for the strictness analysis of lists
- Hankin, Le
- 1994
(Show Context)
Citation Context ...ational semantics. A promising approach towards the construction of an inference algorithm for strictness and totality types is to construct an abstract machine as suggested by Hankin and Le M etayer =-=[6, 7]-=-. We plan to investigate this in our future work and compare it with constraint based techniques. We have briefly compared the results obtained by our analysis to those obtained by e.g. [2, 8, 9, 10, ... |

4 | Termination Analysis based on Operational Semantics - Nielson - 1995 |

2 |
Hanne Riis Nielson. Termination Analysis
- Nielson
- 1994
(Show Context)
Citation Context ... ! ! n A and (! n A ! ! n B ! ! n B) ! ! n B ! (! n A)list ! ! n B, respectively. However, to get this information from the analysis we need to analyse fixpoints in a better way, e.g. as suggested in =-=[14]-=-. Another open problem is to lift the restriction on the placement of conjunction; if successful, this will result in a somewhat more powerful system. One of the technical problems that need to be sol... |

2 |
Strictness and totality analysis. Forthcoming report
- Solberg
- 1994
(Show Context)
Citation Context ...? ut) = ! ? ut #(t 1 ! t 2 ) = t 1 ! #t 2 The idea behind # is that #t is the smallest type (in the sense of "containing" fewest elements) such that both tsT #t and BOT T (#t) hold; for the =-=proof see [16]-=-. The relationsT is sound but not complete. The soundness result is part of Lemma 6 below. For the lack of completeness consider the two totality types ! b Int ! ! n Int 6 and ! ? Int ! ! n Int. It mu... |