<?xml version="1.0" encoding="UTF-8"?>
<TEI xml:space="preserve" xmlns="http://www.tei-c.org/ns/1.0" 
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" 
xsi:schemaLocation="http://www.tei-c.org/ns/1.0 https://raw.githubusercontent.com/kermitt2/grobid/master/grobid-home/schemas/xsd/Grobid.xsd"
 xmlns:xlink="http://www.w3.org/1999/xlink">
	<teiHeader xml:lang="en">
		<fileDesc>
			<titleStmt>
				<title level="a" type="main">Higher-Order Causal Stream Functions in Sig from First Principles</title>
			</titleStmt>
			<publicationStmt>
				<publisher/>
				<availability status="unknown"><licence/></availability>
			</publicationStmt>
			<sourceDesc>
				<biblStruct>
					<analytic>
						<author>
							<persName><forename type="first">Baltasar</forename><surname>Trancón Y Widemann</surname></persName>
							<affiliation key="aff0">
								<orgName type="institution">Technische Universität Ilmenau</orgName>
							</affiliation>
							<affiliation key="aff1">
								<orgName type="institution">semantics GmbH Berlin</orgName>
							</affiliation>
						</author>
						<author>
							<persName><forename type="first">Markus</forename><surname>Lepper</surname></persName>
							<affiliation key="aff1">
								<orgName type="institution">semantics GmbH Berlin</orgName>
							</affiliation>
						</author>
						<title level="a" type="main">Higher-Order Causal Stream Functions in Sig from First Principles</title>
					</analytic>
					<monogr>
						<imprint>
							<date/>
						</imprint>
					</monogr>
					<idno type="MD5">7BC7DC3BA353F659DCB541EB9CB192FD</idno>
				</biblStruct>
			</sourceDesc>
		</fileDesc>
		<encodingDesc>
			<appInfo>
				<application version="0.7.2" ident="GROBID" when="2023-03-25T01:13+0000">
					<desc>GROBID - A machine learning software for extracting information from scholarly documents</desc>
					<ref target="https://github.com/kermitt2/grobid"/>
				</application>
			</appInfo>
		</encodingDesc>
		<profileDesc>
			<abstract>
<div xmlns="http://www.tei-c.org/ns/1.0"><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></div>
			</abstract>
		</profileDesc>
	</teiHeader>
	<text xml:lang="en">
		<body>
