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 95 additions and 69 deletions
/* Example 18. Model of [Red_Green]
/* Example 18. Model of Red Green
Bayesian attribute example
......@@ -13,8 +13,10 @@
since Type 1 assumes that probability of selecting an alternative is
constant for the whole derivation process.
run for scope 1
*/
Instructions: Run for Scope 1. Viewing of traces also includes a "Swim Lanes" option.
==========================================================*/
SCHEMA Red_Green
ATTRIBUTES{ number selection_probability; };
......
/* Example 19. Model of [Stack_Behavior]
/* Example 19. Model of Stack Behavior
An example of Bayesian probability calculation.
run for scopes 1, 2, 3, and up.
This example illustrates the main parts in probabilistic MP model construction:
This example illustrates the main parts in probabilistic MP model construction:
1) selection of the search space - the finite number of event instances,
including the event trace, which is an event by itself.
......@@ -24,6 +22,8 @@
this will require to update the first step in p2 assignment (line 57)
it will become p2 := 1/(M + 1);
Instructions: Run for Scopes 1 and up. Viewing of traces also includes a "Swim Lanes" option.
==========================================================*/
SCHEMA Stack_Behavior
......
/* Example20_Activity_Diagram.mp
/* Example 20. Model of Activity Diagram
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.
*/
Instructions: Run for Scope 1. Viewing of traces also includes a "Swim Lanes" option.
==========================================================*/
SCHEMA Activity_Diagram
......@@ -15,4 +17,4 @@ ROOT A:
a6
( a7 | a8 );
SHOW ACTIVITY DIAGRAM A;
\ No newline at end of file
SHOW ACTIVITY DIAGRAM A;
/* Example 21. Model of Data Flow
Local Report within a trace.
Instructions: Run for Scopes 1 and up. Viewing of traces also includes a "Swim Lanes" option.
==========================================================*/
/* Example 30. Local Report within a trace.
run for scope 1 and up.
*/
SCHEMA Data_Flow
ROOT Writer: (* ( working | writing ) *);
......
/* Example 22. Model of [Simple_Message_Flow]
run for scope 1 and up
/* Example 22. Model of Simple Message Flow
Instructions: Run for Scopes 1 and up. Viewing of traces also includes a "Swim Lanes" option.
==========================================================*/
......
/* Example 23. Model of [Car_Race]
/* Example 23. Model of Car Race
Local graph within the event trace.
run for scope 1 and up
Instructions: Run for Scopes 1 and up. Viewing of traces also includes a "Swim Lanes" option.
==========================================================*/
......
/* Example 24. Model of [Compiler]
/* Example 24. Model of Compiler
Compiler front end, bottom-up parser
Lexer and parser in interactive mode.
......@@ -7,11 +7,12 @@
from the set of valid event traces
The MP code for constructing UML-like Component Diagram
is reusable and can be copied/pasted into any MP model.
run for
scope 1, 20 traces, approx. 5 sec.
====================================================*/
Instructions: Run for Scope 1. Viewing of traces also includes a "Swim Lanes" option.
Scope 1: 20 traces in approx. 3.1 sec.
==========================================================*/
SCHEMA Compiler
ROOT Source_code: (+<1.. $$scope + 1>
......
/* Example 25. Model of [Graph_as_Data_Structure]
/* Example 25. Model of Graph as Data Structure
Accumulating and rendering statistics from event traces.
Accumulating and rendering statistics from event traces.
Graphs as container data structures
============================================================*/
Instructions: Run for Scopes 1 and up. Viewing of traces also includes a "Swim Lanes" option.
==========================================================*/
SCHEMA Graph_as_Data_Structure
ROOT A: (* ( a | b) *);
ROOT B: (+ c +);
......
/* Example 26. Model of [Unreliable_Message_Flow]
/* Example 26. Model of Unreliable Message Flow
GLOBAL query
......@@ -16,8 +16,10 @@ for scope 1), like:
ROOT Sender: (+<1..7> send +);
ROOT Receiver: (+<1..7> (receive |<<0.2>> does_not_receive) +);
Run for scopes 1 and up.
*/
Instructions: Run for Scopes 1 and up. Viewing of traces also includes a "Swim Lanes" option.
==========================================================*/
SCHEMA Unreliable_Message_Flow
ROOT Sender: (+ send +);
......
/* Example 27. Model of [Table_and_Bar_Chart]
/* Example 27. Model of Table and Bar Chart
Assembling statistics about a current trace in a TABLE and rendering it.
Table and bar chart example, run for scope 1
Table and bar chart example.
Instructions: Run for Scope 1. Viewing of traces also includes a "Swim Lanes" option.
==========================================================*/
......
/* Example 28. Model of [Histogram]
/* Example 28. Model of Histogram
Histogram example, run for scopes 1, 2, 3, and up
*/
Histogram example
Instructions: Run for Scopes 1 and up. Viewing of traces also includes a "Swim Lanes" option.
==========================================================*/
SCHEMA Histogram
ROOT A: (<<0.2>> a1 | <<0.3>> a2 | (* a3 *));
ATTRIBUTES { number count; };
......
/* Example 29. Model of [Gantt_Chart]
/* Example 29. Model of Gantt Chart
Gantt chart example
*/
Instructions: Run for Scope 1. Viewing of traces also includes a "Swim Lanes" option.
==========================================================*/
SCHEMA Gantt_Chart
ROOT A: a1 a2;
......
/* Example 30. Model of [Microwave_Oven]
/* Example 30. Model of Microwave Oven
example of finite state diagram behavior model,
CTL formula representation in MP, and model checking for a small scope.
......@@ -26,9 +26,9 @@
or paths, including state visits
and commands triggering state transitions,
following well known algorithm NFA -> RE.
run for:
scope 1 (28 traces, 2 counterexamples, 1.75 sec.)
Instructions: Run for Scope 1. Viewing of traces also includes a "Swim Lanes" option.
Scope 1: 28 traces (including 2 counterexamples) in approx. 1.4 sec.
==========================================================*/
......
/* Example31_Aspect_Oriented_Paradigm.mp
/* Example 31. Model of Aspect Oriented Paradigm
The COORDINATE operation supports a “cause-effect” refinement for
the behavior of two components and it bears a certain similarity
......@@ -13,7 +13,9 @@ methods M1 and M2 as join points, and the aspect behavior requires
a call to Prolog before, and to Epilog after each method call as an
advice. The corresponding MP model may look like the following.
*/
Instructions: Run for Scopes 1 and up. Viewing of traces also includes a "Swim Lanes" option.
==========================================================*/
SCHEMA Aspect_Oriented_Paradigm
......@@ -29,4 +31,4 @@ COORDINATE
DO ADD
$a1 PRECEDES $jp,
$jp PRECEDES $a2;
OD;
\ No newline at end of file
OD;
/* Example 32. Model of [Petri_Net]
/* Example 32. Model of Petri Net
modeling Petri net behavior
see the Petri net diagram in Sec. 2.16.2 in the MP v.4 Language Manual
scope 1 (2 traces, 0.02 sec.)
scope 2 (4 traces, 6.23 sec.)
to obtain in the Global view Petri net diagram
extracted from the event traces, run scope 2
Instructions: Run for Scopes 1 and 2. Viewing of traces also includes a "Swim Lanes" option.
Scope 2: 4 traces in approx. 6.6 sec.
==========================================================*/
SCHEMA Petri_Net
......
/* Example 33. Model of [ATM_Withdrawal]
/* Example 33. Model of ATM Withdrawal
Extracting Statechart view from MP model.
run for scope 1 and up
Instructions: Run for Scopes 1 and up. Viewing of traces also includes a "Swim Lanes" option.
==========================================================*/
SCHEMA ATM_Withdrawal
ROOT Customer: (* insert_card
......
/* Example 34. Model of [Finite_State_Diagram_with_Path_Annotation]
/* Example 34. Model of Finite State Diagram with Path Annotation
example of finite state diagram behavior model,
contains non-deterministic transitions (from S1 with symbol a),
......@@ -28,11 +28,9 @@
1) Event Si_to_Sj contains the symbol triggering the transition.
2) Si_to_Sj is shared by corresponding state behavior roots.
run for:
scope 1 (4 traces),
scope 2 (30 traces),
scope 3 (258 traces)
Instructions: Run for Scopes 1 and 2. Viewing of traces also includes a "Swim Lanes" option.
Scope 2: 30 traces in approx. 9.4 sec.
==========================================================*/
......
/* Example 35. Model of [Finite_State_Diagram_with_Path_Diagram]
/* Example 35. Model of Finite State Diagram with Path Diagram
Adding path and state transition diagrams to
the Finite Automaton behavior model.
run for scope 2
Instructions: Run for Scope 2. Viewing of traces also includes a "Swim Lanes" option.
Scope 2: 30 traces in approx. 11 sec.
==========================================================*/
SCHEMA Finite_State_Diagram_with_Path_Diagram
ROOT S1_behavior:
......
/* Example 36. Model of [Authentication_System]
/* Example 36. Model of Authentication System
Authentication system's behavior for reuse with MAP operation.
Authentication system's behavior for reuse with MAP operation.
run for scope 3 or more to see attempts_exhausted event
you may hide the Requestor node in the event trace graph,
since the User will copy all Requestor's behavior
Instructions: Run for Scopes 1 and up. Viewing of traces also includes a "Swim Lanes" option. At Scope 3 and above, the attempts_exhausted event can be seen. You may hide the Requestor node in the event trace graph, since the User will copy all Requestor's behavior.
============== reused MP code starts here ==================*/
SCHEMA Reuse_of_a_system
SCHEMA Authentication_System
ROOT Data_Base: (* check_ID *);
......
/* Example 37. Model of [Compiler1]
/* Example 37. Model of Compiler 1
Compiler front end,
bottom-up parser
Lexer and parser in batch mode
run for
scope 1, 2 traces, less than 1 sec.
scope 2, 147 traces, approx. time 0.87 sec.
scope 3, 11988 traces, approx. time 148 sec.
Instructions: Run for Scopes 1 and 2. Viewing of traces also includes a "Swim Lanes" option.
Scope 2: 147 traces in approx. 1.8 sec.
==========================================================*/
......
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