A+Practical+Theory+of+Programming+09

# A+Practical+Theory+of+Programming+09 - Independent...

This preview shows pages 1–7. Sign up to view the full content.

Independent Composition Dependent Composition P . Q (sequential execution) P and Q must have exactly the same state variables Independent Composition P || Q (parallel execution) P and Q must have completely different state variables and the state variables of the composition are those of both P and Q Ignoring time and space variables P || Q = P Q 1/21

This preview has intentionally blurred sections. Sign up to view the full version.

View Full Document
Independent Composition example in integer variables x , y , and z x := x +1 || y := y +2 partition the variables: put x in left part, put y and z in right part = x = x +1 || y = y +2 z = z = x = x +1 y = y +2 z = z reasonable partition rule If either x or x := appears in a process specification, then x belongs to that process (then neither x nor x := can appear in the other process specification). If neither x nor x := appears at all, then x can be placed on either side of the partition. 2/21
Independent Composition example in variables x , y , and z x := y || y := x partition: put x in left, y in right, z in either = x = y y = x z = z implementation of a process makes a private copy of the initial value of a variable belonging to the other process if the other process contains an assignment to that variable 3/21

This preview has intentionally blurred sections. Sign up to view the full version.

View Full Document
Independent Composition example in boolean variable b and integer variable x b := x = x || x := x +1 replace x = x by T = b := T || x := x example in integer variables x and y ( x := x +1. x := x –1) || y := x = ok || y := x = y := x 4/21
Independent Composition ( x := x + y . x := x × y ) || ( y := x y . y := x / y ) 5/21

This preview has intentionally blurred sections. Sign up to view the full version.

View Full Document
Independent Composition ( x := x + y . x := x × y ) || ( y := x y . y := x / y ) You should have written ( x := x + y || y := x y ). ( x := x × y || y := x / y ) 6/21
This is the end of the preview. Sign up to access the rest of the document.

## This document was uploaded on 08/10/2011.

### Page1 / 21

A+Practical+Theory+of+Programming+09 - Independent...

This preview shows document pages 1 - 7. Sign up to view the full document.

View Full Document
Ask a homework question - tutors are online