Topic 2.3: Understanding FSP COMP31212: Concurrency Topics 2.3: Understanding FSP
Topic 2.3: Understanding FSP Outline Topic 2.3: Understanding FSP About Transition Systems Prefix & Definition Rules Choice Rule Parallel Composition Rules Generating an LTS Remaining rules
Topic 2.3: Understanding FSP Outline Topic 2.3: Understanding FSP About Transition Systems Prefix & Definition Rules Choice Rule Parallel Composition Rules Generating an LTS Remaining rules
Topic 2.3: Understanding FSP Transition Relation • An FSP process can make a labelled transition into a new FSP process. • Each FSP process has a corresponding LTS • FSP process transition determines state transition in LTS a 1 → · · · a n a 2 • A transition path E → E 1 → E n . . . determines the nodes and edges traversed in the LTS for E . How to find LTS : define Transition Relation Rules for each FSP construct
Topic 2.3: Understanding FSP Transition Rules Transition Relation : σ ⊆ ( Proc × Act × Proc ) where • Proc is the set of FSP process terms • Act is the set of action labels, together with tau .
Topic 2.3: Understanding FSP Transition Rules Transition Relation : σ ⊆ ( Proc × Act × Proc ) where • Proc is the set of FSP process terms • Act is the set of action labels, together with tau . premisses RuleName General Format of Transition Rule: transition Premisses may be transitions (built via transition rules) or other conditions → P ′ means that ( P , a , P ′ ) ∈ σ a Transition P
Topic 2.3: Understanding FSP Outline Topic 2.3: Understanding FSP About Transition Systems Prefix & Definition Rules Choice Rule Parallel Composition Rules Generating an LTS Remaining rules
Topic 2.3: Understanding FSP Prefix and Definition Rules Prefix Action Rule : Prefix a ( a -> P ) → P
Topic 2.3: Understanding FSP Prefix and Definition Rules Prefix Action Rule : Definition Rule : a → P ′ P Prefix Defn where ( ProcId = P ) a a ( a -> P ) → P ProcId → P ′
Topic 2.3: Understanding FSP Prefix and Definition Rules Prefix Action Rule : Definition Rule : a → P ′ P Prefix Defn where ( ProcId = P ) a a ( a -> P ) → P ProcId → P ′ e.g. SWITCH = (on -> (off -> STOP)).
Topic 2.3: Understanding FSP Prefix and Definition Rules Prefix Action Rule : Definition Rule : a → P ′ P Prefix Defn where ( ProcId = P ) a a ( a -> P ) → P ProcId → P ′ e.g. SWITCH = (on -> (off -> STOP)). ⋆ Calculate Transitions? ⋆
Topic 2.3: Understanding FSP Outline Topic 2.3: Understanding FSP About Transition Systems Prefix & Definition Rules Choice Rule Parallel Composition Rules Generating an LTS Remaining rules
Topic 2.3: Understanding FSP Choice Rule for some i ∈ { 1 , . . . , n } Choice a i ( a 1 -> P 1 | · · · | a n -> P n ) → P i
Topic 2.3: Understanding FSP Choice Rule for some i ∈ { 1 , . . . , n } Choice a i ( a 1 -> P 1 | · · · | a n -> P n ) → P i Example: COIN = ( toss -> HEADS | toss -> TAILS ) , HEADS = ( heads -> COIN ) , TAILS = ( tails -> COIN ) . toss heads Transitions: → HEADS → COIN and COIN toss tails COIN → TAILS → COIN ⋆ Calculate Transition Relation? ⋆
Topic 2.3: Understanding FSP Outline Topic 2.3: Understanding FSP About Transition Systems Prefix & Definition Rules Choice Rule Parallel Composition Rules Generating an LTS Remaining rules
Topic 2.3: Understanding FSP Parallel Rules I: Alphabets First. . . Alphabet : α ( P ) ⊆ L : Define α recursively. . . Prefix: α ( a -> P ) = { a } ∪ α ( P )
Topic 2.3: Understanding FSP Parallel Rules I: Alphabets First. . . Alphabet : α ( P ) ⊆ L : Define α recursively. . . Prefix: α ( a -> P ) = { a } ∪ α ( P ) Choice: α ( P 1 | · · · | P n ) = α ( P 1 ) ∪ · · · ∪ α ( P n )
Topic 2.3: Understanding FSP Parallel Rules I: Alphabets First. . . Alphabet : α ( P ) ⊆ L : Define α recursively. . . Prefix: α ( a -> P ) = { a } ∪ α ( P ) Choice: α ( P 1 | · · · | P n ) = α ( P 1 ) ∪ · · · ∪ α ( P n ) Parallel: α ( P 1 || · · · || P n ) = α ( P 1 ) ∪ · · · ∪ α ( P n )
Topic 2.3: Understanding FSP Parallel Rules I: Alphabets First. . . Alphabet : α ( P ) ⊆ L : Define α recursively. . . Prefix: α ( a -> P ) = { a } ∪ α ( P ) Choice: α ( P 1 | · · · | P n ) = α ( P 1 ) ∪ · · · ∪ α ( P n ) Parallel: α ( P 1 || · · · || P n ) = α ( P 1 ) ∪ · · · ∪ α ( P n ) Definition: α ( ProcId ) = α ( P ) where ( ProcId = P )
Topic 2.3: Understanding FSP Parallel Rules I: Alphabets First. . . Alphabet : α ( P ) ⊆ L : Define α recursively. . . Prefix: α ( a -> P ) = { a } ∪ α ( P ) Choice: α ( P 1 | · · · | P n ) = α ( P 1 ) ∪ · · · ∪ α ( P n ) Parallel: α ( P 1 || · · · || P n ) = α ( P 1 ) ∪ · · · ∪ α ( P n ) Definition: α ( ProcId ) = α ( P ) where ( ProcId = P ) Extension: α ( P + { a 1 , . . . , a n } ) = α ( P ) ∪ { a 1 , . . . , a n }
Topic 2.3: Understanding FSP Parallel Rules I: Alphabets First. . . Alphabet : α ( P ) ⊆ L : Define α recursively. . . Prefix: α ( a -> P ) = { a } ∪ α ( P ) Choice: α ( P 1 | · · · | P n ) = α ( P 1 ) ∪ · · · ∪ α ( P n ) Parallel: α ( P 1 || · · · || P n ) = α ( P 1 ) ∪ · · · ∪ α ( P n ) Definition: α ( ProcId ) = α ( P ) where ( ProcId = P ) Extension: α ( P + { a 1 , . . . , a n } ) = α ( P ) ∪ { a 1 , . . . , a n } Hiding: α ( P \{ a 1 , . . . , a n } ) = α ( P ) − { a 1 , . . . , a n }
Topic 2.3: Understanding FSP Parallel Rules I: Alphabets First. . . Alphabet : α ( P ) ⊆ L : Define α recursively. . . Prefix: α ( a -> P ) = { a } ∪ α ( P ) Choice: α ( P 1 | · · · | P n ) = α ( P 1 ) ∪ · · · ∪ α ( P n ) Parallel: α ( P 1 || · · · || P n ) = α ( P 1 ) ∪ · · · ∪ α ( P n ) Definition: α ( ProcId ) = α ( P ) where ( ProcId = P ) Extension: α ( P + { a 1 , . . . , a n } ) = α ( P ) ∪ { a 1 , . . . , a n } Hiding: α ( P \{ a 1 , . . . , a n } ) = α ( P ) − { a 1 , . . . , a n } Stop: α ( STOP ) = { }
Topic 2.3: Understanding FSP Example LAUGH = (laugh -> STOP). CONVERSE = (think -> TALK), TALK = (talk -> STOP). ||LAUGH_CONVERSE = (LAUGH || CONVERSE).
Topic 2.3: Understanding FSP Example LAUGH = (laugh -> STOP). CONVERSE = (think -> TALK), TALK = (talk -> STOP). ||LAUGH_CONVERSE = (LAUGH || CONVERSE). ⋆ Calculate alphabet: α ( LAUGH CONVERSE ) ? ⋆
Topic 2.3: Understanding FSP Parallel Rules II: Definition a → P ′ P a �∈ α ( Q ) Par1 a → ( P ′ || Q ) ( P || Q )
Topic 2.3: Understanding FSP Parallel Rules II: Definition a → P ′ b P a �∈ α ( Q ) → Q ′ Q b �∈ α ( P ) Par1 Par2 a → ( P ′ || Q ) ( P || Q ) ( P || Q ) b → ( P || Q ′ )
Topic 2.3: Understanding FSP Parallel Rules II: Definition a → P ′ b P a �∈ α ( Q ) → Q ′ Q b �∈ α ( P ) Par1 Par2 a → ( P ′ || Q ) ( P || Q ) ( P || Q ) b → ( P || Q ′ ) a a → P ′ → Q ′ P Q Par3 a → ( P ′ || Q ′ ) ( P || Q )
Topic 2.3: Understanding FSP An Example Transition Derivation Consider the LAUGH CONVERSE process ... Defn LAUGH CONVERSE
Topic 2.3: Understanding FSP An Example Transition Derivation Consider the LAUGH CONVERSE process ... Par1 ( LAUGH || CONVERSE ) Defn LAUGH CONVERSE
Topic 2.3: Understanding FSP An Example Transition Derivation Consider the LAUGH CONVERSE process ... Defn LAUGH Par1 ( LAUGH || CONVERSE ) Defn LAUGH CONVERSE
Topic 2.3: Understanding FSP An Example Transition Derivation Consider the LAUGH CONVERSE process ... Prefix ( laugh -> STOP ) Defn LAUGH Par1 ( LAUGH || CONVERSE ) Defn LAUGH CONVERSE
Topic 2.3: Understanding FSP An Example Transition Derivation Consider the LAUGH CONVERSE process ... Prefix laugh ( laugh -> STOP ) → STOP Defn LAUGH Par1 ( LAUGH || CONVERSE ) Defn LAUGH CONVERSE
Topic 2.3: Understanding FSP An Example Transition Derivation Consider the LAUGH CONVERSE process ... Prefix laugh ( laugh -> STOP ) → STOP Defn laugh LAUGH → STOP Par1 ( LAUGH || CONVERSE ) Defn LAUGH CONVERSE
Topic 2.3: Understanding FSP An Example Transition Derivation Consider the LAUGH CONVERSE process ... Prefix laugh ( laugh -> STOP ) → STOP Defn laugh LAUGH → STOP Par1 laugh ( LAUGH || CONVERSE ) → ( STOP || CONVERSE ) Defn LAUGH CONVERSE
Topic 2.3: Understanding FSP An Example Transition Derivation Consider the LAUGH CONVERSE process ... Prefix laugh ( laugh -> STOP ) → STOP Defn laugh LAUGH → STOP Par1 laugh ( LAUGH || CONVERSE ) → ( STOP || CONVERSE ) Defn laugh → ( STOP || CONVERSE ) LAUGH CONVERSE
Topic 2.3: Understanding FSP For you to consider ... ⋆ Derive the other transitions for LAUGH CONVERSE ? ⋆ laugh LAUGH CONVERSE → ( STOP || CONVERSE )
Topic 2.3: Understanding FSP For you to consider ... ⋆ Derive the other transitions for LAUGH CONVERSE ? ⋆ laugh LAUGH CONVERSE → ( STOP || CONVERSE ) think → ( STOP || TALK )
Topic 2.3: Understanding FSP For you to consider ... ⋆ Derive the other transitions for LAUGH CONVERSE ? ⋆ laugh LAUGH CONVERSE → ( STOP || CONVERSE ) think → ( STOP || TALK ) talk → ( STOP || STOP )
Recommend
More recommend