<div xmlns="http://www.tei-c.org/ns/1.0"><head n="1">Introduction</head><p>Streams are a ubiquitous fundamental data structure, even more so in the realms of reactive and data floworiented computation. Semantic foundations in terms of universal coalgebra and coinduction <ref type="bibr" target="#b13">[14]</ref> have been proposed almost twenty years ago <ref type="bibr" target="#b2">[3,</ref><ref type="bibr" target="#b14">15]</ref>, but remain woefully obscure to the general programming community.</p><p>Here we set out to exploit the recent development of the Sig language as a use case for coalgebraic semantics. Unlike for previous technical papers, the priority here is not on the exposition of novel theoretical foundations or practical implementations, but on the clarification and justification of already established solutions. As such it is intended for a broader audience with a general background in programming languages. Consequently, the present paper is partly a self-contained educational summary of pre-existing isolated parts of technical work, and partly a report on novel work to connect the dots. In particular, there has been a considerable rhetorical gap between the theoretical framework <ref type="bibr" target="#b16">[17]</ref> and the implementation strategy employed by the actual compiler <ref type="bibr" target="#b17">[18]</ref>. While the design appears fairly obvious and grounded in standard compiler constructor wisdom, a rigorous reconstruction by calculation from first principles would obviously be more satisfactory. Notable novel contributions are:</p><p>• pseudorandom number generators as illuminating examples of coinductive stream computations (2.8), <ref type="bibr">(5.6</ref>);</p><p>• a method to derive operational facts from abstract coalgebraic specifications (3.12) that qualifies as a basic form of coinductive program synthesis;</p><p>• its application to a number of basic concepts of functional stream programming, resulting in rigorous justification of the plausible implementation strategy by calculation (4.6), (4.7), (5.3), <ref type="bibr">(6.3)</ref>.</p><p>Copyright c by the paper's authors. Copying permitted for private and academic purposes. This volume is published and copyrighted by its editors.</p><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 <ref type="bibr" target="#b13">[14]</ref>. 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 <ref type="bibr" target="#b13">[14]</ref>, 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 <ref type="bibr" target="#b13">[14]</ref> and our own theoretical work <ref type="bibr" target="#b16">[17]</ref>.</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 <ref type="bibr" target="#b17">[18,</ref><ref type="bibr" target="#b18">19]</ref> for detailed discussions.</p></div>
<div xmlns="http://www.tei-c.org/ns/1.0"><head n="2">Zeroth Order: Streams</head><p>Definition* 2.1 (Functor). A functor <ref type="foot" target="#foot_0">1</ref> 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 ).<ref type="foot" target="#foot_1">2</ref> Definition 2.2 (Stream Functor). Fix some nonempty set A and consider the Cartesian pairing operator S A (X) = A × X. It can be extended to a functor, acting on maps as:</p><formula xml:id="formula_0">S A (f )(a, x) = a, f (x)</formula><p>For any functor F , we can define the concepts of mathematical structures called F -coalgebras and their homomorphisms, or structure-preserving maps.</p></div>
<div xmlns="http://www.tei-c.org/ns/1.0"><head>Definition* 2.3 (Coalgebra</head><p>). 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></div>
<div xmlns="http://www.tei-c.org/ns/1.0"><head>Definition 2.4 (Stream Coalgebra Operation). Concretely, the S</head><formula xml:id="formula_1">A -coalgebras are structures (X, f : X → A×X).</formula><p>Usually it is more convenient to decompose the pair-valued map f equivalently as f 0 : X → A and f + : X → X with:</p><formula xml:id="formula_2">f (x) = f 0 (x), f + (x)</formula><p>Algorithm 2.5. The S A -coalgebras are formal representations of enumeration procedures: The carrier X is the state space, and the operation components f 0 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 x 0 , and collecting the outputs a n = f 0 (x n ) from successive states x n+1 = f + (x n ), as an infinite stream. In pseudocode:</p><p>exec(f0, f+)(x0): var x := x0 forever yield f0(x)</p><p>x := f+(x) Example 2.6. The default textbook example of a stream enumeration procedure is the iterative Fibonacci algorithm:</p><formula xml:id="formula_3">A = N X = N 2 fib 0 (a, b) = b fib + (a, b) = (a + b, a)</formula><p>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 <ref type="bibr">(2.19)</ref>, is the following coalgebra,</p><formula xml:id="formula_4">A = R X = N bif 0 (n) = ϕ n √ 5 where ϕ = 1 + √ 5 2 bif + (n) = n + 1</formula><p>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>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 <ref type="bibr" target="#b7">[8]</ref> is specified in coalgebraic form as</p><formula xml:id="formula_5">A = 2 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)</formula><p>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:</p><formula xml:id="formula_6">(n ⇒ k) = n ⊕ (n k) (n ⇐ k) = n ⊕ (n k)</formula><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.9 (Coalgebra of Streams). The set of infinite streams A ω admits an S A -coalgebra operation:</p><formula xml:id="formula_7">s : A ω → A × A ω s 0 (α) = α 0 s + (α) n = α n+1</formula><p>where s 0 and s + are commonly known as head and tail, respectively, and s −1 as cons. In order to let A vary, we write explicitly:</p><formula xml:id="formula_8">out A : A ω → A × A ω head A : A ω → A cons A : A × A ω → A ω tail A : A ω → A ω</formula><p>We also abbreviate cons A (a 0 , α) to a 0 ; α, which saves many parentheses. Note that indices start always at zero. 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><formula xml:id="formula_9">g(h(x)) = F (h)(f (x))</formula><p>Proposition 2.11. For S A -coalgebras the homomorphism property for h from (X, f ) to (Y, g) simplifies to:</p><formula xml:id="formula_10">g 0 h(x) = f 0 (x) g + h(x) = h f + (x)</formula><p>The S A -coalgebra homomorphisms map computations by one enumeration procedure to equivalent computations by another procedure. The coalgebra (A ω , out A ) 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 S A -coalgebra. Proposition 2.12. Let (X, f ) be an S A -coalgebra. Then there is a map:</p><formula xml:id="formula_11">[ (f )] : X → A ω [ (f )](x) n = f 0 f n + (x)</formula><p>Proposition 2.13. The homomorphism property (2.11) specializes for [ (f )] to:</p><formula xml:id="formula_12">head A [ (f )](x) = f 0 (x) tail A [ (f )](x) = [ (f )] f + (x) It is easy to see that [ (f )] is indeed a homomorphism. Proof. head A [ (f )](x) = [ (f )](x) 0 tail A [ (f )](x) n = [ (f )](x) n+1 (2.12) = f 0 f 0 + (x) (2.12) = f 0 f n+1 + (x) = f 0 (x) = f 0 f n + f + (x) (2.12) = [ (f )] f + (x) n</formula><p>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><formula xml:id="formula_13">[ (f )](x) = f 0 (x) ; [ (f )] f + (x)</formula><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. Proposition 2.15. Any homomorphism h : X → A ω between S A -coalgebras (X, f ) and (A ω , out A ), that is each map of that type satisfying <ref type="bibr">(2.11)</ref>, is in fact equivalent to (2.12).</p><p>Proof. By induction in n, with induction hypothesis IH:</p><formula xml:id="formula_14">h(x) n = f 0 f n + (x) . h(x) 0 = head A h(x) h(x) n+1 = tail A h(x) n (2.11) = f 0 (x) (2.11) = h(f + (x)) n = f 0 f 0 + (x) IH = f 0 f n + f + (x) = f 0 f n+1 + (x)</formula><p>This uniqueness is an instance of an important general pattern. 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 ). 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 S A -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.</p><p>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.</p><p>Example 2.19. Now we can state the intended use and precise meaning of the above examples.</p><p>• The standard Fibonacci sequence is obtained from (2.6) as [ (fib)](1, 0).</p><p>• 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.</p><p>• A stream of reasonably random-looking integer words (that pass standard statistical tests <ref type="bibr" target="#b7">[8]</ref>) 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 <ref type="bibr" target="#b6">[7]</ref>. 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.</p></div>
<div xmlns="http://www.tei-c.org/ns/1.0"><head n="3">First Order: Stream Transforms</head><p>Definition 3.1. Fix some nonempty sets A and B, and consider the functor:</p><formula xml:id="formula_15">T AB (X) = (A → B × X) T AB (f )(k)(a) = b, f (x) where k(a) = (b, x)</formula><p>Algorithmically, the T AB -coalgebras represent the category of Mealy-type stream transducers. Their operations f : <ref type="foot" target="#foot_2">3</ref> 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</p><formula xml:id="formula_16">X → A → B × X, by Currying equivalent to f : X × A → B × X,</formula><formula xml:id="formula_17">f 0 : X → A → B and f + : X → A → X, with f (x)(a) = f 0 (x)(a), f + (x)(a) .</formula><p>Proposition 3.2. For T AB -coalgebras the homomorphism property for h from (X, f ) and (Y, g) simplifies to: </p><formula xml:id="formula_18">g 0 h(x) (a) = f 0 (x)(a) g + h(x) (a) = h f + (x)(</formula><formula xml:id="formula_19">A = R B = R X = R sum 0 (x, a) = a + x dif 0 (x, a) = a − x sum + (x, a) = a + x dif + (x, a) = a</formula><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 T AB -coalgebra operation f , we would have to give a component of type f 0 : (A ω → B ω ) → A → B, which is not meaningful generically, without additional knowledge of A and B. On second thought, the T AB -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 T AB -coalgebras have the property of causality: output up to each step is determined by input only up to the same step. 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><formula xml:id="formula_20">A ω B = {k : A ω → B ω | ∀ n. α &lt;n = α &lt;n =⇒ k(α) &lt;n = k(α ) &lt;n }</formula><p>The space of causal stream functions can be endowed with a T AB -coalgebra operation, by a not entirely trivial construction <ref type="bibr" target="#b16">[17]</ref>. Proposition 3.6. For all k : A ω B we have in particular, at the first step:</p><formula xml:id="formula_21">head A (α) = head A (α ) =⇒ head B k(α) = head B k(α )</formula><p>Proposition 3.7. The previous property ensures that there is a generic map satisfying</p><formula xml:id="formula_22">head AB : (A ω B) → A → B head AB (k) head A (α) = head B k(α)</formula><p>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><formula xml:id="formula_23">tail AB (k)(a 0 )(α) = tail B k(a 0 ; α)</formula><p>Proposition 3.9. This map can be specified in analogy to (3.7):</p><formula xml:id="formula_24">tail AB : (A ω B) → A → (A ω B) tail AB (k) head A (α) tail A (α) = tail B k(α)</formula><p>Proposition 3.10. The pair of equations (3.7), (3.9) can be combined equivalently:</p><formula xml:id="formula_25">k(a 0 ; α) = head AB (k)(a 0 ) ; tail AB (k)(a 0 )(α)</formula><p>The causal function space A ω B admits a T AB -coalgebra operation t, namely t 0 = head AB and t + = tail AB . This is again a final T AB -coalgebra: from any other T AB -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 T AB -coalgebra. Then there is a map:</p><formula xml:id="formula_26">[ (f )] : X → (A ω B) [ (f )](x)(α) n = f 0 f + . . . f + (x)(α 0 ) . . . (α n−1 ) (α n )</formula><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, <ref type="bibr" target="#b14">[15]</ref>) of computations becomes a local property. Proposition 3.12. The homomorphism property (3.2) specializes for the final case to:</p><formula xml:id="formula_27">head AB [ (f )](x) (a 0 ) = f 0 (x)(a 0 ) tail AB [ (f )](x) (a 0 )(α) = [ (f )] f + (x)(a 0 ) (α)</formula><p>The proof of validity and uniqueness of [ (f )] is completely analogous to the S A -case; refer to (2.13) and (2.15), respectively. Proposition 3.13. Specialization of (3.10) with k = [ (f )](x) and (3.12) gives the recursive equivalent of the closed form <ref type="bibr">(3.11)</ref>:</p><formula xml:id="formula_28">[ (f )](x)(a 0 ; α) = f 0 (x)(a 0 ) ; [ (f )] f + (x)(a 0 ) (α)</formula><p>Algorithm 3.14. The following literal translation into Haskell syntax is a valid and useful, purely functional program:</p><formula xml:id="formula_29">trans :: (x -&gt; a -&gt; (b, x)) -&gt; x -&gt; [a] -&gt; [b]</formula><p>trans f x (a0 : as) = f0 x a0 : trans f (fp x a0) as where f0 x a = fst (f x a) fp x a = snd (f x a)</p><p>Example 3.15. The stream transforms of (3.4) have the desired semantics:</p><formula xml:id="formula_30">[ (sum)](c)(α) n = c + n i=0 α i [ (dif )](d)(α) 0 = α 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.</formula><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 <ref type="bibr" target="#b9">[10]</ref>.</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. Figure <ref type="figure">1</ref>: T AB -coalgebra (X, r) in quadrilateral form, from <ref type="bibr" target="#b16">[17]</ref>.</p></div>
<div xmlns="http://www.tei-c.org/ns/1.0"><head n="4">Compositional Stream Networks</head><p>The uncurried, quaternary form of T AB -coalgebra operations, r : X × A → B × X, henceforth abbreviated to r : A X − → 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 <ref type="bibr" target="#b16">[17]</ref>. The same form also suggests a visual, quadrilateral presentation, as illustrated in Figure <ref type="figure">1</ref>. The dichotomy of public I/O and private state suggests an object-oriented approach to execution. <ref type="foot" target="#foot_3">4</ref> Alluding to the visual form, and for lack of a more fitting name, we shall call the elements of a function space A X − → 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 r 0 , r + , x 0 are modeled as abstract methods. </p><formula xml:id="formula_31">head AB [[r x]] (a 0 ) = r 0 (x, a 0 ) tail AB [[r x]] (a 0 ) = [[r r + (x, a 0 )]]</formula><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:</p><formula xml:id="formula_32">k : A ω B l : C ω D k ⊗ l : A × C ω B × D (k ⊗ l)(α, γ) n = k(α) n , l(γ) n k : A ω B l : B ω C l • k : A ω C (l • k)(α) n = l k(α) n Proposition 4.5.</formula><p>The definition of parallel composition has the equivalent recursive form:</p><formula xml:id="formula_33">head (A×C)(B×D) (k ⊗ l)(a 0 , c 0 ) = head AB (k)(a 0 ), head CD (l)(c 0 ) tail (A×C)(B×D) (k ⊗ l)(a 0 , c 0 ) = tail AB (k)(a 0 ) ⊗ tail CD (l)(c 0 ) Proof. Implement k ⊗ l = [ (f )](k, l) coalgebraically as (A ω C) × (B ω D), f with: f 0 (k, l)(a 0 , c 0 ) = head AB (k)(a 0 ), head CD (l)(c 0 ) f + (k, l)(a 0 , c 0 ) = tail AB (k)(a 0 ), tail CD (l)(c 0 )</formula><p>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>Proposition 4.6. For any quadrilaterals q : A X − → B and r : C Y − → D, there is a quadrilateral q r such that:</p><formula xml:id="formula_34">q r : A × C X×Y −−−→ B × D [[q r x, y]] = [[q x]] ⊗ [[r y]]</formula><p>Instead of educated guesses as presented ad-hoc in <ref type="bibr" target="#b16">[17]</ref>, we can now give a formal derivation.</p><p>Proof. Take the composite s = q r as unknown and to be solved for. Assume the goal</p><formula xml:id="formula_35">G: [[s x, y]] = [[q x]] ⊗ [[p y]]</formula><p>and work out the homomorphism property according to (4.3): † s 0 (x, y), (a 0 , c 0 )</p><formula xml:id="formula_36">(4.3) = head (A×C)(B×D) [[s x, y]] (a 0 , c 0 ) (4.2) = head (A×C)(B×D) [[q x]] ⊗ [[r y]] (a 0 , c 0 ) G = head (A×C)(B×D) [ (q)](x) ⊗ [ (r)](y) (a 0 , c 0 ) (4.5) = head AB [ (q)](x) (a 0 ), head CD [ (r)](y) (c 0 ) (4.3) = q 0 (x, a 0 ), r 0 (y, c 0 ) † [[s ‡ s + (x, y), (a 0 , c 0 ) ]] (4.2) = [ (s)] s + (x, y)(a 0 , c 0 ) (3.12) = tail (A×C)(B×D) [ (s)](x, y) (a 0 , c 0 ) G = tail (A×C)(B×D) [ (q)](x) ⊗ [ (r)](y) (a 0 , c 0 ) (4.5) = tail AB [ (q)](x) (a 0 ) ⊗ tail CD [ (r)](y) (c 0 ) (3.12) = [ (q)] q + (x)(a 0 ) ⊗ [ (r)] r + (y)(c 0 ) = [ (q)] q + (x, a 0 ) ⊗ [ (r)] r + (y, c 0 ) G = [ (s)] q + (x, a 0 ), r + (y, c 0 ) (4.2) = [[s q + (x, a 0 ), r + (y, c 0 ) ‡ ]]</formula><p>By matching the marked terms we find the most evident solution:</p><p>(q r) 0 (x, y), (a, c) = q 0 (x, a), r 0 (y, c) (q r) + (x, y), (a, c) = q + (x, a), r + (y, c) Proposition 4.7. For any quadrilaterals q : A X − → B and r : B Y − → C, there is a quadrilateral q • r such that: Proof Sketch. By reasoning analogously to the preceding case, we find the solution:</p><formula xml:id="formula_37">q • r : A X×Y −−−→ C [[(q • r) (x, y)]] = [[r y]] • [[q x]]</formula><p>(q • r) 0 (x, y), a = r 0 y, q 0 (x, a) (q • r) + (x, y), a = q + (x, a), r + y, q 0 (x, a) Definition 4.8. A third meaningful axis of quadrilateral composition can be defined, symmetrically to the preceding. For any quadrilaterals q : A X − → B and r : C X − → D, there is q r : A × C X − → B × D, defined as:</p><p>(q r) 0 x, (a, c) = q 0 (x, a), r 0 q + (x, a), c (q r) + x, (a, c) = r + q + (x, a), c</p><p>All three compositions are depicted in Figure <ref type="figure">2</ref>.</p><p>Remark 4.9. A "diagonal" composition of the form depicted in Figure <ref type="figure">3</ref>, probably expected by any reader familiar with the state monad in functional programming <ref type="bibr" target="#b23">[24]</ref>, 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 (x ).</p><p>A little formal detail can make a big difference: for the state monad form, quadrilaterals are simply curried the other way, to r : 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.</p></div>
<div xmlns="http://www.tei-c.org/ns/1.0"><head n="5">State and Delay</head><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 <ref type="bibr" target="#b16">[17]</ref> 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.</p><p>Definition 5.1. The semantic delay operator takes an initial value and a stream to be delayed by one step.</p><formula xml:id="formula_38">delay A : A → A ω A delay A (a 0 )(α) 0 = a 0 delay A (a 0 )(α) n+1 = α n</formula><p>In other words, delay A is simply cons A with explicit causality; the initial value is prepended, and delay A (α) n+1 depends on α n exactly. We abbreviate cons A (a 0 ) to (a 0 ;).</p></div>
<div xmlns="http://www.tei-c.org/ns/1.0"><head>Proposition 5.2. The prepending operation as a class of final T AA -coalgebra elements obeys the recurrence:</head><p>head AA (a 0 ;)(a 1 ) = a 0 tail AA (a 0 ;)(a 1 ) = (a 1 ;)</p><p>Armed with this auxiliary fact, we can formulate the problem.</p></div>
<div xmlns="http://www.tei-c.org/ns/1.0"><head>Proposition 5.3. There is a quadrilateral form δ :</head><formula xml:id="formula_39">A A − → A such that [[δ a 0 ]] = (a 0 ;).</formula><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:</p><formula xml:id="formula_40">[ (δ)](a) = (a;). † δ 0 (a 0 , a 1 ) = δ 0 (a 0 )(a 1 ) [ (δ)] ‡ δ + (a 0 , a 1 )) = [ (δ)] δ + (a 0 )(a 1 ) (3.12) = head AA [ (δ)](a 0 ) (a 1 ) (3.12) = tail AA [ (δ)](a 0 ) (a 1 ) G = head AA (a 0 ;)(a 1 ) G = tail AA (a 0 ;)(a 1 ) (5.2) = a 0 † (5.2) = (a 1 ;) G = [ (δ)] (a 1 ) ‡</formula><p>By matching the marked terms we find the now evident, but generally mildly surprising, solution (see Figure <ref type="figure" target="#fig_4">4</ref>):</p><formula xml:id="formula_41">δ(a 0 , a 1 ) = (a 0 , a 1 )</formula><p>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.</p><p>Algorithm 5.4. With specialization to δ, the object-oriented implementation becomes:</p><p>class delay extends quad: step(a): var a' := x x := a return a' A visualization of delay is depicted in Figure <ref type="figure" target="#fig_4">4</ref>. 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 X 1 × • • • × X n is synthesized from the types of the n occurrences of delay operators in a network r, the corresponding initial value ξ = (x 1 , . . . , x n ) 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 <ref type="figure" target="#fig_5">5</ref>, 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 (s 0 , s 1 , s 2 , s 3 ):</p><p>[ -&gt; r where r := (x ^&lt;&lt; a ^&gt;&gt; b) ^(w ^&gt;&gt; c) x := s0 ; s1 ; s2 ; w w := s3 ; r ]</p><p>The result of state synthesis from delay operators is depicted in Figure <ref type="figure" target="#fig_5">5</ref>, 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: 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</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.</p></div>
<div xmlns="http://www.tei-c.org/ns/1.0"><head n="6">Higher Order: Stream Function Application</head><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 <ref type="bibr" target="#b21">[22,</ref><ref type="bibr" target="#b22">23]</ref>. 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. On the other hand, there is the view on a single stream function as a stream of element functions, given by the head AB and tail AB operations on A ω B. This view had already been explored, albeit in ad-hoc terms, and its practical relevance argued in <ref type="bibr" target="#b2">[3]</ref>. We have given a systematic theoretical reconstruction in <ref type="bibr" target="#b16">[17]</ref> and independently a practical implementation strategy in <ref type="bibr" target="#b17">[18]</ref>.</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 Z AB with an interpretation map, app AB , to represent some set of causal stream functions for each domain-range pair A, B:</p><formula xml:id="formula_42">app AB : Z AB → (A ω B)</formula><p>The type of the interpretation map, with the final coalgebra range, suggests a definition by homomorphism.</p></div>
<div xmlns="http://www.tei-c.org/ns/1.0"><head>Proposition 6.1.</head><p>There is a quadrilateral @ : A</p><formula xml:id="formula_43">Z AB − −− → B such that [ (@)] = app AB .</formula><p>Proof. Follow the same derivation strategy as before. † @ 0 (z, a 0 ) = @ 0 (z)(a 0 ) ‡ app AB @ + (z, a 0 ) G = [ (@)] @ + (z, a 0 )</p><formula xml:id="formula_44">(3.12) = head AB [ (@)](z) (a 0 ) = [ (@)] @ + (z)(a 0 ) G = head AB app AB (z) (a 0 ) † (3.12) = tail AB [ (@)](z) (a 0 ) G = tail AB app AB (z) (a 0 ) ‡</formula><p>By matching the marked terms, we find the specification up to interpretation:</p><formula xml:id="formula_45">@ 0 (z, a 0 ) = head AB app AB (z) (a 0 ) app AB @ + (z, a 0 ) = tail AB app AB (z) (a 0 )</formula><p>This account is, well, abstract. In particular, no help is given for making Z AB closed in the sense of the right hand equation; for each element z ∈ Z AB , we must also include, for each a 0 , some sucessor element @ + (z, a 0 ) ∈ Z AB 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 W ABX with an interpretation map app ABX to represent some set R ABX ⊆ (A X − → B) of quadrilaterals for each domain-range pair A, B and state space X:</p><formula xml:id="formula_46">app ABX : W ABX → (A X − → B)</formula><p>Unlike in the previous attempt, the choice of represented functions, Img(app ABX ), is completely arbitrary; we shall demonstrate that it need not be closed under any operation. Even finite W ABX 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><formula xml:id="formula_47">Z AB = X {X} × W ABX × X app AB (X, w, x) = [[app ABX (w) x]]</formula><p>Proposition 6.3. There is a quadrilateral @ : A</p><formula xml:id="formula_48">Z AB − −− → B, such that [ (@)] = app AB .</formula><p>Proof. Follow the usual derivation strategy. † @ 0 ((X, w, x), a 0 )</p><formula xml:id="formula_49">app AB ‡ @ + ((X, w, x), a 0 )) = @ 0 (X, w, x)(a 0 ) G = tail AB app AB (X, w, x) (a 0 ) G = head AB app AB (X, w, x) (a 0 ) (6.2) = tail AB [[app ABX (w) x]] (a 0 ) (6.2) = head AB [[app ABX (w) x]] (a 0 ) (4.2) = tail AB [ (app ABX (w))](x) (a 0 ) (4.2) = head AB [ (app ABX (w))](x) (a 0 ) (3.12) = [ (app ABX (w))](app ABX (w) + (x)(a 0 )) (3.12) = app ABX (w) 0 (x)(a 0 ) (4.2) = [[app ABX (w) app ABX (w) + (x)(a 0 )]] = app ABX (w) 0 (x, a 0 ) †<label>(6.2)</label></formula><p>= app AB X, w, app ABX (w) + (x, a 0 ) ‡ By matching the marked terms, we find the most evident solution: @ 0 (X, w, x), a 0 = app ABX (w) 0 (x, a 0 ) @ + (X, w, x), a 0 = (X, w, x ) where x = app ABX (w) + (x, a 0 )</p><p>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, x is the dynamically changing state variable typed by X. The return value and in-place update effect of app AB (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. 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. 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.</p></div>
<div xmlns="http://www.tei-c.org/ns/1.0"><head n="7">Conclusion</head></div>
<div xmlns="http://www.tei-c.org/ns/1.0"><head n="7.1">Related Work</head><p>Coalgebraic approaches have been studied early on in the context of structural operational semantics <ref type="bibr" target="#b19">[20]</ref>, 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 <ref type="bibr" target="#b5">[6]</ref>, and with abstract data types <ref type="bibr" target="#b4">[5]</ref>. 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 <ref type="bibr" target="#b15">[16]</ref>, constructive theorem provers such as Coq <ref type="bibr" target="#b1">[2]</ref>, (both of which have worrying issues with coinduction <ref type="bibr" target="#b8">[9]</ref>), categorical languages such as Charity <ref type="bibr" target="#b3">[4]</ref>, and "elementary" approaches to total functional programming <ref type="bibr" target="#b14">[15,</ref><ref type="bibr" target="#b20">21]</ref>.</p><p>Coalgebraic streams have been considered as a foundation for synchronous data-flow programming already in Lucid Synchrone <ref type="bibr" target="#b2">[3]</ref>. 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 <ref type="bibr" target="#b13">[14]</ref> is stream calculus <ref type="bibr" target="#b11">[12]</ref>, 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 <ref type="bibr" target="#b10">[11]</ref>, and more mathematical, with a particular emphasis on linear relationships <ref type="bibr" target="#b0">[1,</ref><ref type="bibr" target="#b12">13]</ref>.</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.</p></div>
<div xmlns="http://www.tei-c.org/ns/1.0"><head n="7.2">Outlook</head><p>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></div><figure xmlns="http://www.tei-c.org/ns/1.0" xml:id="fig_0"><head>a) Algorithm 3 . 3 .Example 3 . 4 .</head><label>3334</label><figDesc>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) The following two similar coalgebra operations compute the (cumulative) sum and the (backward) difference transform of a stream of numbers, respectively.</figDesc></figure>
<figure xmlns="http://www.tei-c.org/ns/1.0" xml:id="fig_2"><head>Definition 4 . 2 .Proposition 4 . 3 .</head><label>4243</label><figDesc>The denotational semantics [[r x]] of a quadrilateral form r : A X − → B with initial state x is given by (homomorphisms to) the final T AB -coalgebra.[[r x]] = [ (r)](x)The unique homomorphism for these semantics from (3.12) is specified by:</figDesc></figure>
<figure xmlns="http://www.tei-c.org/ns/1.0" xml:id="fig_3"><head>Figure 2 :Figure 3 :</head><label>23</label><figDesc>Figure 2: Legal composition axes for data flow networks [17].</figDesc></figure>
<figure xmlns="http://www.tei-c.org/ns/1.0" xml:id="fig_4"><head>Figure 4 :</head><label>4</label><figDesc>Figure 4: Delay operator; left: state-implicit bilateral form; right: state-explicit quadrilateral form.</figDesc></figure>
<figure xmlns="http://www.tei-c.org/ns/1.0" xml:id="fig_5"><head>Figure 5 :</head><label>5</label><figDesc>Figure 5: Marsaglia's four-word xorshift RNG; left: state-implicit form; right: state-explicit form.</figDesc></figure>
<figure xmlns="http://www.tei-c.org/ns/1.0" xml:id="fig_6"><head>Example 6 . 4 .</head><label>64</label><figDesc>Consider the Euler method for numerical integration of autonomous ordinary differential equations:ẏ = f (y) discretized to y n+1 = y n + δt • f (y n )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</figDesc></figure>
			<note xmlns="http://www.tei-c.org/ns/1.0" place="foot" n="1" xml:id="foot_0">More precisely a Set-endofunctor, but no other kind is considered here.</note>
			<note xmlns="http://www.tei-c.org/ns/1.0" place="foot" n="2" xml:id="foot_1">Functors are also required to preserve identity maps and compositions, but that is irrelevant for the present discussion.</note>
			<note xmlns="http://www.tei-c.org/ns/1.0" place="foot" n="3" xml:id="foot_2">We denote both the currying and uncurrying operations by overlining.</note>
			<note xmlns="http://www.tei-c.org/ns/1.0" place="foot" n="4" xml:id="foot_3">Indeed, the current Sig compiler targets the Java VM<ref type="bibr" target="#b17">[18]</ref>.</note>
		</body>
		<back>
			<div type="references">

				<listBibl>

