

Before starting:
===========================

Open Mio WB perspective with "Window > Open Perspective > Other ... > MIO Workbench"

Examples
===========================

Ex 1: Flight booking
---------------------------

Our simplified version of the flight booking scenario serves well for 
instructional purposes. You will find five MIOs:

* The protocol of the service itself (prot.mio)
* The protocol of the service client (partnerProt.mio)
* Two implementations of the service (impl_strong.mio and impl_weak.mio); each of which is different with regard to internal actions.
   
You can check the protocol against the implementations using various notions of refinement, and you can 
verify compatibility of the partner protocol against the protocol of the service and its implementations.

To do this, open the Verification View with "Window > Open View  > Other... > Verification View"
* Drop the abstract MIO into the "Abstract specification" box on the right-hand side (for example, prot.mio)
* Drop the concrete MIO into the "Concrete specification" box on the left-hand side (for example, impl_strong.mio)
* Select a refinement or compatibility implementation to check from the middle drop-down in the view (either "Refinement" or "Compatibility")
* Results are displayed graphically.

Ex 2: Vending Machine
---------------------------

This example consists of the following MIOs specifying a simple vending machine which can dispense tea or coffee. 
It contains the following files:

* AbstractCore.mio : This MIO is the abstract specification of the vending machine.
* CoinSlot.mio, Controller.mio, Buttons.mio : These MIOs specify a coin slot, a controller, and 
  a button panel component, respectively. The composition of all three MIOs refine the 
  abstract specification AbstractCore.mio. 
* Property1.mio, Property2.mio : Two properties of the vending machine. Property1.mio expresses that 
  a coffee or tea can be dispensed only if a coin has been dropped into the machine before. 
  Property2.mio expresses that after a coffee (tea) has been selected by a person, the machine may only 
  dispense coffee (tea). AbstractCore.mio satisfies the two properties. 
  
These MIOs can be checked by executing commands in the Command-Line-Shell. 
To open the command line shell, go to "Window > Open View > Other... > Command-Line-Shell"

* Drag&Drop the MIOs files into the shell. Then:
  
Type in 

	( CoinSlot || Controller || Buttons ) <= AbstractCore
	
...which verifies the refinement.
  
To display the composition graphically:
  
	P := ( CoinSlot || Controller || Buttons ) 
	view P

You can also check "AbstractCore <= (Property1 && Property2)" (without quotes).
    
To display what Property1 && Property2 look like:
  
	P := Property1 && Property2
	view P
  
In these examples, && is composition; <= is strong modal refinement.

 Ex 3: Quotient
 ---------------------------

This small example illustrates the use of the quotient operation. The MIO T.mio is 
the abstract specification, and S.mio is the given component. We are looking for the missing component 
which is T -- S.

Drop both .mio files into the shell. Then execute

	Q := T -- S

Show Q via

	view Q
	
Q is called "the quotient of T by S" and that is the most general MIO satisfying

	((T -- S) || S) <= T	

which can also be checked by

	(S || Q) <= T

