Expressiveness (3) / department of mathematics and computer science - - PowerPoint PPT Presentation

expressiveness 3
SMART_READER_LITE
LIVE PREVIEW

Expressiveness (3) / department of mathematics and computer science - - PowerPoint PPT Presentation

/ department of mathematics and computer science to the transition system above. termination-behaviour. equation specifying for every recursion variable its transition- and 2. associate behaviour to every recursion variable by means of an 1.


slide-1
SLIDE 1

/ department of mathematics and computer science

Process Algebra (2IMF10)

Recursion Bas Luttik

MF 6.072 s.p.luttik@tue.nl http://www.win.tue.nl/~luttik

Lectures 6–7

2/30 / department of mathematics and computer science

Expressiveness (1)

Question

Can we express the following transition system a c b in the syntax of BSP(A).

Answer

Yes! The transition system generated by a.(b.0 + 1) + c.0 is isomorphic to the transition system above.

3/30 / department of mathematics and computer science

Expressiveness (2)

Question

Can we express the following transition system a c b in the syntax of BSP(A).

Answer

No! Infjnite behaviour cannot be expressed in the syntax of BSP(A).

4/30 / department of mathematics and computer science

Expressiveness (3)

General method for expressing transition systems:

  • 1. label states with process names (a.k.a. recursion variables);
  • 2. associate behaviour to every recursion variable by means of an

equation specifying for every recursion variable its transition- and termination-behaviour. X Y Z a c b X = a.Y + c.Z Y = b.X + 1 Z = 0

slide-2
SLIDE 2

5/30 / department of mathematics and computer science

Recursive specifjcations

Let Σ be a signature and let VR be a set of recursion variables A recursive equation over Σ and VR is an equation of the form X = t , with X ∈ VR and t a term over Σ and VR. We say that the recursive equation X = t defjnes X. A recursive specifjcation over Σ and VR is a set of recursive equations

  • ver Σ and VR consisting of precisely one recursive equation defjning X

for every X ∈ VR.

6/30 / department of mathematics and computer science

Recursion: operational semantics

[ Warning: notation slightly simplifjed; we will generalise later! ]

Let E be a recursive specifjcation over Σ and VR including, for every X ∈ VR, a defjning equation X = tX.

Operational rules for recursion

tX

a

− → t′

X

X

a

− → t′

X

tX↓ X↓

9/30 / department of mathematics and computer science

Term model (simplifjed)

Let E be a recursive specifjcation over BSP(A) and VR.

Defjnition

The term algebra for BSP(A)+E is the algebra P(BSP(A)+E) = (C(BSP(A)+E), +, (a.)a∈A, 0, 1, (X)X∈VR) .

Proposition

Bisimilarity is a congruence on P(BSP(A)+E).

Theorem

The equational theory BSP(A)+E is a sound axiomatisation of P(BSP(A)+E)/↔. Is BSP(A)+E also ground-complete for P(BSP(A)+E)/↔?

10/30 / department of mathematics and computer science

Equivalence of recursion variables

Example

Consider the recursive specifjcation { X = a.X , Y = a.a.Y } Then X ↔ Y . But this equation cannot be derived from BSP(A) + E. (Prove!) Conclusion: we need additional methods to reason about the equivalence

  • f recursion variables.

[ Remark: we shall not discuss a full-fmedged ground-complete axiomatisation of the algebra P(BSP(A)+E)/↔, but we’ll come close.]

slide-3
SLIDE 3

11/30 / department of mathematics and computer science

Recursion: algebraic approach

Let E be a rec. spec. over signature Σ and set of variables VR. Furthermore, let A be a Σ-algebra and ι the associated interpretation.

Defjnition

A solution of E in A is an extension κ of ι with interpretations of the recursion variables in VR as elements of A such that A, κ | = X = tX for every equation X = tX in E. If κ is a solution of E and X ∈ VR, then we shall call κ(X) a solution of X in E. NB: a solution of E in an algebra of transition systems modulo bisimilarity is an assignment of closed terms to recursion variables such that the recursion equations are true up to bisimilarity.

12/30 / department of mathematics and computer science