<biblStruct xml:id="b0">
	<analytic>
		<title level="a" type="main">Co)Algebraic Characterizations of Signal Flow Graphs</title>
		<author>
			<persName><forename type="first">H</forename><surname>Basold</surname></persName>
		</author>
		<idno type="DOI">10.1007/978-3-319-06880-0_6</idno>
	</analytic>
	<monogr>
		<title level="m">Horizons of the Mind</title>
		<title level="s">Lecture Notes in Computer Science</title>
		<imprint>
			<publisher>Springer</publisher>
			<date type="published" when="2014">2014</date>
			<biblScope unit="volume">8464</biblScope>
			<biblScope unit="page" from="124" to="145" />
		</imprint>
	</monogr>
</biblStruct>

<biblStruct xml:id="b1">
	<analytic>
		<title level="a" type="main">Inductive and Coinductive Components of Corecursive Functions in Coq</title>
		<author>
			<persName><forename type="first">Y</forename><surname>Bertot</surname></persName>
		</author>
		<author>
			<persName><forename type="first">E</forename><surname>Komendantskaya</surname></persName>
		</author>
		<idno type="DOI">10.1016/j.entcs.2008.05.018</idno>
	</analytic>
	<monogr>
		<title level="j">Electronic Notes in Theoretical Computer Science</title>
		<imprint>
			<biblScope unit="volume">203</biblScope>
			<biblScope unit="issue">5</biblScope>
			<biblScope unit="page" from="25" to="47" />
			<date type="published" when="2008">2008</date>
		</imprint>
	</monogr>
