a denotational semantic theory of concurrent systems

70
A denotational semantic theory of concurrent systems Jayadev Misra 1 Department of Computer Science University of Texas at Austin http://orc.csres.utexas.edu WG 2.3, Orlando May 2013 1 Thanks to Ernie Cohen.

Upload: others

Post on 11-Sep-2021

5 views

Category:

Documents


0 download

TRANSCRIPT

Page 1: A denotational semantic theory of concurrent systems

A denotational semantic theory of concurrentsystems

Jayadev Misra1

Department of Computer ScienceUniversity of Texas at Austin

http://orc.csres.utexas.edu

WG 2.3, OrlandoMay 2013

1Thanks to Ernie Cohen.

Page 2: A denotational semantic theory of concurrent systems

Denotational Semantics of Concurrent Systems

• Scott’s denotational semantics specialized to concurrentsystems.

• Strong results for this specific domain.

• Inappropriate for other areas, such as sequential programs.

• Derive specification of a program from those of its components.

• Prove program properties (safety, progress) from thespecification.

2

Page 3: A denotational semantic theory of concurrent systems

Denotational Semantics

• f ⊕ g is a program constructed out of

componentsf and g, and

combinator⊕, a programming language construct.

• The specification off ⊕ g, [[f ⊕ g]] is given by:

[[f ⊕ g]] ∆ [[f ]] [[⊕]] [[g]]

• [[⊕]] is atransformerof specifications:

It combines two specifications,[[f ]] and [[g]], to yield aspecification.

Notation Overloading: use⊕ instead of [[⊕]].

3

Page 4: A denotational semantic theory of concurrent systems

Denotational Semantics

• f ⊕ g is a program constructed out of

componentsf and g, and

combinator⊕, a programming language construct.

• The specification off ⊕ g, [[f ⊕ g]] is given by:

[[f ⊕ g]] ∆ [[f ]] [[⊕]] [[g]]

• [[⊕]] is atransformerof specifications:

It combines two specifications,[[f ]] and [[g]], to yield aspecification.

Notation Overloading: use⊕ instead of [[⊕]].

3

Page 5: A denotational semantic theory of concurrent systems

Denotational Semantics

• f ⊕ g is a program constructed out of

componentsf and g, and

combinator⊕, a programming language construct.

• The specification off ⊕ g, [[f ⊕ g]] is given by:

[[f ⊕ g]] ∆ [[f ]] [[⊕]] [[g]]

• [[⊕]] is atransformerof specifications:

It combines two specifications,[[f ]] and [[g]], to yield aspecification.

Notation Overloading: use⊕ instead of [[⊕]].

3

Page 6: A denotational semantic theory of concurrent systems

Denotational Semantics

• f ⊕ g is a program constructed out of

componentsf and g, and

combinator⊕, a programming language construct.

• The specification off ⊕ g, [[f ⊕ g]] is given by:

[[f ⊕ g]] ∆ [[f ]] [[⊕]] [[g]]

• [[⊕]] is atransformerof specifications:

It combines two specifications,[[f ]] and [[g]], to yield aspecification.

Notation Overloading: use⊕ instead of [[⊕]].

3

Page 7: A denotational semantic theory of concurrent systems

Contributions of this work

• specifications of concurrent components.

• A theory of transformers: functions mapping specs to specs.

• Provingsafety, progress, branching timeproperties with:

concurrency

non-determinacy

recursion

shared resource

fairness

divergence

real-time

4

Page 8: A denotational semantic theory of concurrent systems

Status

• Completed the theoretical work

• Currently being applied to Orc calculus

• Need to do considerable work in verification engineering

• logic for specification

• applications to other process algebras

• mechanization

5

Page 9: A denotational semantic theory of concurrent systems

Summary

Closure Meaning Preserving CorrespondingTransformer Function

Downward Prefix-closed Smooth MonotonicUpward Limit-closed Bismooth Continuous

• A library of smooth and bismooth transformers.

• Fixed-point theorems:• Least upward-closed fixed point• Min-max fixed point (to deal with fairness)

6

Page 10: A denotational semantic theory of concurrent systems

Component Specification

• Events.

• Traces.

• A specification is a prefix-closed set of traces.

7