Solutions: examples

  • 1. The recursive specifjcation E1 = {X = a.1} has a solution both in

P(BSP(A))/↔ and in P(BSP(A)+E1)/↔.

  • 2. The recursive specifjcation E2 = {X = a.X} has a solution in

P(BSP(A)+E2)/↔, but not in P(BSP(A))/↔.

  • 3. The recursive specifjcation E3 = {X = X} has many solutions, both

in P(BSP(A))/↔ and in P(BSP(A)+E3)/↔.

14/30 / department of mathematics and computer science

Example: equivalence of rec. vars.

Consider the recursive specifjcation { X = a.X , Y = a.a.Y } . Note that we can argue that every solution of X is a solution of Y too: X = a.X = a.a.X . Hence, any solution κ of E in some algebra A satisfjes κ(X) = κ(a.a.X) = a.a.κ(X) (a. the interpretation of a. in A) , so κ(X) is a solution of Y in E.

15/30 / department of mathematics and computer science

Example: equivalence of rec. vars.

Consider the recursive specifjcation { X = a.X , Y = a.a.Y } . The reasoning on the previous slide allows us to conclude that every solution of X in whatever algebra (!) must also be a solution of Y in that algebra. The converse, however, need not hold: Exercise: construct a model of BSP(A) in which Y has a solution that is not also a solution of X.

slide-4
SLIDE 4

16/30 / department of mathematics and computer science

Example: equivalence of rec. vars.

Consider the recursive specifjcation { X = a.X , Y = a.a.Y } . Perhaps if we exclude some models (e.g., the answers to the exercise on the previous slide), then we may be able to say more about the equivalence of X and Y in the above recursive specifjcation. Note that, for models in which X and Y both have a unique solution, the reasoning on slide 14 would suffjce to conclude that X and Y indeed denote the same process!

18/30 / department of mathematics and computer science

Guardedness

Defjnition

An occurrence of a recursion variable X in a closed term s is guarded if it

  • ccurs in the scope of an action prefjx.

A term s is completely guarded if all occurrences of all recursion variables in s are guarded. A recursive specifjcation E is completely guarded if all right-hand sides of all equations in E are completely guarded.

Exercise 5.5.1

Determine whether, in the following terms, the occurrences of the recursion variables X and Y are guarded, unguarded, or both: a.X , Y + b.X , b.(X + Y ) , a.Y + X .

19/30 / department of mathematics and computer science

Guardedness

Example

  • 1. The recursive specifjcation

E1 = {X1 = a.X1, Y1 = a.X1} is completely guarded.

  • 2. The recursive specifjcation

E2 = {X1 = a.X1, Y1 = X1} is not completely guarded. But E1 and E2 have exactly the same solutions in every model!

20/30 / department of mathematics and computer science

Guardedness

Defjnition

A recursive specifjcation E is guarded if there exists a completely guarded recursive specifjcation F with VR(E) = VR(F) and BSP(A)+E ⊢ X = t for all X = t ∈ F.

Example

Although the recursive specifjcation E2 = {X1 = a.X1, Y1 = X1} is not completely guarded, it is guarded.

slide-5
SLIDE 5

21/30 / department of mathematics and computer science

Guardedness

Defjnition

A recursive specifjcation E is guarded if there exists a completely guarded recursive specifjcation F with VR(E) = VR(F) and BSP(A)+E ⊢ X = t for all X = t ∈ F.

Exercise 5.5.2

Determine whether the following recursive specifjcations are guarded or unguarded:

  • 1. {X = Y , Y = a.X}; and
  • 2. {X = a.Y + Z, Y = b.Z + X, Z = c.X + Y }.

22/30 / department of mathematics and computer science

Recursive Specifjcation Principle

Defjnition

Let Σ be a signature; we say that Σ-algebra A satisfjes the Recursive Specifjcation Principle (RSP) if every guarded recursive specifjcation E

  • ver Σ and some set VR of variables has at most one solution.

23/30 / department of mathematics and computer science

RSP as a proof principle

Example