</biblStruct>

<biblStruct xml:id="b2">
	<analytic>
		<title level="a" type="main">A Co-iterative Characterization of Synchronous Stream Functions</title>
		<author>
			<persName><forename type="first">P</forename><surname>Caspi</surname></persName>
		</author>
		<author>
			<persName><forename type="first">M</forename><surname>Pouzet</surname></persName>
		</author>
		<idno type="DOI">10.1016/S1571-0661(04)00050-7</idno>
	</analytic>
	<monogr>
		<title level="j">Electronic Notes in Theoretical Computer Science</title>
		<imprint>
			<biblScope unit="volume">11</biblScope>
			<biblScope unit="page" from="1" to="21" />
			<date type="published" when="1998">1998</date>
		</imprint>
	</monogr>
</biblStruct>

<biblStruct xml:id="b3">
	<monogr>
		<title level="m" type="main">About Charity</title>
		<author>
			<persName><forename type="first">R</forename><surname>Cockett</surname></persName>
		</author>
		<author>
			<persName><forename type="first">T</forename><surname>Fukushima</surname></persName>
		</author>
		<imprint>
			<date type="published" when="1992">1992</date>
		</imprint>
		<respStmt>
			<orgName>Tech. rep. University of Calgary</orgName>
		</respStmt>
	</monogr>
