<!DOCTYPE article PUBLIC "-//NLM//DTD JATS (Z39.96) Journal Archiving and Interchange DTD v1.0 20120330//EN" "JATS-archivearticle1.dtd">
<article xmlns:xlink="http://www.w3.org/1999/xlink">
  <front>
    <journal-meta />
    <article-meta>
      <title-group>
        <article-title>Higher-Order Causal Stream Functions in Sig from First Principles</article-title>
      </title-group>
      <contrib-group>
        <contrib contrib-type="author">
          <string-name>Baltasar Trancón y Widemann</string-name>
          <xref ref-type="aff" rid="aff0">0</xref>
        </contrib>
        <contrib contrib-type="author">
          <string-name>Markus Lepper</string-name>
          <xref ref-type="aff" rid="aff0">0</xref>
        </contrib>
        <aff id="aff0">
          <label>0</label>
          <institution>semantics GmbH Berlin</institution>
        </aff>
      </contrib-group>
      <fpage>25</fpage>
      <lpage>39</lpage>
      <abstract>
        <p>The Sig programming language is a total functional, clocked synchronous data-flow language. Its core has been designed to admit concise coalgebraic semantics. Universal coalgebra is an expressive theoretical framework for behavioral semantics, but traditionally phrased in abstract categorical language, and generally considered inaccessible. In the present paper, we rephrase the coalgebraic concepts relevant for the Sig language semantics in basic mathematical notation. We demonstrate how the language features characteristic of its paradigms, namely sequential and parallel composition for applicative style, delay for data flow, and apply for higher-order functional programming, are shaped naturally by the semantic structure. Thus the present paper serves two purposes, as a gentle, self-contained and applied introduction to coalgebraic semantics, and as an explication of the Sig core language denotational and operational design.</p>
      </abstract>
    </article-meta>
  </front>
  <body>
    <sec id="sec-1">
      <title>1 Technische Universität Ilmenau 2 semantics GmbH Berlin</title>
      <sec id="sec-1-1">
        <title>Introduction</title>
        <p>
          We introduce concepts of universal coalgebra as we go. Statements that have been specialized for the present
discussion are marked with asterisks. For a more comprehensive exposition, see [
          <xref ref-type="bibr" rid="ref14">14</xref>
          ]. The material is organized
into progressive sections which discuss streams, stream transformers, composition of stream transformers, delay,
and higher order function application, respectively. Section 2 also summarizes the basic working tools of the
colgebraic framework. These are completely standard as in [
          <xref ref-type="bibr" rid="ref14">14</xref>
          ], but contrarily to present custom, we spell them
out in non-categorical language, and add novel and domain-specific examples. By analogy, the content of sections
3 and 4 is rephrased from [
          <xref ref-type="bibr" rid="ref14">14</xref>
          ] and our own theoretical work [
          <xref ref-type="bibr" rid="ref17">17</xref>
          ].
        </p>
        <p>
          Since the present discussion is focused on calculation of operational semantics and space is limited, the
frontend features and usage of the Sig language will be mentioned only in passing. We point to our recent work [
          <xref ref-type="bibr" rid="ref18 ref19">18,
19</xref>
          ] for detailed discussions.
2
        </p>
      </sec>
      <sec id="sec-1-2">
        <title>Zeroth Order: Streams</title>
        <p>Definition* 2.1 (Functor). A functor 1 F is a pair of homonymous constructions: One that assigns to each set
X a set F (X), and another that assigns to each map f : X → Y a map F (f ) : F (X) → F (Y ).2
Definition 2.2 (Stream Functor). Fix some nonempty set A and consider the Cartesian pairing operator
SA(X) = A × X. It can be extended to a functor, acting on maps as:</p>
        <p>SA(f )(a, x) = a, f (x)</p>
        <p>For any functor F , we can define the concepts of mathematical structures called F -coalgebras and their
homomorphisms, or structure-preserving maps.</p>
        <p>Definition* 2.3 (Coalgebra). An F -coalgebra is a structure (X, f ), where the set X is called the carrier, and
the map f : X → F (X) is called the operation.</p>
        <p>Definition 2.4 (Stream Coalgebra Operation). Concretely, the SA-coalgebras are structures (X, f : X → A×X).
Usually it is more convenient to decompose the pair-valued map f equivalently as f0 : X → A and f+ : X → X
with:</p>
        <p>f (x) = f0(x), f+(x)
Algorithm 2.5. The SA-coalgebras are formal representations of enumeration procedures: The carrier X is
the state space, and the operation components f0 and f+ specify, for each state, the output element from A
and transition to the next state, respectively. Such a procedure is naturally executed by starting from an initial
state x0, and collecting the outputs an = f0(xn) from successive states xn+1 = f+(xn), as an infinite stream. In
pseudocode:
exec(f0, f+)(x0):
var x := x0
forever
yield f0(x)
x := f+(x)
Example 2.6. The default textbook example of a stream enumeration procedure is the iterative Fibonacci
algorithm:</p>
        <p>A = N</p>
        <p>X = N2
fib0(a, b) = b
fib+(a, b) = (a + b, a)
Its state is the pair of the next and current Fibonacci number, respectively.</p>
        <p>Example 2.7. A procedure that is related in a non-obvious mathematical way, to be explained later in (2.19), is
the following coalgebra,</p>
        <p>A = R</p>
        <p>X = N</p>
        <p>ϕn
bif 0(n) = √
5
where ϕ =
1 + √5
2
bif +(n) = n + 1
which has simply a sequence index as its state, and thus qualifies as a closed-form generator; the projection bif 0
specifies each element of the sequence directly.</p>
        <p>1More precisely a Set-endofunctor, but no other kind is considered here.
2Functors are also required to preserve identity maps and compositions, but that is irrelevant for the present discussion.</p>
        <p>Generating streams coalgebraically goes beyond the power of classical recursive sequence definitions; the state
may contain relevant information that is not available from the observable output. Typical examples that exhibit
this feature are pseudorandom number generators.</p>
        <p>
          Example 2.8. The family of Marsaglia’s four-word xorshift random number generators [
          <xref ref-type="bibr" rid="ref8">8</xref>
          ] is specified in
coalgebraic form as
        </p>
        <p>A = 2`</p>
        <p>X = (2`)4
