## Towards Effects in Mathematical Operational Semantics

### BibTeX

@MISC{Abou-saleh_towardseffects,

author = {Faris Abou-saleh and Dirk Pattinson},

title = {Towards Effects in Mathematical Operational Semantics},

year = {}

}

### OpenURL

### Abstract

In this paper, we study extensions of mathematical operational semantics with algebraic effects. Our starting point is an effect-free coalgebraic operational semantics, given by a natural transformation of syntax over behaviour. The operational semantics of the extended language arises by distributing program syntax over effects, again inducing a coalgebraic operational semantics, but this time in the Kleisli category for the monad derived from the algebraic effects. The final coalgebra in this Kleisli category then serves as the denotational model. For it to exist, we ensure that the the Kleisli category is enriched over CPOs by considering the monad of possibly infinite terms, extended with a bottom element. Unlike the effectless setting, not all operational specifications give rise to adequate and compositional semantics. We give a proof of adequacy and compositionality provided the specifications can be described by evaluation-in-context. We illustrate our techniques with a simple extension of (stateless) while programs with global store, i.e. variable lookup.

### Citations

733 | Notions of Computation and Monads
- Moggi
- 1991
(Show Context)
Citation Context ... an abstract operational semantics relies on syntax and behaviour being defined on the same category, whereas computational effects are are most naturally expressed in the Kleisli category of a monad =-=[12]-=-, which is unsuitable for representating syntax. Second, many of the standard techniques for constructing final coalgebras (that play the roles of denotational domains) fail in a Kleisli category. Fin... |

189 | Toposes, Triples, and Theories
- Barr, Wells
- 1985
(Show Context)
Citation Context ...d like to address. Firstly, we have not considered equations on effects. Equations for finite effect-trees T ˜ ∆ X amounts to quotienting the algebra; in a Lawvere theory, they correspond to sketches =-=[1]-=-. A less syntax-driven approach would be to represent effect-trees via the free model of the Lawvere theory in the base category. This would mean discarding the ‘final ∆-coalgebra’ approach of Definit... |

185 |
Initial algebra semantics and continuous algebras
- Goguen, Thatcher, et al.
- 1977
(Show Context)
Citation Context ... and 4 of [11]), and is given component-wise by F∆: (F ˜ ∆ X)s = F∆(Xs). The objects F ˜ ∆ may be given the natural partial order structure. In Cppo, this structure appears as the initial ˜ ∆-algebra =-=[2]-=-. By contrast, left-strictness is not so straightforward. Intuitively, this requires that if we replace all leaves of an effect-tree with ⊥, the resulting tree is identified with ⊥. We anticipate a be... |

169 | The category-theoretic solution of recursive domain equations - Smyth, Plotkin - 1982 |

134 | G.: Towards a mathematical operational semantics
- Turi, Plotkin
- 1997
(Show Context)
Citation Context ...per is electronically published in Electronic Notes in Theoretical Computer Science URL: www.elsevier.nl/locate/entcsAbou-Saleh and Pattinson A more general approach was proposed by Turi and Plotkin =-=[24]-=- in the case of structural operational semantics, assuming that the operational behaviour of a language can be modelled coalgebraically. Then, the semantic domain can be taken as a final coalgebra, an... |

133 | Semantics with Applications: A Formal Introduction
- Nielson, Nielson
- 1992
(Show Context)
Citation Context ... → n + m √ e → true if (e) then {p} else {q} → p (etc.) while (e) do {p} → if (e) then {p; while (e) do {p}} else {skip} and other familiar rules for the remaining operators ∗, ¬, =, <= , ∧ (see e.g. =-=[13]-=-). It can easily be verified that these rules induce a natural transformation ρ : Σ(X × BX) → BTΣX that distributes syntax over behaviour. To illustrate, we define ρ for some operators. We suppose X =... |

55 | Notions of computation determine monads
- Plotkin, Power
- 2002
(Show Context)
Citation Context ...gramme of mathematical operational semantics is well-suited to process-calculi-like languages, it is not yet clear how imperative languages, or indeed any language that produces computational effects =-=[14,15,5]-=-, can be treated adequately, and a number of difficulties present themselves. Firstly, giving an abstract operational semantics relies on syntax and behaviour being defined on the same category, where... |