Page 11: A denotational semantic theory of concurrent systems

Events associated with a component

pub(true) publish (output) a value

x.read(3) read a value from variablex

c.receive(”val”) receive ”val” from channelc

Heads/Tails outcome of an internal coin toss

x.add(5) Method call

• Events are event instances.

• They are uninterpreted, instantaneous and atomic.

• There is a universal event alphabet.

8

Page 12: A denotational semantic theory of concurrent systems

Events associated with a component

pub(true) publish (output) a value

x.read(3) read a value from variablex

c.receive(”val”) receive ”val” from channelc

Heads/Tails outcome of an internal coin toss

x.add(5) Method call

• Events are event instances.

• They are uninterpreted, instantaneous and atomic.

• There is a universal event alphabet.

8

Page 13: A denotational semantic theory of concurrent systems

Execution of a component (informal notion)

An execution is a sequence of events.

Toss a coin and publish the outcome.Two possible executions:

[Heads, pub(”Heads”)][Tails, pub(”Tails”)]

With all intermediate executions:

[ ][Heads][Heads, pub(”Heads”)][Tails][Tails, pub(”Tails”)]

9

Page 14: A denotational semantic theory of concurrent systems

Execution of a component (informal notion)

An execution is a sequence of events.

Toss a coin and publish the outcome.Two possible executions:

[Heads, pub(”Heads”)][Tails, pub(”Tails”)]

With all intermediate executions:

[ ][Heads][Heads, pub(”Heads”)][Tails][Tails, pub(”Tails”)]

9

Page 15: A denotational semantic theory of concurrent systems

Another Program

Two tosses, but stop if the first toss is Heads

[Heads][Tails, Heads][Tails, Tails]

Plus all the prefixes of these sequences.

10

Page 16: A denotational semantic theory of concurrent systems

Depict Executions by a tree

Two tosses, but stop if the first toss is Heads

[Heads], [Tails, Heads], [Tails, Tails] plus the prefixes.

• Each node is an execution.

• Label on each branch is an event.

• An ancestor is a prefix.

11

Page 17: A denotational semantic theory of concurrent systems

Infinite Executions

Toss a coin repeatedly until it lands Heads.

[ ][Heads] [Tails][Tails, Heads] [Tails, Tails][Tails, Tails, Heads] [Tails, Tails, Tails][Tails, Tails, Tails, Heads] · · ·

• An unfair coin may may always land Tails.

• Admit infinite execution: [Tails, Tails, Tails, · · · ]

• Executions described by:{[Tailsj ] j ≥ 0} ∪ {[Tailsj , Heads] j ≥ 0} ∪ {[Tailsω ]}

12

Page 18: A denotational semantic theory of concurrent systems

Infinite Executions

Toss a coin repeatedly until it lands Heads.

[ ][Heads] [Tails][Tails, Heads] [Tails, Tails][Tails, Tails, Heads] [Tails, Tails, Tails][Tails, Tails, Tails, Heads] · · ·

• An unfair coin may may always land Tails.

• Admit infinite execution: [Tails, Tails, Tails, · · · ]

• Executions described by:{[Tailsj ] j ≥ 0} ∪ {[Tailsj , Heads] j ≥ 0} ∪ {[Tailsω ]}

12

Page 19: A denotational semantic theory of concurrent systems

Status of an Execution• Status denotes the final state of an execution. From{W, H, D}.

• Infinite execution has statusD.

• Finite executions typically have statusH or W. Some haveD.

W is Waiting:more autonomous computation to do or waiting for external input.

H is Halted: nothing more to do.

D is Divergent: An infinite computation.

• Example of Divergent Execution

def loop( ) = loop( )

13

Page 20: A denotational semantic theory of concurrent systems

Trace

A traceis s[m] where

• s, status, is from {W, H, D}.

• mfinite or infinite event sequence.

14

Page 21: A denotational semantic theory of concurrent systems

Trace (formal notion)Trace: A sequence of events plus the final state of computation.

Toss a coin and publish the outcome. Possible traces are:

W[ ] W[Heads] W[Tails]W[Heads, pub(”Heads”)] W[Tails, pub(”Tails”)]H[Heads, pub(”Heads”)] H[Tails, pub(”Tails”)]

15