xsr 0(x, y, z, w) = r
xsr +(x, y, z, w) = (y, z, w, r)
where r = (x ⇐ a ⇒ b) ⊕ (w ⇒ c)
where ` is integer word length, a, b, c are small integer constants from a table of recommendations, ⊕ is bitwise
exclusive or, and the characteristic operations are combinations of exclusive or and bit shifts:
(n ⇒ k) = n ⊕ (n
k)
(n ⇐ k) = n ⊕ (n
k)</p>
        <p>So far, we have argued only operationally what the given examples mean. But one can do much better in the
coalgebraic framework. The intuitive execution model from (2.5) can be given a formal foundation.
Definition* 2.10 (Homomorphism). Let (X, f ) and (Y, g) be F -coalgebras. A map h : X → Y is a
homomorphism from (X, f ) to (Y, g) if and only if:</p>
        <p>g(h(x)) = F (h)(f (x))
Proposition 2.11. For SA-coalgebras the homomorphism property for h from (X, f ) to (Y, g) simplifies to:
g0 h(x) = f0(x)
g+ h(x) = h f+(x)</p>
        <p>The SA-coalgebra homomorphisms map computations by one enumeration procedure to equivalent
computations by another procedure. The coalgebra (Aω, outA) is special, firstly in the sense that it abstracts from any
actual computation by reading elements from a stream that is assumed to be given beforehands, and secondly
due to the fact that it admits a particular map from any other SA-coalgebra.</p>
        <p>Proposition 2.12. Let (X, f ) be an SA-coalgebra. Then there is a map:
[(f )] : X → Aω
[(f )](x)n = f0 f+n(x)
Proposition 2.13. The homomorphism property (2.11) specializes for [(f )] to:
headA [(f )](x) = f0(x)
tailA [(f )](x) = [(f )] f+(x)
It is easy to see that [(f )] is indeed a homomorphism.</p>
        <p>Proof.</p>
        <p>headA [(f )](x) = [(f )](x)0
Proposition 2.14. The two equations of (2.13) can be combined – the recursive equivalent of the closed form
(2.12), and declarative equivalent of imperative algorithm (2.5):</p>
        <p>The homomorphism [(f )] : X → Aω gives the intended denotational semantics of the pseudocode (2.5), mapping
each initial state to the stream of ensuing outputs. It is natural in the sense that it is the unique homomorphism
of its type.</p>
        <p>Proposition 2.15. Any homomorphism h : X → Aω between SA-coalgebras (X, f ) and (Aω, outA), that is each
map of that type satisfying (2.11), is in fact equivalent to (2.12).</p>
        <p>Proof. By induction in n, with induction hypothesis IH: h(x)n = f0 f+n(x) .</p>
        <p>h(x)0 = headA h(x)
h(x)n+1 = tailA h(x) n</p>
        <p>Definition* 2.16. An F -coalgebra (Y, g) is called final if and only if there is a unique homomorphism from any
other F -coalgebra (X, f ).</p>
        <p>Proposition* 2.17. Final F -coalgebras are essentially unique; any pair of them is connected by a unique bijective
homomorphism.</p>
        <p>
          In that terminology, streams are “the” final SA-coalgebra, and the final semantics of enumeration algorithms.
It has several nice properties, of which we can state only the first in terms of the framework established so far.
Remark 2.18. The uniqueness proof given above concisely embodies the relationship of the coalgebraic approach
to streams to traditional index-subscript-based notations: The proof is the only invocation of the induction
principle necessary, and only at the meta level. It establishes a coinductive definition principle: any small-step
behavior map f : X → A × X gives rise to a unique big-step behavior map [(f )] : X → Aω. Note that in
coinduction, foundation via terminating base cases is neither required nor particularly useful.
Example 2.19. Now we can state the intended use and precise meaning of the above examples.
• The standard Fibonacci sequence is obtained from (2.6) as [(fib)](1, 0).
• A near-Fibonacci sequence is obtained from (2.7) as [(bif )](0). It has the funny property that rounding
[(bif )](0)n yields [(f ib)](1, 0)n, which can be derived from Binet’s formula.
• A stream of reasonably random-looking integer words (that pass standard statistical tests [
          <xref ref-type="bibr" rid="ref8">8</xref>
          ]) is obtained
from (2.8) by applying [(xsr )] to four seed values.
        </p>
        <p>
          In this section, we have introduced the concepts of stream spaces as final coalgebras, and of coinductively
defined streams (as a generalization of classical recursively defined sequences) as the corresponding unique
homomorphisms. This idea is well established, see for instance [
          <xref ref-type="bibr" rid="ref7">7</xref>
          ]. So far, the benefits of the theoretical framework
are rather modest. Straightforward intuitions are confirmed, but little further insight is produced. Things shall
get more illuminating now, when input is added.
3
        </p>
      </sec>
      <sec id="sec-1-3">
        <title>First Order: Stream Transforms</title>
        <p>Definition 3.1. Fix some nonempty sets A and B, and consider the functor:</p>
        <p>TAB(X) = (A → B × X)</p>
        <p>TAB(f )(k)(a) = b, f (x)</p>
        <p>where k(a) = (b, x)</p>
        <p>Algorithmically, the TAB-coalgebras represent the category of Mealy-type stream transducers. Their
operations f : X → A → B × X, by Currying equivalent to f : X × A → B × X,3 specify the output element
from B and transition to next state, given the current state and input element from A. Again, it is
sometimes convenient to consider instead the component maps f0 : X → A → B and f+ : X → A → X, with
f (x)(a) = f0(x)(a), f+(x)(a) .</p>
        <p>Proposition 3.2. For TAB-coalgebras the homomorphism property for h from (X, f ) and (Y, g) simplifies to:
g0 h(x) (a) = f0(x)(a)
g+ h(x) (a) = h f+(x)(a)
Algorithm 3.3. Execution yields the transformed output stream as a synchronous function of the input stream:
exec(f0, f+)(x0):
var x := x0
forever
var a := receive
yield f0(x)(a)
x := f+(x)(a)
Example 3.4. The following two similar coalgebra operations compute the (cumulative) sum and the (backward)
difference transform of a stream of numbers, respectively.</p>
        <p>A = R</p>
        <p>B = R</p>
        <p>X = R
sum0(x, a) = a + x
dif 0(x, a) = a − x
sum+(x, a) = a + x
dif +(x, a) = a</p>
        <p>However, there is a catch; the general function space Aω → Bω is too large to be the adequate semantic
domain! Namely, it turns out that for a suitable TAB-coalgebra operation f , we would have to give a component
of type f0 : (Aω → Bω) → A → B, which is not meaningful generically, without additional knowledge of A
and B. On second thought, the TAB-coalgebras specify sequential elementwise computation on streams, and
the internal state X can be used to transport information forwards in time, but not backwards. As a result,
all stream transforms implemented by TAB-coalgebras have the property of causality: output up to each step is
determined by input only up to the same step.</p>
        <p>Definition 3.5 (Causality). Let α&lt;n denote the sequence of the first n elements of the infinite stream α. Then
we can define the space of causal stream functions:</p>
        <p>A ω B = {k : Aω → Bω | ∀ n. α&lt;n = α&lt;0n =⇒ k(α)&lt;n = k(α0)&lt;n}</p>
        <p>
          The space of causal stream functions can be endowed with a TAB-coalgebra operation, by a not entirely trivial
construction [
          <xref ref-type="bibr" rid="ref17">17</xref>
          ].
        </p>
        <p>Proposition 3.6. For all k : A ω B we have in particular, at the first step:</p>
        <p>headA(α) = headA(α0) =⇒ headB k(α) = headB k(α0)
Proposition 3.7. The previous property ensures that there is a generic map satisfying
headAB : (A ω B) → A → B
headAB(k) headA(α) = headB k(α)
with no reference to particular elements of A or B.</p>
        <p>Definition 3.8. Now consider a related map defined by the equation:</p>
        <p>tailAB(k)(a0)(α) = tailB k(a0 ; α)
Proposition 3.9. This map can be specified in analogy to (3.7):
tailAB : (A ω B) → A → (A ω B)</p>
        <p>tailAB(k) headA(α) tailA(α) = tailB k(α)
3We denote both the currying and uncurrying operations by overlining.
Proposition 3.10. The pair of equations (3.7), (3.9) can be combined equivalently:</p>
        <p>k(a0 ; α) = headAB(k)(a0) ; tailAB(k)(a0)(α)</p>
        <p>The causal function space A ω B admits a TAB-coalgebra operation t, namely t0 = headAB and t+ = tailAB.
This is again a final TAB-coalgebra: from any other TAB-coalgebra (X, f ) there is a unique homomorphism [(f )],
which however can not be written down in closed form quite as neatly as in (2.12).</p>
        <p>Definition 3.11. Let (X, f ) be a TAB-coalgebra. Then there is a map:
[(f )] : X → (A ω B)</p>
        <p>[(f )](x)(α)n = f0 f+ . . . f+(x)(α0) . . . (αn−1) (αn)</p>
        <p>
          This makes the causality property explicit: the n-th element of [(f )](x)(α) makes only use of up to the n-th
element of the given, infinite input stream α. Causal stream computations are particularly well-behaved in
online, reactive or real-time context: Assume that the elements of input are being made available at successive
points in time. Once the first n elements have been obtained, the n-th output element can be computed, with
a latency that depends only on the computation itself and can be determined by standard worst-case execution
time analyses, but not on the environment. Thus productiveness (elementwise termination, [
          <xref ref-type="bibr" rid="ref15">15</xref>
          ]) of computations
becomes a local property.
        </p>
        <p>Proposition 3.12. The homomorphism property (3.2) specializes for the final case to:
headAB [(f )](x) (a0) = f0(x)(a0)</p>
        <p>tailAB [(f )](x) (a0)(α) = [(f )] f+(x)(a0) (α)</p>
        <p>The proof of validity and uniqueness of [(f )] is completely analogous to the SA-case; refer to (2.13) and (2.15),
respectively.</p>
        <p>Proposition 3.13. Specialization of (3.10) with k = [(f )](x) and (3.12) gives the recursive equivalent of the
closed form (3.11):</p>
        <p>[(f )](x)(a0 ; α) = f0(x)(a0) ; [(f )] f+(x)(a0) (α)
Algorithm 3.14. The following literal translation into Haskell syntax is a valid and useful, purely functional
program:
trans :: (x -&gt; a -&gt; (b, x)) -&gt; x -&gt; [a] -&gt; [b]
trans f x (a0 : as) = f0 x a0 : trans f (fp x a0) as
where f0 x a = fst (f x a)</p>
        <p>fp x a = snd (f x a)
Example 3.15. The stream transforms of (3.4) have the desired semantics:</p>
        <p>n
[(sum)](c)(α)n = c + X αi
i=0
[(dif )](d)(α)0</p>
        <p>= α0 − d
[(dif )](d)(α)n+1 = αn+1 − αn
that is
[(dif )](d)(α)n = αn − (d ; α)n
Remark 3.16. The forward difference transform, ∇(α)n = αn − αn+1, is not causal.</p>
        <p>
          In this section, we have introduced coinductively defined, causal stream transformers as a coalgebraic
perspective on Mealy automata, in strong analogy to plain coinductive streams. The coalgebraic approach suggests a
head–tail structure for transformers, which has incidentally also been exploited for continuation-based functional
reactive programming [
          <xref ref-type="bibr" rid="ref10">10</xref>
          ].
        </p>
        <p>The closed-form notation which has worked well for coinductive streams breaks down in the transformer
case. This is quite typical for coalgebraic structures, which are often ill-suited to classical syntax-oriented formal
representation, and therefore usually phrased in the more abstract language of category theory.</p>
        <sec id="sec-1-3-1">
          <title>I/O (public)</title>
        </sec>
        <sec id="sec-1-3-2">
          <title>State (private)</title>
          <p>The uncurried, quaternary form of TAB-coalgebra operations, r : X × A → B × X, henceforth abbreviated to</p>
          <p>
            X
r : A −→ B, plays a central role in the semantics of the Sig language. Any data-flow network definition in Sig is
brought to this canonical operational form via a series of program transformations described in [
            <xref ref-type="bibr" rid="ref17">17</xref>
            ]. The same
form also suggests a visual, quadrilateral presentation, as illustrated in Figure 1. The dichotomy of public I/O
and private state suggests an object-oriented approach to execution.4 Alluding to the visual form, and for lack
X
of a more fitting name, we shall call the elements of a function space A −→ B quadrilaterals.
Algorithm 4.1. Execution is reified as objects that consume one input element and produce one output element
on each synchronous call of a public method. Control is transferred back after each element; the stream is held
together by side-effect updates on the private state. The missing pieces r0, r+, x0 are modeled as abstract
methods.
          </p>
          <p>class quad:
private var x := x0()
step(a):
var b
(b, x) := r(x, a)
return b
abstract x0()
abstract r(x, a)
X
Definition 4.2. The denotational semantics [[r ` x]] of a quadrilateral form r : A −→ B with initial state x is
given by (homomorphisms to) the final TAB-coalgebra.</p>
          <p>[[r ` x]] = [(r)](x)
Proposition 4.3. The unique homomorphism for these semantics from (3.12) is specified by:
headAB [[r ` x]] (a0) = r0(x, a0)
tailAB [[r ` x]] (a0) = [[r ` r+(x, a0)]]</p>
          <p>Semantically, stream functions can be composed meaningfully along several axes, namely parallel and
