On a Monadic Encoding of Continuous Behaviour

Similar documents
A [Monad-Based] Semantics for Hybrid Iteration

Bringing class diagrams to life

On a Categorical Framework for Coalgebraic Modal Logic

1. The Method of Coalgebra

Probability as Logic

A categorical view of computational effects

Higher Order Containers

Streams and Coalgebra Lecture 1

Relational Algebra for Just Good Enough Hardware

Preliminaries. Chapter 3

Coalgebraic Walks, in Quantum and Turing Computation

Games for topological fixpoint logics

Towards a Flowchart Diagrammatic Language for Monad-based Semantics

DEFINITIONS: OPERADS, ALGEBRAS AND MODULES. Let S be a symmetric monoidal category with product and unit object κ.

An Algebra of Hybrid Systems

A Coalgebraic Approach to Linear-Time Logics

Distributed transactions and reversibility

arxiv: v1 [cs.lo] 28 Nov 2017

Towards Operations on Operational Semantics

Mathematical Synthesis of Equational Deduction Systems. Marcelo Fiore. Computer Laboratory University of Cambridge

Topological Groupoids and Exponentiability

Monoidal Categories, Bialgebras, and Automata

A few bridges between operational and denotational semantics of programming languages

Duality in Probabilistic Automata

Connecting the categorical and the modal logic approaches to Quantum Mech

Recursion in Coalgebras

The formal theory of adjunctions, monads, algebras, and descent

Cellularity, composition, and morphisms of algebraic weak factorization systems

A Monad For Randomized Algorithms

Monads Need Not Be Endofunctors

A Coalgebraic Perspective on Logical Interpretations

Elements of Category Theory

A Linear/Producer/Consumer model of Classical Linear Logic

A categorical model for a quantum circuit description language

Lecture three: Automata and the algebra-coalgebra duality

Simulations in Coalgebra

Coalgebraic Lindström Theorems

Lax Extensions of Coalgebra Functors and Their Logic

From syntax to semantics of Dependent Type Theories - Formalized

Towards Trace Metrics via Functor Lifting

Category Theory. Categories. Definition.

Semantics for algebraic operations

On simulations and bisimulations of general flow systems

Coalg KPF : Towards a Coalgebraic Calculus for Component-Based Systems

A Differential Model Theory for Resource Lambda Calculi - Part I

Categories and Functors (Lecture Notes for Midlands Graduate School, 2013) Uday S. Reddy The University of Birmingham

Neighborhood Semantics for Modal Logic Lecture 5

A unifying model of variables and names

Uniform Schemata for Proof Rules

Semantics and syntax of higher inductive types

COMMUTATIVE ALGEBRA LECTURE 1: SOME CATEGORY THEORY

Relational Algebra by Way of Adjunctions. Jeremy Gibbons (joint work with Fritz Henglein, Ralf Hinze, Nicolas Wu) DBPL, October 2015

QPEL Quantum Program and Effect Language

Partially ordered monads and powerset Kleene algebras

Generic trace semantics via coinduction

Logical connections in the many-sorted setting

Streams and Coalgebra Lecture 2

Secondly, a loose semantics for graph transformation systems is dened, which

Homological Algebra and Differential Linear Logic

via Topos Theory Olivia Caramello University of Cambridge The unification of Mathematics via Topos Theory Olivia Caramello

sset(x, Y ) n = sset(x [n], Y ).

Bisimulation for Neighbourhood Structures

arxiv:math/ v1 [math.ct] 1 Apr 2004

About permutation algebras, (pre)sheaves and named sets

In the beginning God created tensor... as a picture

Quotients of Fully Nonlinear Control Systems

Duality in Logic and Computation

TOPOSES ARE SYMMETRIC MONOIDAL CLOSED CATEGORIES

Locally cartesian closed categories

ON EXTENSIONS OF LAX MONADS

Denoting computation

The equivalence axiom and univalent models of type theory.

PDF hosted at the Radboud Repository of the Radboud University Nijmegen

Introduction to Coalgebra

Spectra and the Stable Homotopy Category

6 Coalgebraic modalities via predicate liftings

Context-Free Languages, Coalgebraically

Operads. Spencer Liang. March 10, 2015

Weighted automata coalgebraically

Affine Monads and Side-Effect-Freeness


An adjoint construction for topological models of intuitionistic modal logic Extended abstract

HOMOTOPY THEORY OF MODULES OVER OPERADS AND NON-Σ OPERADS IN MONOIDAL MODEL CATEGORIES