Page 22: A denotational semantic theory of concurrent systems

Trace prefix

In the trace tree, prefix of a node is an ancestor.

Formally, s[m] ≤ s′[m′], means

s[m] = s′[m′], or

(s = W) and(m prefix ofm′)

Applies to infinite traces.

• ≤ is a partial order.

• < is a well-founded order.

• W[ ] is the bottom trace.

16

Page 23: A denotational semantic theory of concurrent systems

Trace prefix

In the trace tree, prefix of a node is an ancestor.

Formally, s[m] ≤ s′[m′], means

s[m] = s′[m′], or

(s = W) and(m prefix ofm′)

Applies to infinite traces.

• ≤ is a partial order.

• < is a well-founded order.

• W[ ] is the bottom trace.

16

Page 24: A denotational semantic theory of concurrent systems

Prefix Closure (downward closure)

Prefix closure of tracet is the set of all its prefixes:

t∗ = {s s≤ t}

For traceset (non-empty set of traces)p define downward closure by:

p∗ = ∪t∈p(t∗), for non-emptyp

(p× q× · · · × r)∗ = p∗ × q∗ · · · × r∗ Cartesian Product

17

Page 25: A denotational semantic theory of concurrent systems

Spec

• A specification (spec) is a prefix-closed set of traces.

• Definition: Tracesetp is a spec iff p = p∗.

• Note: A spec is always non-empty.

18

Page 26: A denotational semantic theory of concurrent systems

Meaning of a component spec

• Each trace in a spec is a possible execution in some environment.

• So, a spec is prefix-closed.

• W[m] without extension denotes deadlock.

• Eventual halting:

• Every waiting trace has an extension by an autonomous event.• There is no divergent trace.

19

Page 27: A denotational semantic theory of concurrent systems

Example spec: successor

• suc(x) publishes the successor of the argument integerx.

• spec: {H[read(i), pub(i + 1)] i integer}∗

20

Page 28: A denotational semantic theory of concurrent systems

Example spec: conditional

• Ift(b) for booleanb• publishessignalfor b = true

• halts silently for b = false

• spec:{H[read(false)], H[read(true), pub(signal)]}∗

21

Page 29: A denotational semantic theory of concurrent systems

Tree depiction of a spec is insufficient

Toss a coin sequentially until it lands Heads.

unfair coin: {H[Tailsj , Heads] j ≥ 0}∗ ∪ {D[Tailsω]}

fair coin: {H[Tailsj , Heads] j ≥ 0}∗

Explicit inclusion/exclusion of infinite traces in a spec.

22

Page 30: A denotational semantic theory of concurrent systems

Transformers

Denotational Semantics (repeated)

• f ⊕ g is a program constructed out of

componentsf and g, and

combinator ⊕, a programming language construct.

• The specification off ⊕ g, [[f ⊕ g]] is given by:

[[f ⊕ g]] ∆ [[f ]][[⊕]][[g]]

• [[⊕]] is atransformer:

It combines two specifications,[[f ]] and [[g]], to yield aspecification.

Notation Overloading: use⊕ instead of [[⊕]].

23

Page 31: A denotational semantic theory of concurrent systems

A Motivating Example

• Programming language construct,⊕: ⊕ (A, B, C)

• ExecuteA, B concurrently.

• If A engages ineand B in e, they rendezvous.Then startC to run concurrently withA and B.

24

Page 32: A denotational semantic theory of concurrent systems

A Motivating Example: ⊕ (A, B, C)

• Let specifications ofA, B, C be p, q, r, respectively.

• C′ starts with eventa and then behaves asC:spec iscons(a, r).

• spec of A, B, C′ running concurrently:p | q | cons(a, r).

• Retain those traces in which{e, e, a} are contiguous.Replace these 3 events by eventτ :rendezvous({e, e, a}, τ, (p | q | cons(a, r)))

• Drop the τ symbol from each trace:⊕′ (p, q, r) =

drop(τ, rendezvous({e, e, a}, τ, (p | q | cons(a, r))))

25

Page 33: A denotational semantic theory of concurrent systems

A Motivating Example: ⊕ (A, B, C)

• Let specifications ofA, B, C be p, q, r, respectively.

• C′ starts with eventa and then behaves asC:spec iscons(a, r).