Consider rec. spec. E consisting of the following equations: X = a.X + b.X , Y = a.Y + b.Z , and Z = a.Z + b.Y . We can prove that X = Y in the context of E as follows: Defjne two sequences of terms ˜ t = tX, tY , tZ and ˜ u = uX, uY , uZ by tX ≡ X, tY ≡ Y , tZ ≡ Z, and uX ≡ X, uY ≡ X, uZ ≡ X. Then both ˜ t and ˜ u denote solutions of E (verify!). Since E is guarded, by RSP, ˜ t = ˜ u, so X ≡ uY = tY ≡ Y .

24/30 / department of mathematics and computer science

Extension with recursion

[Not in the book!] Let A be a set of actions, and let T(A) be some process theory. Let Rec be the collection of all recursive specifjcations over T(A). T(A)rec: extension of T(A) with for every rec. spec. E over T(A) and for every (X = tX) ∈ E:

  • 1. a constant symbol µX.E, and
  • 2. an axiom µX.E = µtX.E (Rec).

[We write µt.E for the term obtained from t by replacing all occurrences of a recursion variable X by µX.E (see book for an inductive defjnition).]

slide-6
SLIDE 6

25/30 / department of mathematics and computer science

BSPrec(A)

So: BSPrec(A) is the extension of BSP(A) with, for every rec. spec. E

  • ver BSP(A) and for every (X = tX) ∈ E, a constant symbol

µX.E and an equation µX.E = µtX.E The term algebra P(BSPrec(A)) for BSPrec(A) is the algebra (C(BSPrec(A)), +, (a.)a∈A, 0, 1, (µX.E)E∈Rec,X∈VR(E)) We use operational semantics and bisimilarity to build a model for BSPrec(A) from P(BSPrec(A)).

26/30 / department of mathematics and computer science

Term model

a.x

a

− → x x

a

− → x′ x + y

a

− → x′ y

a

− → y′ x + y

a

− → y′ 1↓ x↓ (x + y)↓ y↓ (x + y)↓ µtX.E

a

− → t′

X

µX.E

a

− → t′

X

µtX.E↓ µX.E↓

  • 1. Bisimilarity is a congruence on P(BSPrec(A)).
  • 2. P(BSPrec(A))/↔ is a model for the equational theory BSP(A), the

so called term model for BSP(A).

27/30 / department of mathematics and computer science

Recursive Defjnition Principle (RDP)

Defjnition

Let Σ be a signature; we say that Σ-algebra A satisfjes the Recursive Defjnition Principle if every recursive specifjcation E over Σ and some set VR of variables has at least one solution.

Theorem

P(BSPrec(A))/↔ | = RDP.

Proof.

Let E be a recursive specifjcation. Defjne κ as the extension of ι such that, for every recursion variable X in E, κ(X) = [µX.E]↔ . Then κ(X) = κ(tX) for every recursion variable X in E (verify!), so κ is indeed a solution of E in P(BSPrec(A))/↔.

28/30 / department of mathematics and computer science

Recursive Specifjcation Principle (RSP)

Defjnition

Let Σ be a signature; we say that Σ-algebra A satisfjes the Recursive Specifjcation Principle (RSP) if every guarded recursive specifjcation E

  • ver Σ and some set VR of variables has at most one solution.

Theorem

The term model P(BSPrec(A))/↔ satisfjes RSP (notation: P(BSPrec(A))/↔ | = RSP).

Proof.

[Postponed.]

slide-7
SLIDE 7

29/30 / department of mathematics and computer science

TSP with recursion (example)

Consider the guarded recursive specifjcation E over TSP(A) consisting of: X = a.(X · Y ) + c.1 Y = b.1 + 1 .

  • a. Draw the transition system associated with µX.E.
  • b. Prove that the process denoted by µX.E in (TSP + PR)rec(A) is not

fjnitely defjnable over BSP(A).

  • c. Find a recursive specifjcation F over BSP(A) defjning a recursion

variable Z such that µX.E ↔ µZ.F.

30/30 / department of mathematics and computer science

Example

Let E = {X = a.a.X} and let F = {Y = a.(Y · b.1)} . Prove that TSPrec(A) + RSP ⊢ µX.E = µY .F .