(data)sequential.</p>
          <p>Definition 4.4. Parallel and sequential composition of stream functions are defined in the obvious way:
k : A ω B
k ⊗ l : A × C
l : C ω D
ω</p>
          <p>B × D
k : A ω B
l : B</p>
          <p>ω C
l ◦ k : A ω C
(k ⊗ l)(α, γ)n = k(α)n, l(γ)n
(l ◦ k)(α)n = l k(α) n
Proposition 4.5. The definition of parallel composition has the equivalent recursive form:
head(A×C)(B×D)(k ⊗ l)(a0, c0) = headAB(k)(a0), headCD(l)(c0)</p>
          <p>
            tail(A×C)(B×D)(k ⊗ l)(a0, c0) = tailAB(k)(a0) ⊗ tailCD(l)(c0)
4Indeed, the current Sig compiler targets the Java VM [
            <xref ref-type="bibr" rid="ref18">18</xref>
            ].
Proof. Implement k ⊗ l = [(f )](k, l) coalgebraically as (A
ω
          </p>
          <p>C) × (B
ω</p>
        </sec>
        <sec id="sec-1-3-3">
          <title>D), f with:</title>
          <p>f0(k, l)(a0, c0) = headAB(k)(a0), headCD(l)(c0)
f+(k, l)(a0, c0) = tailAB(k)(a0), tailCD(l)(c0)
The proof of correctness of this solution and transformation to the above form are left as an exercise to the
reader.</p>
          <p>These abstract semantic concepts of composition can be pulled back to the concrete quadrilateral form.</p>
          <p>X Y
Proposition 4.6. For any quadrilaterals q : A −→ B and r : C −→ D, there is a quadrilateral q k r such that:</p>
          <p>X×Y