• spec of A, B, C′ running concurrently:p | q | cons(a, r).

• Retain those traces in which{e, e, a} are contiguous.Replace these 3 events by eventτ :rendezvous({e, e, a}, τ, (p | q | cons(a, r)))

• Drop the τ symbol from each trace:⊕′ (p, q, r) =

drop(τ, rendezvous({e, e, a}, τ, (p | q | cons(a, r))))

25

Page 34: A denotational semantic theory of concurrent systems

A Motivating Example: ⊕ (A, B, C)

• Let specifications ofA, B, C be p, q, r, respectively.

• C′ starts with eventa and then behaves asC:spec iscons(a, r).

• spec of A, B, C′ running concurrently:p | q | cons(a, r).

• Retain those traces in which{e, e, a} are contiguous.Replace these 3 events by eventτ :rendezvous({e, e, a}, τ, (p | q | cons(a, r)))

• Drop the τ symbol from each trace:⊕′ (p, q, r) =

drop(τ, rendezvous({e, e, a}, τ, (p | q | cons(a, r))))

25

Page 35: A denotational semantic theory of concurrent systems

A Motivating Example: ⊕ (A, B, C)

• Let specifications ofA, B, C be p, q, r, respectively.

• C′ starts with eventa and then behaves asC:spec iscons(a, r).

• spec of A, B, C′ running concurrently:p | q | cons(a, r).

• Retain those traces in which{e, e, a} are contiguous.Replace these 3 events by eventτ :rendezvous({e, e, a}, τ, (p | q | cons(a, r)))

• Drop the τ symbol from each trace:⊕′ (p, q, r) =

drop(τ, rendezvous({e, e, a}, τ, (p | q | cons(a, r))))

25

Page 36: A denotational semantic theory of concurrent systems

A Motivating Example: ⊕ (A, B, C)

• Let specifications ofA, B, C be p, q, r, respectively.

• C′ starts with eventa and then behaves asC:spec iscons(a, r).

• spec of A, B, C′ running concurrently:p | q | cons(a, r).

• Retain those traces in which{e, e, a} are contiguous.Replace these 3 events by eventτ :rendezvous({e, e, a}, τ, (p | q | cons(a, r)))

• Drop the τ symbol from each trace:⊕′ (p, q, r) =

drop(τ, rendezvous({e, e, a}, τ, (p | q | cons(a, r))))

25

Page 37: A denotational semantic theory of concurrent systems

Example Transformer: Sequential Composition,f ; g

• g starts executing when and only whenf halts.

• A trace of f ; g is of the form:

• s[m] where s[m] is a trace off and s is W or D, or

• s[m n] where

H[m] is a trace off

s[n] is a trace ofg

26

Page 38: A denotational semantic theory of concurrent systems

Example Transformer: Sequential Composition,f ; g

• g starts executing when and only whenf halts.

• A trace of f ; g is of the form:

• s[m] where s[m] is a trace off and s is W or D, or

• s[m n] where

H[m] is a trace off

s[n] is a trace ofg

26

Page 39: A denotational semantic theory of concurrent systems

Example Transformer: parallel composition,f | g

• f and g execute independently.

• Let s[m] be a trace off , t[n] of g, sand t from {H, W}.

Then, f | g includes traces(s∩ t)(m⊗ n) where:

• ∩ symmetric. H ∩ s = s, W∩ W = W.

• m⊗ n is all interleavings (merge) ofm and n.

• Merging with infinite sequence:fair andunfair merge.

27

Page 40: A denotational semantic theory of concurrent systems

Example Transformer: parallel composition,f | g

• f and g execute independently.

• Let s[m] be a trace off , t[n] of g, sand t from {H, W}.

Then, f | g includes traces(s∩ t)(m⊗ n) where:

• ∩ symmetric. H ∩ s = s, W∩ W = W.

• m⊗ n is all interleavings (merge) ofm and n.

• Merging with infinite sequence:fair andunfair merge.

27

Page 41: A denotational semantic theory of concurrent systems

Example Transformer: parallel composition,f | g

• f and g execute independently.

• Let s[m] be a trace off , t[n] of g, sand t from {H, W}.

Then, f | g includes traces(s∩ t)(m⊗ n) where:

• ∩ symmetric. H ∩ s = s, W∩ W = W.

• m⊗ n is all interleavings (merge) ofm and n.

• Merging with infinite sequence:fair andunfair merge.

27

Page 42: A denotational semantic theory of concurrent systems

Example Transformer: parallel composition,f | g

• f and g execute independently.

• Let s[m] be a trace off , t[n] of g, sand t from {H, W}.

Then, f | g includes traces(s∩ t)(m⊗ n) where:

• ∩ symmetric. H ∩ s = s, W∩ W = W.

• m⊗ n is all interleavings (merge) ofm and n.

• Merging with infinite sequence:fair andunfair merge.

27

Page 43: A denotational semantic theory of concurrent systems

Definition: Transformer, Trace-wise Transformer

• A transformer is a function that maps a tuple of specs to a spec:f (p, q, · · · , r)

Notation: Infix p⊕ q for 2-tuple transformer .

• Tracewise-transformer: Maps a tuple oftracesto a traceset.Then,

f (p) = ∪{f (t) t ∈ p}

p⊕ q = ∪{s⊕ t s∈ p, t ∈ q}

• Henceforth all transformers are tracewise.

When is f (p) a spec given thatp is a spec?

28

Page 44: A denotational semantic theory of concurrent systems

Smooth Transformer

• A smoothtransformer preserves prefix closure.

• Smooth Transformer: For any traces,

f ∗(s) = f (s∗) (Notation: f ∗(s) is (f (s))∗)(s⊕ t)∗ = s∗ ⊕ t∗

29

Page 45: A denotational semantic theory of concurrent systems

Properties of smooth transformers

• For smoothf and specp, f ∗(p) = f (p∗).

• Follows: A smooth transformer transforms specs to specs.

• Composition of smooth transformers is smooth.

• f is smooth iff• f transforms specs to specs, and

• f is monotonic: s≤ t ⇒ f ∗(s) ⊆ f ∗(t).

30

Page 46: A denotational semantic theory of concurrent systems

Example of Smooth Transformer: choice

• f or g: choose to execute eitherf or g

transformer: sor t = {s} ∪ {t}

• or is smooth.

31

Page 47: A denotational semantic theory of concurrent systems

Example of Smooth Transformer: cons

• Append a specific eventa as the first event of every trace.

• cons(a, W[ ]) = {W[ ], W[a]}

cons(a, s[m]) = {s[a m]}

32

Page 48: A denotational semantic theory of concurrent systems

Example of Smooth Transformer: Filter

• A filter transformer accepts or rejects each trace.

• A filter is defined by a predicateb on traces, where

1. b(W[ ]) holds, and

2. If b(t) holds thenb(s) holds for all prefixess of t.

• A filter transformer accepts all prefixes for whichb holds.

f (t) = {s b(s) ∧ s≤ t}

33

Page 49: A denotational semantic theory of concurrent systems

Examples of Smooth transformers

• unfair merge: f | g

• fair merge: f | ′g

• rendezvous: merge traces so that eventseand e′ are contiguous.

• sequential composition:f ; g

H[m] ; t[n] = {t[m n]},

s ; t[n] = {s}, otherwise

34

Page 50: A denotational semantic theory of concurrent systems

Fairness

• Coin tosses are fair.

• Fair scheduler: In a multiprocess implementation every processgets to execute eventually.

• A semaphore is granted fairly.

• Any finite interval in time can contain only a finite number ofevents.

35

Page 51: A denotational semantic theory of concurrent systems

Fairness is a filter transformer

• The transformer accepts all finite traces,accepts the fair infinite traces and rejects the unfair ones.

• Fits the definition of a filter, a smooth transformer.

Example: coin toss forever until Heads appears.

• unfair coin:

{H[Tailsj , Heads] j ≥ 0}∗ ∪ {D[Tailsω]}

• fair coin: Apply the filter that rejects the infinite sequenceofTails.

{H[Tailsj , Heads] j ≥ 0}∗

36

Page 52: A denotational semantic theory of concurrent systems

Fairness is a filter transformer

• The transformer accepts all finite traces,accepts the fair infinite traces and rejects the unfair ones.

• Fits the definition of a filter, a smooth transformer.

