Available online at www.sciencedirect.com

ScienceDirect

Electronic Notes in Theoretical Computer Science 301 (2014) 21-37

www.elsevier.com/locate/entcs

Observationally-induced Algebras in Domain Theory

Ingo Battenfeld1

Fakultät für Informatik

TU Dortmund Dortmund, Germany

Abstract

We investigate the observationally-induced free algebra approach for constructing computational monads in the categories of classical domain theory. Our investigation yields that the free algebra construction exists for all finitary algebraic signatures and computational prototypes. We furthermore investigate the classical powerdomain constructions in the observationally-induced approach. For the Hoare, Smyth and probabilistic powerdomain constructions we build on established results, showing that they can be recovered observationally-induced. However, the Plotkin powerdomain turns out to be more problematic. Here we show that with the obvious prototype algebra, Heckmanns algebra A, one does not get the classical Plotkin powerdomain.

Keywords: denotational semantics, computational effects, powerdomains, topological domain theory

1 Introduction

Eugenio Moggi's theory of computational monads uses a mathematical concept for separating programs involving computational effects, such as nondeterminism, exceptions, state or interactive I/O, from purely functional programs. Moreover, the monadic approach allows to systematically lift pure programs into an effectful environment [17]. This theory has proven so successful that it has been conceptually introduced into Haskell [13], one of the most broadly used functional programming languages today. Later on, Gordon Plotkin and John Power refined Moggi's approach by constructing the computational monads as free algebras for equational theories in the sense of universal algebra [19]. This idea allows a systematic combination of different effects [11] and helps explaining the origin of effects by introducing the concept of algebraic operations as effect triggers [18]. However, in contrast

1 Email: ingo.battenfeld@tu-dortmund.de

http://dx.doi.Org/10.1016/j.entcs.2014.01.003 1571-0661/© 2014 Elsevier B.V. All rights reserved.

to the correspondence between algebraic operations and effect triggers, the correspondence between algebraic equations and certain well-behavedness conditions of computational types seems to be slightly artificial.

In 2005 Alex Simpson and Matthias Schroder suggested a novel approach for constructing computational monads in semantic frameworks [20]. Similar to Plotkin and Power they use algebraic operations as effect triggers, but instead of using an equational theory, they suggest to define properties by a single algebra of computational observations, thought of as computational prototype, to characterise a class of complete algebras as computation types. The monad is then given by the free algebra construction into the class of those complete algebras. This approach is close in spirit to Smyth's theory of observable properties of datatypes [22], and therefore they call it observationally-induced. In [3,4], the observationally-induced free algebra approach has been investigated in the category Top of continuous maps between topological spaces, and, in [2], in general cartesian closed categories. The result in the former case was that the free observationally-induced algebra construction exists for arbitrary finitary signatures and computational prototypes, and in the latter case the same holds under fairly mild conditions on the ambient category.

In the work at hand we investigate the observationally-induced free algebra approach in the categories of classical domain theory, in particular in DCPO. One of our main result will be that DCPO supports the free algebra construction for arbitrary finitary signatures and prototypes. This was already claimed in [2], but in contrast to that work, here we use the definitions of [4], which exhibit the category of complete algebras as a full reflective category of the category of algebras for the given signature.

We also examine the classical powerdomain constructions, i.e. the Plotkin, Hoare, Smyth and probabilistic powerdomains via free observationally-induced algebras. The Hoare and Smyth constructions have in slightly different shape already been investigated in op.cit., and the probabilistic powerdomain in [20]. We use those results to show that they can be recovered in the observationally-induced approach. The proofs of completeness of the respective powerdomains all follow the same strategy, yielding a systematic template for further constructions. For the Plotkin powerdomain, Alex Simpson [21] has suggested to use Reinhold Heckmann's dcpo A [9] as computational prototype. However, we show that this observationally-induced construction not yield the classical Plotkin powerdomain, given by A-valuations loc.cit. or Goubault-Larrecq's quasilenses [8].

It should be mentioned that the work at hand and, in particular, some of our results bear close resemblance to Klaus Keimel's recent work [15], in which he relates state transformer and predicate transformer semantics in the category DCPO.

The paper is organised as follows. In Section 2 we recall the definitions of P-complete algebras as used in [4], and give two requirements under which they form a full reflective subcategory of the category of algebras for the underlying signature. The definitions differ from the original ones proposed by Schroder and Simpson, but with theirs a reflectivity result is not known. In Section 3, we show that DCPO satisfies the two requirements, and hence the free algebra construction

exists for arbitrary signatures and prototypes. In Section 4 we examine in how far the classical powerdomain constructions can be recovered in the ovbservationally-induced approach. Finally, in Section 5 we give conclusions.

2 Prerequisites

We assume C to be a cartesian closed category and Q a (finitary) algebraic signature. By Cq, we denote the category of Q-homomorphism between Q-algebras in C, defined as usual. We abbreviate Cn-algebras (A, {wa }) by A.

As C is cartesian closed, the category Cq has C-powers: if A ( = (A, {wa})) is a Cn-algebra and X any C-object, the canonical operations on AX are defined pointwise by:

wax := M/i)ieM- wA((fi( Moreover, we assume Cq to be C-enriched, i.e. for Cn-algebras A and B, the homomorphisms Cq(A, B) form a C-object, which we denote by [A ^ B]. We assume this C-object [A ^ B] is a subobject of the exponential BA, and if C has enough limits and colimits, it can be carved out of BA as an equalizer.

Finally, we fix a Cn-algebra P (= (P, {wp})) as computational prototype. The next definition is well-known in Synthetic Domain Theory.

Definition 2.1 For Cn-algebras A, B and C_, a Cn-homomorphism h : A ^ B is called C-equable, if every Cn-homomorphism f : A ^ C has a unique homomor-phism extension f : B ^ C along h.

In category-theoretical terms, h is orthogonal to the identity idc, written h ± idcX.

Next, we identify our class of computation types as complete algebras in the following sense.

Definition 2.2 A P-complete algebra is a Cn-algebra C for which every P-equable homomorphism h : A ^ B is C-equable, i.e.:

h ± idp ^ h ± idc•

We denote the category of Cn-homomorphisms between P-complete algebras by

Recall that the forgetful functor Cq ^ C creates limits. It turns out that the same holds for the subcategory of P-complete algebras.

Lemma 2.3 The forgetful functor U : Cp ^ C creates limits.

Proof. Clearly, the forgetful functor factors as Cp ^ Cq ^ C, and the right part creates limits. Thus, if D is a diagram in Cp, and the limit of U(D) exists in C, then it's limit Lim(D) carries a canonical Q-algebra structure, making (Lim(D), {w|jm(D)}) the corresponding limit in Cq. It only remains to show that

(Lim(D), {w|jm(_D)}) is P-complete, which follows from a straightforward calculation. The details are left to the inclined reader. □

A further assumption we want to make on a categorical framework for provide a good basis for observationally-induced effect monads is that Cp inherits C-powers from Cq. This cannot be shown from our definitions, so we make it our first requirement.

Requirement 1 The category Cp inherits C-powers from Cq.

For the next result, let us fix algebras A and B• Recall that we assume [A ^ B] to be a subobject of the exponential BA. We denote the inclusion by i. Moreover we have a canonical map 7 : A ^ BB , in A-terms given by Ax. A/ ./ (x). We denote the composite B1 o 7 : A ^ B[A^B by n. For simplicity's sake we write it in A-terms as Ax. Ah .h(x), where we use h to suggest that it takes the place of an Q-homomorphism.

Lemma 2.4 For all Q-algebras A and B, the map n : A ^ B[A^B1 is an Q-homomorphism on the corresponding algebra structures.

Proof. We have to show that for all operations w, the maps n◦ wa and Wbia^b] on|w| coincide. If we rewrite wa as A(xi)ie|^|.WA((xi)ie|^|), we calculate for the first term:

n o wa = (Ax. Ah. (h(x))) o (A(xi)ie|w|. WA((xi)ie|w|)) = A(xi)ie|^|. Ah. (h(wA(xi)ie|^|)).

For the second term we calculate:

wb[A-BJ o nM = (A(/0ieM. Ah. wb((/i(h))ie|^|)) o (A(xi)ie|^|. A(hi)ie|^|. (hifai^ieM) = A(xi)ie|w|. Ah. wb(((Ah. (h(xi)))(h))ie|w|) = A(xi)ie|w|. Ah. wb((h(xi))ieM).

So for the terms to be equal, we need h(wA(xi)ie|w|) = wb((h(x^))ie|w|), which is exactly the condition for h to be an Q-homomorphism. □

Thus, in particular, for every Cn-algebra A, we obtain a canonical Cn-homomorphism nA : A ^ P. Our second requirement for a categorical framework, building upon the first, demands this map to have a convenient factorisation.

Requirement 2 For every Cn-algebra A, the canonical Cn-homomorphism nA : A ^ Pfactors as a P-equable h : A ^ A, with A being P-complete, followed by a monomorphism A ^ P.

Observe that the demand on A being P-complete, characterises this factorisation unique up to isomorphism.

Proposition 2.5 Under Requirements 1 and 2, the category Cp forms a full reflective subcategory of Cq.

Proof. The reflection of an Q-algebra A is the P-complete algebra A obtained in the factorisation of n from Requirement 2. □

3 Observationally-induced algebras in Domain Theory

We will now consider categories of P-complete algebras in classical domain theory. We start by fixing our notation.

By DCPO we denote the category of Scott-continuous maps between directed complete partially ordered sets (dcpos). It is well-known that DCPO is a cartesian closed, complete and cocomplete category. Again we assume a finitary algebraic signature Q to be given, and we obtain the category DCPOn of Scott-continuous Q-homomorphisms between dcpo-Q-algebras (for which we also write DCPOn-algebras). As in the previous section, we abbreviate DCPOn-algebras by underlining: A := (A, {wa}). For a (pointwise) directed family of Scott-continuous Q-homomorphism {hi : A ^ B}iei, the (pointwise) directed supremum \/ieI hi is also a Scott-continuous Q-homomorphism A ^ B, hence the category DCPOq is DCPO-enriched. We denote the dcpo of homomorphisms between A and B by [A ^ B]. For DCPO-powers, if X is a dcpo and A a DCPOn-algebra, we denote X-power of A by AX.

We also fix a DCPOn-algebra P as computational prototype and get the notions of P-equable homomorphisms and complete P-algebras as in the previous section. DCPOp denotes the category of Scott-continuous Q-homomorphisms between incomplete algebras (which we also abbreviate by DCPOp-algebras).

We will also use the notions of subdcpos and subalgebras, for which we give the following formal definition.

Definition 3.1 If X is a dcpo, then a subdcpo of X is a subset Y C X such that for every directed {yi}iei C Y, the supremum Viei yi as calculated in X belongs to Y.

If A = (A, {wa}) is a DCPOn-algebra, then a DCPOn-subalgebra is given by a DCPOn-algebra B = (B, {wb}) such that B is a subdcpo of A and the corresponding embedding is a Scott-continuous Q-homomorphism B ^ A. We write B < A to denote that B is a DCPOn-subalgebra of A.

If A is a DCPOp-algebra, then a P-complete subalgebra of A is a DCPOn-subalgebra B of A which itself is P-complete.

We now proceed to show that DCPO satisfies Requirements 1 and 2 of the previous section. We start with some results which are specific to the category DCPO. The first such observation, which is well known, is that a map f : X x Y ^ Z is Scott-continuous if and only if it is continuous in each component separately. Let us now define component-wise homomorphisms.

Definition 3.2 Let X be a dcpo and A and B be DCPOn-algebras. Then a Scott-continuous map f : X x A ^ B is a right Q-homomorphism, if for all x £ X, w G Q and {ai }ie m C A^ it holds that f (x, wA((ai)ie|^

The following result, the straightforward verification of which is left to the inclined reader, is not specific to DCPO, but holds in every well-pointed cartesian closed category.

Lemma 3.3 Let X be a dcpo and A and B be DCPOn-algebras. Then a Scott-continuous map f : X x A ^ B is a right Q-homomorphism if and only if its exponential transpose f t becomes a Q-homomorphism A ^ BX.

The next lemma, from which Requirement 1 immediately follows, is very specific to the category DCPO.

Lemma 3.4 In the category DCPO, an Q-homomorphism h : A ^ B is C-equable if and only if it is CX-equable for every DCPO-power of C.

Proof. Let h be C-equable. We have to show that it is CX-equable for every DCPO-power of C.

So assume f : A ^ CX is any Q-homomorphism. We consider its exponential transpose g : X x A ^ C which is a right homomorphism on the corresponding algebra structures. Thus, for every x G X, the corresponding map gx : A ^ C (given by a ^ g(x, a)) yields a homomorphism A ^ C, hence has a unique extension gx : B ^ C along h.

Thus, we can define a map g : X x B ^ C, by (x,b) ^ gx(b), which clearly is a right homomorphism on the corresponding algebra structures. It must also be unique as such, as otherwise we could find some x0 G X, for which gx0 had no unique extension along h, contradicting the C-equablity of it. Hence, it remains to show that gg is Scott-continuous.

Since all the gx are Scott-continuous by assumption, it suffices to show that g is Scott-continuous in its first component, i.e. for all 60 G B and directed {xi}iei C X, it holds that

Vg(xi'bo) = ?(V xi,bo).

iel iel

This is to show that Viei gxi = gy xi. Since Viei gxi is the directed supremum of Scott-continuous Q-homomorphisms B ^ C, it is itself a Scott-continuous Q-homomorphism. As it holds that Vieigxi(h(a)) = gy.eIxi(h(a)), for all a G A, we get that Viei gxi extends gyieI xi along h, and so by uniqueness it must hold that

Viei gxi = gviei xi, as required. □

Corollary 3.5 The category DCPO satisfies Requirement 1 from the previous section.

In order to show that DCPO also satisfies Requirement 2, we make use of the so-called d-completion [25], which is also known as monotone convergence reflection [6]. It is a topological construction which applied in DCPO assigns to a subset S C X of a dcpo X, the smallest subdcpo d(S) C X containing S. Keimel and Lawson [16] have shown that given a semi-topological Q-algebra (A, {wa}) (i.e. all operations are separately continuous), the operations can be extended to its d-completion, rendering (d(A), {w^(a)}) a semi-topological Q-algebra. We use their result in the following form.

Lemma 3.6 Let A = (A, {wa}) be a DCPOn-algebra, and S C A be a subset closed under the operations wa. Then (d(S), {wa|^(s)}) is a DCPOn-subalgebra of A.

Proof. Considering S C A as a topological subspace, (S, {wa|s}) becomes a semi-topological Q-algebra. Hence, by Keimel and Lawsons result, the operations can be extended to its d-completion, and so (d(S), {wa|d(s)}) is a semi-topological Q-algebra, making it a DCPOn-subalgebra of A. □

Proposition 3.7 The category DCPO satisfies Requirement 2, i.e. for every DCPOn-algebra,, the Scott-continuous Q-homomorphism n : A ^ Pfactors as h : A ^ A' followed by i : A' ^ Psuch that A is P-complete, h is P-equable and A' < P.

Proof. Consider im (n) C P[A^P], the image of the map n. It is clear that im(n) is closed under the operations {wp[a^pj }, since n is an Q-homomorphism, by Lemma 2.4. We set A C to be the d-completion of im(n), which by the previous

lemma becomes a DCPOn-subalgebra A of P. Now we consider the set

J := {B<P[A^P]| B is P-complete and A <B}.

Since DCPO satisfies Requirement 1, g J, hence J is nonempty. Con-

sider J := P| bj B as a subset of P [A^P]. By Lemma 2.3, J equipped with the induced operations of Pbecomes a P-complete DCPOn-subalgebra of P[A^P], as the intersection can be described as the limit of the corresponding DCPOn-subalgebra embeddings. Also, it clearly holds that A < J. Now, we have a factorisation of n as:

A A J P

where all parts are Scott-continuous Q-homomorphisms, and the map on the right-hand side is a DCPOn-subalgebra embedding. It remains to show that composition of the two maps on the left-hand side, which we denote by h : A ^ J is P-equable.

For this, consider any Scott-continuous Q-homomorphism / : A ^ P and the following diagram:

[A^P ]

where : P^ P is the evaluation map F ^ F(f ), which is readily checked to be a Scott-continuous Q-homomorphism. Thus, composition o i : J ^ P extends f along h. It remains to show uniqueness as such.

For this suppose g : J ^ P is another such map. Then, the equalizer of o i and g defines a P-complete DCPOn-algebra J' < J, which also is a P-complete DCPOn-subalgebra of P[A^P] containing the image of n, and hence A, hence J' G J, and it follows that J' = J. This only holds if o i = g, showing that h is P-equable, as required. □

Thus Proposition 2.5 applies to DCPO.

Theorem 3.8 For every finitary algebraic signature Q and computational prototype P, the category DCPOp is a full reflective subcategory of DCPOq.

It is well-known that for any finitary algebraic signature, the forgetful functor DCPOq ^ DCPO has a left adjoint, i.e. the absolutely free algebra construction F : DCPO ^ DCPOq exists. Composing this absolutely free algebra functor with the reflection we obtain a free DCPOp-algebra functor.

Corollary 3.9 For every finitary algebraic signature Q and computational prototype P, the forgetful functor DCPOp ^ DCPO has a left adjoint Fp : DCPO ^ DCPOp.

Finally, we show that the P-complete algebras satisfy all algebraic inequations satisfied by P itself. The proof is very much akin to the corresponding proof about algebraic equations in the topological framework [3].

Proposition 3.10 Let t < t' be an algebraic inequation satisfied by P. Then all P-complete algebras satisfy t < t'.

Proof. Let X be a discretely ordered countable set. Then X is a dcpo, and we can form the free DCPOn-algebra TX, consisting of all generic Q-terms. TX is itself discretely ordered. Furthermore the algebraic inequation t < t' induces an inequational theory (Q,I) and we can form the free DCPO(ni)-algebra FX over X. FX is not discretely ordered as it satisfies our inequation for all variable instantiations.

By the properties of free algebras, we have a canonical Q-homomorphism h : TX ^ FX, extending the inclusion X ^ FX along the inclusion X ^ TX, and there are isomorphisms between Scott-continuous maps X ^ P, Q-homomorphisms TX ^ P and Q-homomorphisms FX ^ P, the last correspondence given by extensions along h. This makes h a P-equable Q-homomorphism.

Thus, for each P-complete Q-algebra B, every Q-homomorphisms v : TX ^ B can be extended along h to an Q-homomorphisms v : FX ^ B. So let tv ,tv G B be corresponding term instantiations of t, t' given by v : TX ^ B. Let U C B be Scott-open, containing tv. Then we have that for the corresponding terms t, t' G FX (i.e. tv = v(t) and t^ = v(t')), that t G v-1(U), hence t' G v-1 (U), and so t^ G U. This shows tv <b tV, as required. □

I. Battenfeld/Electronic Notes in Theoretical Computer Science 301 (2014) 21-37

4 Powerdomain Constructions

We now examine in how far the classical powerdomain constructions can be recovered by the observationally-induced approach. We start with the Hoare, Smyth and (extended) probabilistic powerdomains. The results for the Hoare and Smyth powerdomains have been worked out in a topological setting in [3,4]. The proof strategy is the same in the cases at hand, so we omit the proofs, as the reader should have no problems filling in the details by consulting loc. cit.. In the case of the extended probabilistic powerdomain, the needed technicalities follow essentially from the work of Tix [23], so we give brief hints for the proofs in this case.

For constructing the Plotkin powerdomain in the observationally-induced approach, Simpson [21] has suggested to use Heckmann's three-element domain A [9] as computational prototype. We give a very simple counterexample showing that the observationally-induced approach with this prototype does not yield the classical Plotkin powerdomain, but may contain genuinely more elements. In fact, the algebra of traditional construction fails to be A-complete even in most simple cases.

In the three cases for ordinary nondeterminism, i.e. the Hoare, Smyth and Plotkin powerdomains, we consider an algebraic signature consisting of a single binary operation Q = {*}, and write the shorthands ^-algebras (or DCPO*-algebras) and *-homomorphisms (or DCPO*-homomorphisms). Furthermore, we let S denote the two element Sierpinski-domain {±, T} with ± < T, but not vice-versa. We constantly identify maps f : X ^ S with the corresponding Scott-open subsets U := f-1({T}).

In the case of the extended probabilistic powerdomain, we use a signature Q = {*A | A G R+}, where R+ denotes the set of the nonnegative real numbers, extended by to. We also use R+ to denote the dcpo consisting of the same underlying set and the usual order. R+ becomes a DCPOn-algebra (in fact a dcpo-cone [24]) when equipped with the operations as x +a y := A ■ x + (1 — A) ■ y, as usual.

4.1 The Hoare Powerdomain

The prototype algebra for the Hoare powerdomain is §v := (S, V), where V : S2 ^ S is the usual join operation. The Scott-continuous maps f : X ^ S can be identified with open subsets U C X, by U = f-1({T}).

The classical characterisation of the Hoare powerdomain over a dcpo X exhibits it as the dcpo of nonempty closed subsets of X ordered by inclusion, which we denote by C(X), with the operation given by set-union, i.e. (C(X), U). We use a general strategy to show that for every dcpo X, (C(X), U) is a DCPO§V-algebra.

The key for this is to characterise it algebraically as a subsetofSS .This is obtained by the following sequence of results.

Lemma 4.1 The map i : C(X) ^ SsX is Scott-continuous and becomes a *-homomorphism (C(X), U) ^ SVS .

Lemma 4.2 An element F G SsX is in im(i) if and only if it satisfies the following two properties:

(i) F(X) = T,

(ii) F(U V V) = F(U) V F(V).

Theorem 4.3 For every dcpo X, (C(X), U) is a Sy-complete algebra.

It is known that for every dcpo X, (C(X), U) is the free dcpo-algebra over X for an inequational theory which is given by reflexivity, commutativity and associativity for *, together with the inequation x < x * y. Thus, freeness follows from the universal property of the classical free algebra construction.

Theorem 4.4 For every dcpo X, the free DCPO§V-algebra over X is given by (C(X), U), with the free algebra inclusion X ^ C(X) being the point closure map.

4.2 The Smyth Powerdomain

The prototype algebra for the Smyth powerdomain is §a := (S, A), where A : S2 ^ S is the usual meet operation. The classical characterisation of the Smyth powerdomain over a continuous dcpo X exhibits it as the dcpo of nonempty compact saturated subsets of X ordered by reverse inclusion, which we denote by K(X), with the operation given again by set-union, i.e. (K(X), U). Under the assumption of sobriety, one can again show that (K(X), U) is a DCPOsa-algebra.

Lemma 4.5 For a sober dcpo X, 1 : K(X) ^ SsX is Scott-continuous and becomes

a *-homomorphism (K(X), U) ^ §a .

Lemma 4.6 For a sober dcpo X, an element F G SsX is in im(i) if and only if it satisfies the following two properties:

(i) F(0)=

(ii) F(U A V) = F(U) A F(V).

Theorem 4.7 For every sober dcpo X, the DCPO^-algebra (K(X), U) is S ^-complete.

It is known that for every continuous dcpo X, (K(X), U) is the free dcpo-algebra over X for an inequational theory which is given by reflexivity, commutativity and associativity for *, together the inequation x * y < x. This yields the following result.

Theorem 4.8 For every continuous dcpo X, the free DCPOsa-algebra over X is given by (K(X), U), with the free algebra inclusion X ^ K(X) being x ^|{x}.

4.3 The extended Probabilistic Powerdomain

The prototype algebra for the extended probabilistic powerdomain is R+ := (R+, {+a}), defined as above. The classical characterisation of the extended probabilistic powerdomain over a continuous dcpo X exhibits it as the dcpo of Scott-continuous valuations V(X), i.e. Scott-continuous maps v : O(X) ^ R+ with v(0) = 0 and v(U U V) + v(U fl V) = v(U) + v(V), ordered pointwise, and with the corresponding operations given pointwise.

We show the results only for continuous dcpos in this case, as this allows us to use the topological results of [23], because in this case the Scott-topology and the weak topology used in loc.cit. coincide. Also initiality of V(X) for dcpo-cones is only known in this case. Notationally we do not distinguish between operations on DCPO-powers of DCPOq-algebras and the corresponding ground algebras. This should not cause any confusion, as the corresponding operation lifting is canonical.

Lemma 4.9 For a continuous dcpo X, the map i : V(X) ^ R+ + is Scott_ rx

continuous and becomes an Q-homomorphism (V(X), {+a}) ^ R+ + .

Proof. This follows from Satz 4.4 in [23]. □

Lemma 4.10 For a continuous dcpo X, an element F G R+ + is in im(i) if and only if it satisfies the following two properties:

(i) F(const0) = 0,

(ii) F(f +a g) = F(f )+A F(g).

Proof. This is essentially the Riesz-Representation Theorem which is Satz 4.19 in [23]. □

Theorem 4.11 For every continuous dcpo X, (V(X), {+a}) is a R+-complete algebra.

Proof. The proof is now purely algebraic and follows exactly the steps of the proof of Lemma 4.14 below. The details are left to the inclined reader. □

It is known that for every continuous dcpo X, (V(X), {+a}) is the free dcpo-cone over X, see [12]. This yields the following result.

Theorem 4.12 For every continuous dcpo X, the free DCPOr+ -algebra over X is given by (V(X), {+a}), with the free algebra inclusion X ^ V(X) mapping x G X to the corresponding point evaluation.

4.4 The Plotkin Powerdomain

Let A be the three element chain, which has as underlying set {0,1, 2} with 0 < 1 < 2 and not vice-versa. As suggested by Simpson [21], for the convex powerdomain we choose the prototype algebra A« := (A, M), where M: A2 ^ A is defined as:

(2 if x = y = 2 x M y := ^0 if x = y = 0 1 otherwise.

The Scott-continuous maps f : X ^ A can be identified with pairs of open subsets (U, V) of X such that U C V, by U = f-1({2}) and V = f-1({1}), and we may switch between these representations.

We proceed as in the previous sections to characterise a suitable DCPOam-subalgebra of the double exponential Ama algebraically.

Definition 4.13 Let X be a dcpo. Let A(X) be the subdcpo of AaX given by those elements which satisfy the following three properties:

(i) F(consto) = 0,

(ii) F(const2) = 2,

(iii) F(f M g) = F(f) M F(g),

where in the last property f M g uses the corresponding operation on Amx.

That A(X) is indeed a subdcpo of AaX is easily checked, as well as that it is closed under the operation M, i.e. it is a subalgebra. In fact it is a complete subalgebra, as the following result shows.

Lemma 4.14 For every dcpo X, the DCPO*--algebra (A(X), M) is Am-complete.

Proof. We denote the embedding (A(X), M) ^ AmaX by e. Let h : A ^ B be AM-equable and f : A ^ (A(X), M) be a Scott-continuous ^-homomorphism. Consider the following diagram:

___ _ _ _ _ _ ^

♦ ❖

B' (A(X), M)—^ AmaX

where e o f : B ^ Ama is the unique homomorphism extension of e o f along h, obtained by Ama being An-complete. It suffices to show that for all b £ B, e o f (b) satisfies properties (i)-(iii) of Definition 4.13.

For this, observe that for every f : X ^ A, the evaluation map n/ : AmaX ^ A^. is a *-homomorphism, since the canonical operations on DCPO-powers of AM-complete algebras are just given by pointwise liftings. Thus we get that nconst0 ◦ e o f must be the unique *-homomorphism extension of nconst0 o e o f along h. But the latter is equal to the map const0 : A ^ A^, because it factors through f, and all elements of im(i) satisfy property (i) of Definition 4.13. Thus, by uniqueness of homomorphism extensions, it must also hold that nconst0 oe o f = const0 : B ^ Am, showing that for all b £ B, e o f (b) satisfies property (i). A very similar argument can be made for showing that the same holds for property (ii).

In order to show that property (iii) holds, observe that M: Am2 ^ Am can be used to compose homomorphisms into Am, i.e. if g,g' are any Scott-continuous ★-homomorphisms from the same source algebra into Am, then the pointwise composition g M g' is a Scott-continuous ^-homomorphism, as well. Thus, we get that

for all f, g : X ^ A, it holds that (n/ o e o f) M (ng o e o f) is a *-homomorphism extension of (n/ o e o f) M (ng o e o f) along h. But the latter is equal to n/o e o f, since it factors through f. Finally, n/o e o f is extended along h by n/o e o f, and so by uniqueness we get that (n/ o e o f) M (ng o e o f) = n/o e o f, which shows that for all b G B:

(&)(/ M g) = n/Mg o e^f (b)

= ((n/ o eof) M (ng o eo7))(b) = (n/ o eo7)(b) m (ng o eo7)(b)

= eof (b)(7) m eof (b)(g),

hence e o f (b) satisfies property (iii) from Definition 4.13, which concludes the proof. □

In correspondence to the powerdomains examined in the previous sections, one might expect that the DCPOam-algebra defined in Definition 4.13 is in fact the traditional convex powerdomain. However, we now show that this is not the case even for very simple dcpos.

Several different definitions of the traditional convex powerdomain (or Plotkin powerdomain) can be found in the literature. The standard references [6,1] use the notion of lenses, Goubault-Larrecq [8] substitutes lenses with the notion of quasi lenses to obtain more general results. However, the most suitable definition for our purpose was suggested by Heckmann [9] and is equivalent to Goubault-Larrecq's. He uses the notion of an A-valuation over X which is a Scott-continuous map a : O(X) ^ A such that a(0) = 0, a(X) = 2, a(U) = 0 implies a(U U V) = a(V) and a(U) = 2 implies a(U n V) = a(V). For every dcpo X, we denote the set of A-valuations ordered pointwise by AVal(X). It is straightforward to check that the directed supremum of A-valuations in the function space is again an

A-valuation, hence AVal(X) is always a dcpo. Furthermore we define a binary operation i+J : AVal(X)2 ^ AVal(X), by applying M pointwise, i.e. for all open U C X, (a+a')(U) := a(U) M a'(U). It is easily checked that + is Scott-continuous, hence (AVal(X), +) forms a DCPO*-algebra.

There is a Scott-continuous *-homomorphism embedding of (AVal(X), +) into A«a , given by the map i : AVal(X) ^ AaX . In terms of maps given by pairs of open subsets i is given by:

( 2 if a(U) = 2 i(a)((U, V)) = J0 if a(V) = 0 1 otherwise.

In fact it becomes a DCPO*-algebra embedding. The proof of this claim is left to the inclined reader.

We simply remark that every element in im(i) satisfies the properties of Defini-

<{a,b}, {a,b}} o

<{a}, {a}} o

◦ <{b}, {b}}

<0, 0}

Fig. 1. a2

12 112 11

21 2 1 0 1 0

11 111 11

12 012 01

110 10

11 011 01

Fig. 2. A(2)

tion 4.13, but in the following we will show that these are not enough to characterise im(i) completely.

We now give an example of a dcpo X for which AVal(X) = A(X). In fact, it suffices to take X to be 2, the two-element discrete domain. Let us denote the elements of 2 by {a, b}. AVal(2) is well-known to consist of three elements aa, aa which are defined as:

similar for a and

aab (U)

if a £ U otherwise,

if U = 2 if U = 0 otherwise.

Let us also give a sketch of the dcpo A2. In terms of pairs of opens it looks as in Figure 1. The operation M on Am2 combines elements "towards the middle". We now sketch A(2) C Aa2 , by giving the corresponding images of the elements of A2, as sketched in Figure 1. Notice that by conditions (i) and (ii), for every F £ A(2), we have that F((0, 0)) = 0 and F(({a, b}, {a, b})) = 2. Hence, we can omit the top and bottom elements. Thus, A(2) looks as in Figure 2, where we have omitted the orderings and named the elements according to their position in the diagram, i.e. ul for upper left and so on. In fact, we see that A(2) is isomorphic to the subalgebra

of Am2 obtained by omitting the top and bottom elements, the isomorphism being homomorphic.

There is an obvious embedding k : AVal(2) ^ A(2), given by aa ^ l, a& ^ r, aab ^ c. With the following lemma, k is easily shown to be A-equable.

Lemma 4.15 Every Scott-continuous map f : 2 ^ A has a unique homomorphism extension f : (A(2), M) ^ Am along the canonical embedding 2 ^ A(2).

Proof. We exemplify the proof by showing the claim for the map f : 2 ^ A, given by f (a) = 2 and f (b) = 1. The canonical embedding is given by a ^ l and b ^ r. This immediately yields f (l) = 2 and f (r) = 1, and so:

f (c)= f (l M r) = f (l) M f (r) = 1. Since ul > l, monotonicity yields f (ul) = 2.

The final three cases all follow the same pattern, the most interesting one being ll. Monotonicity yields f (ll) < f (c) = 1. But we also get:

f (ll) = f (ll M l) = f (ll) M f (l) = 0,

hence only f (ll) = 1 remains. □

Corollary 4.16 The embedding k : AVal(2) ^ A(2) is A-equable and the free DCPOam-algebra over 2 is given by A(2).

So we have shown that the DCPOam-algebra (A(X), M) is in general larger that the algebra of A-valuations. However, the question remains whether it characterises the free DCPOam-algebra construction. We conjecture this to be the case for continuous dcpos, but have no proof for it at the moment.

Finally, we remark that we do not think that another observationally-induced theory will yield the traditional Plotkin powerdomain construction. The reason for this is that the algebra Am is a very canonical case of a Plotkin powerdomain, namely the traditional Plotkin powerdomain over the Sierpinsky space S. Thus, Am must belong the class of complete algebras for an observationally-induced theory giving the Plotkin powerdomain. But our example above shows that this is very unlikely to be the case.

5 Conclusions and Further Work

We have shown that the category DCPO of Scott-continuous maps between dcpos supports a free observationally-induced algebra construction for arbitrary finitary algebraic signatures Q and computational prototypes P. The construction is given by an ordinary absolutely free Q-algebra construction followed by a reflection functor into the category of P-complete algebras. Showing the existence of the reflection functor was made possible by using the definition of P-complete algebras using P-equable homomorphisms, given in Section 2.

Moreover, we have investigated in how far the classical powerdomains can be recovered in the observationally-induced approach. For the Hoare, Smyth and (extended) probabilistic powerdomains we have given observationally-induced constructions which yield the traditional constructions. For any dcpo the observationally-induced Hoare powerdomain is given by the dcpo of non-empty Scott-closed subsets, for all continuous dcpos the observationally-induced Smyth powerdomain is given by the dcpo of nonempty compact saturated subsets and the observationally-induced (extended) probabilistic powerdomain is given by the dcpo of R+-valued valuations. Corresponding results should also hold for other versions of probabilistic powerdomains.

Only the Plotkin powerdomain falls out of this pattern. We have shown that using Heckmann's dcpo A as computational prototype does not yield the dcpo of A-valuations, even in simplest cases. Our results suggest that no observationally-induced constructions exists which gives the traditional construction. This is in accordance with recent investigations by Klaus Keimel2 , who also examines algebraic properties of the Plotkin powerdomain.

The attentive reader will have realised that the prototypes we used for the powerdomain constructions are always of the form FS where F is the free algebra functor for the inequational theory of the corresponding classical construction. This can be used as a general pattern: as a prototype for an observationally-induced construction for a certain effect E, one can always use the algebra FeS, where F is the free algebra construction obtained by the (in)equational approach of Plotkin and Power. This also yields a method for combining observationally-induced monads: if we want to model a combination of the effects E and E', we can calculated the combination Fe©e' of the free algebra functors Fe and Fe', as in the theory developed in [11,10], and then use Fe©e'S as computational prototype. However, in how far this prototype for the combination yields the traditional combination of the corresponding monads, such as sum and tensor, still needs to be examined. First investigations hint at the situation being non-trivial. Such an approach of combining prototypes also raises the questions as to whether the various combinations of powerdomain constructions [24,14,5,7,8] can be recovered this way.

Acknowledgements

The author wishes to thank Ernst-Erich Doberkat, Klaus Keimel, Alex Simpson and Thomas Streicher for helpful and encouraging discussions.

References

[1] Samson Abramsky and Achim Jung. Domain theory. volume 3 of Handbook of Logic in Computer

Science, pages 1—168. Clarendon Press, Oxford, 1994.

[2] Ingo Battenfeld. Observationally-induced effects in cartesian closed categories. Electr. Notes Theor.

Comput. Sci., 286:43-56, 2012.

2 personal communication

[3] Ingo Battenfeld and Matthias Schroder. Observationally-induced effect monads: Upper and lower powerspace constructions. Electr. Notes Theor. Comput. Sci., 276:105—119, 2011.

[4] Ingo Battenfeld and Matthias Schröder. Observationally induced upper and lower powerspace constructions. 2012. submitted for publication.

[5] Ben S. Cohen. Mathematical foundations for denotational semantics for combining probability and nondeterminism over stably compact spaces. Master's thesis, TU Darmstadt, 2006.

[6] Gerhard Gierz, Karl H. Hofmann, Klaus Keimel, Jimmie Lawson, Michael Mislove, and Dana S. Scott. Continuous Lattices and Domains. Cambridge University Press, Cambridge, 2003.

[7] Jean Goubault-Larrecq. Prevision domains and convex powercones. In Roberto M. Amadio, editor, FoSSaCS, volume 4962 of Lecture Notes in Computer Science, pages 318—333. Springer, 2008.

[8] Jean Goubault-Larrecq. De groot duality and models of choice: angels, demons and nature. Mathematical Structures in Computer Science, 20(2):169—237, 2010.

[9] Reinhold Heckmann. Abstract valuations: A novel representation of plotkin power domain and vietoris hyperspace. Electr. Notes Theor. Comput. Sci., 6:160—173, 1997.

10] Martin Hyland, Paul Blain Levy, Gordon D. Plotkin, and John Power. Combining algebraic effects with continuations. Theor. Comput. Sci., 375(1-3):20—40, 2007.

11] Martin Hyland, Gordon D. Plotkin, and John Power. Combining computational effects: commutativity & sum. In Ricardo A. Baeza-Yates, Ugo Montanari, and Nicola Santoro, editors, IFIP TCS, volume 223 of IFIP Conference Proceedings, pages 474-484. Kluwer, 2002.

12] Claire Jones. Probabilistic Non-determinism. PhD thesis, LFCS, University of Edinburgh, 1989.

13] Simon Peyton Jones, editor. Haskell 98 language and libraries. Cambridge University Press, Cambridge, 2003. The revised report, J. Funct. Programming 13 (2003), no. 1.

14] Klaus Keimel. Topological cones: Foundations for a domain theoretical semantics combining probability and nondeterminism. Electr. Notes Theor. Comput. Sci., 155:423-443, 2006.

15] Klaus Keimel. On the equivalence of state transformer semantics and predicate transformer semantics. Proceedings of the Workshop Informatics and Information Technologies in Education: Theory, Practice, Didactics, Novosibirsk, 1:78-104, 2012.

16] Klaus Keimel and Jimmie D. Lawson. D-completions and the d-topology. Ann. Pure Appl. Logic, 159(3):292-306, 2009.

17] Eugenio Moggi. Computational lambda-calculus and monads. In Proceedings, Fourth Annual Symposium on Logic in Computer Science, 5-8 June, 1989, Asilomar Conference Center, Pacific Grove, California, USA, pages 14-23. IEEE Computer Society, 1989.

18] Gordon D. Plotkin and John Power. Notions of computation determine monads. In Mogens Nielsen and Uffe Engberg, editors, FoSSaCS, volume 2303 of Lecture Notes in Computer Science, pages 342-356. Springer, 2002. Erratum available at: http://homepages.inf.ed.ac.uk/gdp/publications/.

19] Gordon D. Plotkin and John Power. Computational effects and operations: An overview. Electr. Notes Theor. Comput. Sci., 73:149-163, 2004.

20] Matthias Schroöder and Alex Simpson. Probabilistic observations and valuations: (extended abstract). Electr. Notes Theor. Comput. Sci., 155:605-615, 2006.

21] Alex Simpson. Probabilistic observations and valuations. Talk given at: MFPS XXI, University of Birmingham, 2005. Slides: http://homepages.inf.ed.ac.uk/als/.

22] Michael B. Smyth. Topology. volume 1 of Handbook of Logic in Computer Science, pages 641-761. Clarendon Press, Oxford, 1992.

23] Regina Tix. Stetige Bewertungen auf topologischen Röaumen (continuous valuations on topological spaces). Master's thesis, TU Darmstadt, 1995.

24] Regina Tix, Klaus Keimel, and Gordon D. Plotkin. Semantic domains for combining probability and non-determinism. Electr. Notes Theor. Comput. Sci., 129:1-104, 2005.

25] Oswald Wyler. Dedekind complete posets and scott topologies. In Continuous Lattices, Proceedings of the Conference on Topological and Categorical Aspects of Continuous Lattices, Bremen 1979, volume 871 of Lecture Notes in Mathematics, pages 384-389. Springer, 1981.