</biblStruct>

<biblStruct xml:id="b4">
	<analytic>
		<title level="a" type="main">Categorical Programming with Abstract Data Types</title>
		<author>
			<persName><forename type="first">M</forename><surname>Erwig</surname></persName>
		</author>
		<idno type="DOI">10.1007/3-540-49253-4_29</idno>
	</analytic>
	<monogr>
		<title level="m">Proc. AMAST</title>
		<title level="s">Lecture Notes in Computer Science</title>
		<meeting>AMAST</meeting>
		<imprint>
			<publisher>Springer</publisher>
			<date type="published" when="1998">1998</date>
			<biblScope unit="volume">1548</biblScope>
			<biblScope unit="page" from="406" to="421" />
		</imprint>
	</monogr>
</biblStruct>

<biblStruct xml:id="b5">
	<analytic>
		<title level="a" type="main">Objects and Classes, Co-Algebraically</title>
		<author>
			<persName><forename type="first">B</forename><surname>Jacobs</surname></persName>
		</author>
	</analytic>
	<monogr>
		<title level="m">Object Orientation with Parallelism and Persistence</title>
				<imprint>
			<date type="published" when="1995">1995</date>
			<biblScope unit="page" from="83" to="103" />
		</imprint>
	</monogr>
</biblStruct>