Automata and minimization 1

Bayes Nets. CS 188: Artificial Intelligence Fall Example: Alarm Network. Bayes Net Semantics. Building the (Entire) Joint. Size of a Bayes Net

Kleisli Category and Database Mappings

Logic As A Tool For Building Theories

Exponentiable functors between quantaloid-enriched categories

OVERVIEW OF SPECTRA. Contents

Stream automata are coalgebras

Conceptual Connections of Circularity and Category Theory

DRAFT DRAFT. Introduction to Coalgebra. Towards Mathematics of States and Observations. Bart Jacobs. Draft Copy.

Lecture 15: Duality. Next we spell out the answer to Exercise It is part of the definition of a TQFT.

Quantum Groups. Jesse Frohlich. September 18, 2018

NOTES ON ADJUNCTIONS, MONADS AND LAWVERE THEORIES. 1. Adjunctions

Vietoris bisimulations

Applications of 2-categorical algebra to the theory of operads. Mark Weber

Teooriaseminar. TTÜ Küberneetika Instituut. May 10, Categorical Models. for Two Intuitionistic Modal Logics. Wolfgang Jeltsch.

A note on coinduction and weak bisimilarity for while programs

A Coalgebraic Approach to Bidirectional Transformations

Transcription:

On a Monadic Encoding of Continuous Behaviour Renato Neves joint work with: Luís Barbosa, Manuel Martins, Dirk Hofmann INESC TEC (HASLab) & Universidade do Minho October 1, 2015 1 / 27

The main goal A coalgebraic calculus of hybrid components. 2 / 27

Motivation & Context Hybrid systems possess both discrete and continuous behaviour. A discrete evolution A continuous evolution 4 3 2 1 4 3 2 1 1 2 3 4 5 6 Time 1 2 3 4 5 6 Time They are often complex but can be seen as the composition of (simpler) components. 3 / 27

Motivation & Context Hybrid systems possess both discrete and continuous behaviour. A discrete evolution A continuous evolution 4 3 2 1 4 3 2 1 1 2 3 4 5 6 Time 1 2 3 4 5 6 Time They are often complex but can be seen as the composition of (simpler) components. 3 / 27

Motivation & Context Hybrid systems possess both discrete and continuous behaviour. A discrete evolution A continuous evolution 4 3 2 1 4 3 2 1 1 2 3 4 5 6 Time 1 2 3 4 5 6 Time They are often complex but can be seen as the composition of (simpler) components. 3 / 27

Thermostat 22 A possible behaviour (c 10) 20 18 y 16 14 12 10 0 2 4 6 8 10 x 4 / 27

Water level regulator 25 A possible behaviour (d 0) 20 15 y 10 5 0 0 10 20 30 40 50 60 x 5 / 27

Hybrid components (coalgebraically) Arrows of type S I S HO where S I S defines the internal (discrete) transitions and S I HO the observable (continuous) behaviour. This favours a coalgebraic perspective! 6 / 27

Hybrid components (coalgebraically) Arrows of type S I S HO where S I S defines the internal (discrete) transitions and S I HO the observable (continuous) behaviour. This favours a coalgebraic perspective! 6 / 27

Coalgebras & Hybrid systems (related work) Object oriented hybrid systems of coalgebras plus monoid actions [Jacobs, 2000]. A coalgebra for the (discrete) assignments, a monoid for the (continuous) evolutions. Notions of bisimulation for hybrid systems (resort to open maps) [Haghverdi et al., 2005]. 7 / 27

Coalgebras & Hybrid systems (related work) Object oriented hybrid systems of coalgebras plus monoid actions [Jacobs, 2000]. A coalgebra for the (discrete) assignments, a monoid for the (continuous) evolutions. Notions of bisimulation for hybrid systems (resort to open maps) [Haghverdi et al., 2005]. 7 / 27

Components as coalgebras We view a component as s S, c : S I B(S O) where B is a (strong) monad that captures a specific type of behaviour [Barbosa, 2001]. [Barbosa, 2001] shows how to generate a rich component algebra from a strong monad. 8 / 27

Motivation & Context Different monads capture different types of behaviour...... and thus different kinds of component Maybe monad (M) faulty components Powerset monad (P) non deterministic components Distribution monad (D) probabilistic components Hybrid monad (H) hybrid components 9 / 27

