Skip to content
Snippets Groups Projects
Commit b41f1f23 authored by Giammarco, Kristin M's avatar Giammarco, Kristin M
Browse files

Merge branch 'Pamela_Branch_2' into 'master'

Pamela's 2nd Merge Request - FIXED

See merge request !9
parents b9e16b8a 2bea2d8e
No related branches found
No related tags found
1 merge request!9Pamela's 2nd Merge Request - FIXED
Showing
with 148 additions and 123 deletions
/* Example 01. Model of [Simple_Message_Flow] /* Example 01. Model of Simple Message Flow
Event grammar rules for each root define derivations for event traces, Event grammar rules for each root define derivations for event traces,
in this case a simple sequence of zero or more events for each root. in this case a simple sequence of zero or more events for each root.
...@@ -8,8 +8,8 @@ a modified event trace, merging behaviors of Sender and Receiver ...@@ -8,8 +8,8 @@ a modified event trace, merging behaviors of Sender and Receiver
and adding the PRECEDES relation for the selected send/receive pairs. and adding the PRECEDES relation for the selected send/receive pairs.
The coordination operation behaves as a "cross-cutting" derivation rule. The coordination operation behaves as a "cross-cutting" derivation rule.
Run for scopes 1 and up. The "Sequence" or "Swim Lanes" layouts are Instructions: Run for Scopes 1 and up. Viewing of traces also includes a
the most appropriate for browsing traces here. "Swim Lanes" option.
==========================================================*/ ==========================================================*/
......
/* Example 01a. Model of [Unreliable_Message_Flow] /* Example 01a. Model of Unreliable Message Flow
We may want to specify behaviors when some messages get lost in the transition. We may want to specify behaviors when some messages get lost in the transition.
It can be done using ‘virtual’ events. It can be done using ‘virtual’ events.
run for scopes 1 and up. Instructions: Run for Scopes 1 and up. Viewing of traces also includes a "Swim
Lanes" option.
==========================================================*/ ==========================================================*/
......
/* Example 02. Model of [Data_Flow] /* Example 02. Model of Data Flow
data items as behaviors data items as behaviors
...@@ -18,10 +18,10 @@ only event traces where corresponding event sharing is implemented. ...@@ -18,10 +18,10 @@ only event traces where corresponding event sharing is implemented.
Event traces specified by the schema represent system’s emergent behavior, Event traces specified by the schema represent system’s emergent behavior,
where behaviors of subsystems are influenced by the coordination. where behaviors of subsystems are influenced by the coordination.
This is a toy example of System_of_Systems emerging behavior modeling. This is a toy example of System of Systems emerging behavior modeling.
Run for scopes 1 and up. The "Sequence" or "Swim Lanes" layouts are Instructions: Run for Scopes 1 and up. Viewing of traces also includes a
the most appropriate for browsing traces here. "Swim Lanes" option.
==========================================================*/ ==========================================================*/
......
/* Example 03. Model of [ATM_Withdrawal] /* Example 03. Model of ATM Withdrawal
Integrated system and environment behaviors Integrated system and environment behaviors
...@@ -17,15 +17,13 @@ among events in different components. ...@@ -17,15 +17,13 @@ among events in different components.
The event traces produced from a model partitioned using this separation of concerns The event traces produced from a model partitioned using this separation of concerns
include all combinations of event selections allowed by the model. include all combinations of event selections allowed by the model.
Run for scopes 1 and up.
The "Sequence" or "Swim Lanes" layouts are the most appropriate for browsing traces here.
The "Sequence" mode yields views very similar to the UML or SysML Sequence Diagrams.
By selecting a representative enough trace (containing all events and interactions of interest, By selecting a representative enough trace (containing all events and interactions of interest,
like traces 2 or 3 for scope 1), and then collapsing root event, it becomes possible like traces 2 or 3 for scope 1), and then collapsing root event, it becomes possible
to view a traditional "box-and-arrow" architecture diagram, i.e. to visualize an architecture view. to view a traditional "box-and-arrow" architecture diagram, i.e. to visualize an architecture view.
Instructions: Run for Scopes 1 and up. "Sequence" mode yields views very similar to the UML or SysML
Sequence Diagrams. Viewing of traces also includes a "Swim Lanes" option.
==========================================================*/ ==========================================================*/
SCHEMA ATM_Withdrawal SCHEMA ATM_Withdrawal
......
/* Example04_StackBehavior_EnsureCondition.mp /* Example 04. Model of Stack Behavior
The event trace is a set of events and the Boolean expressions The event trace is a set of events and the Boolean expressions
in MP can embrace the traditional predicate calculus notation. A set in MP can embrace the traditional predicate calculus notation. A set
...@@ -27,12 +27,16 @@ and demonstrates an example of combining imperative (event grammar) ...@@ -27,12 +27,16 @@ and demonstrates an example of combining imperative (event grammar)
and declarative (Boolean expressions) constructs for behavior and declarative (Boolean expressions) constructs for behavior
specification. specification.
*/ Instructions: Run for Scopes 1 and up. Viewing of traces also
SCHEMA Stack_behavior includes a "Swim Lanes" option.
==========================================================*/
SCHEMA Stack_Behavior
ROOT Stack: (* ( push | pop ) *) ROOT Stack: (* ( push | pop ) *)
BUILD { BUILD {
/* If an element is retrieved, it should have been stored before */ /* If an element is retrieved, it should have been stored before */
ENSURE FOREACH $x: pop FROM Stack ENSURE FOREACH $x: pop FROM Stack
( #pop BEFORE $x < #push BEFORE $x ); ( #pop BEFORE $x < #push BEFORE $x );
}; };
\ No newline at end of file
/* Example4a_Queue_behavior.mp /* Example 04a. Model of Stack Behavior
run for scopes 1, 2, 3, and up. The event trace is a set of events and the Boolean expression constructs in MP
*/ can support the traditional first order predicate calculus notation.
/* This rule specifies the behavior of a queue in terms of queue operations A set of behaviors (event traces) may be defined by the event
enqueue and dequeue. It is assumed that initially Queue is empty. grammar rules, composition operations, and some additional constraints –
ENSURE conditions.
This rule specifies the behavior of a stack in terms of stack operations
push and pop. It is assumed that initially Stack is empty.
The BUILD block associated with a root or composite event The BUILD block associated with a root or composite event
contains composition operations performed when event trace segment contains composition operations performed when event trace segment
representing the behavior of that root or composite is generated. representing the behavior of that root or composite is generated.
The ENSURE Boolean expression provides a condition that each valid trace The ENSURE Boolean expression provides a condition that each valid trace
should satisfy. The domain of the universal quantifier is the set of all should satisfy. The domain of the universal quantifier is the set of all
dequeue events inside Queue trace. pop events inside Stack trace. The FROM Stack part is optional, by default it is
assumed to be FROM THIS.
The function #dequeue BEFORE $x yields the number of dequeue events preceding $x. The function #pop BEFORE $x yields the number of pop events preceding $x.
The set of valid event traces specified by this schema contains only traces The set of valid event traces specified by this schema contains only traces
that satisfy the constraint. This example presents a filtering operation that satisfy the constraint. This example presents a filtering operation
as yet another kind of behavior composition, and demonstrates an as yet another kind of behavior composition, and demonstrates an
example of combining imperative (event grammar) and declarative example of combining imperative (event grammar) and declarative
(Boolean expressions) constructs for behavior specification. */ (Boolean expressions) constructs for behavior specification.
SCHEMA Queue_Behavior Instructions: Run for Scopes 1 and up. Viewing of traces also includes a
"Swim Lanes" option.
ROOT Queue: (* ( enqueue | dequeue ) *)
BUILD { ==========================================================*/
/* if an element is retrieved, it should have been stored before,
this constraint is identical to Stack behavior constraint. */ SCHEMA Stack_Behavior
ENSURE FOREACH $x: dequeue
( #dequeue BEFORE $x < #enqueue BEFORE $x ); ROOT Stack: (* ( push | pop ) *)
BUILD {
/* The following composition operation establishes enqueue/dequeue pairs /* if an element is retrieved, it should have been stored before */
in the Queue behavior. For each 'dequeue' the earliest in time ENSURE FOREACH $x: pop FROM Stack
preceding 'enqueue' is selected, unless it has been already ( #pop BEFORE $x < #push BEFORE $x );
consumed by another 'dequeue' */
/* The following composition operation establishes push/pop pairs
COORDINATE $get: dequeue in the Stack behavior. For each 'pop' the closest in time
DO COORDINATE $put: enqueue preceding 'push' is selected, unless it has been already
SUCH THAT $put BEFORE $get consumed by another 'pop' */
DO IF NOT ( EXISTS $g: dequeue $put Paired_with $g OR
EXISTS $p: enqueue $p Paired_with $get ) COORDINATE $get: pop
THEN ADD $put Paired_with $get; FI; DO COORDINATE <REVERSE> $put: push
OD; SUCH THAT $put BEFORE $get
OD; DO IF NOT ( EXISTS $g: pop $put Paired_with $g OR
};/* end BUILD for Queue */ EXISTS $p: push $p Paired_with $get )
THEN ADD $put Paired_with $get; FI;
OD;
OD;
};/* end BUILD for Stack */
/* Example 04b. Model of [Queue_Behavior] /* Example 04b. Model of Queue Behavior
The event trace is a set of events and the Boolean expression constructs in MP This rule specifies the behavior of a queue in terms of queue operations
can support the traditional first order predicate calculus notation. enqueue and dequeue. It is assumed that initially Queue is empty.
A set of behaviors (event traces) may be defined by the event
grammar rules, composition operations, and some additional constraints –
ENSURE conditions.
run for scopes 1, 2, 3, and up.
This rule specifies the behavior of a stack in terms of stack operations
push and pop. It is assumed that initially Stack is empty.
The BUILD block associated with a root or composite event The BUILD block associated with a root or composite event
contains composition operations performed when event trace segment contains composition operations performed when event trace segment
representing the behavior of that root or composite is generated. representing the behavior of that root or composite is generated.
The ENSURE Boolean expression provides a condition that each valid trace The ENSURE Boolean expression provides a condition that each valid trace
should satisfy. The domain of the universal quantifier is the set of all should satisfy. The domain of the universal quantifier is the set of all
pop events inside Stack trace. The FROM Stack part is optional, by default it is dequeue events inside Queue trace.
assumed to be FROM THIS.
The function #pop BEFORE $x yields the number of pop events preceding $x. The function #dequeue BEFORE $x yields the number of dequeue events preceding $x.
The set of valid event traces specified by this schema contains only traces The set of valid event traces specified by this schema contains only traces
that satisfy the constraint. This example presents a filtering operation that satisfy the constraint. This example presents a filtering operation
as yet another kind of behavior composition, and demonstrates an as yet another kind of behavior composition, and demonstrates an
example of combining imperative (event grammar) and declarative example of combining imperative (event grammar) and declarative
(Boolean expressions) constructs for behavior specification. (Boolean expressions) constructs for behavior specification.
Instructions: Run for Scopes 1 and up. Viewing of traces also includes a "Swim
Lanes" option.
==========================================================*/ ==========================================================*/
SCHEMA Stack_Behavior SCHEMA Queue_Behavior
ROOT Stack: (* ( push | pop ) *) ROOT Queue: (* ( enqueue | dequeue ) *)
BUILD { BUILD {
/* if an element is retrieved, it should have been stored before */ /* if an element is retrieved, it should have been stored before,
ENSURE FOREACH $x: pop FROM Stack this constraint is identical to Stack behavior constraint. */
( #pop BEFORE $x < #push BEFORE $x ); ENSURE FOREACH $x: dequeue
( #dequeue BEFORE $x < #enqueue BEFORE $x );
/* The following composition operation establishes push/pop pairs
in the Stack behavior. For each 'pop' the closest in time /* The following composition operation establishes enqueue/dequeue pairs
preceding 'push' is selected, unless it has been already in the Queue behavior. For each 'dequeue' the earliest in time
consumed by another 'pop' */ preceding 'enqueue' is selected, unless it has been already
consumed by another 'dequeue' */
COORDINATE $get: pop
DO COORDINATE <REVERSE> $put: push COORDINATE $get: dequeue
SUCH THAT $put BEFORE $get DO COORDINATE $put: enqueue
DO IF NOT ( EXISTS $g: pop $put Paired_with $g OR SUCH THAT $put BEFORE $get
EXISTS $p: push $p Paired_with $get ) DO IF NOT ( EXISTS $g: dequeue $put Paired_with $g OR
THEN ADD $put Paired_with $get; FI; EXISTS $p: enqueue $p Paired_with $get )
OD; THEN ADD $put Paired_with $get; FI;
OD; OD;
};/* end BUILD for Stack */ OD;
};/* end BUILD for Queue */
/* Example 05. Model of [Car_Race] /* Example 05. Model of Car Race
more coordination patterns: more coordination patterns:
- ordering of selected events in concurrent threads - ordering of selected events in concurrent threads
can be modeled by coordinating them with event sequence; can be modeled by coordinating them with event sequence;
- one-many coordination. - one-many coordination.
Run for scopes 1 and up. The "Sequence" or "Swim Lanes" Instructions: Run for Scopes 1 and up. Viewing of traces also
layouts are the most appropriate for browsing traces here. includes a "Swim Lanes" option.
==========================================================*/ ==========================================================*/
......
/* Example 06. Model of [Unreliable_Channel] /* Example 06. Model of Unreliable Channel
Assertion checking, Communicating via unreliable channel. Assertion checking, Communicating via unreliable channel.
...@@ -20,6 +20,9 @@ ...@@ -20,6 +20,9 @@
if the property should always hold, it makes sense to convert it if the property should always hold, it makes sense to convert it
into the ENSURE condition. into the ENSURE condition.
Instructions: Run for Scopes 1 and up. Viewing of traces also
includes a "Swim Lanes" option.
==========================================================*/ ==========================================================*/
SCHEMA Unreliable_Channel SCHEMA Unreliable_Channel
......
/* Example 07. Model of [Unconstrained_Stack] /* Example 07. Model of Unconstrained Stack
Trace annotation techniques Trace annotation techniques
...@@ -17,6 +17,9 @@ might violate certain property, and how to annotate these particular ...@@ -17,6 +17,9 @@ might violate certain property, and how to annotate these particular
events in the trace with additional messages. Programmers will recognize events in the trace with additional messages. Programmers will recognize
the use of debugging print statements for traditional program testing/debugging. the use of debugging print statements for traditional program testing/debugging.
Instructions: Run for Scopes 1 and up. Viewing of traces also includes a
"Swim Lanes" option.
==========================================================*/ ==========================================================*/
SCHEMA Unconstrained_Stack SCHEMA Unconstrained_Stack
......
/* Example 08. Model of [Employee_Employer] /* Example 08. Model of Employee Employer
The web site http://www.infoq.com/articles/bpelbpm The web site http://www.infoq.com/articles/bpelbpm
“Why BPEL is not the holy grail for BPM “ “Why BPEL is not the holy grail for BPM “
...@@ -18,11 +18,9 @@ from the human resource database. When both the computer and the ...@@ -18,11 +18,9 @@ from the human resource database. When both the computer and the
medical check have been performed, the employee is ready to work. medical check have been performed, the employee is ready to work.
Of course, you may want to model this simple process differently, Of course, you may want to model this simple process differently,
but the point here is that you cannot define a structured but the point here is that you cannot define a structured
parallel workflow [in BPEL] that is equivalent to this one ..." parallel workflow [in BPEL] that is equivalent to this one ..."
Run for scope 1. The "Sequence" or "Swim Lanes" Instructions: Run for Scopes 1 and up. Viewing of traces also includes a "Swim Lanes" option. Some box reshuffling may be needed to improve the trace layout.
layouts are the most appropriate for browsing traces here.
Some box reshuffling may be needed to improve the trace layout.
==========================================================*/ ==========================================================*/
......
/* Example 09. Model of [Pipe_Filter] /* Example 09. Model of Pipe Filter
pipe/filter architecture model with 2 filters pipe/filter architecture model with 2 filters
...@@ -8,6 +8,9 @@ ...@@ -8,6 +8,9 @@
3) received message can stay in the Filter for while, 3) received message can stay in the Filter for while,
before being sent (if at all). before being sent (if at all).
Instructions: Run for Scopes 1, 2, 3, and 4. Viewing of traces also includes a "Swim Lanes" option.
Scope 4: 959 traces in approx. 6.1 sec.
==========================================================*/ ==========================================================*/
SCHEMA Pipe_Filter SCHEMA Pipe_Filter
......
/* Example 10. Model of [Publish_Subscribe] /* Example 10. Model of Publish Subscribe
Publisher sends a notification to all active Subscribers Publisher sends a notification to all active Subscribers
when new information is available. when new information is available.
scope 1, 1 trace in less than 1 sec. Instructions: Run for Scopes 1, 2, and 3. Viewing of traces also includes a "Swim Lanes" option.
scope 2, 51 traces in less than 1 sec. Scope 3: 3813 traces in approx. 7.4 min.
scope 3 3813 traces in approx. 5 min.
==========================================================*/ ==========================================================*/
......
/* Example 11. Model of [Ring_Topology] /* Example 11. Model of Ring Topology
ring topology ring topology
an example of user-defined relation use an example of user-defined relation use
The following is a model of network ring, The following is a model of network ring,
where each node interacts with its left and right neighbors only. where each node interacts with its left and right neighbors only.
Instructions: Run for Scopes 1, 2, and 3. Viewing of traces also includes a "Swim Lanes" option.
Scope 3: 1570 traces in approx. 31 sec.
==========================================================*/ ==========================================================*/
......
/* Example 12. Model of [Cardiac_Arrest_Workflow] /* Example 12. Model of Cardiac Arrest Workflow
the web site the web site
http://workflowpatterns.com/patterns/control/index.php http://workflowpatterns.com/patterns/control/index.php
...@@ -12,7 +12,7 @@ run in parallel. Once the first of these has completed, the triage task ...@@ -12,7 +12,7 @@ run in parallel. Once the first of these has completed, the triage task
is commenced. Completion of the other task is ignored and does not result is commenced. Completion of the other task is ignored and does not result
in a second instance of the triage task. in a second instance of the triage task.
run for scope 1 Instructions: Run for Scope 1. Viewing of traces also includes a "Swim Lanes" option.
==========================================================*/ ==========================================================*/
......
/* Example 13. Model of [Consumers_Suppliers] /* Example 13. Model of Consumers Suppliers
Asynchronous coordination and dependency definition example. Asynchronous coordination and dependency definition example.
user-defined relation related_to connects events within each user-defined relation related_to connects events within each
single Request_delivery -> Consume chain single Request_delivery -> Consume chain
on Gryphon: Instructions: Run for Scopes 1 and 2. Viewing of traces also includes a "Swim Lanes" option.
scope 1, 2 traces, in less than 1 sec. Scope 2: 110 traces in approx. 38 sec.
scope 2, 670 traces, approx. time 2.5 min.
==========================================================*/ ==========================================================*/
......
/* Example 14. Model of [Shopping_Spree] /* Example 14. Model of Shopping Spree
Instructions: Run for Scopes 1 and up. Viewing of traces also includes a "Swim Lanes" option.
==========================================================*/ ==========================================================*/
......
/* Example 15. Model of [Backpack_Weight] /* Example 15. Model of Backpack Weight
Use of interval attributes. Use of interval attributes.
...@@ -6,9 +6,10 @@ ...@@ -6,9 +6,10 @@
the total weight of 30 units. the total weight of 30 units.
There may be several instances of the same item. There may be several instances of the same item.
run for scopes 1 and up Instructions: Run for Scopes 1 and up. Viewing of traces also includes a "Swim Lanes" option.
==========================================================*/ ==========================================================*/
SCHEMA Backpack_Weight SCHEMA Backpack_Weight
ATTRIBUTES{ interval weight; }; ATTRIBUTES{ interval weight; };
......
/* Example16_StackBehavior_ProbabilityCalculationsType1.mp /* Example 16. Model of Stack Behavior
Here is a simple stack behavior model. Valid behaviors don’t permit Here is a simple stack behavior model. Valid behaviors don’t permit
a scenario when Pop operation is applied to the empty stack. For the a scenario when Pop operation is applied to the empty stack. For the
...@@ -13,10 +13,13 @@ impossible in a real stack, so they are cut from the model. ...@@ -13,10 +13,13 @@ impossible in a real stack, so they are cut from the model.
By removing some scenarios, the remaining probabilities change. By removing some scenarios, the remaining probabilities change.
*/ Instructions: Run for Scopes 1 and up. Viewing of traces also includes a "Swim Lanes" option.
==========================================================*/
SCHEMA Stack_Behavior SCHEMA Stack_Behavior
ROOT Stack: (* (<<0.75>> Push | <<0.25>> Pop ) *) ROOT Stack: (* (<<0.75>> Push | <<0.25>> Pop ) *)
BUILD { /* If an element is retrieved, it should have been stored before */ BUILD { /* If an element is retrieved, it should have been stored before */
ENSURE FOREACH $x: Pop FROM Stack ENSURE FOREACH $x: Pop FROM Stack
( #Pop BEFORE $x < #Push BEFORE $x ); }; ( #Pop BEFORE $x < #Push BEFORE $x ); };
\ No newline at end of file
/* Example17_SharedEvents_ProbabilityCalculationsType1.mp /* Example 17. Model of Shared Events
A simple example of shared events. If one root has a, the other root A simple example of shared events. If one root has a, the other root
also has a. If neither root has a, then root 1 must have b, and root 2 also has a. If neither root has a, then root 1 must have b, and root 2
must have c. Additionally, probabilities show how "SHARE ALL" increases must have c. Additionally, probabilities show how "SHARE ALL" increases
the chances of the shared event. the chances of the shared event.
*/ Instructions: Run for Scope 1. Viewing of traces also includes a "Swim Lanes" option.
==========================================================*/
SCHEMA Shared_Events SCHEMA Shared_Events
ROOT R1: (<<0.6>> a | b); ROOT R1: (<<0.6>> a | b);
ROOT R2: (<<0.8>> a | c); ROOT R2: (<<0.8>> a | c);
R1, R2 SHARE ALL a; R1, R2 SHARE ALL a;
\ No newline at end of file
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment