tcalculus-1.0.0: A DSL prototype for structured realtime/reactive functional programing

Copyright(c) David Janin, 2016
Licensesee the LICENSE file in the distribution
Maintainerjanin@labri.fr
Stabilityexperimental
Safe HaskellSafe
LanguageHaskell2010

Docs.Additive

Contents

Description

Sum, negation and few axioms from inverse semigroup theory.

Synopsis

The additive monoid of tiles

temporal values

b0 :: Tile Integer Char Char Source #

A basic atomic tile (temporal value):

b0 = fromDurationAndValueT 3 a

It can be depicted by

with duration d=3 and value v=a.

Delay

b1 :: Tile Integer Char Char Source #

A basic delay tile:

b1 = fromDurationT 3

It can be depicted by

with duration d=3. Forgeting values is handled by the delayT functions with

b1 == delayT b0

Sum

b2 :: Tile Integer Char Char Source #

The sum of two tiles amounts to merge the output root of the first one with the inoput root of the second.

b2 = x + y

It can be depicted by

with x = fromDurationAndValueT 3 a and y = fromDurationAndValueT 2 b.

Property: function delayT is functorial over sum:

delayT (x+y) == delayT x + delayT y

Negation

b3 :: Tile Integer Char Char Source #

The negation of a tile amounts to flip input and ouput roots.

b3 = -x

It can be depicted by

with x = fromDurationAndValueT 3 a.

Property: the negation distributes over sums reversing it.

- (x+y) == - y - x

Difference

b4 :: Tile Integer Char Char Source #

The induced difference x - y defined as x + (-y).

b4 = x - y

It can be depicted by

Property : delayT is also functorial with respect to difference

delayT (x - y) == delayT x - delayT y

Spatio-temporal resulting zigzags

b5 :: Tile Integer Char Char Source #

Temporal zigzag as a more general structure

b5 = x1 - x2 + x3 -x4 

It can be depicted by

with x1 = fromDurationAndValueT 3 a, x2 = fromDurationAndValueT 5 b, x3 = fromDurationAndValueT 7 c and x4 = fromDurationAndValueT 3 d

Semigroup inverse

b6 :: Tile Integer Char Char Source #

Merging parallel temporal values

b6 = x - x + x

Both x and x - x + x are depicted by

and we have

x == x - x + x

Idempotent tiles

b7 :: Tile Integer Char Char Source #

The coreset co[x] of a tile x is obtained by moving its input root to its ouput root. Dually, the reset re[y] of a tile is otained by moving its ouput root to its input root.

b7 = co[x] + re[y]

When input and out roots coincides, as in co[x] or re[y], elements are idempotents.

and we have:

re[x] == x - x  and  x == re[x] + x
co[y] == -y + y  and  y == y + co[y]