DisCo Logo  

The DisCo Home Page


Main Page
Disco in a Nutshell
Formal Issues
Publications
Bugreporting
Members
Links


Example: Distributed Exchange Sort with Termination Detection


This Java applet gives you a taste of what it means to execute a DisCo specification. The full animation tool has many features for controlling the layout of objects and actions, saving execution histories etc., but the basic functionality is very similar to this applet. The applet was created by Risto Pitkänen and Mika Katara.

Distributed exchange sort

Above you see two rows of boxes. The upper row represents actions and the lower row objects. Each object is a process that has an integer variable x associated with it. The idea is that by executing actions repeatedly the integers eventually become sorted. Each action is enabled if certain conditions hold and only enabled actions can be executed. In this case each action has two participant objects, which must be adjacent and also otherwise suitable. The DisCo specification is given in two layers. The first layer describes how objects swap values of their x attributes, and the second layer describes how termination is detected.

Execution can be controlled in two ways, manually and semi-automatically. In manual execution the user can select an enabled action (enabled actions are painted in white) by clicking on its top half. Then the user must select a role by clicking on either half of the bottom part of the action. The applet then indicates suitable participants for that role by drawing a thick red border around them. The user can now select one of these objects and the action is executed. There is no need to select the other participant explicitly, because there always exists only one possibility.

In semi-automatic execution the user only has to click on the button labeled "Step" and some enabled action will be executed. The user can mix manual and semi-automatic execution. However, semi-automatic execution always selects a new action to execute, which means it does not necessarily continue exactly from the state the user left the animation in.

More information available

The source code.


Give feedback.