Selective strictness and parametricity in structural operational semantics, inequationally

被引:9
|
作者
Voigtlaender, Janis [1 ]
Johann, Patricia [2 ]
机构
[1] Tech Univ Dresden, Inst Theoret Informat, D-01062 Dresden, Germany
[2] Rutgers State Univ, Dept Comp Sci, Camden, NJ 08102 USA
基金
美国国家科学基金会;
关键词
clean; Haskell; extensionality principles; fixpoint recursion; functional programming languages; identity extension; lambda calculus; logical relations; mixing strict and nonstrict semantics; parametric polymorphism; program transformations; seq; short cut fusion; theorems for free; types;
D O I
10.1016/j.tcs.2007.09.014
中图分类号
TP301 [理论、方法];
学科分类号
081202 ;
摘要
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. The formal background of such 'free theorems' is well developed for extensions of the Girard-Reynolds polymorphic lambda calculus by algebraic datatypes and general recursion, provided the resulting calculus is endowed with either a purely strict or a purely nonstrict semantics. But modem functional languages like Clean and Haskell, while using nonstrict evaluation by default, also provide means to enforce strict evaluation of subcomputations at will. The resulting selective strictness gives the advanced programmer explicit control over evaluation order, but is not without semantic consequences: it breaks standard parametricity results. This paper develops an operational semantics for a core calculus supporting all the language features emphasized above. Its main achievement is the characterization of observational approximation with respect to this operational semantics via a carefully constructed logical relation. This establishes the formal basis for new parametricity results, as illustrated by several example applications, including the first complete correctness proof for short cut fusion in the presence of selective strictness. The focus on observational approximation, rather than equivalence, allows a finer-grained analysis of computational behavior in the presence of selective strictness than would be possible with observational equivalence alone. (C) 2007 Elsevier B.V. All rights reserved.
引用
收藏
页码:290 / 318
页数:29
相关论文
共 50 条
  • [1] Structural operational semantics for AKL
    Haridi, Seif
    Janson, Sverker
    Palamidessi, Catuscia
    Future Generation Computer Systems, 1992, 8 (04) : 409 - 421
  • [2] Modular structural operational semantics
    Mosses, PD
    JOURNAL OF LOGIC AND ALGEBRAIC PROGRAMMING, 2004, 60-1 : 195 - 228
  • [3] The origins of structural operational semantics
    Plotkin, GD
    JOURNAL OF LOGIC AND ALGEBRAIC PROGRAMMING, 2004, 60-1 : 3 - 15
  • [4] Dynamic structural operational semantics
    Johansen, Christian
    Owe, Olaf
    JOURNAL OF LOGICAL AND ALGEBRAIC METHODS IN PROGRAMMING, 2019, 107 : 79 - 107
  • [5] A structural approach to operational semantics
    Plotkin, GD
    JOURNAL OF LOGIC AND ALGEBRAIC PROGRAMMING, 2004, 60-1 : 17 - 139
  • [6] Structural Operational Semantics - Preface
    Mosses, Peter D.
    Ulidowski, Irek
    THEORETICAL COMPUTER SCIENCE, 2007, 373 (03) : 161 - 162
  • [7] Adaptive Structural Operational Semantics
    Jouneaux, Gwendal
    Frolich, Damian
    Barais, Olivier
    Combemale, Benoit
    Le Guernic, Gurvan
    Mussbacher, Gunter
    van Binsbergen, L. Thomas
    PROCEEDINGS OF THE 16TH ACM SIGPLAN INTERNATIONAL CONFERENCE ON SOFTWARE LANGUAGE ENGINEERING, SLE 2023, 2023, : 29 - 42
  • [8] Parametricity for Haskell with Imprecise Error Semantics
    Stenger, Florian
    Voigtlaender, Janis
    TYPED LAMBDA CALCULI AND APPLICATIONS, PROCEEDINGS, 2009, 5608 : 294 - 308
  • [9] Structural operational semantics and bounded nondeterminism
    Fokkink, W
    Vu, TD
    ACTA INFORMATICA, 2003, 39 (6-7) : 501 - 516
  • [10] Exploiting labels in structural operational semantics
    Mosses, PD
    FUNDAMENTA INFORMATICAE, 2004, 60 (1-4) : 17 - 31