Motivation & Context Different monads capture different types of behaviour...... and thus different kinds of component Maybe monad (M) faulty components Powerset monad (P) non deterministic components Distribution monad (D) probabilistic components Hybrid monad (H) hybrid components 9 / 27

Motivation & Context Different monads capture different types of behaviour...... and thus different kinds of component Maybe monad (M) faulty components Powerset monad (P) non deterministic components Distribution monad (D) probabilistic components Hybrid monad (H) hybrid components 9 / 27

Motivation & Context Different monads capture different types of behaviour...... and thus different kinds of component Maybe monad (M) faulty components Powerset monad (P) non deterministic components Distribution monad (D) probabilistic components Hybrid monad (H) hybrid components 9 / 27

Motivation & Context Different monads capture different types of behaviour...... and thus different kinds of component Maybe monad (M) faulty components Powerset monad (P) non deterministic components Distribution monad (D) probabilistic components Hybrid monad (H) hybrid components 9 / 27

Monad H It is defined in such a way that c : S I S HO c : S I S (O T D) unfold H where T = R 0 and D = [0, ]. Kleisli composition allows the transfer of evolution control between components. Technically, this amounts to concatenation of evolutions. 10 / 27

Monad H It is defined in such a way that c : S I S HO c : S I S (O T D) unfold H where T = R 0 and D = [0, ]. Kleisli composition allows the transfer of evolution control between components. Technically, this amounts to concatenation of evolutions. 10 / 27

Kleisli composition (thermostat revisited) c 1 i = ( λt.(i + t), 10 ), c 2 i = ( λt.(i + sin t), ) 25 c 2 c 1 10 20 y 15 10 0 5 10 15 20 25 30 x 11 / 27

Kleisli composition (thermostat revisited) c 1 i = ( λt.(i + t), 10 ), c 2 i = ( λt.(i + sin t), ) 25 c 2 c 1 10 20 y 15 10 0 5 10 15 20 25 30 x 11 / 27

Monad H and Höfner s Algebra Kleisli composition of Monad H corresponds to concatenation of evolutions in An algebra of hybrid systems [Höfner, 2009] Concatenation of evolutions 3 2 1 1 2 3 4 5 6 Time 12 / 27

Assembly of monad H (underlying functor) Based upon the category of topological spaces Top. Definition Given a space X Top, HX = { (f, d) X T D f d = f } where d = id d d. Definition Given a continuous function g : X Y, Hg : HX HY, Hg = g T id Intuitively, Hg alters evolutions pointwise (but keeps durations). 13 / 27

Assembly of monad H (underlying functor) Based upon the category of topological spaces Top. Definition Given a space X Top, HX = { (f, d) X T D f d = f } where d = id d d. Definition Given a continuous function g : X Y, Hg : HX HY, Hg = g T id Intuitively, Hg alters evolutions pointwise (but keeps durations). 13 / 27

Assembly of monad H (underlying functor) Based upon the category of topological spaces Top. Definition Given a space X Top, HX = { (f, d) X T D f d = f } where d = id d d. Definition Given a continuous function g : X Y, Hg : HX HY, Hg = g T id Intuitively, Hg alters evolutions pointwise (but keeps durations). 13 / 27

Assembly of monad H (underlying functor) An interesting algebra HX θ X θ (f, d) = f 0 14 / 27

Assembly of Monad H (monad operations) Id HH η H µ Definition Given a space X Top, η X x = (x, 0) Defines the simplest continuous system of type X HX. 15 / 27

Assembly of Monad H (monad operations) Id HH η H µ Definition Given a space X Top,... µ X (f, d) = (θ f, d) ++ (f d) 16 / 27

Assembly of Monad H (monad operations) Let us reason HHX (HX) T D (HX) T (X T D) T = (X T ) T D T (X T ) T = X T T 17 / 27

Kleisli category Top H (An environment to study the effects of continuity over composition) Top H = Top, for any objects I, O Top H, Top H (I, O) = Top(I, HO) the identity of I is η I, and given two arrows c 1 : I HK, c 2 : K HO their (sequential) composition, is equal to c 2 c 1 : I HO µ Hc 2 c 1 18 / 27

Kleisli composition (of Top H ) I c 1 HK Hc 2 HHO µ HO 4 c1 0 y 3 2 Hc 2 1 0 0 0.5 1 1.5 2 2.5 3 x 19 / 27

Other forms of composition (in Top H ) Choice (coproduct) c 1 : I 1 HO, c 2 : I 2 HO [c 1, c 2 ] : I 1 + I 2 HO (+) Parallelism (pullback) c 1 : I HO 1, c 2 : I HO 2 c 1, c 2 : I H(O 1 O 2 ) ( ) These operators are (co)limits, hence a number of useful laws come for free! 20 / 27

Other forms of composition (in Top H ) Choice (coproduct) c 1 : I 1 HO, c 2 : I 2 HO [c 1, c 2 ] : I 1 + I 2 HO (+) Parallelism (pullback) c 1 : I HO 1, c 2 : I HO 2 c 1, c 2 : I H(O 1 O 2 ) ( ) These operators are (co)limits, hence a number of useful laws come for free! 20 / 27

Other forms of composition (in Top H ) Choice (coproduct) c 1 : I 1 HO, c 2 : I 2 HO [c 1, c 2 ] : I 1 + I 2 HO (+) Parallelism (pullback) c 1 : I HO 1, c 2 : I HO 2 c 1, c 2 : I H(O 1 O 2 ) ( ) These operators are (co)limits, hence a number of useful laws come for free! 20 / 27

Other forms of composition (in Top H ) Synchronised parallelism c 1 : I HO 1, c 2 : I HO 2 c 1, c 2 : I H(O 1 O 2 ) (s) Feedback c : I HI νc : I HI (ν) 21 / 27

Other forms of composition (in Top H ) Synchronised parallelism c 1 : I HO 1, c 2 : I HO 2 c 1, c 2 : I H(O 1 O 2 ) (s) Feedback c : I HI νc : I HI (ν) 21 / 27

Top H (Parallelism) c 1 x = (λt. x + (sin t), 20 ) c 2 x = (λt. x + (sin(3 t)), 20 ) c 1, c 2 0 2 y 0 2 0 5 10 15 20 x 22 / 27

Top H (Parallelism) c 1 x = (λt. x + (sin t), 20 ) c 2 x = (λt. x + (sin(3 t)), 20 ) c 1, c 2 0 2 y 0 2 0 5 10 15 20 x 22 / 27

Top H (Parallelism) c 3 (x, y) = (λt. x + y, 0) c 3 c 1, c 2 0 2 y 0 2 0 5 10 15 20 x 23 / 27

Top H (Parallelism) c 3 (x, y) = (λt. x + y, 0) c 3 c 1, c 2 0 2 y 0 2 0 5 10 15 20 x 23 / 27

Conclusions Our goal is a coalgebraic calculus of hybrid components and monad H seems to be a promising approach for this. But mind Simulink, widely used in industry, and Hybrid automata, the standard formalism for the specification of hybrid systems. The former is highly expressive, but lacks a clear semantics. The latter is very intuitive, but does not have composition mechanisms as rich as Simulink. 24 / 27

Conclusions Our goal is a coalgebraic calculus of hybrid components and monad H seems to be a promising approach for this. But mind Simulink, widely used in industry, and Hybrid automata, the standard formalism for the specification of hybrid systems. The former is highly expressive, but lacks a clear semantics. The latter is very intuitive, but does not have composition mechanisms as rich as Simulink. 24 / 27

Conclusions Our goal is a coalgebraic calculus of hybrid components and monad H seems to be a promising approach for this. But mind Simulink, widely used in industry, and Hybrid automata, the standard formalism for the specification of hybrid systems. The former is highly expressive, but lacks a clear semantics. The latter is very intuitive, but does not have composition mechanisms as rich as Simulink. 24 / 27

Future work Introduction of non determinism. Development of a calculus bisimulation based. Try to answer the question: Which kind of logics does monad H gives rise to? 25 / 27

Future work Introduction of non determinism. Development of a calculus bisimulation based. Try to answer the question: Which kind of logics does monad H gives rise to? 25 / 27

Future work Introduction of non determinism. Development of a calculus bisimulation based. Try to answer the question: Which kind of logics does monad H gives rise to? 25 / 27

References I Barbosa, L. S. (2001). Components as coalgebras. PhD thesis, DI, Minho University. Haghverdi, E., Tabuada, P., and Pappas, G. J. (2005). Bisimulation relations for dynamical, control, and hybrid systems. Theoretical Computer Science, 342(2 3):229 261. Höfner, P. (2009). Algebraic calculi for hybrid systems. PhD thesis, University of Augsburg. 26 / 27

References II Jacobs, B. (2000). Object-oriented hybrid systems of coalgebras plus monoid actions. Theoretical Computer Science, 239(1):41 95. 27 / 27