<biblStruct xml:id="b6">
	<analytic>
		<title level="a" type="main">A Tutorial on (Co)Algebras and (Co)Induction</title>
		<author>
			<persName><forename type="first">B</forename><surname>Jacobs</surname></persName>
		</author>
		<author>
			<persName><forename type="first">J</forename><surname>Rutten</surname></persName>
		</author>
	</analytic>
	<monogr>
		<title level="j">EATCS Bulletin</title>
		<imprint>
			<biblScope unit="volume">62</biblScope>
			<biblScope unit="page" from="222" to="259" />
			<date type="published" when="1997">1997</date>
		</imprint>
	</monogr>
</biblStruct>

<biblStruct xml:id="b7">
	<analytic>
		<title level="a" type="main">Xorshift RNGs</title>
		<author>
			<persName><forename type="first">G</forename><surname>Marsaglia</surname></persName>
		</author>
		<idno type="DOI">10.18637/jss.v008.i14</idno>
	</analytic>
	<monogr>
		<title level="j">Journal of Statistical Software</title>
		<imprint>
			<biblScope unit="volume">8</biblScope>
			<biblScope unit="page">14</biblScope>
			<date type="published" when="2003">2003</date>
		</imprint>
	</monogr>
</biblStruct>

<biblStruct xml:id="b8">
	<analytic>
		<title level="a" type="main">Let&apos;s See How Things Unfold: Reconciling the Infinite with the Intensional (Extended Abstract)</title>
		<author>
			<persName><forename type="first">C</forename><surname>Mcbride</surname></persName>
		</author>
		<idno type="DOI">10.1007/978-3-642-03741-2_9</idno>
	</analytic>
	<monogr>
		<title level="m">Proc. CALCO</title>
				<meeting>CALCO</meeting>
		<imprint>
			<date type="published" when="2009">2009</date>
			<biblScope unit="page" from="113" to="126" />
		</imprint>
	</monogr>