Example: coin toss forever until Heads appears.

• unfair coin:

{H[Tailsj , Heads] j ≥ 0}∗ ∪ {D[Tailsω]}

• fair coin: Apply the filter that rejects the infinite sequenceofTails.

{H[Tailsj , Heads] j ≥ 0}∗

36

Page 53: A denotational semantic theory of concurrent systems

Shared Resource

• Considerx.read() | x.write(3),where local variablex is initialized to 0.

• spec of x.read() includes the traceH[read(5)].

spec of programx.write(3) is H[write(3)]∗

• Applying merge: a trace ofx.read() | x.write(3) is

H[read(5), write(3)], an invalid trace.

37

Page 54: A denotational semantic theory of concurrent systems

Parallel executions may not be independent• The complete program is

int x = 0

x.read() | x.write(3)

• The declaration “intx = 0” induces a filter transformer,x.int.

It rejects all traces that are not possible with the resource.

• Given specsp and q of x.read() and x.write(3), spec of

int x = 0

x.read() | x.write(3)

is x.int(p | q)

38

Page 55: A denotational semantic theory of concurrent systems

Research Area

• Each shared resource is defined by a filter.

• Each filter is an acceptor of strings, i.e., a formal language.

• So, a shared resource can be specified as a language.

• The language may include infinite strings, say, for strongsemaphore.

• I have defined filters forread/write shared variables,write-once variables,channel,weak and strong semaphore

39

Page 56: A denotational semantic theory of concurrent systems

Recursion: Procedurestut()

• Toss an unfair coinif it lands Heads halt, otherwise callstut().

• Let the spec ofstut() be x.

• stut() chooses between

• halting the computation (when toss lands Heads), with specH[Heads]∗, and

• eventTails followed by stut(), with speccons(Tails, x)

• The transformer for choice is set union.

• x = H[Heads]∗ ∪ cons(Tails, x)

40

Page 57: A denotational semantic theory of concurrent systems

Recursion: Procedurestut()

• Toss an unfair coinif it lands Heads halt, otherwise callstut().

• Let the spec ofstut() be x.

• stut() chooses between

• halting the computation (when toss lands Heads), with specH[Heads]∗, and

• eventTails followed by stut(), with speccons(Tails, x)

• The transformer for choice is set union.

• x = H[Heads]∗ ∪ cons(Tails, x)

40

Page 58: A denotational semantic theory of concurrent systems

Recursion: Procedurestut()

• Toss an unfair coinif it lands Heads halt, otherwise callstut().

• Let the spec ofstut() be x.

• stut() chooses between

• halting the computation (when toss lands Heads), with specH[Heads]∗, and

• eventTails followed by stut(), with speccons(Tails, x)

• The transformer for choice is set union.

• x = H[Heads]∗ ∪ cons(Tails, x)

40

Page 59: A denotational semantic theory of concurrent systems

Solutions of recursive equation:x = F(x)

• Extensively studied in denotational semantics wherex, called apoint, is from acomplete partial order(CPO).

• There is a partial order⊆ in the cpo.

• There is a bottom element,⊥.

• Every chainx0 ≤ x1... has a least upper bound (lub)y:

xi ⊆ y upper boundy ⊆ z for any upper boundz.

• A solution of x = F(x) is a fixed point ofF.

Wanted: the least fixed point,lfp(F), according to ⊆.

41

Page 60: A denotational semantic theory of concurrent systems

Kleene-Scott Theorem

• F is continuousmeans:For every chainC, F(lub(C)) = lub(F(C)).

• Theorem: Given x = F(x) where F is continuous:

lfp(F) = lub(Fi(W[ ]))

• That is, with

x0 = ⊥, xi+1 = F(xi),

lfp(F) = lub(x0, ..., xi , ...)

42

Page 61: A denotational semantic theory of concurrent systems

In the current work

Specs form a complete partial order, where

• the order relation is subset order over specs,lub is set union,

• ⊥ is the W[ ],

• F, a smooth transformer is always continuous.

• Proposition: lfp(F) is the expected outcome in an execution.

43

Page 62: A denotational semantic theory of concurrent systems

Example: stut()

• Recursive equation:x = H[Heads]∗ ∪ cons(Tails, x)