55 | Initial Algebra and Final Coalgebra Semantics for Concurrency, Report CS-R9409 - Rutten, Turi - 1994 |

53 |
Functorial Operational Semantics and its Denotational Dual
- Turi
- 1996
(Show Context)
Citation Context ...is inspired by [19,6]. Final coalgebras in Kleisli categories were studied in [4]. 2 Introducing Effects into Syntax and Behaviour We recall the mathematical operational semantics of Turi and Plotkin =-=[23,24]-=- applied to multi-sorted syntax signatures in a category C S . In general, we assume that C is cartesian closed, with countable products and coproducts (ω-arities are needed for effects, e.g. the read... |

30 | Adequacy for algebraic effects
- Plotkin, Power
- 2001
(Show Context)
Citation Context ...gramme of mathematical operational semantics is well-suited to process-calculi-like languages, it is not yet clear how imperative languages, or indeed any language that produces computational effects =-=[14,15,5]-=-, can be treated adequately, and a number of difficulties present themselves. Firstly, giving an abstract operational semantics relies on syntax and behaviour being defined on the same category, where... |

29 | Combining effects: sum and tensor
- Hyland, Plotkin, et al.
(Show Context)
Citation Context ...gramme of mathematical operational semantics is well-suited to process-calculi-like languages, it is not yet clear how imperative languages, or indeed any language that produces computational effects =-=[14,15,5]-=-, can be treated adequately, and a number of difficulties present themselves. Firstly, giving an abstract operational semantics relies on syntax and behaviour being defined on the same category, where... |

18 | Trace semantics for coalgebras
- Jacobs
- 2004
(Show Context)
Citation Context ...for B in the Kleisli category suggests that the final Bcoalgebra in Kl(M), if it exists, is a natural candidate for program denotations. Standard results guaranteeing its existence are reviewed below =-=[21,4,7]-=-. Definition 2.12 A category C is Cppo-enriched if all hom-sets are complete partial orders with least element ⊥ and composition is ω-continuous in both arguments (g ◦ ⊔ n fn = ⊔ n (g ◦ fn) and simila... |

17 | Generic trace semantics via coinduction
- Hasuo, Jacobs, et al.
(Show Context)
Citation Context ...een extended into various directions [9,10], but effects have so far been elusive. Our treatment of computational effects is inspired by [19,6]. Final coalgebras in Kleisli categories were studied in =-=[4]-=-. 2 Introducing Effects into Syntax and Behaviour We recall the mathematical operational semantics of Turi and Plotkin [23,24] applied to multi-sorted syntax signatures in a category C S . In general,... |

14 | D.: A coalgebraic foundation for linear time semantics
- Power, Turi
- 1999
(Show Context)
Citation Context ...phism γ ′ : X → BX has underlying type γ : X → MBX, establishing the 1-1 correspondence between MB-coalgebras and B-coalgebras mentioned above. Liftings can be described in terms of distributive laws =-=[21,3]-=-: Lemma 2.11 There is a 1-1 correspondence between liftings B of B into Kl(M) and distributive laws λ : BM → MB. For B defined by sums and copowers (i.e. isomorphic to BX = V + A × X for some V, A), t... |

10 | Discrete lawvere theories and computational effects
- Hyland, Power
- 2006
(Show Context)
Citation Context ...]. The framework of abstract operational semantics itself has been extended into various directions [9,10], but effects have so far been elusive. Our treatment of computational effects is inspired by =-=[19,6]-=-. Final coalgebras in Kleisli categories were studied in [4]. 2 Introducing Effects into Syntax and Behaviour We recall the mathematical operational semantics of Turi and Plotkin [23,24] applied to mu... |

9 | Substitution in non-wellfounded syntax with variable binding. Theoretical Computer Science, 327:155–174, 2004. D. Petri¸san. Investigations into Algebra and Topology over Nominal Sets
- Matthes, Uustalu
- 2012
(Show Context)
Citation Context ...y define: Definition 2.14 For a countably-polynomial functor ˜ ∆ on C n , we define F ˜ ∆ to be the cofree ˜ ∆ + ⊥-coalgebra functor on C n where ⊥ ∼ = 1. F ˜ ∆ is indeed a monad (Theorems 2 and 4 of =-=[11]-=-), and is given component-wise by F∆: (F ˜ ∆ X)s = F∆(Xs). The objects F ˜ ∆ may be given the natural partial order structure. In Cppo, this structure appears as the initial ˜ ∆-algebra [2]. By contra... |

8 | Bialgebraic methods and modal logic in structural operational semantics
- Klin
- 2009
(Show Context)
Citation Context ...e would wish to reconcile this work with the co-algebraic treatment of operational semantics’ in [24]. The framework of abstract operational semantics itself has been extended into various directions =-=[9,10]-=-, but effects have so far been elusive. Our treatment of computational effects is inspired by [19,6]. Final coalgebras in Kleisli categories were studied in [4]. 2 Introducing Effects into Syntax and ... |

7 | A generic operational metatheory for algebraic effects
- Johann, Simpson, et al.
(Show Context)
Citation Context ...iscussion of comodels [16]. Related Work. Algebraic effects have been considered in [14] in the context of PCF, which has recently been extended to account for a larger class of operational phenomena =-=[8]-=-. Both papers are mainly operational, and indeed [14] concludes with the remark that ‘one would wish to reconcile this work with the co-algebraic treatment of operational semantics’ in [24]. The frame... |

7 | V.: Structural operational semantics for stochastic process calculi
- Klin, Sassone
- 2008
(Show Context)
Citation Context ...e would wish to reconcile this work with the co-algebraic treatment of operational semantics’ in [24]. The framework of abstract operational semantics itself has been extended into various directions =-=[9,10]-=-, but effects have so far been elusive. Our treatment of computational effects is inspired by [19,6]. Final coalgebras in Kleisli categories were studied in [4]. 2 Introducing Effects into Syntax and ... |

7 |
From comodels to coalgebras: State and arrays
- Power, Shkaravska
(Show Context)
Citation Context ...Another key question we did not have space to discuss is the relationship of the above semantics with comodels [16], which implement effects and are suitable for e.g. global state and interactive I/O =-=[20]-=-. However, they do not account for 23Abou-Saleh and Pattinson non-determinism, unless we exclude equations. By contrast, the conventional form of operational semantics for nondeterminism is obtained ... |

6 |
Tracing Anonymity with Coalgebras
- Hasuo
- 2010
(Show Context)
Citation Context ...way – e.g. the above identity becomes g ′ ◦ f ′ = (g† ◦ f) ′. We write J for the canonical (left-adjoint) inclusion functor C → Kl(M), identity-on-objects and sending f : X → Y to Jf = ηY ◦ f : X → Y =-=[3]-=-. One finds that g ′ ◦ Jf = (g ◦ f) ′ and Jf ◦ h ′ = (Mf ◦ h) ′. A ‘lifting’ B of the behaviour functor B into Kl(M) satisfies JB = BJ. In particular, this implies that B is identity-on-objects – so a... |

6 |
Enriched Lawvere theories. Theory and
- Power
(Show Context)
Citation Context ...y some aspects of program execution traces, such as the number of steps before termination; we do 2Abou-Saleh and Pattinson not do this here. We plan to address these points in future work following =-=[18]-=- along with more discussion of comodels [16]. Related Work. Algebraic effects have been considered in [14] in the context of PCF, which has recently been extended to account for a larger class of oper... |

4 | Tensors of comodels and models for operational semantics
- Plotkin, Power
(Show Context)
Citation Context ...such as the number of steps before termination; we do 2Abou-Saleh and Pattinson not do this here. We plan to address these points in future work following [18] along with more discussion of comodels =-=[16]-=-. Related Work. Algebraic effects have been considered in [14] in the context of PCF, which has recently been extended to account for a larger class of operational phenomena [8]. Both papers are mainl... |