</biblStruct>

<biblStruct xml:id="b9">
	<analytic>
		<title level="a" type="main">Functional Reactive Programming, Continued</title>
		<author>
			<persName><forename type="first">H</forename><surname>Nilsson</surname></persName>
		</author>
		<author>
			<persName><forename type="first">A</forename><surname>Courtney</surname></persName>
		</author>
		<author>
			<persName><forename type="first">J</forename><surname>Peterson</surname></persName>
		</author>
		<idno type="DOI">10.1145/581690.581695</idno>
	</analytic>
	<monogr>
		<title level="m">Proc. Haskell Workshop. ACM</title>
				<meeting>Haskell Workshop. ACM</meeting>
		<imprint>
			<date type="published" when="2002">2002</date>
			<biblScope unit="page" from="51" to="64" />
		</imprint>
	</monogr>
</biblStruct>

<biblStruct xml:id="b10">
	<analytic>
		<title level="a" type="main">Sampling, Splitting and Merging in Coinductive Stream Calculus</title>
		<author>
			<persName><forename type="first">M</forename><surname>Niqui</surname></persName>
		</author>
		<author>
			<persName><forename type="first">J</forename><surname>Rutten</surname></persName>
		</author>
		<idno type="DOI">10.1007/978-3-642-13321-3_18</idno>
	</analytic>
	<monogr>
		<title level="m">Proc. MPC</title>
		<title level="s">Lecture Notes in Computer Science</title>
		<meeting>MPC</meeting>
		<imprint>
			<publisher>Springer</publisher>
			<date type="published" when="2010">2010</date>
			<biblScope unit="volume">6120</biblScope>
			<biblScope unit="page" from="310" to="330" />
		</imprint>
	</monogr>
</biblStruct>

<biblStruct xml:id="b11">
	<analytic>
		<title level="a" type="main">A coinductive calculus of streams</title>
		<author>
			<persName><forename type="first">J</forename><surname>Rutten</surname></persName>
		</author>
		<idno type="DOI">10.1017/S0960129504004517</idno>
	</analytic>
	<monogr>
		<title level="j">Mathematical Structures in Computer Science</title>
		<imprint>
			<biblScope unit="volume">15</biblScope>
			<biblScope unit="issue">1</biblScope>
			<biblScope unit="page" from="93" to="147" />
			<date type="published" when="2005">2005</date>
		</imprint>
	</monogr>
</biblStruct>

<biblStruct xml:id="b12">
	<analytic>
		<title level="a" type="main">Coalgebraic Foundations of Linear Systems</title>
		<author>
			<persName><forename type="first">J</forename><surname>Rutten</surname></persName>
		</author>
		<idno type="DOI">10.1007/978-3-540-73859-6_29</idno>
	</analytic>
	<monogr>
		<title level="m">Proc. CALCO</title>
		<title level="s">Lecture Notes in Computer Science</title>
		<meeting>CALCO</meeting>
		<imprint>
			<publisher>Springer</publisher>
			<date type="published" when="2007">2007</date>
			<biblScope unit="volume">4624</biblScope>
			<biblScope unit="page" from="425" to="446" />
		</imprint>
	</monogr>
</biblStruct>

<biblStruct xml:id="b13">
	<analytic>
		<title level="a" type="main">Universal coalgebra: a theory of systems</title>
		<author>
			<persName><forename type="first">J</forename><surname>Rutten</surname></persName>
		</author>
		<idno type="DOI">10.1016/S0304-3975(00)00056-6</idno>
	</analytic>
	<monogr>
		<title level="j">Theoretical Computer Science</title>
		<imprint>
			<biblScope unit="volume">249</biblScope>
			<biblScope unit="issue">1</biblScope>
			<biblScope unit="page" from="3" to="80" />
			<date type="published" when="2000">2000</date>
		</imprint>
	</monogr>
</biblStruct>

<biblStruct xml:id="b14">
	<analytic>
		<title level="a" type="main">Ensuring Streams Flow</title>
		<author>
			<persName><forename type="first">A</forename><surname>Telford</surname></persName>
		</author>
		<author>
			<persName><forename type="first">D</forename><surname>Turner</surname></persName>
		</author>
		<idno type="DOI">10.1007/BFb0000493</idno>
	</analytic>
	<monogr>
		<title level="m">Proc. AMAST</title>
				<meeting>AMAST</meeting>
		<imprint>
			<date type="published" when="1997">1997</date>
			<biblScope unit="page" from="509" to="523" />
		</imprint>
	</monogr>
</biblStruct>

<biblStruct xml:id="b15">
	<monogr>
		<title level="m" type="main">The Agda Wiki</title>
		<ptr target="http://wiki.portal.chalmers.se/agda/" />
		<imprint>
			<date type="published" when="2010">2010</date>
		</imprint>
	</monogr>
	<note>The Agda Team</note>
