The Impact of seq on Free Theorems-Based Program Transformations
نویسندگان
چکیده
Parametric polymorphism constrains the behavior of pure functional programs in a way that allows the derivation of interesting theorems about them solely from their types, i.e., virtually for free. Unfortunately, standard parametricity results — including so-called free theorems — fail for nonstrict languages supporting a polymorphic strict evaluation primitive such as Haskell’s seq . A folk theorem maintains that such results hold for a subset of Haskell corresponding to a GirardReynolds calculus with fixpoints and algebraic datatypes even when seq is present provided the relations which appear in their derivations are required to be bottom-reflecting and admissible. In this paper we show that this folklore is incorrect, but that parametricity results can be recovered in the presence of seq by restricting attention to left-closed, total, and admissible relations instead. The key novelty of our approach is the asymmetry introduced by left-closedness, which leads to “inequational” versions of standard parametricity results together with preconditions guaranteeing their validity even when seq is present. We use these results to derive criteria ensuring that both equational and inequational versions of short cut fusion and related program transformations based on free theorems hold in the presence of seq . This work is based on the paper Free Theorems in the Presence of seq , which appeared in 31st Symposium on Principles of Programming Languages (POPL’04), Proceedings, c ©ACM Press, 2004. http://doi.acm.org/10.1145/964001.964010 Research supported in part by the National Science Foundation under grant CCF-0429072. Research supported by the “Deutsche Forschungsgemeinschaft” under grant KU 1290/2-4. 2 P. Johann, J. Voigtländer / The Impact of seq on Free Theorems-Based Program Transformations
منابع مشابه
On proving the correctness of program transformations based on free theorems for higher-order polymorphic calculi
A number of program transformations currently of interest can be derived from Wadler's \free theorems" for calculi approximating modern functional languages. Although delicate but fundamental issues arise in proving the correctness of free theorems-based program transformations, these issues are usually left unaddressed in correctness proofs appearing in the literature. As a result, most such p...
متن کاملChecking the Influence of Non-Termination on Free Theorems
Free theorems are a helpful tool for validating program transformations, based only on types. Also in other areas they are useful proof utilities. General recursion and hence the possibility of endless looping reduces the strength of free theorems by forcing additional restrictions. These are, dependent on the type, sometimes dispensable. We present two algorithms, one claimed to disprove the n...
متن کاملInfluence of heat generation on the phase transformations and impact responses of composite plates with embedded SMA wires
In the present research, in contrast to the available papers, not only the superelasticity but also the shape memory effects are taken into account in determination of the impact responses. At the same time, in addition to modifying Brinson’s model for the shape memory alloys (SMAs), to include new parameters and loading events, and Hertz contact law, distributions of the SMA phases are conside...
متن کاملProving Correctness via Free Theorems
Free theorems feature prominently in the field of program transformation for pure functional languages such as Haskell. However, somewhat disappointingly, the semantic properties of so based transformations are often established only very superficially. This paper is intended as a case study showing how to use the existing theoretical foundations and formal methods for improving the situation. ...
متن کاملImpact of “Sambhav” Program (Financial Assistance and Counselor Services) on Hepatitis C Pegylated Interferon Alpha Treatment Initiation in India
Background Financial constraints, social taboos and beliefs in alternative medicine are common reasons for delaying or not considering treatment for hepatitis C in India. The present study was planned to analyze the impact of non-banking interest free loan facility in patients affected with hepatitis C virus (HCV) in North India. Methods This one year observational, re...
متن کاملذخیره در منابع من
با ذخیره ی این منبع در منابع من، دسترسی به آن را برای استفاده های بعدی آسان تر کنید
برای دانلود متن کامل این مقاله و بیش از 32 میلیون مقاله دیگر ابتدا ثبت نام کنید
ثبت ناماگر عضو سایت هستید لطفا وارد حساب کاربری خود شوید
ورودعنوان ژورنال:
- Fundam. Inform.
دوره 69 شماره
صفحات -
تاریخ انتشار 2006