No edit summary |
No edit summary |
||

Line 26: | Line 26: | ||

An alternate means to figure out the source of the problem is ProB's graphical formula viewer. | An alternate means to figure out the source of the problem is ProB's graphical formula viewer. | ||

For this, choose the "Analyse Graphically" | For this, choose the "Analyse Graphically/Properties" in the "Analyse" menu: | ||

Line 34: | Line 34: | ||

[[file:ProB_Jukebox_AnalyseGraphicallyUnsatProp.png|center]] | [[file:ProB_Jukebox_AnalyseGraphicallyUnsatProp.png|center]] | ||

This viewer uses another, more sophisticated algorithm to determine a maximal subset of the Properties which is satisfiable. In this case, it has determined <tt>limit=1</tt> to make <tt>limit:NAT1</tt> true (but which obviously does not make <tt>limit>99</tt> true. | |||

In any way, the problem here is that we have set MAXINT to 3, and hence <tt>NAT1={1,2,3}</tt>. | |||

To make our PROPERTIES satisfiable again, we could add for example | |||

<pre> | |||

DEFINITIONS | |||

SET_PREF_MAXINT==255 | |||

</pre> | |||

to the machine and re-load it. | |||

[[file:ProB_JukeboxAfterLoad2.png|center||700px]] |

We assume that you grasped the way that ProB setups up the initial states of a B machine as outlined in Tutorial Setup Phases.

In this lesson, we examine what can go wrong in these phases and how one can find a solution. Indeed, setting up the constants and initial values of a machine is often the most difficult step for an animator. Unfortunately, it is also the very first step an animator has to perform.

First, open the machine "Jukebox.mch" which can be found in the SchneiderBook/Jukebox_Chapter13 subdirectory of the ProB Examples folder.
The main ProB window should look more or less as follows:

Now edit the file, and type `& limit>99` after `PROPERTIES limit:NAT1`.
Save the machine and reload it. Hint: there is a "Save and reopen" command in the "File" menu for this action.

ProB should now popup the following message:

If you click "Yes" (or Ja), you will get the following window:

What ProB does is add conjuncts from the PROPERTIES (and CONSTRAINTS clause) one-by-one, until it can no longer find a solution. This can often give you an indication of what is wrong, and where the trouble (or inconsistency) stems from.

An alternate means to figure out the source of the problem is ProB's graphical formula viewer. For this, choose the "Analyse Graphically/Properties" in the "Analyse" menu:

This will result in the following visualisation:

This viewer uses another, more sophisticated algorithm to determine a maximal subset of the Properties which is satisfiable. In this case, it has determined `limit=1` to make `limit:NAT1` true (but which obviously does not make `limit>99` true.

In any way, the problem here is that we have set MAXINT to 3, and hence `NAT1={1,2,3}`.
To make our PROPERTIES satisfiable again, we could add for example

DEFINITIONS SET_PREF_MAXINT==255

to the machine and re-load it.