</biblStruct>

<biblStruct xml:id="b16">
	<analytic>
		<title level="a" type="main">Foundations of Total Functional Data-Flow Programming</title>
		<author>
			<persName><forename type="first">B</forename><surname>Trancón Y Widemann</surname></persName>
		</author>
		<author>
			<persName><forename type="first">M</forename><surname>Lepper</surname></persName>
		</author>
		<idno type="DOI">10.4204/EPTCS.153.10</idno>
	</analytic>
	<monogr>
		<title level="m">Electronic Proceedings in Theoretical Computer Science</title>
				<imprint>
			<date type="published" when="2014">2014</date>
			<biblScope unit="volume">154</biblScope>
			<biblScope unit="page" from="143" to="167" />
		</imprint>
	</monogr>
	<note>Proc. MSFP.</note>
</biblStruct>

<biblStruct xml:id="b17">
	<analytic>
		<title level="a" type="main">On-Line Synchronous Total Purely Functional Data-Flow Programming on the Java Virtual Machine with Sig</title>
		<author>
			<persName><forename type="first">B</forename><surname>Trancón Y Widemann</surname></persName>
		</author>
		<author>
			<persName><forename type="first">M</forename><surname>Lepper</surname></persName>
		</author>
		<idno type="DOI">10.1145/2807426.2807430</idno>
	</analytic>
	<monogr>
		<title level="m">Proc. PPPJ. ACM</title>
				<meeting>PPPJ. ACM</meeting>
		<imprint>
			<date type="published" when="2015">2015</date>
			<biblScope unit="page" from="37" to="50" />
		</imprint>
	</monogr>
</biblStruct>

<biblStruct xml:id="b18">
	<analytic>
		<title level="a" type="main">The Shepard Tone and Higher-Order Multi-Rate Synchronous Data-Flow Programming in Sig</title>
		<author>
			<persName><forename type="first">B</forename><surname>Trancón Y Widemann</surname></persName>
		</author>
		<author>
			<persName><forename type="first">M</forename><surname>Lepper</surname></persName>
		</author>
		<idno type="DOI">10.1145/2808083.2808086</idno>
	</analytic>
	<monogr>
		<title level="m">Proc. FARM. ACM</title>
				<meeting>FARM. ACM</meeting>
		<imprint>
			<date type="published" when="2015">2015</date>
			<biblScope unit="page" from="6" to="14" />
		</imprint>
	</monogr>
</biblStruct>

<biblStruct xml:id="b19">
	<analytic>
		<title level="a" type="main">Towards a Mathematical Operational Semantics</title>
		<author>
			<persName><forename type="first">D</forename><surname>Turi</surname></persName>
		</author>
		<author>
			<persName><forename type="first">G</forename><forename type="middle">D</forename><surname>Plotkin</surname></persName>
		</author>
		<idno type="DOI">10.1109/LICS.1997.614955</idno>
	</analytic>
	<monogr>
		<title level="m">Proc. LICS. IEEE</title>
				<meeting>LICS. IEEE</meeting>
		<imprint>
			<date type="published" when="1997">1997</date>
			<biblScope unit="page" from="280" to="291" />
		</imprint>
	</monogr>
</biblStruct>

<biblStruct xml:id="b20">
	<analytic>
		<title level="a" type="main">Total Functional Programming</title>
		<author>
			<persName><forename type="first">D</forename><forename type="middle">A</forename><surname>Turner</surname></persName>
		</author>
		<idno type="DOI">10.3217/jucs-010-07-0751</idno>
	</analytic>
	<monogr>
		<title level="j">Universal Computer Science</title>
		<imprint>
			<biblScope unit="volume">10</biblScope>
			<biblScope unit="issue">7</biblScope>
			<biblScope unit="page" from="751" to="768" />
			<date type="published" when="2004">2004</date>
		</imprint>
	</monogr>
</biblStruct>

<biblStruct xml:id="b21">
	<analytic>
		<title level="a" type="main">Signals and Comonads</title>
		<author>
			<persName><forename type="first">T</forename><surname>Uustalu</surname></persName>
		</author>
		<author>
			<persName><forename type="first">V</forename><surname>Vene</surname></persName>
		</author>
		<idno type="DOI">10.3217/jucs-011-07-1311</idno>
	</analytic>
	<monogr>
		<title level="j">Universal Computer Science</title>
		<imprint>
			<biblScope unit="volume">11</biblScope>
			<biblScope unit="issue">7</biblScope>
			<biblScope unit="page" from="1310" to="1326" />
			<date type="published" when="2005">2005</date>
		</imprint>
	</monogr>
</biblStruct>

<biblStruct xml:id="b22">
	<analytic>
		<title level="a" type="main">The Essence of Dataflow Programming</title>
		<author>
			<persName><forename type="first">T</forename><surname>Uustalu</surname></persName>
		</author>
		<author>
			<persName><forename type="first">V</forename><surname>Vene</surname></persName>
		</author>
		<idno type="DOI">10.1007/11575467_2</idno>
	</analytic>
	<monogr>
		<title level="m">Proc. APLAS. Ed</title>
		<title level="s">Lecture Notes in Computer Science</title>
		<editor>
			<persName><forename type="first">K</forename><surname>Yi</surname></persName>
		</editor>
		<meeting>APLAS. Ed</meeting>
		<imprint>
			<publisher>Springer</publisher>
			<date type="published" when="2005">2005</date>
			<biblScope unit="volume">3780</biblScope>
			<biblScope unit="page" from="2" to="18" />
		</imprint>
	</monogr>
</biblStruct>

<biblStruct xml:id="b23">
	<analytic>
		<title level="a" type="main">Comprehending Monads</title>
		<author>
			<persName><forename type="first">P</forename><surname>Wadler</surname></persName>
		</author>
		<idno type="DOI">10.1145/91556.91592</idno>
	</analytic>
	<monogr>
		<title level="m">Proc. LFP. ACM</title>
				<meeting>LFP. ACM</meeting>
		<imprint>
			<date type="published" when="1990">1990</date>
			<biblScope unit="page" from="61" to="78" />
		</imprint>
	</monogr>
</biblStruct>

				</listBibl>
			</div>
		</back>
	</text>
</TEI>