q k r : A × C −−−→ B × D
[[q k r ` x, y]] = [[q ` x]] ⊗ [[r ` y]]</p>
          <p>
            Instead of educated guesses as presented ad-hoc in [
            <xref ref-type="bibr" rid="ref17">17</xref>
            ], we can now give a formal derivation.
Proof. Take the composite s = q k r as unknown and to be solved for. Assume the goal
          </p>
          <p>G: [[s ` x, y]] = [[q ` x]] ⊗ [[p ` y]]
and work out the homomorphism property according to (4.3):</p>
          <p>†
z }|
s0 (x, y), (a0, c0)</p>
          <p>‡
z }| { (4.2)
[[s ` s+ (x, y), (a0, c0) ]] = [(s)] s+(x, y)(a0, c0)
{(4.3)
(4.2)
= head(A×C)(B×D) [[s ` x, y]] (a0, c0)
= head(A×C)(B×D) [[q ` x]] ⊗ [[r ` y]] (a0, c0)
G
= head(A×C)(B×D) [(q)](x) ⊗ [(r)](y) (a0, c0)</p>
          <p>headAB [(q)](x) (a0), headCD [(r)](y) (c0)
(4.3)
= q0(x, a0), r0(y, c0)
|
{z
†</p>
          <p>}
(3.12)
= tail(A×C)(B×D) [(s)](x, y) (a0, c0)
G
= tail(A×C)(B×D) [(q)](x) ⊗ [(r)](y) (a0, c0)
(4.5)
= tailAB [(q)](x) (a0) ⊗ tailCD [(r)](y) (c0)
(3.12)
= [(q)] q+(x)(a0) ⊗ [(r)] r+(y)(c0)
= [(q)] q+(x, a0) ⊗ [(r)] r+(y, c0)
G
= [(s)] q+(x, a0), r+(y, c0)
(4.2)
= [[s ` q+(x, a0), r+(y, c0) ]]
|
{z
‡
}
By matching the marked terms we find the most evident solution:
(q k r)0 (x, y), (a, c) = q0(x, a), r0(y, c)</p>
          <p>(q k r)+ (x, y), (a, c) = q+(x, a), r+(y, c)</p>
          <p>X Y
Proposition 4.7. For any quadrilaterals q : A −→ B and r : B −→ C, there is a quadrilateral q · r such that:</p>
          <p>X×Y
q · r : A −−−→ C</p>
          <p>[[(q · r) ` (x, y)]] = [[r ` y]] ◦ [[q ` x]]</p>
          <p>Proof Sketch. By reasoning analogously to the preceding case, we find the solution:
(q · r)0 (x, y), a = r0 y, q0(x, a)</p>
          <p>(q · r)+ (x, y), a = q+(x, a), r+ y, q0(x, a)
Definition 4.8. A third meaningful axis of quadrilateral composition can be defined, symmetrically to the</p>
          <p>X X X
preceding. For any quadrilaterals q : A −→ B and r : C −→ D, there is q # r : A × C −→ B × D, defined as:
(q # r)0 x, (a, c) = q0(x, a), r0 q+(x, a), c
(q # r)+ x, (a, c) = r+ q+(x, a), c</p>
        </sec>
        <sec id="sec-1-3-4">
          <title>All three compositions are depicted in Figure 2.</title>
          <p>
            Remark 4.9. A “diagonal” composition of the form depicted in Figure 3, probably expected by any reader familiar
with the state monad in functional programming [
            <xref ref-type="bibr" rid="ref24">24</xref>
            ], is conspicuously absent, as it breaks the synchronous
paradigm where ”horizontal” data flow is instantaneous. By constrast, such an operation makes perfect sense
in sequential programming, where data dependency (b) is generally understood to entail state dependency (x0).
A little formal detail can make a big difference: for the state monad form, quadrilaterals are simply curried the
other way, to re : A → (S → B × S), but the resulting change of perspective is enormous. As a side effect,
comparison of coinductive and functional reactive programming styles is very difficult, due to the orthogonal
attitudes.
          </p>
          <p>Remark 4.10. Cyclic data flow cannot be constructed by the given composition operators. For the Sig approach
to cycles, see the next section.</p>
          <p>In this section, we have introduced the quadrilateral form of elementwise stream computation, which
corresponds straightforwardly to either the state monad or the coinductive stream transformer approach on the
theoretical side, and to an object-oriented implementation strategy on the practical side. We have calculated
parallel and sequential composition operators on quadrilaterals, and confirmed the visual and formal intuitive
solutions. The method used to obtain these calculations is of general notability: We have reworked the
coalgebraic semantic equations according to (4.3), using the specification of the desired operation in the process, and
read off the most evident solution by syntactic pattern matching. Despite the simple approach, we shall find this
method of coinductive program synthesis just as useful for other primitive operations of stream programming
language implementations.
5</p>
        </sec>
      </sec>
      <sec id="sec-1-4">
        <title>State and Delay</title>
        <p>The quadrilateral form, and the explicit management of state, exists only in the intermediate representation of
Sig programs. The front-end language takes a more high-level approach, adapted to pervasive patterns of causal
stream programming. On the one hand, element-wise computations where output βn depends on input αn only
are extremely common. They are implemented for free, by simply ignoring the state axis.</p>
        <p>
          On the other hand, dependency on past inputs often has relative and bounded form, with βn depending on
αn−i for a few small delay lengths i only. To this end, Sig features a single-step delay operator. In [
          <xref ref-type="bibr" rid="ref17">17</xref>
          ] we
have argued for its implementation in quadrilateral form by appeal to operational intuition. Actually we can do
better in the coalgebraic framework, and derive the same result from a rigorous semantic specification.
Definition 5.1. The semantic delay operator takes an initial value and a stream to be delayed by one step.
delayA : A → A ω A
delayA(a0)(α)0 = a0
delayA(a0)(α)n+1 = αn
In other words, delayA is simply consA with explicit causality; the initial value is prepended, and delayA(α)n+1
depends on αn exactly. We abbreviate consA(a0) to (a0;).
        </p>
        <p>Proposition 5.2. The prepending operation as a class of final TAA-coalgebra elements obeys the recurrence:
headAA(a0;)(a1) = a0
tailAA(a0;)(a1) = (a1;)
Armed with this auxiliary fact, we can formulate the problem.</p>
        <p>A
Proposition 5.3. There is a quadrilateral form δ : A −→ A such that [[δ ` a0]] = (a0;).</p>
        <p>The reader is encouraged to pause for an educated guess before reading on.</p>
        <p>Proof. Follow the derivation strategy of (4.6) with the goal G: [(δ)](a) = (a;).</p>
        <p>†
δz0(a0, a1{) = δ0(a0)(a1)
}|</p>
        <p>‡
[(δ)] δz+(a0, a1)) = [(δ)] δ+(a0)(a1)</p>
        <p>}| {
(3.12)
= headAA [(δ)](a0) (a1)
=G headAA(a0;)(a1)
(5.2)
=
a0
|{z}
†
(3.12)
= tailAA [(δ)](a0) (a1)
=G tailAA(a0;)(a1)
By matching the marked terms we find the now evident, but generally mildly surprising, solution (see Figure 4):
δ(a0, a1) = (a0, a1)
This formal argument rigorously reconstructs the previous intuitive construction of δ:</p>
        <p>Simultaneously route pre-state to output and input to post-state, respectively, such that the current input
becomes pre-state and hence output in the next step, and so forth.
Algorithm 5.4. With specialization to δ, the object-oriented implementation becomes:
class delay extends quad:
step(a):
var a’ := x
x := a
return a’</p>
        <p>A visualization of delay is depicted in Figure 4. Delay operators can be combined freely with stateless
computations in a data flow network. The quadrilateral form is obtained by synthesizing a pair of pre- and
post-state variable for each occurrence of delay, and wiring them in the way depicted on the right hand side.
Since each δ node is replaced by a pair of independent identities, the network may be simplified afterwards by
propagation.</p>
        <p>Remark 5.5. Apparent data flow through the δ node is broken in the process. Hence delayed feedback loops no
longer appear as cycles. The Sig language forbids instantaneous cyclic data flow; only networks that become
acyclic by delay elimination are valid.</p>
        <p>Since the state space X1 × · · · × Xn is synthesized from the types of the n occurrences of delay operators in
a network r, the corresponding initial value ξ = (x1, . . . , xn) need to be inferred as well. Then the semantics of
the network is the single causal stream function [[r ` ξ]]. The Sig front-end language provides a binary delay
operator of the form a;e which translates to δ(e) with implied initial value a.</p>
        <p>Example 5.6. The random number generators from (2.8) in delay-based state-implicit form are depicted in
Figure 5, left hand side. The shift register structure is more clearly elucidated than in the coalgebraic form, or in
the original imperative code, for that matter. The following pseudocode in simplified Sig describes this network,
including seed values (s0, s1, s2, s3):</p>
        <p>In this section, we have introduced the single-step delay operator, the crucial ingredient in stream programming
beyond memoryless elementwise computation and basic operation of the pervasive “shift register” algorithmic
pattern. We have calculated the mildly confusing implementation of delay as the identical quadrilateral, and
illustrated the transition from delay to explicit state in the front-to-core reduction of the Sig language.
6</p>
      </sec>
      <sec id="sec-1-5">
        <title>Higher Order: Stream Function Application</title>
        <p>Higher-order functions are notoriously a more complex subject in a stream context than in ordinary functional
programming. However, they are of crucial importance for the high-level expressivity of a practical stream
programming language.</p>
        <p>
          On the one hand, if streams are the first-class citizens, then there are streams of stream functions, and
functions on these, to deal with. An abstract semantics has been given in terms of comonads [
          <xref ref-type="bibr" rid="ref22 ref23">22, 23</xref>
          ]. All theoretical
elegance notwithstanding, that theoretical framework is even less well-known to the general programming
community than coalgebras. Apparently it is also less directly tied to practical matters; we are not aware of any
relevant implementation it could have inspired.
class xsr(s0, s1, s2, s3):
var x := s0; y := s1; z := s2; w := s3
step():
r := (x ^&lt;&lt; a ^&gt;&gt; b) ^ (w ^&gt;&gt; c)
(x, y, z, w) := (y, z, w, r)
return r
The result of state synthesis from delay operators is depicted in Figure 5, right hand side. Note the absence
of cycles. The object-oriented implementation gives the moral equivalent of the original presentation in the C
language, in pseudocode:
δ
δ
⇐a
δ
w
⇒b
⇒c
δ
⊕
r
        </p>
        <p>⇐a</p>
        <p>
          On the other hand, there is the view on a single stream function as a stream of element functions, given by the
headAB and tailAB operations on A ω B. This view had already been explored, albeit in ad-hoc terms, and its
practical relevance argued in [
          <xref ref-type="bibr" rid="ref3">3</xref>
          ]. We have given a systematic theoretical reconstruction in [
          <xref ref-type="bibr" rid="ref17">17</xref>
          ] and independently
a practical implementation strategy in [
          <xref ref-type="bibr" rid="ref18">18</xref>
          ].
        </p>
        <p>In the following section, in order to connect the two more precisely, we follow up on the method already applied
in the two preceding section, and calculate a representation for first-class stream functions and its interpretation
from a coalgebraic specification.</p>
        <p>As a first approximation, assume a generic abstract datatype ZAB with an interpretation map, appAB, to
represent some set of causal stream functions for each domain–range pair A, B:</p>
        <p>appAB : ZAB → (A ω B)</p>
        <p>The type of the interpretation map, with the final coalgebra range, suggests a definition by homomorphism.
Proposition 6.1. There is a quadrilateral @ : A −Z−A−→B B such that [(@)] = appAB.</p>
        <p>Proof. Follow the same derivation strategy as before.</p>
        <p>‡
appAB @+(z, a0){ =G [(@)] @+(z, a0)
z }|
=G headAB appAB(z) (a0)
| {z }
†
(3.12)
= tailAB [(@)](z) (a0)
=G tailAB appAB(z) (a0)
| {z }
‡
By matching the marked terms, we find the specification up to interpretation:</p>
        <p>appAB @+(z, a0) = tailAB appAB(z) (a0)</p>
        <p>This account is, well, abstract. In particular, no help is given for making ZAB closed in the sense of the
right hand equation; for each element z ∈ ZAB, we must also include, for each a0, some sucessor element
@+(z, a0) ∈ ZAB whose interpretation is the stream function tail of the interpretation of z.</p>
        <p>The problem can be simplified substantially, if the representation is given at the same implementation level
as its usage context, namely in terms of quadrilaterals. Assume a generic abstract datatype WABX with an
X
interpretation map app0ABX to represent some set RABX ⊆ (A −→ B) of quadrilaterals for each domain–range
pair A, B and state space X:</p>
        <p>X
app0ABX : WABX → (A −→ B)
=G headAB appAB(X, w, x) (a0)
(6=.2) headAB [[app0ABX (w) ` x]] (a0)
(4=.2) headAB [(app0ABX (w))](x) (a0)
(3.12)
= app0ABX (w)0(x)(a0)
= app0ABX (w)0(x, a0)
| {z }</p>
        <p>†
Unlike in the previous attempt, the choice of represented functions, Img(app0ABX ), is completely arbitrary; we
shall demonstrate that it need not be closed under any operation. Even finite WABX will do.</p>
        <p>Any stream function may be implemented by various quadrilaterals: only the input–output relation is specified,
but neither the state space parameter X, nor the initial state x ∈ X. Packing these information items into a
dependent record type yields our improved datatype of stream functions:
Definition 6.2.</p>
        <p>ZAB = [ {X} × WABX × X</p>
        <p>X
appAB(X, w, x) = [[app0ABX (w) ` x]]
Proposition 6.3. There is a quadrilateral @ : A −Z−A−→B B, such that [(@)] = appAB.</p>
        <p>Proof. Follow the usual derivation strategy.</p>
        <p>‡
appAB @+((X,}w|, x), a0))
z {
=G tailAB appAB(X, w, x) (a0)
(6.2)
= tailAB [[app0ABX (w) ` x]] (a0)
(4.2)
= tailAB [(app0ABX (w))](x) (a0)
(3.12)</p>
        <p>= [(app0ABX (w))](app0ABX (w)+(x)(a0))
(4.2)
= [[app0ABX (w) ` app0ABX (w)+(x)(a0)]]
(6=.2) appAB X, w, app0ABX (w)+(x, a0)
|
{z
‡
}
By matching the marked terms, we find the most evident solution:
@0 (X, w, x), a0 = app0ABX (w)0(x, a0) @+ (X, w, x), a0 = (X, w, x0) where x0 = app0ABX (w)+(x, a0)
The calculated solution keeps the first two fields of the dependent record, namely the state space X and the
quadrilateral reference w constant, and updates only the transient state component x. Hence we have kept our
promise that the choice of represented stream functions is completely arbitrary, and not subject to any closure
constraints.</p>
        <p>This solution also goes extremely well with the object-oriented approach to implementation, where X and w
are realized statically as a field declaration and method binding, respectively, whereas as x, x0 is the dynamically
changing state variable typed by X. The return value and in-place update effect of app0AB(w) can be understood
as the invocation of the step update on a private instance of the class implementing w. Thus the application of
stream functions is realized as the aggregation of objects.</p>
        <p>Example 6.4. Consider the Euler method for numerical integration of autonomous ordinary differential equations:
y˙ = f (y)
discretized to
yn+1 = yn + δt · f (yn)
Its implementation with output stream y, indepently of the stream function f given as a class w, is a simple
matter of managing a private instance z:
class int(dt, w, y0):
var y := y0
const z := new w()
step():
var u := y
y := y + dt * z.step(y)
return u
Note how variables w and z have been chosen to allude to the above formal datatypes, how the new operation
instantiates w to z, with unknown initial private state, and how the method invocation z.step performs the
computations of @0 and @+ as interface data flow and side effect, respectively.</p>
        <p>The pictured code pattern, distilled from the preceding formal reasoning, is in line with what could be
expected from a competent imperative programmer. On the one hand, this observation serves to illustrate that
the calculation of higher-order function semantics is not so much of theoretical, but rather of practical interest,
and relevant for efficient code generation. On the other hand, it embodies the aspiration of the Sig design to
reconcile formal semantics with domain-specific low-level programming lore.</p>
        <p>In this section, we have introduced the dynamic application operator for coinductive stream functions, as
the key ingredient for higher-order programming. We have given a formal representation in terms of dependent
records, the mathematical metaphor for objects with hidden state and virtual step methods, and calculated the
intuitive solution, namely application-as-aggregation, by coinductive synthesis.
7</p>
      </sec>
      <sec id="sec-1-6">
        <title>Conclusion</title>
        <p>
          Related Work
Coalgebraic approaches have been studied early on in the context of structural operational semantics [
          <xref ref-type="bibr" rid="ref20">20</xref>
          ], for
their potential to reduce the conceptual distance between denotational and operational semantics considerably.
Whereas algebraic approaches produce abstract metaphors of computational concepts, their coalgebraic duals
lead to more concrete descriptions of hands-on computational business, but at the same level of formal rigor.
        </p>
        <p>
          Coalgebraic semantics have been given for programming with objects and classes [
          <xref ref-type="bibr" rid="ref6">6</xref>
          ], and with abstract data
types [
          <xref ref-type="bibr" rid="ref5">5</xref>
          ]. Whereas these deal with the general expressivity of the respective concepts, we are only interested in
OO in a narrow, back-end sense; namely for the implementation of quadrilaterals, the common denominator of
our operational semantics of stream programming, in terms of private state variables and public I/O interfaces.
        </p>
        <p>
          Coinductive datatypes and their associated recursive functions play an important role in functional
programming under the Curry–Howard correspondence: in dependently typed languages such as Agda [
          <xref ref-type="bibr" rid="ref16">16</xref>
          ], constructive
theorem provers such as Coq [
          <xref ref-type="bibr" rid="ref2">2</xref>
          ], (both of which have worrying issues with coinduction [
          <xref ref-type="bibr" rid="ref9">9</xref>
          ]), categorical languages
such as Charity [
          <xref ref-type="bibr" rid="ref4">4</xref>
          ], and “elementary” approaches to total functional programming [
          <xref ref-type="bibr" rid="ref15 ref21">15, 21</xref>
          ].
        </p>
        <p>
          Coalgebraic streams have been considered as a foundation for synchronous data-flow programming already
in Lucid Synchrone [
          <xref ref-type="bibr" rid="ref3">3</xref>
          ]. They remain a viable, if not very popular, alternative to streams-as-functions-of-time
approaches, analogously to closed-form versus recursive mathematical definitions of sequences.
        </p>
        <p>
          A notable high-level approach to coalgebraic streams and natural continuation of [
          <xref ref-type="bibr" rid="ref14">14</xref>
          ] is stream calculus
[
          <xref ref-type="bibr" rid="ref12">12</xref>
          ], which extends the classical mathematical framework of infinitesimal calculus to streams, and presents
computations as systems of differential equations. However, that approach is both more general than warranted
for our present purpose, considering more than just causal stream functions [
          <xref ref-type="bibr" rid="ref11">11</xref>
          ], and more mathematical, with
a particular emphasis on linear relationships [
          <xref ref-type="bibr" rid="ref1 ref13">1, 13</xref>
          ].
        </p>
        <p>By contrast, we feel that the operational aspect, namely the adequate representation of low-level loop-based
programming patterns that pervade real-world stream processing, has not been fully appreciated. We consider
the design and implementation of Sig a well-arguable case in point.
7.2</p>
        <p>Outlook
For the sake of accessibility, we have not pushed the coalgebraic framework to the limits of its expressivity.
In particular, we have omitted accounts for semantic relations, embodied in the formal concepts of behavioral
equivalence and bisimulation. These would be relevant to the calculation of semantics-preserving program
transformations, such as featuring in code optimization passes of the Sig compiler, as well as in the study of alternative
solutions to the ones we have calculated as the “most evident”.</p>
        <p>Nevertheless, we consider the method for the calculation of practically illuminating operational specifications,
as applied repeatedly in each of the preceding sections, a valuable tool in the coalgebraic semantics box, as well
as promising step towards more general coinductive program synthesis.</p>
      </sec>
    </sec>
  </body>
  <back>
    <ref-list>
      <ref id="ref1">
        <mixed-citation>
          [1]
          <string-name>
            <given-names>H.</given-names>
            <surname>Basold</surname>
          </string-name>
          et al. “
          <article-title>(Co)Algebraic Characterizations of Signal Flow Graphs”</article-title>
          .
          <source>In: Horizons of the Mind</source>
          . Vol.
          <volume>8464</volume>
          . Lecture Notes in Computer Science. Springer,
          <year>2014</year>
          , pp.
          <fpage>124</fpage>
          -
          <lpage>145</lpage>
          . doi:
          <volume>10</volume>
          .1007/978- 3-
          <fpage>319</fpage>
          - 06880-
          <issue>0</issue>
          _
          <fpage>6</fpage>
          .
        </mixed-citation>
      </ref>
      <ref id="ref2">
        <mixed-citation>
          [2]
          <string-name>
            <given-names>Y.</given-names>
            <surname>Bertot</surname>
          </string-name>
          and
          <string-name>
            <surname>E. Komendantskaya.</surname>
          </string-name>
          “
          <article-title>Inductive and Coinductive Components of Corecursive Functions in Coq”</article-title>
          .
          <source>In: Electronic Notes in Theoretical Computer Science 203.5</source>
          (
          <issue>2008</issue>
          ), pp.
          <fpage>25</fpage>
          -
          <lpage>47</lpage>
          . doi:
          <volume>10</volume>
          .1016/j. entcs.
          <year>2008</year>
          .
          <volume>05</volume>
          .018.
        </mixed-citation>
      </ref>
      <ref id="ref3">
        <mixed-citation>
          [3]
          <string-name>
            <given-names>P.</given-names>
            <surname>Caspi</surname>
          </string-name>
          and
          <string-name>
            <given-names>M.</given-names>
            <surname>Pouzet</surname>
          </string-name>
          .
          <article-title>“A Co-iterative Characterization of Synchronous Stream Functions”</article-title>
          .
          <source>In: Electronic Notes in Theoretical Computer Science</source>
          <volume>11</volume>
          (
          <year>1998</year>
          ), pp.
          <fpage>1</fpage>
          -
          <lpage>21</lpage>
          . doi:
          <volume>10</volume>
          .1016/S1571-
          <volume>0661</volume>
          (
          <issue>04</issue>
          )
          <fpage>00050</fpage>
          -
          <lpage>7</lpage>
          .
        </mixed-citation>
      </ref>
      <ref id="ref4">
        <mixed-citation>
          [4]
          <string-name>
            <given-names>R.</given-names>
            <surname>Cockett</surname>
          </string-name>
          and
          <string-name>
            <given-names>T.</given-names>
            <surname>Fukushima</surname>
          </string-name>
          .
          <source>About Charity. Tech. rep</source>
          . University of Calgary,
          <year>1992</year>
          .
        </mixed-citation>
      </ref>
      <ref id="ref5">
        <mixed-citation>
          [5]
          <string-name>
            <given-names>M.</given-names>
            <surname>Erwig</surname>
          </string-name>
          . “
          <article-title>Categorical Programming with Abstract Data Types”</article-title>
          .
          <source>In: Proc. AMAST</source>
          . Vol.
          <volume>1548</volume>
          . Lecture Notes in Computer Science. Springer,
          <year>1998</year>
          , pp.
          <fpage>406</fpage>
          -
          <lpage>421</lpage>
          . doi:
          <volume>10</volume>
          .1007/3-540-49253-4_
          <fpage>29</fpage>
          .
        </mixed-citation>
      </ref>
      <ref id="ref6">
        <mixed-citation>
          [6]
          <string-name>
            <given-names>B.</given-names>
            <surname>Jacobs</surname>
          </string-name>
          . “
          <article-title>Objects and Classes, Co-Algebraically”</article-title>
          .
          <source>In: Object Orientation with Parallelism and Persistence</source>
          .
          <year>1995</year>
          , pp.
          <fpage>83</fpage>
          -
          <lpage>103</lpage>
          .
        </mixed-citation>
      </ref>
      <ref id="ref7">
        <mixed-citation>
          [7]
          <string-name>
            <given-names>B.</given-names>
            <surname>Jacobs</surname>
          </string-name>
          and
          <string-name>
            <given-names>J.</given-names>
            <surname>Rutten</surname>
          </string-name>
          .
          <article-title>“A Tutorial on (Co)Algebras and (Co)Induction”</article-title>
          .
          <source>In: EATCS Bulletin</source>
          <volume>62</volume>
          (
          <year>1997</year>
          ), pp.
          <fpage>222</fpage>
          -
          <lpage>259</lpage>
          .
        </mixed-citation>
      </ref>
      <ref id="ref8">
        <mixed-citation>
          [8]
          <string-name>
            <surname>G. Marsaglia.</surname>
          </string-name>
          “
          <article-title>Xorshift RNGs”</article-title>
          .
          <source>In: Journal of Statistical Software</source>
          <volume>8</volume>
          .14 (
          <year>2003</year>
          ). doi:
          <volume>10</volume>
          .18637/jss.v008.
          <year>i14</year>
          .
        </mixed-citation>
      </ref>
      <ref id="ref9">
        <mixed-citation>
          [9]
          <string-name>
            <surname>C. McBride.</surname>
          </string-name>
          “
          <article-title>Let's See How Things Unfold: Reconciling the Infinite with the Intensional (Extended Abstract)”</article-title>
          .
          <source>In: Proc. CALCO</source>
          .
          <year>2009</year>
          , pp.
          <fpage>113</fpage>
          -
          <lpage>126</lpage>
          . doi:
          <volume>10</volume>
          .1007/978-3-
          <fpage>642</fpage>
          -03741-
          <issue>2</issue>
          _
          <fpage>9</fpage>
          .
        </mixed-citation>
      </ref>
      <ref id="ref10">
        <mixed-citation>
          [10]
          <string-name>
            <given-names>H.</given-names>
            <surname>Nilsson</surname>
          </string-name>
          ,
          <string-name>
            <given-names>A.</given-names>
            <surname>Courtney</surname>
          </string-name>
          , and
          <string-name>
            <given-names>J.</given-names>
            <surname>Peterson</surname>
          </string-name>
          . “
          <article-title>Functional Reactive Programming, Continued”</article-title>
          .
          <source>In: Proc. Haskell Workshop</source>
          . ACM,
          <year>2002</year>
          , pp.
          <fpage>51</fpage>
          -
          <lpage>64</lpage>
          . doi:
          <volume>10</volume>
          .1145/581690.581695.
        </mixed-citation>
      </ref>
      <ref id="ref11">
        <mixed-citation>
          [11]
          <string-name>
            <given-names>M.</given-names>
            <surname>Niqui</surname>
          </string-name>
          and
          <string-name>
            <given-names>J.</given-names>
            <surname>Rutten</surname>
          </string-name>
          . “Sampling,
          <article-title>Splitting and Merging in Coinductive Stream Calculus”</article-title>
          .
          <source>In: Proc. MPC</source>
          . Vol.
          <volume>6120</volume>
          . Lecture Notes in Computer Science. Springer,
          <year>2010</year>
          , pp.
          <fpage>310</fpage>
          -
          <lpage>330</lpage>
          . doi:
          <volume>10</volume>
          .1007/978-3-
          <fpage>642</fpage>
          -13321-3_
          <fpage>18</fpage>
          .
        </mixed-citation>
      </ref>
      <ref id="ref12">
        <mixed-citation>
          [12]
          <string-name>
            <given-names>J.</given-names>
            <surname>Rutten</surname>
          </string-name>
          . “
          <article-title>A coinductive calculus of streams”</article-title>
          .
          <source>In: Mathematical Structures in Computer Science 15.1</source>
          (
          <issue>2005</issue>
          ), pp.
          <fpage>93</fpage>
          -
          <lpage>147</lpage>
          . doi:
          <volume>10</volume>
          .1017/S0960129504004517.
        </mixed-citation>
      </ref>
      <ref id="ref13">
        <mixed-citation>
          [13]
          <string-name>
            <given-names>J.</given-names>
            <surname>Rutten</surname>
          </string-name>
          . “
          <article-title>Coalgebraic Foundations of Linear Systems”</article-title>
          .
          <source>In: Proc. CALCO</source>
          . Vol.
          <volume>4624</volume>
          . Lecture Notes in Computer Science. Springer,
          <year>2007</year>
          , pp.
          <fpage>425</fpage>
          -
          <lpage>446</lpage>
          . doi:
          <volume>10</volume>
          .1007/978-3-
          <fpage>540</fpage>
          -73859-6_
          <fpage>29</fpage>
          .
        </mixed-citation>
      </ref>
      <ref id="ref14">
        <mixed-citation>
          [14]
          <string-name>
            <given-names>J.</given-names>
            <surname>Rutten</surname>
          </string-name>
          . “
          <article-title>Universal coalgebra: a theory of systems”</article-title>
          .
          <source>In: Theoretical Computer Science 249.1</source>
          (
          <issue>2000</issue>
          ), pp.
          <fpage>3</fpage>
          -
          <lpage>80</lpage>
          . doi:
          <volume>10</volume>
          .1016/S0304-
          <volume>3975</volume>
          (
          <issue>00</issue>
          )
          <fpage>00056</fpage>
          -
          <lpage>6</lpage>
          .
        </mixed-citation>
      </ref>
      <ref id="ref15">
        <mixed-citation>
          [15]
          <string-name>
            <given-names>A.</given-names>
            <surname>Telford</surname>
          </string-name>
          and
          <string-name>
            <given-names>D.</given-names>
            <surname>Turner</surname>
          </string-name>
          . “
          <article-title>Ensuring Streams Flow”</article-title>
          .
          <source>In: Proc. AMAST</source>
          .
          <year>1997</year>
          , pp.
          <fpage>509</fpage>
          -
          <lpage>523</lpage>
          . doi:
          <volume>10</volume>
          .1007/ BFb0000493.
        </mixed-citation>
      </ref>
      <ref id="ref16">
        <mixed-citation>
          [16]
          <article-title>The Agda Wiki</article-title>
          .
          <source>The Agda Team</source>
          .
          <year>2010</year>
          . url: http://wiki.portal.chalmers.se/agda/.
        </mixed-citation>
      </ref>
      <ref id="ref17">
        <mixed-citation>
          [17]
          <string-name>
            <given-names>B.</given-names>
            <surname>Trancón</surname>
          </string-name>
          y Widemann and
          <string-name>
            <given-names>M.</given-names>
            <surname>Lepper</surname>
          </string-name>
          . “
          <article-title>Foundations of Total Functional Data-Flow Programming”</article-title>
          .
          <source>In: Proc. MSFP</source>
          . Vol.
          <volume>154</volume>
          .
          <source>Electronic Proceedings in Theoretical Computer Science</source>
          .
          <year>2014</year>
          , pp.
          <fpage>143</fpage>
          -
          <lpage>167</lpage>
          . doi:
          <volume>10</volume>
          .4204/EPTCS.153.10.
        </mixed-citation>
      </ref>
      <ref id="ref18">
        <mixed-citation>
          [18]
          <string-name>
            <given-names>B.</given-names>
            <surname>Trancón</surname>
          </string-name>
          y Widemann and
          <string-name>
            <given-names>M.</given-names>
            <surname>Lepper</surname>
          </string-name>
          . “
          <article-title>On-Line Synchronous Total Purely Functional Data-Flow Programming on the Java Virtual Machine with Sig”</article-title>
          .
          <source>In: Proc. PPPJ. ACM</source>
          ,
          <year>2015</year>
          , pp.
          <fpage>37</fpage>
          -
          <lpage>50</lpage>
          . doi:
          <volume>10</volume>
          .1145/ 2807426.2807430.
        </mixed-citation>
      </ref>
      <ref id="ref19">
        <mixed-citation>
          [19]
          <string-name>
            <given-names>B.</given-names>
            <surname>Trancón</surname>
          </string-name>
          y Widemann and
          <string-name>
            <given-names>M.</given-names>
            <surname>Lepper</surname>
          </string-name>
          . “
          <article-title>The Shepard Tone and Higher-Order Multi-Rate Synchronous Data-Flow Programming in Sig”</article-title>
          .
          <source>In: Proc. FARM. ACM</source>
          ,
          <year>2015</year>
          , pp.
          <fpage>6</fpage>
          -
          <lpage>14</lpage>
          . doi:
          <volume>10</volume>
          .1145/2808083.2808086.
        </mixed-citation>
      </ref>
      <ref id="ref20">
        <mixed-citation>
          [20]
          <string-name>
            <given-names>D.</given-names>
            <surname>Turi</surname>
          </string-name>
          and
          <string-name>
            <given-names>G. D.</given-names>
            <surname>Plotkin</surname>
          </string-name>
          . “
          <article-title>Towards a Mathematical Operational Semantics”</article-title>
          .
          <source>In: Proc. LICS</source>
          . IEEE,
          <year>1997</year>
          , pp.
          <fpage>280</fpage>
          -
          <lpage>291</lpage>
          . doi:
          <volume>10</volume>
          .1109/LICS.
          <year>1997</year>
          .
          <volume>614955</volume>
          .
        </mixed-citation>
      </ref>
      <ref id="ref21">
        <mixed-citation>
          [21]
          <string-name>
            <given-names>D. A.</given-names>
            <surname>Turner</surname>
          </string-name>
          . “
          <article-title>Total Functional Programming”</article-title>
          .
          <source>In: Universal Computer Science 10.7</source>
          (
          <issue>2004</issue>
          ), pp.
          <fpage>751</fpage>
          -
          <lpage>768</lpage>
          . doi:
          <volume>10</volume>
          .3217/jucs-010-07-0751.
        </mixed-citation>
      </ref>
      <ref id="ref22">
        <mixed-citation>
          [22]
          <string-name>
            <given-names>T.</given-names>
            <surname>Uustalu</surname>
          </string-name>
          and
          <string-name>
            <given-names>V.</given-names>
            <surname>Vene</surname>
          </string-name>
          . “
          <article-title>Signals and Comonads”</article-title>
          .
          <source>In: Universal Computer Science 11.7</source>
          (
          <issue>2005</issue>
          ), pp.
          <fpage>1310</fpage>
          -
          <lpage>1326</lpage>
          . doi:
          <volume>10</volume>
          .3217/jucs-011-07-1311.
        </mixed-citation>
      </ref>
      <ref id="ref23">
        <mixed-citation>
          [23]
          <string-name>
            <given-names>T.</given-names>
            <surname>Uustalu</surname>
          </string-name>
          and
          <string-name>
            <given-names>V.</given-names>
            <surname>Vene</surname>
          </string-name>
          . “
          <article-title>The Essence of Dataflow Programming”</article-title>
          .
          <source>In: Proc. APLAS</source>
          . Ed.
          <article-title>by K. Yi</article-title>
          . Vol.
          <volume>3780</volume>
          . Lecture Notes in Computer Science. Springer,
          <year>2005</year>
          , pp.
          <fpage>2</fpage>
          -
          <lpage>18</lpage>
          . doi:
          <volume>10</volume>
          .1007/11575467_2.
        </mixed-citation>
      </ref>
      <ref id="ref24">
        <mixed-citation>
          [24]
          <string-name>
            <given-names>P.</given-names>
            <surname>Wadler</surname>
          </string-name>
          . “
          <article-title>Comprehending Monads”</article-title>
          .
          <source>In: Proc. LFP. ACM</source>
          ,
          <year>1990</year>
          , pp.
          <fpage>61</fpage>
          -
          <lpage>78</lpage>
          . doi:
          <volume>10</volume>
          .1145/91556.91592.
        </mixed-citation>
      </ref>
    </ref-list>
  </back>
</article>