Specification and Verification for Unrestricted Algebraic Effects and Handling

被引:0
|
作者
Song, Yahui [1 ]
Foo, Darius [1 ]
Chin, Wei-Ngan [2 ]
机构
[1] Natl Univ Singapore, Sch Comp, Singapore, Singapore
[2] Natl Univ Singapore, Dept Comp Sci, Singapore, Singapore
关键词
Multi-shot Continuations; Separation Logic; Automated Verification; Effectful Specification Logic; HANDLERS;
D O I
10.1145/3674656
中图分类号
TP31 [计算机软件];
学科分类号
081202 ; 0835 ;
摘要
Programming with user-defined effects and effect handlers has many practical use cases involving imperative effects. Additionally, it is natural and powerful to use multi-shot effect handlers for non-deterministic or probabilistic programs that allow backtracking to compute a comprehensive outcome. Existing works for verifying effect handlers are restricted in one of three ways: i) permitting multi-shot continuations under pure setting; ii) allowing heap manipulation for only one-shot continuations; or iii) allowing multi-shot continuations with heap-manipulation but under a restricted frame rule. This work proposes a novel calculus called Effectful Specification Logic (ESL) ESL ) to support unrestricted effect handlers, where zero-/one-/multi-shot continuations can co-exist with imperative effects and higher-order constructs. ESL captures behaviors in stages, and provides precise models to support invoked effects, handlers and continuations. To show its feasibility, we prototype an automated verification system for this novel specification logic, prove its soundness, report on useful case studies, and present experimental results. With this proposal, we have provided an extended specification logic that is capable of modeling arbitrary imperative higher-order programs with algebraic effects and continuation-enabled handlers.
引用
收藏
页数:29
相关论文
共 50 条
  • [1] ALGEBRAIC SPECIFICATION AND VERIFICATION OF COMMUNICATION PROTOCOLS
    KOOMEN, CJ
    [J]. SCIENCE OF COMPUTER PROGRAMMING, 1985, 5 (01) : 1 - 36
  • [2] On the Algebraic Specification and Verification of Parallel Systems
    Triantafyllou, Nikolaos
    Ksystra, Katerina
    Stefaneas, Petros
    [J]. LEVERAGING APPLICATIONS OF FORMAL METHODS, VERIFICATION AND VALIDATION: SPECIALIZED TECHNIQUES AND APPLICATIONS, PT II, 2014, 8803 : 623 - 624
  • [3] AN ALGEBRAIC SPECIFICATION OF HDLC PROCEDURES AND ITS VERIFICATION
    HIGASHINO, T
    MORI, M
    SUGIYAMA, Y
    TANIGUCHI, K
    KASAMI, T
    [J]. IEEE TRANSACTIONS ON SOFTWARE ENGINEERING, 1984, 10 (06) : 825 - 836
  • [4] HANDLING ALGEBRAIC EFFECTS
    Plotkin, Gordon D.
    Pretnar, Matija
    [J]. LOGICAL METHODS IN COMPUTER SCIENCE, 2013, 9 (04)
  • [5] Component-based algebraic specification and verification in CafeOBJ
    Diaconescu, R
    Futatsugi, K
    Iida, S
    [J]. FM'99-FORMAL METHODS, VOL II, 1999, 1709 : 1644 - 1663
  • [6] Handling Fibred Algebraic Effects
    Ahman, Danel
    [J]. PROCEEDINGS OF THE ACM ON PROGRAMMING LANGUAGES-PACMPL, 2018, 2
  • [7] Handling Polymorphic Algebraic Effects
    Sekiyama, Taro
    Igarashi, Atsushi
    [J]. PROGRAMMING LANGUAGES AND SYSTEMS, ESOP 2019: 28TH EUROPEAN SYMPOSIUM ON PROGRAMMING, 2019, 11423 : 353 - 380
  • [9] EFFECTS ON LOAD HANDLING OF RESTRICTED AND UNRESTRICTED SHELF OPENING CLEARANCES
    MITAL, A
    WANG, LW
    [J]. ERGONOMICS, 1989, 32 (01) : 39 - 49
  • [10] Automated Temporal Verification for Algebraic Effects
    Song, Yahui
    Foo, Darius
    Chin, Wei-Ngan
    [J]. PROGRAMMING LANGUAGES AND SYSTEMS, APLAS 2022, 2022, 13658 : 88 - 109