• lfp(stut) = {H[Tailsj , Heads] j ≥ 0}∗

• This isnot the correct solution.Does not include the infinite trace.

The fixed point should include the limit of all trace chains.

44

Page 63: A denotational semantic theory of concurrent systems

Upward Closure

• Two notions of chains:

• specs:p0 ⊆ p1.... lub is the union of thepis.

• traces: ChainC = t0 ≤ t1....

• Limit of the trace chain,lim(C), is a trace.Shortest trace that includes everyti as a prefix.

• Define upward closure of specp asp∗ = p∪ {lim(C) C a chain inp}

• Follows: for specs,(p× q · · · × r)∗ = p∗ × q∗ · · · × r∗

45

Page 64: A denotational semantic theory of concurrent systems

least upward-closed fixed point (lufp)

• For recursive equationx = F(x),the least upward-closed fixed pointp is a spec such that:

p = F(p) fixed point

p = p∗ upward-closed

p ⊆ q for any upward-closed fixed pointq

Note: p is a spec, so downward-closed.

• lufp(F) may not exist for smoothF.

46

Page 65: A denotational semantic theory of concurrent systems

least upward-closed fixed point (lufp)

• For recursive equationx = F(x),the least upward-closed fixed pointp is a spec such that:

p = F(p) fixed point

p = p∗ upward-closed

p ⊆ q for any upward-closed fixed pointq

Note: p is a spec, so downward-closed.

• lufp(F) may not exist for smoothF.

46

Page 66: A denotational semantic theory of concurrent systems

Bismooth Transformer

• Smooth: f (p∗) = f ∗(p), for any tracesetp

• Bismooth:

Smooth (preserve downward-closure)

Spec p: f (p∗) = f ∗(p) (preserve upward-closure)

Fairness is smooth but not bismooth.

Unfair merge is bismooth, fair merge only smooth.

Continuous filter is bismooth, discontinuous filter only smooth.

All other transformers seen so far are bismooth.

47

Page 67: A denotational semantic theory of concurrent systems

Bismooth Transformer

• Smooth: f (p∗) = f ∗(p), for any tracesetp

• Bismooth:

Smooth (preserve downward-closure)

Spec p: f (p∗) = f ∗(p) (preserve upward-closure)

Fairness is smooth but not bismooth.

Unfair merge is bismooth, fair merge only smooth.

Continuous filter is bismooth, discontinuous filter only smooth.

All other transformers seen so far are bismooth.

47

Page 68: A denotational semantic theory of concurrent systems

lufp of bismooth transformer

Theorem: For bismoothF, lufp(F) = lfp∗(F)

48

Page 69: A denotational semantic theory of concurrent systems

Revisit stut()• Recursive equation:x = H[Heads]∗ ∪ cons(Tails, x)

• lfp(stut) = {H[Tailsj , Heads] j ≥ 0}∗

• lufp(stut())= {From theorem}

lfp∗(stut())= { lfp(stut) = {H[Tailsj , Heads] j ≥ 0}∗}

({H[Tailsj , Heads] j ≥ 0}∗)∗

= {computing}{H[Tailsj , Heads] j ≥ 0}∗ ∪ {D[Tailsω]}

• Toss of a fair coin:fair_filter({H[Tailsj , Heads] j ≥ 0}∗ ∪ {D[Tailsω]})

= {Definition of fair_filter }{H[Tailsj , Heads] j ≥ 0}∗

49

Page 70: A denotational semantic theory of concurrent systems

Revisit stut()• Recursive equation:x = H[Heads]∗ ∪ cons(Tails, x)

• lfp(stut) = {H[Tailsj , Heads] j ≥ 0}∗

• lufp(stut())= {From theorem}

lfp∗(stut())= { lfp(stut) = {H[Tailsj , Heads] j ≥ 0}∗}

({H[Tailsj , Heads] j ≥ 0}∗)∗

= {computing}{H[Tailsj , Heads] j ≥ 0}∗ ∪ {D[Tailsω]}

• Toss of a fair coin:fair_filter({H[Tailsj , Heads] j ≥ 0}∗ ∪ {D[Tailsω]})

= {Definition of fair_filter }{H[Tailsj , Heads] j ≥ 0}∗

49