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

Merge branch 'Keane_Branch' into 'master'

Keane branch

See merge request !6
parents 51979e9b 976a01ff
No related branches found
No related tags found
1 merge request!6Keane branch
Showing
with 111 additions and 27 deletions
...@@ -13,7 +13,7 @@ the most appropriate for browsing traces here. ...@@ -13,7 +13,7 @@ the most appropriate for browsing traces here.
==========================================================*/ ==========================================================*/
SCHEMA simple_message_flow SCHEMA Simple_Message_Flow
ROOT Sender: (* send *); ROOT Sender: (* send *);
ROOT Receiver: (* receive *); ROOT Receiver: (* receive *);
......
...@@ -7,7 +7,7 @@ run for scopes 1 and up. ...@@ -7,7 +7,7 @@ run for scopes 1 and up.
==========================================================*/ ==========================================================*/
SCHEMA unreliable_message_flow SCHEMA Unreliable_Message_Flow
ROOT Sender: (* send *); ROOT Sender: (* send *);
ROOT Receiver: (* (receive | does_not_receive) *); ROOT Receiver: (* (receive | does_not_receive) *);
......
...@@ -25,7 +25,7 @@ the most appropriate for browsing traces here. ...@@ -25,7 +25,7 @@ the most appropriate for browsing traces here.
==========================================================*/ ==========================================================*/
SCHEMA Data_flow SCHEMA Data_Flow
ROOT Writer: (* ( working | writing ) *); ROOT Writer: (* ( working | writing ) *);
......
...@@ -28,7 +28,7 @@ to view a traditional "box-and-arrow" architecture diagram, i.e. to visualize an ...@@ -28,7 +28,7 @@ to view a traditional "box-and-arrow" architecture diagram, i.e. to visualize an
==========================================================*/ ==========================================================*/
SCHEMA ATM_withdrawal SCHEMA ATM_Withdrawal
ROOT Customer: (* insert_card ROOT Customer: (* insert_card
( identification_succeeds ( identification_succeeds
......
/* Example04_StackBehavior_EnsureCondition.mp
The event trace is a set of events and the Boolean expressions
in MP can embrace the traditional predicate calculus notation. A set
of behaviors (event traces) may be defined by the event grammar rules,
composition operations, and some additional constraints – ENSURE
conditions.
Stack implements the “last in, first out” behavior for
storing/retrieving elements. It is assumed that initially Stack
is empty.
This rule specifies the behavior of a stack in terms of stack
operations push and pop. The BUILD block associated with a root or
composite event contains composition operations performed when event
trace segment representing the behavior of that root or composite is
generated. The ENSURE Boolean expression provides a condition that
each valid trace should satisfy. The domain of the universal quantifier
is the set of all pop events inside Stack. The FROM Stack part is
optional, by default it is assumed to be FROM THIS.
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 that satisfy the constraint. This example presents a
filtering operation as yet another kind of behavior composition,
and demonstrates an example of combining imperative (event grammar)
and declarative (Boolean expressions) constructs for behavior
specification.
*/
SCHEMA Stack_behavior
ROOT Stack: (* ( push | pop ) *)
BUILD {
/* If an element is retrieved, it should have been stored before */
ENSURE FOREACH $x: pop FROM Stack
( #pop BEFORE $x < #push BEFORE $x );
};
\ No newline at end of file
...@@ -20,7 +20,7 @@ as yet another kind of behavior composition, and demonstrates an ...@@ -20,7 +20,7 @@ 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 SCHEMA Queue_Behavior
ROOT Queue: (* ( enqueue | dequeue ) *) ROOT Queue: (* ( enqueue | dequeue ) *)
BUILD { BUILD {
......
...@@ -29,7 +29,7 @@ example of combining imperative (event grammar) and declarative ...@@ -29,7 +29,7 @@ example of combining imperative (event grammar) and declarative
==========================================================*/ ==========================================================*/
SCHEMA Stack_behavior SCHEMA Stack_Behavior
ROOT Stack: (* ( push | pop ) *) ROOT Stack: (* ( push | pop ) *)
BUILD { BUILD {
......
...@@ -11,7 +11,7 @@ layouts are the most appropriate for browsing traces here. ...@@ -11,7 +11,7 @@ layouts are the most appropriate for browsing traces here.
==========================================================*/ ==========================================================*/
SCHEMA Example5_Car_Race SCHEMA Car_Race
Car: Start Car: Start
(* drive_lap *) (* drive_lap *)
......
...@@ -22,7 +22,7 @@ ...@@ -22,7 +22,7 @@
==========================================================*/ ==========================================================*/
SCHEMA AtoB SCHEMA Unreliable_Channel
ROOT TaskA: (* A_sends_request_to_B ROOT TaskA: (* A_sends_request_to_B
( A_receives_data_from_B | ( A_receives_data_from_B |
......
...@@ -8,7 +8,7 @@ ...@@ -8,7 +8,7 @@
==========================================================*/ ==========================================================*/
SCHEMA ring SCHEMA Ring_Topology
/* model of networking ring, where each node sends/receives /* model of networking ring, where each node sends/receives
to/from its left and right neighbor. to/from its left and right neighbor.
*/ */
......
...@@ -16,7 +16,7 @@ run for scope 1 ...@@ -16,7 +16,7 @@ run for scope 1
==========================================================*/ ==========================================================*/
SCHEMA Cardiac_Arrest SCHEMA Cardiac_Arrest_Workflow
ROOT Phase1: { check_breathing [finish_first], ROOT Phase1: { check_breathing [finish_first],
check_pulse [finish_first] } check_pulse [finish_first] }
......
...@@ -11,7 +11,7 @@ on Gryphon: ...@@ -11,7 +11,7 @@ on Gryphon:
==========================================================*/ ==========================================================*/
SCHEMA Suppliers SCHEMA Consumers_Suppliers
/*=========================================*/ /*=========================================*/
ROOT Consumers: {+ Consumer +}; ROOT Consumers: {+ Consumer +};
......
...@@ -2,7 +2,7 @@ ...@@ -2,7 +2,7 @@
==========================================================*/ ==========================================================*/
SCHEMA Shopping_spree SCHEMA Shopping_Spree
ROOT Buyer: (*<0.. 2 * $$scope> Buy *); ROOT Buyer: (*<0.. 2 * $$scope> Buy *);
/* Increase the iteration to ensure enough Buy events to coordinate with both Shops */ /* Increase the iteration to ensure enough Buy events to coordinate with both Shops */
......
...@@ -9,8 +9,7 @@ ...@@ -9,8 +9,7 @@
run for scopes 1 and up run for scopes 1 and up
==========================================================*/ ==========================================================*/
SCHEMA Backpack_Weight
SCHEMA backpack
ATTRIBUTES{ interval weight; }; ATTRIBUTES{ interval weight; };
......
/* Example16_StackBehavior_ProbabilityCalculationsType1.mp
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
example’s purpose we assume probability of Push is higher than
probability of Pop. It is assumed also that probabilities to perform 0,
1 or more iterations by the iterative event pattern (* … *) are equal.
Consider a test at scope 2. Because pop cannot occur before a push,
the model rejects the scenarios where a single pop alone occurs, a pop
occurs before a push, and 2 pops with no pushing. These would all be
impossible in a real stack, so they are cut from the model.
By removing some scenarios, the remaining probabilities change.
*/
SCHEMA Stack_Behavior
ROOT Stack: (* (<<0.75>> Push | <<0.25>> Pop ) *)
BUILD { /* If an element is retrieved, it should have been stored before */
ENSURE FOREACH $x: Pop FROM Stack
( #Pop BEFORE $x < #Push BEFORE $x ); };
\ No newline at end of file
/* Example17_SharedEvents_ProbabilityCalculationsType1.mp
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
must have c. Additionally, probabilities show how "SHARE ALL" increases
the chances of the shared event.
*/
SCHEMA Shared_Events
ROOT R1: (<<0.6>> a | b);
ROOT R2: (<<0.8>> a | c);
R1, R2 SHARE ALL a;
\ No newline at end of file
...@@ -14,10 +14,8 @@ ...@@ -14,10 +14,8 @@
constant for the whole derivation process. constant for the whole derivation process.
run for scope 1 run for scope 1
*/
==========================================================*/ SCHEMA Red_Green
SCHEMA RedGreen
ATTRIBUTES{ number selection_probability; }; ATTRIBUTES{ number selection_probability; };
......
...@@ -26,7 +26,7 @@ ...@@ -26,7 +26,7 @@
==========================================================*/ ==========================================================*/
SCHEMA stack1 SCHEMA Stack_Behavior
ROOT Stack: (* ( <<0.75>> push | <<0.25>> pop ) *) ROOT Stack: (* ( <<0.75>> push | <<0.25>> pop ) *)
/* probabilities for alternatives are here to enable also /* probabilities for alternatives are here to enable also
......
/* Example20_Activity_Diagram.mp
This model demonstrates how to use "SHOW ACTIVITY DIAGRAM" to
display the possible traces in flowchart form. Root A has 4 different
possible traces at scope 1, and the flowchart displays those possiblities.
*/
SCHEMA Activity_Diagram
ROOT A:
a1
[a2]
{ a3, a4, a5 }
a6
( a7 | a8 );
SHOW ACTIVITY DIAGRAM A;
\ No newline at end of file
/* Example 21. Model of [Data_Flow]
Local Report within a trace. /* Example 30. Local Report within a trace.
run for scope 1 and up.
run for scope 1 and up. */
SCHEMA Data_Flow
==========================================================*/
SCHEMA Data_flow
ROOT Writer: (* ( working | writing ) *); ROOT Writer: (* ( working | writing ) *);
......
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