From high to low: Simulating nondeterminism and state with state

保存先:
書誌詳細
出版年:Journal of Functional Programming vol. 34 (2024)
第一著者: Tang, Wenhao
その他の著者: Schrijvers, Tom
出版事項:
Cambridge University Press
主題:
オンライン・アクセス:Citation/Abstract
Full Text - PDF
タグ: タグ追加
タグなし, このレコードへの初めてのタグを付けませんか!

MARC

LEADER 00000nab a2200000uu 4500
001 3151096742
003 UK-CbPIL
022 |a 0956-7968 
022 |a 1469-7653 
024 7 |a 10.1017/S0956796824000133  |2 doi 
035 |a 3151096742 
045 2 |b d20240101  |b d20241231 
084 |a 79046  |2 nlm 
100 1 |a Tang, Wenhao  |u The University of Edinburgh, Edinburgh, UK (e-mail: wenhao.tang@ed.ac.uk ) 
245 1 |a From high to low: Simulating nondeterminism and state with state 
260 |b Cambridge University Press  |c 2024 
513 |a Journal Article 
520 3 |a Some effects are considered to be higher level than others. High-level effects provide expressive and succinct abstraction of programming concepts, while low-level effects allow more fine-grained control over program execution and resources. Yet, often it is desirable to write programs using the convenient abstraction offered by high-level effects, and meanwhile still benefit from the optimizations enabled by low-level effects. One solution is to translate high-level effects to low-level ones.This paper studies how algebraic effects and handlers allow us to simulate high-level effects in terms of low-level effects. In particular, we focus on the interaction between state and nondeterminism known as the local state, as provided by Prolog. We map this high-level semantics in successive steps onto a low-level composite state effect, similar to that managed by Prolog’s Warren Abstract Machine. We first give a translation from the high-level local-state semantics to the low-level global-state semantics, by explicitly restoring state updates on backtracking. Next, we eliminate nondeterminism altogether in favour of a lower-level state containing a choicepoint stack. Then we avoid copying the state by restricting ourselves to incremental, reversible state updates. We show how these updates can be stored on a trail stack with another state effect. We prove the correctness of all our steps using program calculation where the fusion laws of effect handlers play a central role. 
653 |a Simulation 
653 |a Programming languages 
653 |a Semantics 
653 |a Algebra 
653 |a Syntax 
653 |a Copying 
653 |a Optimization techniques 
653 |a Abstract machines 
700 1 |a Schrijvers, Tom  |u Department of Computer Science, KU Leuven, Leuven, Belgium (e-mail: tom.schrijvers@kuleuven.be ) 
773 0 |t Journal of Functional Programming  |g vol. 34 (2024) 
786 0 |d ProQuest  |t Advanced Technologies & Aerospace Database 
856 4 1 |3 Citation/Abstract  |u https://www.proquest.com/docview/3151096742/abstract/embedded/7BTGNMKEMPT1V9Z2?source=fedsrch 
856 4 0 |3 Full Text - PDF  |u https://www.proquest.com/docview/3151096742/fulltextPDF/embedded/7BTGNMKEMPT1V9Z2?source=fedsrch