Proving a dynamic property on the mouse hanlder

This example is defined in the directory: /home/lbesnard/Polychrony/V4.19/Linux/Examples/mouse/Dynamic_property.

This directory contains the description in Signal of a mouse handler, which is a control example. This program is similar to the mouse program, in which the definition of signals, necessary to prove a dynamic property on the program, has been added.

Description of the program VTMOUSE_P2.gpk

(we do not describe systematically all the files related to this version of the mouse program; these files contain "_P2" in their name)

VTMOUSE_P2.gpk is the same program as VTMOUSE.gpk, in which the definitions of the signals CSTART and CRELAX have been added.

To prove that START and RELAX are alternating signals, it is sufficient to show that the signal CSTART holds always the value true (when it is present) and the signal CRELAX holds always the value false (when it is present).

If you add the specification of this property to the program:

        when CSTART ^= CSTART | when (not CRELAX) ^= CRELAX

you will obtain clock constraints (the compiler cannot prove it).

This is a dynamic property, which can be proved automatically if you have the formal calculus system SIGALI.

For that purpose, we add the following equation to the SIGNAL program:

        SIGALI(Never(B_And(B_False(CSTART),B_True(CRELAX))))

Remind the following encoding in Z/3Z:

This uses some functions of a predefined SIGALI library usable in SIGNAL programs (a command "use SIGALI" must be added in the SIGNAL program).

The command file VTMOUSE_P2_CMD.z3z looks like:

	  read("VTMOUSE_P2.z3z");
	  read("Creat_SDP.lib");
	  read("Bibli.lib");
	  PROP_1010:B_False(S,CSTART);
	  PROP_1005:B_True(S,CRELAX);
	  PROP:B_And(PROP_1010,PROP_1005);
	  Never(S,PROP);
	  sigali
	  Sigali : read("VTMOUSE_P2.z3z");
	  ----------------------------------------------------------------------------

	  ---------------------------------------------------------------------------- 
	  Sigali : read("Creat_SDP.lib");

	  ----------------------------------------------------------------------------
	  Polynomial Dynamical System Building

	  ---------------------------------------------------------------------------- 
	  Sigali : read("Bibli.lib");

	  ----------------------------------------------------------------------------

	  ---------------------------------------------------------------------------- 
	  Sigali : PROP_1010:B_False(S,CSTART);

	  ----------------------------------------------------------------------------
	  PROP_1010
	  ---------------------------------------------------------------------------- 
	  Sigali : PROP_1005:B_True(S,CRELAX);

	  ----------------------------------------------------------------------------
	  PROP_1005
	  ---------------------------------------------------------------------------- 
	  Sigali : PROP:B_And(PROP_1010,PROP_1005);

	  ----------------------------------------------------------------------------
	  PROP
	  ---------------------------------------------------------------------------- 
	  Sigali : Never(S,PROP);

	  ----------------------------------------------------------------------------
	  True
	  ---------------------------------------------------------------------------- 

The answer "True" mean that the property is proved.

Quit SIGALI as follows:

	  Sigali : quit();

SIGALI Session:

          sigali
          Sigali : read("VTMOUSE_P2.z3z");
          Sigali : read("Creat_SDP.lib");
          Sigali : read("Bibli.lib");
          Sigali : PROP_1010:B_False(S,CSTART);
          Sigali : PROP_1005:B_True(S,CRELAX);
          Sigali : PROP:B_And(PROP_1010,PROP_1005);
          Sigali : Never(S,PROP);
          Sigali : quit();

Verification of a deadlock-free property

You must have the formal calculus system SIGALI (the functions used are described in the documentation of SIGALI).

You have to compile the program VTMOUSE_P3.SIG with the option -z3z:

    signal -tra -z3z VTMOUSE_P3.SIG -par=VTMOUSE_P3.PAR

this creates the file VTMOUSE_P3.z3z (in the sub-directory VTMOUSE_P3) which contains a description of the dynamic system associated with the program. (VTMOUSE_P3.SIG is similar to the original VTMOUSE.SIG, only SINGLE and DOUBLE signals are added as outputs)

We use directly functions of SIGALI to prove the property.

We consider the following deadlock state: whatever the inputs are, the mouse no more react; i.e., the outputs DOUBLE and SINGLE do not occur.

SIGALI Session:

    sigali
    Sigali : read("VTMOUSE_P3.z3z");
    Sigali : read("Creat_SDP.lib"); %Creates a system named S%
    Sigali : no_output:gen([DOUBLE = 0, SINGLE = 0]);
    Sigali : states_with_no_output:coefx(no_output,state_var(S));
    Sigali : states_in_deadlock:greatest_inv(S,states_with_no_output);
    Sigali : Reachable(S,states_in_deadlock);
    Sigali : quit();
 All Files

Generated on Mon Jul 25 16:55:00 2011 for Polychrony, by  doxygen 1.6.1. This page has been designed by the Espresso team ( contact )