<?xml version="1.0"?>
<feed xmlns="http://www.w3.org/2005/Atom" xml:lang="en">
	<id>https://prob.hhu.de/w/api.php?action=feedcontributions&amp;feedformat=atom&amp;user=Bivab</id>
	<title>ProB Documentation - User contributions [en]</title>
	<link rel="self" type="application/atom+xml" href="https://prob.hhu.de/w/api.php?action=feedcontributions&amp;feedformat=atom&amp;user=Bivab"/>
	<link rel="alternate" type="text/html" href="https://prob.hhu.de/w/index.php?title=Special:Contributions/Bivab"/>
	<updated>2026-05-27T06:50:58Z</updated>
	<subtitle>User contributions</subtitle>
	<generator>MediaWiki 1.43.8</generator>
	<entry>
		<id>https://prob.hhu.de/w/index.php?title=Developer_Manual&amp;diff=4072</id>
		<title>Developer Manual</title>
		<link rel="alternate" type="text/html" href="https://prob.hhu.de/w/index.php?title=Developer_Manual&amp;diff=4072"/>
		<updated>2019-02-12T15:19:09Z</updated>

		<summary type="html">&lt;p&gt;Bivab: Update parser url&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;The kernel of ProB is written in Prolog, the B parser is developed in Java using SableCC. The [https://github.com/hhu-stups/probparsers ProB parser is available on github].&lt;br /&gt;
There is a comprehensive Java API available (also known as ProB 2.0).&lt;br /&gt;
&lt;br /&gt;
A [https://www3.hhu.de/stups/handbook/prob2/prob_developer.html new ProB Developer Manual] is available, superseding the information below.&lt;br /&gt;
&lt;br /&gt;
== ProB Prolog Source Code ==&lt;br /&gt;
*[[Getting Involved]] (includes details about getting and running the Prolog sources)&lt;br /&gt;
*[[ProB Tcl/Tk Architecture]]&lt;br /&gt;
*[[Why Prolog?]]&lt;br /&gt;
*[[Prolog Coding Guidelines]]&lt;br /&gt;
*[http://www.stups.uni-duesseldorf.de/ProB/developer_tutorial Tutorial: Extending ProB]&lt;br /&gt;
*[[Running ProB from source]]&lt;br /&gt;
*[[ProB&#039;s Prolog Datastructures]]&lt;br /&gt;
&lt;br /&gt;
== ProB Java API (aka ProB 2.0) ==&lt;br /&gt;
&lt;br /&gt;
The documentation for the Java API to ProB can be found [[ProB_Java_API|here]].&lt;/div&gt;</summary>
		<author><name>Bivab</name></author>
	</entry>
	<entry>
		<id>https://prob.hhu.de/w/index.php?title=PROBPATH&amp;diff=3787</id>
		<title>PROBPATH</title>
		<link rel="alternate" type="text/html" href="https://prob.hhu.de/w/index.php?title=PROBPATH&amp;diff=3787"/>
		<updated>2017-03-15T13:48:56Z</updated>

		<summary type="html">&lt;p&gt;Bivab: &lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;{{DISPLAYTITLE:The ProB Search Path}}&lt;br /&gt;
&lt;br /&gt;
Starting with version 1.5 of ProB, it is possible to customize where the parser will ProB will search for referenced files.&lt;br /&gt;
&lt;br /&gt;
By default ProB will try to find files referenced from a machine (using SEES, INCLUDES, DEFINITON-files, etc) resolving paths as relative to the current machine or within the ProB standard library.&lt;br /&gt;
&lt;br /&gt;
Commonly used files can be placed in a shared location, e.g. in the standard library (the stdlib directory in the ProB distribution) or any custom location.&lt;br /&gt;
&lt;br /&gt;
The search path can be customized by defining a PROBPATH environment variable that contains a list of directories to be searched. On windows the directors are separated by a &amp;quot;;&amp;quot; and on unix systems by a &amp;quot;:&amp;quot; character, e.g.:&lt;br /&gt;
&lt;br /&gt;
On unix: &lt;br /&gt;
&lt;br /&gt;
 PROBPATH=~/myproject/common:~/myotherproject/common probcli model.mch&lt;br /&gt;
&lt;br /&gt;
And on windows:&lt;br /&gt;
  PROBPATH=~/myproject/common;~/myotherproject/common probcli model.mch&lt;br /&gt;
	&lt;br /&gt;
will resolved referenced files relative to model.mch, then in &#039;&#039;&#039;~/myproject/common&#039;&#039;&#039; then in &#039;&#039;&#039;~/myotherproject/common&#039;&#039;&#039; and finally in the standard library of ProB, stopping as soon as a file with the name being looked up is found.&lt;/div&gt;</summary>
		<author><name>Bivab</name></author>
	</entry>
	<entry>
		<id>https://prob.hhu.de/w/index.php?title=Tips:_B_Idioms&amp;diff=3652</id>
		<title>Tips: B Idioms</title>
		<link rel="alternate" type="text/html" href="https://prob.hhu.de/w/index.php?title=Tips:_B_Idioms&amp;diff=3652"/>
		<updated>2016-06-06T14:28:04Z</updated>

		<summary type="html">&lt;p&gt;Bivab: &lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;&lt;br /&gt;
Also have a look at [[Tips:_Writing_Models_for_ProB]].&lt;br /&gt;
&lt;br /&gt;
== Let ==&lt;br /&gt;
&lt;br /&gt;
Classical B only has a LET substitution, no let construct for predicates or expressions.&lt;br /&gt;
Event-B has no let construct whatsoever.&lt;br /&gt;
&lt;br /&gt;
=== Nightly Builds ===&lt;br /&gt;
&lt;br /&gt;
ProB nightly builds for version &#039;&#039;&#039;1.6.1-beta&#039;&#039;&#039; support, since the 28th of April 2016, the use of the &amp;lt;tt&amp;gt;LET&amp;lt;/tt&amp;gt; substitution syntax in expressions and predicates.&lt;br /&gt;
&lt;br /&gt;
==== Examples: ====&lt;br /&gt;
&lt;br /&gt;
 &amp;gt;&amp;gt;&amp;gt; LET a BE a = 10 IN a + 10 END&lt;br /&gt;
 Expression Value = 20&lt;br /&gt;
&lt;br /&gt;
 &amp;gt;&amp;gt;&amp;gt; LET a BE a=10 IN a END + 10&lt;br /&gt;
 Expression Value = 20&lt;br /&gt;
&lt;br /&gt;
 &amp;gt;&amp;gt;&amp;gt; LET a BE a=10 IN a END = 10&lt;br /&gt;
 Predicate is TRUE&lt;br /&gt;
&lt;br /&gt;
 &amp;gt;&amp;gt;&amp;gt; LET a BE a = 10 IN a &amp;lt; 10 END&lt;br /&gt;
 Predicate is FALSE&lt;br /&gt;
&lt;br /&gt;
 &amp;gt;&amp;gt;&amp;gt; LET a BE a=10 IN a /= 10 END or 1=1&lt;br /&gt;
 Predicate is TRUE&lt;br /&gt;
&lt;br /&gt;
 &amp;gt;&amp;gt;&amp;gt; LET a, b BE a = 10 &amp;amp; b = 1 IN a + b END&lt;br /&gt;
 Expression Value = 11&lt;br /&gt;
&lt;br /&gt;
=== Let for predicates ===&lt;br /&gt;
&lt;br /&gt;
For predicates this encodes a let predicate:&lt;br /&gt;
 #x.(x=E &amp;amp; P)&lt;br /&gt;
corresponds to something like&lt;br /&gt;
 let x=E in P&lt;br /&gt;
&lt;br /&gt;
Within set comprehensions one can use the following construct:&lt;br /&gt;
 dom({x,y|y=E &amp;amp; P})&lt;br /&gt;
corresponds to something like&lt;br /&gt;
 {x|let y=E in P}&lt;br /&gt;
&lt;br /&gt;
One can also use the ran operator or introduce multiple lets in one go:&lt;br /&gt;
 dom(dom({x,y,z|y=E1 &amp;amp; z=E2 &amp;amp;P}))&lt;br /&gt;
or&lt;br /&gt;
 ran({y,z,x|y=E1 &amp;amp; z=E2 &amp;amp;P})&lt;br /&gt;
both encode&lt;br /&gt;
 {x|let y=E1 &amp;amp; z=E2 in P}&lt;br /&gt;
&lt;br /&gt;
=== Let for expressions ===&lt;br /&gt;
&lt;br /&gt;
In case F is a set expression, then the following construct can be used to encode a let statement:&lt;br /&gt;
 UNION(x).(x=E|F)&lt;br /&gt;
corresponds to something like&lt;br /&gt;
 let x=E in F&lt;br /&gt;
&lt;br /&gt;
The following construct has exactly the same effect:&lt;br /&gt;
 INTER(x).(x=E|F)&lt;br /&gt;
&lt;br /&gt;
== If-Then-Else ==&lt;br /&gt;
&lt;br /&gt;
Classical B only has an IF-THEN-ELSE substitution (aka statement), no such construct for predicates or expressions.&lt;br /&gt;
=== Nightly Builds ===&lt;br /&gt;
&lt;br /&gt;
ProB nightly builds for version &#039;&#039;&#039;1.6.1-beta&#039;&#039;&#039; support, since the 28th of April 2016, the use of the &amp;lt;tt&amp;gt;LET&amp;lt;/tt&amp;gt; substitution syntax in expressions and predicates.&lt;br /&gt;
&lt;br /&gt;
==== Examples: ====&lt;br /&gt;
&lt;br /&gt;
 &amp;gt;&amp;gt;&amp;gt; IF 1 = 1 THEN 3 ELSE 4 END&lt;br /&gt;
 Expression Value = 3&lt;br /&gt;
&lt;br /&gt;
 &amp;gt;&amp;gt;&amp;gt; IF 1 = 1 THEN 3 ELSE 4 END + 5&lt;br /&gt;
 Expression Value = 8&lt;br /&gt;
&lt;br /&gt;
 &amp;gt;&amp;gt;&amp;gt; IF 1=1 THEN TRUE = FALSE  ELSE TRUE=TRUE END&lt;br /&gt;
 Predicate is FALSE&lt;br /&gt;
&lt;br /&gt;
 &amp;gt;&amp;gt;&amp;gt; IF 1=1 THEN TRUE = FALSE  ELSE TRUE=TRUE END or 1=1&lt;br /&gt;
 Predicate is TRUE&lt;br /&gt;
&lt;br /&gt;
=== Expressions ===&lt;br /&gt;
The following construct&lt;br /&gt;
 %((x).(x=0 &amp;amp; PRED|C1)\/%(x).(x=0 &amp;amp; not(PRED)|C2)) (0)&lt;br /&gt;
encodes an if-then-else for expressions:&lt;br /&gt;
 IF PRED THEN C1 ELSE C2 END&lt;br /&gt;
&lt;br /&gt;
The former lambda-construct is recognised by ProB and replaced internally by an if-then-else construct.&lt;br /&gt;
The latter syntax is actually now recognised as well by ProB 1.6 (version 1.6.0 still requires parentheses around the IF-THEN-ELSE; version 1.6.1 no longer requires them).&lt;br /&gt;
&lt;br /&gt;
== finite ==&lt;br /&gt;
In classical B there is no counterpart to the Event-B &amp;lt;tt&amp;gt;finite&amp;lt;/tt&amp;gt; operator.&lt;br /&gt;
However, the following construct has the same effect as &amp;lt;tt&amp;gt;finite(x)&amp;lt;/tt&amp;gt; (and is recognised by ProB):&lt;br /&gt;
 x : FIN(x)&lt;br /&gt;
&lt;br /&gt;
== all-different ==&lt;br /&gt;
One can encode the fact that n objects x1,...,xn are pair-wise different using the following construct (recognised by ProB):&lt;br /&gt;
 card({x1,...,xn})=n&lt;br /&gt;
&lt;br /&gt;
== map ==&lt;br /&gt;
Given a function f and a sequence &amp;lt;tt&amp;gt;sqce&amp;lt;/tt&amp;gt; one can map the function over all elements of &amp;lt;tt&amp;gt;sqce&amp;lt;/tt&amp;gt; using the relational composition operator &amp;lt;tt&amp;gt;;&amp;lt;/tt&amp;gt;:&lt;br /&gt;
 (sqce ; f)&lt;br /&gt;
&lt;br /&gt;
For example, &amp;lt;tt&amp;gt;([1,2,3] ; succ)&amp;lt;/tt&amp;gt; gives us the sequence &amp;lt;tt&amp;gt;[2,3,4]&amp;lt;/tt&amp;gt;.&lt;br /&gt;
&lt;br /&gt;
== Recursion using closure1 ==&lt;br /&gt;
&lt;br /&gt;
Even though B has no built-in support for recursion, one can use the transitive closure operator &amp;lt;tt&amp;gt;closure1&amp;lt;/tt&amp;gt; to compute certain recursive functions.&lt;br /&gt;
For this we need to encode the recursion as a step function of the form:&lt;br /&gt;
 %(in,acc).(P|(inr,accr))&lt;br /&gt;
where P is a predicate which in case we have not yet reached a base case for the input value &amp;lt;tt&amp;gt;in&amp;lt;/tt&amp;gt;. The computation result has to be stored in an accumulator: &amp;lt;tt&amp;gt;acc&amp;lt;/tt&amp;gt; is the accumulator before the recursion step, &amp;lt;tt&amp;gt;accr&amp;lt;/tt&amp;gt; after.&lt;br /&gt;
&amp;lt;tt&amp;gt;inr&amp;lt;/tt&amp;gt; is the new input value for the recursive call.&lt;br /&gt;
In case the base case is reached for &amp;lt;tt&amp;gt;in&amp;lt;/tt&amp;gt;, the predicate P should be false and the value of the recursive call should be the value of the accumulator.&lt;br /&gt;
&lt;br /&gt;
The value of the recursive function can thus be obtained by calling:&lt;br /&gt;
 closure1(step)[{(in,ia)}](b)&lt;br /&gt;
where &amp;lt;tt&amp;gt;in&amp;lt;/tt&amp;gt; is the input value, &amp;lt;tt&amp;gt;b&amp;lt;/tt&amp;gt; is the base case and &amp;lt;tt&amp;gt;ia&amp;lt;/tt&amp;gt; is the initial (empty) accumulator.&lt;br /&gt;
&lt;br /&gt;
For example, to sort a set of integers into a ascending sequence, we would define the step function as follows:&lt;br /&gt;
 step = %(s,o).(s/={} | (s\{min(s)},o&amp;lt;-min(s)))&lt;br /&gt;
A particular call would be:&lt;br /&gt;
 closure1(step)[{({4,5,2},[])}]({})&lt;br /&gt;
resulting in the sequence &amp;lt;tt&amp;gt;[2,4,5]&amp;lt;/tt&amp;gt;.&lt;br /&gt;
&lt;br /&gt;
Observe that, even though &amp;lt;tt&amp;gt;closure1(step)&amp;lt;/tt&amp;gt; is an infinite relation, ProB can compute the relational image of &amp;lt;tt&amp;gt;closure1(step)&amp;lt;/tt&amp;gt; for a particular set such as &lt;br /&gt;
&amp;lt;tt&amp;gt;{({4,5,2},[])}&amp;lt;/tt&amp;gt; (provided the recursion terminates).&lt;br /&gt;
&lt;br /&gt;
== Recursion using &amp;lt;tt&amp;gt;ABSTRACT_CONSTANTS&amp;lt;/tt&amp;gt; ==&lt;br /&gt;
&lt;br /&gt;
Recursive functions can be declared using the &amp;lt;tt&amp;gt;ABSTRACT_CONSTANTS&amp;lt;/tt&amp;gt; section in B machines. Functions declared as &amp;lt;tt&amp;gt;ABSTRACT_CONSTANTS&amp;lt;/tt&amp;gt; are treated symbolically by ProB and not evaluated eagerly.&lt;br /&gt;
&lt;br /&gt;
For example, to sort a set of integers into a ascending sequence, as above, we would define a recursive function as follows:&lt;br /&gt;
 ABSTRACT_CONSTANTS&lt;br /&gt;
     Recursive_Sort&lt;br /&gt;
 PROPERTIES&lt;br /&gt;
     Recursive_Sort : POW(INTEGER) &amp;lt;-&amp;gt; POW(INTEGER*INTEGER)&lt;br /&gt;
     &amp;amp; Recursive_Sort =&lt;br /&gt;
         %in.(in : POW(INTEGER) &amp;amp; in = {} | [])&lt;br /&gt;
         \/ %in.(in : POW(INTEGER) &amp;amp; in /= {}&lt;br /&gt;
                          | min(in) -&amp;gt; Recursive_Sort(in\{min(in)}))&lt;br /&gt;
&lt;br /&gt;
By defining &amp;lt;tt&amp;gt;Recursive_Sort&amp;lt;/tt&amp;gt; as an abstract constant we indicate that ProB should handle the function symbolically, i.e. ProB will not try to enumerate all elements of the function. The recursive function itself is composed of two single functions: a function defining the base case and a function defining the recursive case. Note, that the intersection of the domains of these function is empty, and hence, the union is still a function.&lt;/div&gt;</summary>
		<author><name>Bivab</name></author>
	</entry>
	<entry>
		<id>https://prob.hhu.de/w/index.php?title=Tips:_B_Idioms&amp;diff=3651</id>
		<title>Tips: B Idioms</title>
		<link rel="alternate" type="text/html" href="https://prob.hhu.de/w/index.php?title=Tips:_B_Idioms&amp;diff=3651"/>
		<updated>2016-06-06T14:23:20Z</updated>

		<summary type="html">&lt;p&gt;Bivab: /* Examples: */&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;&lt;br /&gt;
Also have a look at [[Tips:_Writing_Models_for_ProB]].&lt;br /&gt;
&lt;br /&gt;
== Let ==&lt;br /&gt;
&lt;br /&gt;
Classical B only has a LET substitution, no let construct for predicates or expressions.&lt;br /&gt;
Event-B has no let construct whatsoever.&lt;br /&gt;
&lt;br /&gt;
=== Nightly Builds ===&lt;br /&gt;
&lt;br /&gt;
ProB nightly builds for version &#039;&#039;&#039;1.6.1-beta&#039;&#039;&#039; support, since the 28th of April 2016, the use of the &amp;lt;tt&amp;gt;LET&amp;lt;/tt&amp;gt; substitution syntax in expressions and predicates.&lt;br /&gt;
&lt;br /&gt;
==== Examples: ====&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
 &amp;gt;&amp;gt;&amp;gt; LET a BE a = 10 IN a + 10 END&lt;br /&gt;
 Expression Value = 20&lt;br /&gt;
&lt;br /&gt;
 &amp;gt;&amp;gt;&amp;gt; LET a BE a=10 IN a END + 10&lt;br /&gt;
 Expression Value = 20&lt;br /&gt;
&lt;br /&gt;
 &amp;gt;&amp;gt;&amp;gt; LET a BE a=10 IN a END = 10&lt;br /&gt;
 Predicate is TRUE&lt;br /&gt;
&lt;br /&gt;
 &amp;gt;&amp;gt;&amp;gt; LET a BE a = 10 IN a &amp;lt; 10 END&lt;br /&gt;
 Predicate is FALSE&lt;br /&gt;
&lt;br /&gt;
 &amp;gt;&amp;gt;&amp;gt; LET a BE a=10 IN a /= 10 END or 1=1&lt;br /&gt;
 Predicate is TRUE&lt;br /&gt;
&lt;br /&gt;
 &amp;gt;&amp;gt;&amp;gt; LET a, b BE a = 10 &amp;amp; b = 1 IN a + b END&lt;br /&gt;
 Expression Value = 11&lt;br /&gt;
&lt;br /&gt;
=== Let for predicates ===&lt;br /&gt;
&lt;br /&gt;
For predicates this encodes a let predicate:&lt;br /&gt;
 #x.(x=E &amp;amp; P)&lt;br /&gt;
corresponds to something like&lt;br /&gt;
 let x=E in P&lt;br /&gt;
&lt;br /&gt;
Within set comprehensions one can use the following construct:&lt;br /&gt;
 dom({x,y|y=E &amp;amp; P})&lt;br /&gt;
corresponds to something like&lt;br /&gt;
 {x|let y=E in P}&lt;br /&gt;
&lt;br /&gt;
One can also use the ran operator or introduce multiple lets in one go:&lt;br /&gt;
 dom(dom({x,y,z|y=E1 &amp;amp; z=E2 &amp;amp;P}))&lt;br /&gt;
or&lt;br /&gt;
 ran({y,z,x|y=E1 &amp;amp; z=E2 &amp;amp;P})&lt;br /&gt;
both encode&lt;br /&gt;
 {x|let y=E1 &amp;amp; z=E2 in P}&lt;br /&gt;
&lt;br /&gt;
=== Let for expressions ===&lt;br /&gt;
&lt;br /&gt;
In case F is a set expression, then the following construct can be used to encode a let statement:&lt;br /&gt;
 UNION(x).(x=E|F)&lt;br /&gt;
corresponds to something like&lt;br /&gt;
 let x=E in F&lt;br /&gt;
&lt;br /&gt;
The following construct has exactly the same effect:&lt;br /&gt;
 INTER(x).(x=E|F)&lt;br /&gt;
&lt;br /&gt;
== If-Then-Else ==&lt;br /&gt;
&lt;br /&gt;
Classical B only has an IF-THEN-ELSE substitution (aka statement), no such construct for predicates or expressions.&lt;br /&gt;
The following construct&lt;br /&gt;
 %((x).(x=0 &amp;amp; PRED|C1)\/%(x).(x=0 &amp;amp; not(PRED)|C2)) (0)&lt;br /&gt;
encodes an if-then-else for expressions:&lt;br /&gt;
 IF PRED THEN C1 ELSE C2 END&lt;br /&gt;
&lt;br /&gt;
The former lambda-construct is recognised by ProB and replaced internally by an if-then-else construct.&lt;br /&gt;
The latter syntax is actually now recognised as well by ProB 1.6 (version 1.6.0 still requires parentheses around the IF-THEN-ELSE; version 1.6.1 no longer requires them).&lt;br /&gt;
&lt;br /&gt;
== finite ==&lt;br /&gt;
In classical B there is no counterpart to the Event-B &amp;lt;tt&amp;gt;finite&amp;lt;/tt&amp;gt; operator.&lt;br /&gt;
However, the following construct has the same effect as &amp;lt;tt&amp;gt;finite(x)&amp;lt;/tt&amp;gt; (and is recognised by ProB):&lt;br /&gt;
 x : FIN(x)&lt;br /&gt;
&lt;br /&gt;
== all-different ==&lt;br /&gt;
One can encode the fact that n objects x1,...,xn are pair-wise different using the following construct (recognised by ProB):&lt;br /&gt;
 card({x1,...,xn})=n&lt;br /&gt;
&lt;br /&gt;
== map ==&lt;br /&gt;
Given a function f and a sequence &amp;lt;tt&amp;gt;sqce&amp;lt;/tt&amp;gt; one can map the function over all elements of &amp;lt;tt&amp;gt;sqce&amp;lt;/tt&amp;gt; using the relational composition operator &amp;lt;tt&amp;gt;;&amp;lt;/tt&amp;gt;:&lt;br /&gt;
 (sqce ; f)&lt;br /&gt;
&lt;br /&gt;
For example, &amp;lt;tt&amp;gt;([1,2,3] ; succ)&amp;lt;/tt&amp;gt; gives us the sequence &amp;lt;tt&amp;gt;[2,3,4]&amp;lt;/tt&amp;gt;.&lt;br /&gt;
&lt;br /&gt;
== Recursion using closure1 ==&lt;br /&gt;
&lt;br /&gt;
Even though B has no built-in support for recursion, one can use the transitive closure operator &amp;lt;tt&amp;gt;closure1&amp;lt;/tt&amp;gt; to compute certain recursive functions.&lt;br /&gt;
For this we need to encode the recursion as a step function of the form:&lt;br /&gt;
 %(in,acc).(P|(inr,accr))&lt;br /&gt;
where P is a predicate which in case we have not yet reached a base case for the input value &amp;lt;tt&amp;gt;in&amp;lt;/tt&amp;gt;. The computation result has to be stored in an accumulator: &amp;lt;tt&amp;gt;acc&amp;lt;/tt&amp;gt; is the accumulator before the recursion step, &amp;lt;tt&amp;gt;accr&amp;lt;/tt&amp;gt; after.&lt;br /&gt;
&amp;lt;tt&amp;gt;inr&amp;lt;/tt&amp;gt; is the new input value for the recursive call.&lt;br /&gt;
In case the base case is reached for &amp;lt;tt&amp;gt;in&amp;lt;/tt&amp;gt;, the predicate P should be false and the value of the recursive call should be the value of the accumulator.&lt;br /&gt;
&lt;br /&gt;
The value of the recursive function can thus be obtained by calling:&lt;br /&gt;
 closure1(step)[{(in,ia)}](b)&lt;br /&gt;
where &amp;lt;tt&amp;gt;in&amp;lt;/tt&amp;gt; is the input value, &amp;lt;tt&amp;gt;b&amp;lt;/tt&amp;gt; is the base case and &amp;lt;tt&amp;gt;ia&amp;lt;/tt&amp;gt; is the initial (empty) accumulator.&lt;br /&gt;
&lt;br /&gt;
For example, to sort a set of integers into a ascending sequence, we would define the step function as follows:&lt;br /&gt;
 step = %(s,o).(s/={} | (s\{min(s)},o&amp;lt;-min(s)))&lt;br /&gt;
A particular call would be:&lt;br /&gt;
 closure1(step)[{({4,5,2},[])}]({})&lt;br /&gt;
resulting in the sequence &amp;lt;tt&amp;gt;[2,4,5]&amp;lt;/tt&amp;gt;.&lt;br /&gt;
&lt;br /&gt;
Observe that, even though &amp;lt;tt&amp;gt;closure1(step)&amp;lt;/tt&amp;gt; is an infinite relation, ProB can compute the relational image of &amp;lt;tt&amp;gt;closure1(step)&amp;lt;/tt&amp;gt; for a particular set such as &lt;br /&gt;
&amp;lt;tt&amp;gt;{({4,5,2},[])}&amp;lt;/tt&amp;gt; (provided the recursion terminates).&lt;br /&gt;
&lt;br /&gt;
== Recursion using &amp;lt;tt&amp;gt;ABSTRACT_CONSTANTS&amp;lt;/tt&amp;gt; ==&lt;br /&gt;
&lt;br /&gt;
Recursive functions can be declared using the &amp;lt;tt&amp;gt;ABSTRACT_CONSTANTS&amp;lt;/tt&amp;gt; section in B machines. Functions declared as &amp;lt;tt&amp;gt;ABSTRACT_CONSTANTS&amp;lt;/tt&amp;gt; are treated symbolically by ProB and not evaluated eagerly.&lt;br /&gt;
&lt;br /&gt;
For example, to sort a set of integers into a ascending sequence, as above, we would define a recursive function as follows:&lt;br /&gt;
 ABSTRACT_CONSTANTS&lt;br /&gt;
     Recursive_Sort&lt;br /&gt;
 PROPERTIES&lt;br /&gt;
     Recursive_Sort : POW(INTEGER) &amp;lt;-&amp;gt; POW(INTEGER*INTEGER)&lt;br /&gt;
     &amp;amp; Recursive_Sort =&lt;br /&gt;
         %in.(in : POW(INTEGER) &amp;amp; in = {} | [])&lt;br /&gt;
         \/ %in.(in : POW(INTEGER) &amp;amp; in /= {}&lt;br /&gt;
                          | min(in) -&amp;gt; Recursive_Sort(in\{min(in)}))&lt;br /&gt;
&lt;br /&gt;
By defining &amp;lt;tt&amp;gt;Recursive_Sort&amp;lt;/tt&amp;gt; as an abstract constant we indicate that ProB should handle the function symbolically, i.e. ProB will not try to enumerate all elements of the function. The recursive function itself is composed of two single functions: a function defining the base case and a function defining the recursive case. Note, that the intersection of the domains of these function is empty, and hence, the union is still a function.&lt;/div&gt;</summary>
		<author><name>Bivab</name></author>
	</entry>
	<entry>
		<id>https://prob.hhu.de/w/index.php?title=Tips:_B_Idioms&amp;diff=3650</id>
		<title>Tips: B Idioms</title>
		<link rel="alternate" type="text/html" href="https://prob.hhu.de/w/index.php?title=Tips:_B_Idioms&amp;diff=3650"/>
		<updated>2016-06-06T14:20:44Z</updated>

		<summary type="html">&lt;p&gt;Bivab: /* Let */&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;&lt;br /&gt;
Also have a look at [[Tips:_Writing_Models_for_ProB]].&lt;br /&gt;
&lt;br /&gt;
== Let ==&lt;br /&gt;
&lt;br /&gt;
Classical B only has a LET substitution, no let construct for predicates or expressions.&lt;br /&gt;
Event-B has no let construct whatsoever.&lt;br /&gt;
&lt;br /&gt;
=== Nightly Builds ===&lt;br /&gt;
&lt;br /&gt;
ProB nightly builds for version &#039;&#039;&#039;1.6.1-beta&#039;&#039;&#039; support, since the 28th of April 2016, the use of the &amp;lt;tt&amp;gt;LET&amp;lt;/tt&amp;gt; substitution syntax in expressions and predicates.&lt;br /&gt;
&lt;br /&gt;
==== Examples: ====&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
 &amp;gt;&amp;gt;&amp;gt; LET a BE a = 10 IN a + 10 END&lt;br /&gt;
 Expression Value = 20&lt;br /&gt;
&lt;br /&gt;
 &amp;gt;&amp;gt;&amp;gt; LET a BE a=10 IN a END + 10&lt;br /&gt;
 Expression Value = 20&lt;br /&gt;
&lt;br /&gt;
 &amp;gt;&amp;gt;&amp;gt; LET a BE a=10 IN a END = 10&lt;br /&gt;
 Predicate is TRUE&lt;br /&gt;
&lt;br /&gt;
 &amp;gt;&amp;gt;&amp;gt; LET a BE a = 10 IN a &amp;lt; 10 END&lt;br /&gt;
 Predicate is FALSE&lt;br /&gt;
&lt;br /&gt;
 &amp;gt;&amp;gt;&amp;gt; LET a BE a=10 IN a /= 10 END or 1=1&lt;br /&gt;
 Predicate is TRUE&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
=== Let for predicates ===&lt;br /&gt;
&lt;br /&gt;
For predicates this encodes a let predicate:&lt;br /&gt;
 #x.(x=E &amp;amp; P)&lt;br /&gt;
corresponds to something like&lt;br /&gt;
 let x=E in P&lt;br /&gt;
&lt;br /&gt;
Within set comprehensions one can use the following construct:&lt;br /&gt;
 dom({x,y|y=E &amp;amp; P})&lt;br /&gt;
corresponds to something like&lt;br /&gt;
 {x|let y=E in P}&lt;br /&gt;
&lt;br /&gt;
One can also use the ran operator or introduce multiple lets in one go:&lt;br /&gt;
 dom(dom({x,y,z|y=E1 &amp;amp; z=E2 &amp;amp;P}))&lt;br /&gt;
or&lt;br /&gt;
 ran({y,z,x|y=E1 &amp;amp; z=E2 &amp;amp;P})&lt;br /&gt;
both encode&lt;br /&gt;
 {x|let y=E1 &amp;amp; z=E2 in P}&lt;br /&gt;
&lt;br /&gt;
=== Let for expressions ===&lt;br /&gt;
&lt;br /&gt;
In case F is a set expression, then the following construct can be used to encode a let statement:&lt;br /&gt;
 UNION(x).(x=E|F)&lt;br /&gt;
corresponds to something like&lt;br /&gt;
 let x=E in F&lt;br /&gt;
&lt;br /&gt;
The following construct has exactly the same effect:&lt;br /&gt;
 INTER(x).(x=E|F)&lt;br /&gt;
&lt;br /&gt;
== If-Then-Else ==&lt;br /&gt;
&lt;br /&gt;
Classical B only has an IF-THEN-ELSE substitution (aka statement), no such construct for predicates or expressions.&lt;br /&gt;
The following construct&lt;br /&gt;
 %((x).(x=0 &amp;amp; PRED|C1)\/%(x).(x=0 &amp;amp; not(PRED)|C2)) (0)&lt;br /&gt;
encodes an if-then-else for expressions:&lt;br /&gt;
 IF PRED THEN C1 ELSE C2 END&lt;br /&gt;
&lt;br /&gt;
The former lambda-construct is recognised by ProB and replaced internally by an if-then-else construct.&lt;br /&gt;
The latter syntax is actually now recognised as well by ProB 1.6 (version 1.6.0 still requires parentheses around the IF-THEN-ELSE; version 1.6.1 no longer requires them).&lt;br /&gt;
&lt;br /&gt;
== finite ==&lt;br /&gt;
In classical B there is no counterpart to the Event-B &amp;lt;tt&amp;gt;finite&amp;lt;/tt&amp;gt; operator.&lt;br /&gt;
However, the following construct has the same effect as &amp;lt;tt&amp;gt;finite(x)&amp;lt;/tt&amp;gt; (and is recognised by ProB):&lt;br /&gt;
 x : FIN(x)&lt;br /&gt;
&lt;br /&gt;
== all-different ==&lt;br /&gt;
One can encode the fact that n objects x1,...,xn are pair-wise different using the following construct (recognised by ProB):&lt;br /&gt;
 card({x1,...,xn})=n&lt;br /&gt;
&lt;br /&gt;
== map ==&lt;br /&gt;
Given a function f and a sequence &amp;lt;tt&amp;gt;sqce&amp;lt;/tt&amp;gt; one can map the function over all elements of &amp;lt;tt&amp;gt;sqce&amp;lt;/tt&amp;gt; using the relational composition operator &amp;lt;tt&amp;gt;;&amp;lt;/tt&amp;gt;:&lt;br /&gt;
 (sqce ; f)&lt;br /&gt;
&lt;br /&gt;
For example, &amp;lt;tt&amp;gt;([1,2,3] ; succ)&amp;lt;/tt&amp;gt; gives us the sequence &amp;lt;tt&amp;gt;[2,3,4]&amp;lt;/tt&amp;gt;.&lt;br /&gt;
&lt;br /&gt;
== Recursion using closure1 ==&lt;br /&gt;
&lt;br /&gt;
Even though B has no built-in support for recursion, one can use the transitive closure operator &amp;lt;tt&amp;gt;closure1&amp;lt;/tt&amp;gt; to compute certain recursive functions.&lt;br /&gt;
For this we need to encode the recursion as a step function of the form:&lt;br /&gt;
 %(in,acc).(P|(inr,accr))&lt;br /&gt;
where P is a predicate which in case we have not yet reached a base case for the input value &amp;lt;tt&amp;gt;in&amp;lt;/tt&amp;gt;. The computation result has to be stored in an accumulator: &amp;lt;tt&amp;gt;acc&amp;lt;/tt&amp;gt; is the accumulator before the recursion step, &amp;lt;tt&amp;gt;accr&amp;lt;/tt&amp;gt; after.&lt;br /&gt;
&amp;lt;tt&amp;gt;inr&amp;lt;/tt&amp;gt; is the new input value for the recursive call.&lt;br /&gt;
In case the base case is reached for &amp;lt;tt&amp;gt;in&amp;lt;/tt&amp;gt;, the predicate P should be false and the value of the recursive call should be the value of the accumulator.&lt;br /&gt;
&lt;br /&gt;
The value of the recursive function can thus be obtained by calling:&lt;br /&gt;
 closure1(step)[{(in,ia)}](b)&lt;br /&gt;
where &amp;lt;tt&amp;gt;in&amp;lt;/tt&amp;gt; is the input value, &amp;lt;tt&amp;gt;b&amp;lt;/tt&amp;gt; is the base case and &amp;lt;tt&amp;gt;ia&amp;lt;/tt&amp;gt; is the initial (empty) accumulator.&lt;br /&gt;
&lt;br /&gt;
For example, to sort a set of integers into a ascending sequence, we would define the step function as follows:&lt;br /&gt;
 step = %(s,o).(s/={} | (s\{min(s)},o&amp;lt;-min(s)))&lt;br /&gt;
A particular call would be:&lt;br /&gt;
 closure1(step)[{({4,5,2},[])}]({})&lt;br /&gt;
resulting in the sequence &amp;lt;tt&amp;gt;[2,4,5]&amp;lt;/tt&amp;gt;.&lt;br /&gt;
&lt;br /&gt;
Observe that, even though &amp;lt;tt&amp;gt;closure1(step)&amp;lt;/tt&amp;gt; is an infinite relation, ProB can compute the relational image of &amp;lt;tt&amp;gt;closure1(step)&amp;lt;/tt&amp;gt; for a particular set such as &lt;br /&gt;
&amp;lt;tt&amp;gt;{({4,5,2},[])}&amp;lt;/tt&amp;gt; (provided the recursion terminates).&lt;br /&gt;
&lt;br /&gt;
== Recursion using &amp;lt;tt&amp;gt;ABSTRACT_CONSTANTS&amp;lt;/tt&amp;gt; ==&lt;br /&gt;
&lt;br /&gt;
Recursive functions can be declared using the &amp;lt;tt&amp;gt;ABSTRACT_CONSTANTS&amp;lt;/tt&amp;gt; section in B machines. Functions declared as &amp;lt;tt&amp;gt;ABSTRACT_CONSTANTS&amp;lt;/tt&amp;gt; are treated symbolically by ProB and not evaluated eagerly.&lt;br /&gt;
&lt;br /&gt;
For example, to sort a set of integers into a ascending sequence, as above, we would define a recursive function as follows:&lt;br /&gt;
 ABSTRACT_CONSTANTS&lt;br /&gt;
     Recursive_Sort&lt;br /&gt;
 PROPERTIES&lt;br /&gt;
     Recursive_Sort : POW(INTEGER) &amp;lt;-&amp;gt; POW(INTEGER*INTEGER)&lt;br /&gt;
     &amp;amp; Recursive_Sort =&lt;br /&gt;
         %in.(in : POW(INTEGER) &amp;amp; in = {} | [])&lt;br /&gt;
         \/ %in.(in : POW(INTEGER) &amp;amp; in /= {}&lt;br /&gt;
                          | min(in) -&amp;gt; Recursive_Sort(in\{min(in)}))&lt;br /&gt;
&lt;br /&gt;
By defining &amp;lt;tt&amp;gt;Recursive_Sort&amp;lt;/tt&amp;gt; as an abstract constant we indicate that ProB should handle the function symbolically, i.e. ProB will not try to enumerate all elements of the function. The recursive function itself is composed of two single functions: a function defining the base case and a function defining the recursive case. Note, that the intersection of the domains of these function is empty, and hence, the union is still a function.&lt;/div&gt;</summary>
		<author><name>Bivab</name></author>
	</entry>
	<entry>
		<id>https://prob.hhu.de/w/index.php?title=Tips:_B_Idioms&amp;diff=3642</id>
		<title>Tips: B Idioms</title>
		<link rel="alternate" type="text/html" href="https://prob.hhu.de/w/index.php?title=Tips:_B_Idioms&amp;diff=3642"/>
		<updated>2016-05-31T14:04:52Z</updated>

		<summary type="html">&lt;p&gt;Bivab: &lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;&lt;br /&gt;
Also have a look at [[Tips:_Writing_Models_for_ProB]].&lt;br /&gt;
&lt;br /&gt;
== Let ==&lt;br /&gt;
&lt;br /&gt;
Classical B only has a LET substitution, no let construct for predicates or expressions.&lt;br /&gt;
Event-B has no let construct whatsoever.&lt;br /&gt;
&lt;br /&gt;
=== Let for predicates ===&lt;br /&gt;
&lt;br /&gt;
For predicates this encodes a let predicate:&lt;br /&gt;
 #x.(x=E &amp;amp; P)&lt;br /&gt;
corresponds to something like&lt;br /&gt;
 let x=E in P&lt;br /&gt;
&lt;br /&gt;
Within set comprehensions one can use the following construct:&lt;br /&gt;
 dom({x,y|y=E &amp;amp; P})&lt;br /&gt;
corresponds to something like&lt;br /&gt;
 {x|let y=E in P}&lt;br /&gt;
&lt;br /&gt;
One can also use the ran operator or introduce multiple lets in one go:&lt;br /&gt;
 dom(dom({x,y,z|y=E1 &amp;amp; z=E2 &amp;amp;P}))&lt;br /&gt;
or&lt;br /&gt;
 ran({y,z,x|y=E1 &amp;amp; z=E2 &amp;amp;P})&lt;br /&gt;
both encode&lt;br /&gt;
 {x|let y=E1 &amp;amp; z=E2 in P}&lt;br /&gt;
&lt;br /&gt;
=== Let for expressions ===&lt;br /&gt;
&lt;br /&gt;
In case F is a set expression, then the following construct can be used to encode a let statement:&lt;br /&gt;
 UNION(x).(x=E|F)&lt;br /&gt;
corresponds to something like&lt;br /&gt;
 let x=E in F&lt;br /&gt;
&lt;br /&gt;
The following construct has exactly the same effect:&lt;br /&gt;
 INTER(x).(x=E|F)&lt;br /&gt;
&lt;br /&gt;
== If-Then-Else ==&lt;br /&gt;
&lt;br /&gt;
Classical B only has an IF-THEN-ELSE substitution (aka statement), no such construct for predicates or expressions.&lt;br /&gt;
The following construct&lt;br /&gt;
 %((x).(x=0 &amp;amp; PRED|C1)\/%(x).(x=0 &amp;amp; not(PRED)|C2)) (0)&lt;br /&gt;
encodes an if-then-else for expressions:&lt;br /&gt;
 if PRED then C1 else C2&lt;br /&gt;
&lt;br /&gt;
It is recognised by ProB.&lt;br /&gt;
&lt;br /&gt;
== finite ==&lt;br /&gt;
In classical B there is no counterpart to the Event-B &amp;lt;tt&amp;gt;finite&amp;lt;/tt&amp;gt; operator.&lt;br /&gt;
However, the following construct has the same effect as &amp;lt;tt&amp;gt;finite(x)&amp;lt;/tt&amp;gt; (and is recognised by ProB):&lt;br /&gt;
 x : FIN(x)&lt;br /&gt;
&lt;br /&gt;
== all-different ==&lt;br /&gt;
One can encode the fact that n objects x1,...,xn are pair-wise different using the following construct (recognised by ProB):&lt;br /&gt;
 card({x1,...,xn})=n&lt;br /&gt;
&lt;br /&gt;
== map ==&lt;br /&gt;
Given a function f and a sequence s one can map the function over all elements of s using the relational composition operator &amp;lt;tt&amp;gt;;&amp;lt;/tt&amp;gt;:&lt;br /&gt;
 (s ; f)&lt;br /&gt;
&lt;br /&gt;
For example, &amp;lt;tt&amp;gt;([1,2,3] ; succ)&amp;lt;/tt&amp;gt; gives us the sequence &amp;lt;tt&amp;gt;[2,3,4]&amp;lt;/tt&amp;gt;.&lt;br /&gt;
&lt;br /&gt;
== Recursion using closure1 ==&lt;br /&gt;
&lt;br /&gt;
Even though B has no built-in support for recursion, one can use the transitive closure operator &amp;lt;tt&amp;gt;closure1&amp;lt;/tt&amp;gt; to compute certain recursive functions.&lt;br /&gt;
For this we need to encode the recursion as a step function of the form:&lt;br /&gt;
 %(in,acc).(P|(inr,accr))&lt;br /&gt;
where P is a predicate which in case we have not yet reached a base case for the input value &amp;lt;tt&amp;gt;in&amp;lt;/tt&amp;gt;. The computation result has to be stored in an accumulator: &amp;lt;tt&amp;gt;acc&amp;lt;/tt&amp;gt; is the accumulator before the recursion step, &amp;lt;tt&amp;gt;accr&amp;lt;/tt&amp;gt; after.&lt;br /&gt;
&amp;lt;tt&amp;gt;inr&amp;lt;/tt&amp;gt; is the new input value for the recursive call.&lt;br /&gt;
In case the base case is reached for &amp;lt;tt&amp;gt;in&amp;lt;/tt&amp;gt;, the predicate P should be false and the value of the recursive call should be the value of the accumulator.&lt;br /&gt;
&lt;br /&gt;
The value of the recursive function can thus be obtained by calling:&lt;br /&gt;
 closure1(step)[{(in,ia)}](b)&lt;br /&gt;
where &amp;lt;tt&amp;gt;in&amp;lt;/tt&amp;gt; is the input value, &amp;lt;tt&amp;gt;b&amp;lt;/tt&amp;gt; is the base case and &amp;lt;tt&amp;gt;ia&amp;lt;/tt&amp;gt; is the initial (empty) accumulator.&lt;br /&gt;
&lt;br /&gt;
For example, to sort a set of integers into a ascending sequence, we would define the step function as follows:&lt;br /&gt;
 step = %(s,o).(s/={} | (s\{min(s)},o&amp;lt;-min(s)))&lt;br /&gt;
A particular call would be:&lt;br /&gt;
 closure1(step)[{({4,5,2},[])}]({})&lt;br /&gt;
resulting in the sequence &amp;lt;tt&amp;gt;[2,4,5]&amp;lt;/tt&amp;gt;.&lt;br /&gt;
&lt;br /&gt;
Observe that, even though &amp;lt;tt&amp;gt;closure1(step)&amp;lt;/tt&amp;gt; is an infinite relation, ProB can compute the relational image of &amp;lt;tt&amp;gt;closure1(step)&amp;lt;/tt&amp;gt; for a particular set such as &lt;br /&gt;
&amp;lt;tt&amp;gt;{({4,5,2},[])}&amp;lt;/tt&amp;gt; (provided the recursion terminates).&lt;br /&gt;
&lt;br /&gt;
== Recursion using &amp;lt;tt&amp;gt;ABSTRACT_CONSTANTS&amp;lt;/tt&amp;gt; ==&lt;br /&gt;
&lt;br /&gt;
Recursive functions can be declared using the &amp;lt;tt&amp;gt;ABSTRACT_CONSTANTS&amp;lt;/tt&amp;gt; section in B machines. Functions declared as &amp;lt;tt&amp;gt;ABSTRACT_CONSTANTS&amp;lt;/tt&amp;gt; are treated symbolically by ProB and not evaluated eagerly.&lt;br /&gt;
&lt;br /&gt;
For example, to sort a set of integers into a ascending sequence, as above, we would define a recursive function as follows:&lt;br /&gt;
 ABSTRACT_CONSTANTS&lt;br /&gt;
     Recursive_Sort&lt;br /&gt;
 PROPERTIES&lt;br /&gt;
     Recursive_Sort : POW(INTEGER) &amp;lt;-&amp;gt; POW(INTEGER*INTEGER)&lt;br /&gt;
     &amp;amp; Recursive_Sort =&lt;br /&gt;
         %in.(in : POW(INTEGER) &amp;amp; in = {} | [])&lt;br /&gt;
         \/ %in.(in : POW(INTEGER) &amp;amp; in /= {}&lt;br /&gt;
                          | min(in) -&amp;gt; Recursive_Sort(in\{min(in)}))&lt;br /&gt;
&lt;br /&gt;
By defining &amp;lt;tt&amp;gt;Recursive_Sort&amp;lt;/tt&amp;gt; as an abstract constant we indicate that ProB should handle the function symbolically, i.e. ProB will not try to enumerate all elements of the function. The recursive function itself is composed of two single functions: a function defining the base case and a function defining the recursive case. Note, that the intersection of the domains of these function is empty, and hence, the union is still a function.&lt;/div&gt;</summary>
		<author><name>Bivab</name></author>
	</entry>
	<entry>
		<id>https://prob.hhu.de/w/index.php?title=PROBPATH&amp;diff=3590</id>
		<title>PROBPATH</title>
		<link rel="alternate" type="text/html" href="https://prob.hhu.de/w/index.php?title=PROBPATH&amp;diff=3590"/>
		<updated>2016-04-19T12:14:18Z</updated>

		<summary type="html">&lt;p&gt;Bivab: &lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;{{DISPLAYTITLE:The ProB Search Path}}&lt;br /&gt;
&lt;br /&gt;
Starting with version 1.5 of ProB, it is possible to customize where the parser will ProB will search for referenced files.&lt;br /&gt;
&lt;br /&gt;
By default ProB will try to find files referenced from a machine (using SEES, INCLUDES, DEFINITON-files, etc) resolving paths as relative to the current machine or within the ProB standard library.&lt;br /&gt;
&lt;br /&gt;
Commonly used files can be placed in a shared location, e.g. in the standard library (the stdlib directory in the ProB distribution) or any custom location.&lt;br /&gt;
&lt;br /&gt;
The search path can be customized by defining a PROBPATH environment variable that contains a “:” separated list of directories to be searched, e.g.:&lt;br /&gt;
&lt;br /&gt;
 PROBPATH=~/myproject/common:~/myotherproject/common probcli model.mch&lt;br /&gt;
	&lt;br /&gt;
will resolved referenced files relative to model.mch, then in &#039;&#039;&#039;~/myproject/common&#039;&#039;&#039; then in &#039;&#039;&#039;~/myotherproject/common&#039;&#039;&#039; and finally in the standard library of ProB, stopping as soon as a file with the name being looked up is found.&lt;/div&gt;</summary>
		<author><name>Bivab</name></author>
	</entry>
	<entry>
		<id>https://prob.hhu.de/w/index.php?title=ProB_Logic_Calculator&amp;diff=3543</id>
		<title>ProB Logic Calculator</title>
		<link rel="alternate" type="text/html" href="https://prob.hhu.de/w/index.php?title=ProB_Logic_Calculator&amp;diff=3543"/>
		<updated>2016-03-03T09:30:42Z</updated>

		<summary type="html">&lt;p&gt;Bivab: &lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;Below is a ProB-based [http://research.microsoft.com/en-us/um/people/lamport/tla/logic-calculators.html logic calculator]. You can enter predicates and expressions in the upper textfield ([[Summary_of_B_Syntax|using B syntax]]). When you stop typing, ProB will evaluate the formula and display the result in the lower textfield.  A series of examples for the &amp;quot;Evaluate&amp;quot; mode can be loaded from the examples menu. There is a [[ProB_Logic_Calculator#Small_Tutorial|small tutorial]] at the bottom of the page.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;html&amp;gt;&lt;br /&gt;
&amp;lt;iframe src=&amp;quot;https://wyvern.cs.uni-duesseldorf.de:8443/evalB/embedded.html&amp;quot; width=&amp;quot;780&amp;quot; height=&amp;quot;450&amp;quot; border=&amp;quot;0&amp;quot; frameborder=&amp;quot;0&amp;quot; scrolling=&amp;quot;no&amp;quot;&amp;gt;&lt;br /&gt;
  &amp;lt;p&amp;gt;Your Browser does not suport IFrames.&amp;lt;/p&amp;gt;&lt;br /&gt;
&amp;lt;/iframe&amp;gt;&lt;br /&gt;
&amp;lt;/html&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
The above calculator has a time-out of 3 seconds, and &amp;lt;tt&amp;gt;MAXINT&amp;lt;/tt&amp;gt; is set to 127 and &amp;lt;tt&amp;gt;MININT&amp;lt;/tt&amp;gt; to -128.&lt;br /&gt;
A front-end with larger text areas is [http://wyvern.cs.uni-duesseldorf.de:8080/evalB/index.html available here].&lt;br /&gt;
An alternative, older version of the calculator is available at the [http://www.formalmind.com/en/blog/prob-logic-calculator Formal Mind website].&lt;br /&gt;
You can also [[Download|download ProB]] for execution on your computer, along with support for [http://en.wikipedia.org/wiki/B B], [http://www.event-b.org/ Event-B], [http://en.wikipedia.org/wiki/Communicating_sequential_processes CSP-M],&lt;br /&gt;
[http://research.microsoft.com/en-us/um/people/lamport/tla/tla.html TLA+], and [http://en.wikipedia.org/wiki/Z_notation Z]. There are also 64-bit versions available for Linux and Mac (the above calculator only uses the 32-bit version).&lt;br /&gt;
&lt;br /&gt;
Short syntax guide for some of B&#039;s constructs: &lt;br /&gt;
* comments &amp;lt;tt&amp;gt;/* ... */&amp;lt;/tt&amp;gt;&lt;br /&gt;
* conjunction &amp;lt;tt&amp;gt;P &amp;amp; Q&amp;lt;/tt&amp;gt;, disjunction &amp;lt;tt&amp;gt;P or Q&amp;lt;/tt&amp;gt;, implication &amp;lt;tt&amp;gt;P =&amp;gt; Q&amp;lt;/tt&amp;gt;, equivalence &amp;lt;tt&amp;gt;P &amp;lt;=&amp;gt; Q&amp;lt;/tt&amp;gt;, negation &amp;lt;tt&amp;gt;not(P)&amp;lt;/tt&amp;gt;, existential quantification &amp;lt;tt&amp;gt;#x.(P)&amp;lt;/tt&amp;gt;, universal quantification &amp;lt;tt&amp;gt;!x.(P=&amp;gt;Q)&amp;lt;/tt&amp;gt;&lt;br /&gt;
* equality &amp;lt;tt&amp;gt;x=y&amp;lt;/tt&amp;gt;, disequality &amp;lt;tt&amp;gt;x/=y&amp;lt;/tt&amp;gt;&lt;br /&gt;
* boolean values &amp;lt;tt&amp;gt;TRUE&amp;lt;/tt&amp;gt;, &amp;lt;tt&amp;gt;FALSE&amp;lt;/tt&amp;gt;, converting predicate to value &amp;lt;tt&amp;gt;bool(P)&amp;lt;/tt&amp;gt;; Warning: &amp;lt;tt&amp;gt;TRUE&amp;lt;/tt&amp;gt; and &amp;lt;tt&amp;gt;FALSE&amp;lt;/tt&amp;gt; are values and &amp;lt;em&amp;gt;not&amp;lt;/em&amp;gt; predicates in B and cannot be combined using logical connectives.&lt;br /&gt;
* strings &amp;lt;tt&amp;gt;&amp;quot;...&amp;quot;&amp;lt;/tt&amp;gt;, set of all strings &amp;lt;tt&amp;gt;STRING&amp;lt;/tt&amp;gt;&lt;br /&gt;
* arithmetic comparisons &amp;lt;tt&amp;gt;x &amp;lt; y&amp;lt;/tt&amp;gt;,  &amp;lt;tt&amp;gt;x &amp;gt; y&amp;lt;/tt&amp;gt;,  &amp;lt;tt&amp;gt;x &amp;lt;= y&amp;lt;/tt&amp;gt;,  &amp;lt;tt&amp;gt;x &amp;gt;= y&amp;lt;/tt&amp;gt;&lt;br /&gt;
* membership &amp;lt;tt&amp;gt;x:S&amp;lt;/tt&amp;gt;, not membership, &amp;lt;tt&amp;gt;x/:S&amp;lt;/tt&amp;gt;, subset &amp;lt;tt&amp;gt;S&amp;lt;:R&amp;lt;/tt&amp;gt;, strict subset &amp;lt;tt&amp;gt;S &amp;lt;&amp;lt;: R&amp;lt;/tt&amp;gt;&lt;br /&gt;
* arithmetic operators   &amp;lt;tt&amp;gt;x+y&amp;lt;/tt&amp;gt;,  &amp;lt;tt&amp;gt;x-y&amp;lt;/tt&amp;gt;,  &amp;lt;tt&amp;gt;x*y&amp;lt;/tt&amp;gt;,  &amp;lt;tt&amp;gt;x/y&amp;lt;/tt&amp;gt;,  &amp;lt;tt&amp;gt;x mod y&amp;lt;/tt&amp;gt;,  &amp;lt;tt&amp;gt;x**y&amp;lt;/tt&amp;gt; ,  &amp;lt;tt&amp;gt;succ(x)&amp;lt;/tt&amp;gt;, &amp;lt;tt&amp;gt;pred(x)&amp;lt;/tt&amp;gt;&lt;br /&gt;
* mathematical integers &amp;lt;tt&amp;gt;INTEGER&amp;lt;/tt&amp;gt;, mathematical natural numbers &amp;lt;tt&amp;gt;NATURAL&amp;lt;/tt&amp;gt;, implementable integers &amp;lt;tt&amp;gt;INT&amp;lt;/tt&amp;gt;, implementable naturals &amp;lt;tt&amp;gt;NAT&amp;lt;/tt&amp;gt;, maximum implementable integer &amp;lt;tt&amp;gt;MAXINT&amp;lt;/tt&amp;gt;, minimum implementable integer &amp;lt;tt&amp;gt;MININT&amp;lt;/tt&amp;gt;&lt;br /&gt;
* empty set &amp;lt;tt&amp;gt;{}&amp;lt;/tt&amp;gt;, set enumeration &amp;lt;tt&amp;gt;{x,y,...}&amp;lt;/tt&amp;gt;, comprehension set defined by predicate &amp;lt;tt&amp;gt;{x|P}&amp;lt;/tt&amp;gt;, lambda abstraction &amp;lt;tt&amp;gt;%x.(P|E)&amp;lt;/tt&amp;gt;, interval &amp;lt;tt&amp;gt;m..n&amp;lt;/tt&amp;gt;&lt;br /&gt;
* set union &amp;lt;tt&amp;gt;S \/ T&amp;lt;/tt&amp;gt;, set intersection &amp;lt;tt&amp;gt;S /\ T&amp;lt;/tt&amp;gt;, set difference &amp;lt;tt&amp;gt;S - T&amp;lt;/tt&amp;gt;, power set &amp;lt;tt&amp;gt;POW(S)&amp;lt;/tt&amp;gt;, Cartesian product &amp;lt;tt&amp;gt;S*T&amp;lt;/tt&amp;gt;, cardinality of set &amp;lt;tt&amp;gt;card(S)&amp;lt;/tt&amp;gt;&lt;br /&gt;
* set of relations between two sets &amp;lt;tt&amp;gt;S &amp;lt;-&amp;gt; T&amp;lt;/tt&amp;gt;, set of partial functions &amp;lt;tt&amp;gt;S +-&amp;gt; T&amp;lt;/tt&amp;gt;, set of total functions &amp;lt;tt&amp;gt;S --&amp;gt; T&amp;lt;/tt&amp;gt;&lt;br /&gt;
* relational image &amp;lt;tt&amp;gt;r[S]&amp;lt;/tt&amp;gt;, relational composition &amp;lt;tt&amp;gt;(r1 ; r2)&amp;lt;/tt&amp;gt;, transitive closure &amp;lt;tt&amp;gt;closure1(r)&amp;lt;/tt&amp;gt;, identity relation over a set &amp;lt;tt&amp;gt;id(S)&amp;lt;/tt&amp;gt;, domain of a relation &amp;lt;tt&amp;gt;dom(r)&amp;lt;/tt&amp;gt;, its range &amp;lt;tt&amp;gt;ran(r)&amp;lt;/tt&amp;gt;, its inverse &amp;lt;tt&amp;gt;r~&amp;lt;/tt&amp;gt;, relational overriding &amp;lt;tt&amp;gt;r1 &amp;lt;+ r2&amp;lt;/tt&amp;gt;&lt;br /&gt;
* empty sequence &amp;lt;tt&amp;gt;[]&amp;lt;/tt&amp;gt;, explicit sequence &amp;lt;tt&amp;gt;[x,y,...]&amp;lt;/tt&amp;gt;, concatenation &amp;lt;tt&amp;gt;s1^s2&amp;lt;/tt&amp;gt;, first element &amp;lt;tt&amp;gt;first(s)&amp;lt;/tt&amp;gt;, tail &amp;lt;tt&amp;gt;tail(s)&amp;lt;/tt&amp;gt;, prepend an element &amp;lt;tt&amp;gt;E-&amp;gt;s&amp;lt;/tt&amp;gt;, size of a sequence &amp;lt;tt&amp;gt;size(s)&amp;lt;/tt&amp;gt;&lt;br /&gt;
* sets of sequences over a set &amp;lt;tt&amp;gt;seq(S)&amp;lt;/tt&amp;gt;, set of injective sequences &amp;lt;tt&amp;gt;iseq(S)&amp;lt;/tt&amp;gt;, set of permutations &amp;lt;tt&amp;gt;perm(S)&amp;lt;/tt&amp;gt;&lt;br /&gt;
More details can be found on our [[Summary_of_B_Syntax|page on the B syntax]]. Note: statements (aka substitutions) and B machine construction elements cannot be used above; you must enter either a predicate or an expression.&lt;br /&gt;
&lt;br /&gt;
The term &amp;lt;em&amp;gt;logic calculator&amp;lt;/em&amp;gt; is taken over from [http://research.microsoft.com/en-us/um/people/lamport/tla/logic-calculators.html Leslie Lamport].&lt;br /&gt;
An early implementation of a logic calculator is the [http://en.wikipedia.org/wiki/William_Stanley_Jevons#Logic Logic Piano].&lt;br /&gt;
&lt;br /&gt;
We are grateful for feedback about our logic calculator (send an email to [http://www.stups.uni-duesseldorf.de/~leuschel Michael Leuschel]). &lt;br /&gt;
You can also switch the calculator into [http://research.microsoft.com/en-us/um/people/lamport/tla/tla.html TLA+] mode.&lt;br /&gt;
In future we plan to provide additional features:&lt;br /&gt;
* getting an unsat core for unsatisfiable formulas&lt;br /&gt;
* better feedback for syntax and type errors&lt;br /&gt;
* graphical visualization of formulas and models&lt;br /&gt;
* support for further alternative input syntax, such as [http://en.wikipedia.org/wiki/Z_notation Z]&lt;br /&gt;
* ability to change the parameters, e.g., use the [http://www.stups.uni-duesseldorf.de/w/Special:Publication/PlaggeLeuschel_Kodkod2012 ProB-Kodkod backend] instead of the default constraint-logic programming kernel.&lt;br /&gt;
&lt;br /&gt;
== Small Tutorial ==&lt;br /&gt;
&lt;br /&gt;
Here is a small tutorial to get you started.&lt;br /&gt;
B distinguishes &amp;lt;em&amp;gt;expressions&amp;lt;/em&amp;gt;, which have a value, and &amp;lt;em&amp;gt;predicates&amp;lt;/em&amp;gt; which can be either true or false.&lt;br /&gt;
First, let us type an expression:&lt;br /&gt;
 1+1&lt;br /&gt;
The calculator returns the value &amp;lt;tt&amp;gt;2&amp;lt;/tt&amp;gt;.&lt;br /&gt;
A more complicated expression is:&lt;br /&gt;
 {1,2,3} \/ {1+2+3}&lt;br /&gt;
which has the value &amp;lt;tt&amp;gt;{1,2,3,6}&amp;lt;/tt&amp;gt;.&lt;br /&gt;
Now, let us type a simple predicate:&lt;br /&gt;
 1&amp;gt;2&lt;br /&gt;
The calculator tells us that this predicate is false.&lt;br /&gt;
We can combine predicates using the logical connectives.&lt;br /&gt;
For example, the following predicate is true:&lt;br /&gt;
 1&amp;gt;2 or 2&amp;gt;1&lt;br /&gt;
We can also use existential quantification to produce a predicate:&lt;br /&gt;
 #(x).(x+10=30)&lt;br /&gt;
which is true and ProB will give you a solution &amp;lt;tt&amp;gt;x=20&amp;lt;/tt&amp;gt;.&lt;br /&gt;
In the calculator, any variable that is not explicitly introduced is considered existentially quantified. Thus, you get the same effect by simply typing:&lt;br /&gt;
 x+10=30&lt;br /&gt;
If you want to get all solutions for the equation x+10=30, you can make use of a set comprehension:&lt;br /&gt;
 {x|x+10=30}&lt;br /&gt;
Here the calculator will compute the value of the expression to be &amp;lt;tt&amp;gt;{20}&amp;lt;/tt&amp;gt;, i.e., we know that 20 is the only solution for &amp;lt;tt&amp;gt;x&amp;lt;/tt&amp;gt;.&lt;br /&gt;
Note that the B language has Boolean values &amp;lt;tt&amp;gt;TRUE&amp;lt;/tt&amp;gt; and &amp;lt;tt&amp;gt;FALSE&amp;lt;/tt&amp;gt;, but these are &amp;lt;em&amp;gt;not&amp;lt;/em&amp;gt; considered predicates in B.&lt;br /&gt;
Thus if we type:&lt;br /&gt;
 TRUE&lt;br /&gt;
this is considered an expression and not a predicate.&lt;br /&gt;
This also means that &amp;lt;tt&amp;gt;TRUE or FALSE&amp;lt;/tt&amp;gt; is not considered a legal predicate in pure B.&lt;br /&gt;
However, for convenience, the logic calculator accepts this and as such you can type:&lt;br /&gt;
 TRUE or FALSE&lt;br /&gt;
which is determined to be true.&lt;br /&gt;
In pure B, you would have to write something like:&lt;br /&gt;
 1=1 or 1=2&lt;br /&gt;
Finally, in pure B, variables can only range over values in B, not over predicates. Thus &amp;lt;tt&amp;gt;P or Q&amp;lt;/tt&amp;gt; is not allowed in pure B, but our logic calculator does accept it. &lt;br /&gt;
As such you can type&lt;br /&gt;
 P or Q&lt;br /&gt;
which is equivalent to typing&lt;br /&gt;
 P=TRUE or Q=TRUE&lt;br /&gt;
If you want to find all models of the formula, you can use a set comprehension:&lt;br /&gt;
 {P,Q | P or Q}&lt;br /&gt;
Also, if you want to check whether your formula is a tautology you can select the &amp;quot;Universal (Checking)&amp;quot; entry in the Quantification Mode menu. In this case (for &amp;lt;tt&amp;gt;P or Q&amp;lt;/tt&amp;gt;) a counter example is produced by the tool.&lt;br /&gt;
More generally, you can check proof rules using the &amp;quot;Tautology Check&amp;quot; button.&lt;br /&gt;
E.g., our tool will confirm that the following is a tautology:&lt;br /&gt;
 (A =&amp;gt; B) &amp;amp; not(B) =&amp;gt; not(A)&lt;br /&gt;
Note, however, that our tool is &amp;lt;em&amp;gt;not&amp;lt;/em&amp;gt; a prover in general: you can use it to find solutions and counter-examples, but in general it cannot be used to prove formulas using variables with infinite type.&lt;br /&gt;
In those cases, you may see enumeration warnings in the output, which means  that ProB was only able to check a finite number of values from an infinite set. This could mean that the result displayed is not correct (even though in general solutions and counter-examples tend to be correct; in future we will refine ProB&#039;s output to also indicate when the solution/counter-example is still guaranteed to be correct)!&lt;br /&gt;
&lt;br /&gt;
== Executing the Calculator locally ==&lt;br /&gt;
You can evaluate formulas on your machine in the same way as the calculator above, by [[Download|downloading ProB]]  (ideally a nightly build) and then executing one of the following commands:&lt;br /&gt;
 ./probcli -p BOOL_AS_PREDICATE TRUE -p CLPFD TRUE -p MAXINT 127 -p MININT -128 -p TIME_OUT 500 -eval_file MYFILE&lt;br /&gt;
The above command requires you to put the formula into a file &amp;lt;tt&amp;gt;MYFILE&amp;lt;/tt&amp;gt;.&lt;br /&gt;
The command below allows you to put the formula directly into the command:  &lt;br /&gt;
 ./probcli -p BOOL_AS_PREDICATE TRUE -p CLPFD TRUE -p MAXINT 127 -p MININT -128 -p TIME_OUT 500 -eval &amp;quot;MYFORMULA&amp;quot;&lt;br /&gt;
If you want to perform the tautology check you have to do the following using the -eval_rule_file command:&lt;br /&gt;
 ./probcli -p BOOL_AS_PREDICATE TRUE -p CLPFD TRUE -p MAXINT 127 -p MININT -128 -p TIME_OUT 500 -eval_rule_file MYFILE&lt;br /&gt;
You can also start your own REPL using the -repl command (you may wish to use the rlwrap tool):&lt;br /&gt;
 ./probcli -repl -p BOOL_AS_PREDICATE TRUE -p CLPFD TRUE -p MAXINT 127 -p MININT -128&lt;br /&gt;
You can of course adapt the preferences (TIME_OUT, MININT, MAXINT, ...) according to your needs; the [[Using_the_Command-Line_Version_of_ProB|user manual]] provides more details.&lt;br /&gt;
You may wish to use the rlwrap tool:&lt;br /&gt;
 rlwrap ./probcli -repl -p BOOL_AS_PREDICATE TRUE -p CLPFD TRUE -p MAXINT 127 -p MININT -128&lt;br /&gt;
&lt;br /&gt;
Probably, you may want to generate full-fledged B machines as input to &amp;lt;tt&amp;gt;probcli&amp;lt;/tt&amp;gt;.&lt;br /&gt;
This allows you to introduce enumerated and deferred sets; compared to using sets of strings, this has benefits in terms of more stringent typechecking and more efficient constraint solving.&lt;br /&gt;
&lt;br /&gt;
An alternate front-end to the calculator is [http://wyvern.cs.uni-duesseldorf.de:8080/evalB/ available here]. &lt;br /&gt;
Its code is available at &amp;lt;tt&amp;gt;https://github.com/bendisposto/evalB&amp;lt;/tt&amp;gt;.&lt;/div&gt;</summary>
		<author><name>Bivab</name></author>
	</entry>
	<entry>
		<id>https://prob.hhu.de/w/index.php?title=Editors_for_ProB&amp;diff=3540</id>
		<title>Editors for ProB</title>
		<link rel="alternate" type="text/html" href="https://prob.hhu.de/w/index.php?title=Editors_for_ProB&amp;diff=3540"/>
		<updated>2016-02-26T14:05:47Z</updated>

		<summary type="html">&lt;p&gt;Bivab: /* VIM */&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;&lt;br /&gt;
== ProB Tcl/Tk Editor ==&lt;br /&gt;
&lt;br /&gt;
ProB Tcl/Tk contains an editor in which syntax errors are displayed and which can be used to edit B, CSP, Z and TLA+ models.&lt;br /&gt;
The editor of Tcl/Tk, however, has a few limitations:&lt;br /&gt;
* it can become very slow with long or very long lines&lt;br /&gt;
* the syntax highlighting can become slow with very large files. Hence, syntax highlighting is automatically turned off in some circumstances (when more than 50,000 characters are encountered or when a line is longer than 500 characters).&lt;br /&gt;
&lt;br /&gt;
It is possible to open the files in an external editor. You can setup the editor to be used by modifying the preference &amp;quot;Path to External Text Editor&amp;quot; in the &amp;quot;Advanced Preferences&amp;quot; list (available in the &amp;quot;Preferences&amp;quot; menu).&lt;br /&gt;
You can then use the command &amp;quot;Open FILE in external editor&amp;quot; in the &amp;quot;File&amp;quot; menu to open your main specification file with this editor. You can also use the command-key shortcut &amp;quot;Cmd-E&amp;quot; for this.&lt;br /&gt;
&lt;br /&gt;
== Launching the editor in probcli ==&lt;br /&gt;
&lt;br /&gt;
The [[Using_the_Command-Line_Version_of_ProB|probcli]] REPL (read-eval-print-loop) supports the command &amp;lt;tt&amp;gt;:e&amp;lt;/tt&amp;gt; to open the current file in the external editor, as specified in the &amp;quot;EDITOR&amp;quot; preference.&lt;br /&gt;
You can set this preference using&lt;br /&gt;
 probcli -repl -p EDITOR PATH&lt;br /&gt;
In case errors occurred with the last command, this will also try and move the cursor to the corresponding location in the file.&lt;br /&gt;
&lt;br /&gt;
== External Editors ==&lt;br /&gt;
&lt;br /&gt;
== VIM ==&lt;br /&gt;
&lt;br /&gt;
A [https://github.com/bivab/prob.vim VIM plugin for ProB is available].&lt;br /&gt;
It shows a quick fix list of parse and type errors for classical B machines (.mch) using the [[Using_the_Command-Line_Version_of_ProB|command line tool probcli]]. VIM has builtin syntax highlighting support for [https://github.com/vim/vim/blob/master/runtime/syntax/b.vim B].&lt;br /&gt;
&lt;br /&gt;
== Atom ==&lt;br /&gt;
&lt;br /&gt;
There is a package [https://atom.io/packages/language-b-eventb language-b-eventb] available for the Atom editor.&lt;br /&gt;
It adds syntax highlighting and snippets for the specification languages B and Event-B to Atom.&lt;br /&gt;
&lt;br /&gt;
== BBEdit ==&lt;br /&gt;
&lt;br /&gt;
Some [https://github.com/leuschel/bbedit-prob BBedit Language modules for B, TLA+, CSP and Prolog] are available.&lt;br /&gt;
&lt;br /&gt;
== Emacs ==&lt;br /&gt;
&lt;br /&gt;
A package [[File:b-mode.el.zip]] is available.&lt;/div&gt;</summary>
		<author><name>Bivab</name></author>
	</entry>
	<entry>
		<id>https://prob.hhu.de/w/index.php?title=User_Manual&amp;diff=3387</id>
		<title>User Manual</title>
		<link rel="alternate" type="text/html" href="https://prob.hhu.de/w/index.php?title=User_Manual&amp;diff=3387"/>
		<updated>2016-02-02T10:51:05Z</updated>

		<summary type="html">&lt;p&gt;Bivab: /* Sample Models */&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;[[Category:User_Manual]]&lt;br /&gt;
__NOTOC__&lt;br /&gt;
ProB is a graphical animator and model checker for the B method. The ProB homepage is at [http://www.stups.uni-duesseldorf.de/ProB http://www.stups.uni-duesseldorf.de/ProB], where precompiled binaries, installation instructions and documentation are available. &lt;br /&gt;
&lt;br /&gt;
== Important notice ==&lt;br /&gt;
If you find a problem with ProB or this documentation please let us know. We are happy to receive suggestions for improvements to ProB or the documentation.&lt;br /&gt;
More information about submitting bug reports is available in the [[Bugs|&amp;quot;bugs&amp;quot; section]] or directly in our  [http://jira.cobra.cs.uni-duesseldorf.de/ bug tracker].&lt;br /&gt;
You can also post a question in our [https://groups.google.com/d/forum/prob-users prob-users group] or  send an email to [mailto:Michael.Leuschel@hhu.de Michael Leuschel].&lt;br /&gt;
&lt;br /&gt;
== Content of this handbook ==&lt;br /&gt;
{{User_Manual_Index}}&lt;br /&gt;
&lt;br /&gt;
&amp;lt;!--Edit with Template:User_Manual_Index (type &amp;quot;Template:User_Manual_Index&amp;quot; into Go field to the left and type return) --&amp;gt;&lt;br /&gt;
&lt;br /&gt;
(Also have a look at the tutorial; in particular [[Tutorial First Step|Starting ProB and first animation steps]]).&lt;br /&gt;
&lt;br /&gt;
== Sample Models ==&lt;br /&gt;
&lt;br /&gt;
* [[TrainSwitchingPuzzle]]&lt;br /&gt;
* [[Gilbreath_Card_Trick|Model for Card Trick by Gilbreath]]&lt;br /&gt;
* [[Rush Hour Puzzle]]&lt;br /&gt;
* [[Game of Life]]&lt;br /&gt;
* [[N-Queens]]&lt;br /&gt;
* [[Peaceable Armies of Queens]]&lt;br /&gt;
* [[Die Hard Jugs Puzzle]]&lt;br /&gt;
* [[ABZ14|ABZ 2014 Landing Gear Case Study]]&lt;br /&gt;
* [[Sudoku Solved in the ProB REPL]]&lt;br /&gt;
* [[Euler Problem 67 - Maximum Path Sum II]]&lt;br /&gt;
* [[Mutual Exclusion (Fairness)]]&lt;br /&gt;
* [[Cheryl&#039;s Birthday]]&lt;br /&gt;
* [[Blocks World (Directed Model Checking)]]&lt;br /&gt;
* [[Nine Prisoners|Nine Prisoners Puzzle by Dudeney and Gardner]]&lt;br /&gt;
* [[Apples and Oranges (Apple Interview Question)]]&lt;br /&gt;
* [[Bridges Puzzle (Hashiwokakero)]]&lt;br /&gt;
* [[Argumentation Theory]]&lt;br /&gt;
* [[State_space_visualization_examples]]&lt;br /&gt;
* [[The Jobs Puzzle]]&lt;br /&gt;
&lt;br /&gt;
== Sample Graphics ==&lt;br /&gt;
&lt;br /&gt;
* [[SiemensComplicatedProp|Siemens Complicated Property Visualized]]&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
{{Feedback}}&lt;/div&gt;</summary>
		<author><name>Bivab</name></author>
	</entry>
	<entry>
		<id>https://prob.hhu.de/w/index.php?title=The_Jobs_Puzzle&amp;diff=3386</id>
		<title>The Jobs Puzzle</title>
		<link rel="alternate" type="text/html" href="https://prob.hhu.de/w/index.php?title=The_Jobs_Puzzle&amp;diff=3386"/>
		<updated>2016-02-02T10:49:48Z</updated>

		<summary type="html">&lt;p&gt;Bivab: &lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;{{DISPLAYTITLE:The Jobs Puzzle}}&lt;br /&gt;
&lt;br /&gt;
Based on &#039;&#039;Michael Leuschel, David Schneider. Towards B as a High-Level Constraint Modeling Language. In Yamine Ait Amer, Klaus-Dieter Schewe (ed.): Abstract State Machines, Alloy, B, TLA, VDM, and Z, Springer Berlin Heidelberg, 8477: 101-116, 2014.&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
This puzzle was originally published in 1984 by Wos et al. &amp;lt;ref&amp;gt;L. Wos, R. Overbeek, E. Lusk, and J. Boyle. Automated Reasoning: Introduction and Applications. Prentice-Hall, Englewood Cliffs, NJ, 1984.&amp;lt;/ref&amp;gt; as part of a collection of puzzles for automatic reasoners. A reference implementation of the puzzle, by one of the authors of the book, using [http://www.mcs.anl.gov/~wos/mathproblems/jobs.txt OTTER]&amp;lt;ref&amp;gt;W. Mccune. Otter 3.3 reference manual, 2003.&amp;lt;/ref&amp;gt;.&lt;br /&gt;
&lt;br /&gt;
The puzzle consists of eight statements that describe the problem domain and provide some constraints on the elements of the domain. The problem is about a set of people and a set of jobs; the question posed by the puzzle is: who holds which job? The text of the puzzle as presented in &#039;&#039;&amp;quot;The jobs puzzle: A challenge for logical expressibility and automated reasoning.&amp;quot;&#039;&#039;&amp;lt;ref name=&amp;quot;shapiro_jobs_puzzle&amp;quot;&amp;gt;S. C. Shapiro. The jobs puzzle: A challenge for logical expressibility and automated reasoning. In AAAI Spring Symposium: Logical Formalizations of Commonsense Reasoning, 2011.&amp;lt;/ref&amp;gt; is as follows:&lt;br /&gt;
&lt;br /&gt;
* There are four people: Roberta, Thelma, Steve, and Pete.&lt;br /&gt;
* Among them, they hold eight different jobs.&lt;br /&gt;
* Each holds exactly two jobs.&lt;br /&gt;
* The jobs are: chef, guard, nurse, clerk, police officer (gender not implied), teacher, actor, and boxer.&lt;br /&gt;
* The job of nurse is held by a male.&lt;br /&gt;
* The husband of the chef is the clerk.&lt;br /&gt;
* Roberta is not a boxer.&lt;br /&gt;
* Pete has no education past the ninth grade.&lt;br /&gt;
* Roberta, the chef, and the police officer went golfing together.&lt;br /&gt;
&lt;br /&gt;
What makes this puzzle interesting for automatic reasoners, is that not all the information required to solve the puzzle is provided explicitly in the text.&lt;br /&gt;
&lt;br /&gt;
The puzzle can only be solved if certain implicit assumptions about the world are taken into account, such as: the names in the puzzle denote gender or that some of the job names imply the gender of the person that holds it.&lt;br /&gt;
&lt;br /&gt;
== Shapiro’s Challenge ==&lt;br /&gt;
Shapiro&amp;lt;ref name=&amp;quot;shapiro_jobs_puzzle&amp;quot; /&amp;gt;, following the original authors’ remarks, that formalizing the puzzle was at times hard and tedious, identified three challenges posed by the puzzle with regard to automatic reasoners. According to Shapiro, the challenges posed by the jobs puzzle are to:&lt;br /&gt;
&lt;br /&gt;
* formalize it in a non-difficult, non-tedious way&lt;br /&gt;
* formalize it in a way that adheres closely to the English statement of the puzzle&lt;br /&gt;
* have an automated general-purpose commonsense reasoner that can accept that formalization and solve the puzzle quickly.&lt;br /&gt;
&lt;br /&gt;
Any formalization also needs to encode the implicit knowledge used to solve the puzzle for the automatic reasoners while still trying to satisfy the aspects mentioned above. Addressing this challenge makes this puzzle a good case-study for the expressiveness of B to formalize such a problem.&lt;br /&gt;
&lt;br /&gt;
== A Solution to the Jobs Puzzle using B ==&lt;br /&gt;
&lt;br /&gt;
The B encoding of the puzzle uses plain predicate logic, combined with set theory and arithmetic. We will show how this enables a very concise encoding of the problem, staying very close to the natural language requirements. Moreover, the puzzle can be quickly solved using the constraint solving capabilities of ProB. Following the order of the sentences in the puzzle we will discuss one or more possibilities to formalize them using B.&lt;br /&gt;
&lt;br /&gt;
To express &#039;&#039;&amp;quot;There are four people: Roberta, Thelma, Steve, and Pete”&#039;&#039; we define a set of people, that holds the list of names:&lt;br /&gt;
&amp;lt;pre&amp;gt;PEOPLE={&amp;quot;Roberta&amp;quot;, &amp;quot;Thelma&amp;quot;, &amp;quot;Steve&amp;quot;, &amp;quot;Pete&amp;quot;}&amp;lt;/pre&amp;gt;&lt;br /&gt;
We are using strings here to describe the elements of the set. This has the advantage, that the elements of the set are implicitly different.&amp;lt;ref&amp;gt;This encoding allows us to input the puzzle directly into the [http://stups.hhu.de/ProB/index.php5/ProB_Logic_Calculator ProB Console].&amp;lt;/ref&amp;gt; Alternatively, we could use enumerated or deferred sets defined in the SETS section of a B machine.&lt;br /&gt;
As stated above we need some additional information that is not included in the puzzle to solve it. The first bit of information is that the names used in the puzzle imply the gender. In order to express this information we create two sets, MALE and FEMALE which are subsets of PEOPLE and contain the corresponding names.&lt;br /&gt;
&amp;lt;pre&amp;gt;FEMALE={&amp;quot;Roberta&amp;quot;, &amp;quot;Thelma&amp;quot;} &amp;amp; MALE={&amp;quot;Steve&amp;quot;, &amp;quot;Pete&amp;quot;}&amp;lt;/pre&amp;gt;&lt;br /&gt;
The next statement of the puzzle is: &#039;&#039;“among them, they hold eight different jobs”&#039;&#039;. This can be formalized in B using a function that maps from a job to the corresponding person that holds this job using a total surjection from JOBS to PEOPLE:&lt;br /&gt;
&amp;lt;pre&amp;gt;HoldsJob : JOBS --&amp;gt;&amp;gt; PEOPLE&amp;lt;/pre&amp;gt;&lt;br /&gt;
Although redundant, as we will see below, to express &#039;&#039;“Among them, they hold eight different jobs”&#039;&#039; we can add the assertion that the cardinality of HoldsJob is 8. This is possible, because in B functions and relations can be treated as sets of pairs, where each pair consists of an element of the domain and the corresponding element from the range of the relation.&lt;br /&gt;
&amp;lt;pre&amp;gt;card(HoldsJob) = 8&amp;lt;/pre&amp;gt;&lt;br /&gt;
Constraining the jobs each person holds, the puzzle states: &#039;&#039;“Each holds exactly two jobs”&#039;&#039;. To express this we use the inverse relation of HoldsJob, it maps a PERSON to the JOBS associated to her. The inverse function or relation is expressed in B using the ~ operator. For readability we assign the inverse of HoldsJob to a variable called JobsOf. JobsOf is in this case is a relation, because, as stated above, each person holds two jobs.&lt;br /&gt;
&amp;lt;pre&amp;gt;JobsOf = HoldsJob~&amp;lt;/pre&amp;gt;&lt;br /&gt;
Because JobsOf is a relation and not a function, in order to read the values, we need to use B’s relational image operator. This operator maps a subset of the domain to a subset of the range, instead of a single value. To read the jobs Steve holds, the relational image of JobsOf is used as shown below:&lt;br /&gt;
&amp;lt;pre&amp;gt;JobsOf[{&amp;quot;Steve&amp;quot;}]&amp;lt;/pre&amp;gt;&lt;br /&gt;
Using the JobsOf relation we can express the third sentence of the puzzle using a universally quantified expression over the set PEOPLE. The Universal quantification operator (∀) is expressed in B using the ! symbol followed by the name of the variable that is quantified. This way of expressing the constraint is close to the original text of the puzzle, saying that the set of jobs each person holds has a cardinality of two.&lt;br /&gt;
&amp;lt;pre&amp;gt;!x.(x : PEOPLE =&amp;gt; card(JobsOf[{x}]) = 2)&amp;lt;/pre&amp;gt;&lt;br /&gt;
The fourth sentence assigns the set of job names to the identifier JOBS. This statement also constraints the cardinality of HoldsJob to 8.&lt;br /&gt;
&amp;lt;pre&amp;gt;JOBS = {&amp;quot;chef&amp;quot;, &amp;quot;guard&amp;quot;, &amp;quot;nurse&amp;quot;, &amp;quot;clerk&amp;quot;, &amp;quot;police&amp;quot;, &amp;quot;teacher&amp;quot;, &amp;quot;actor&amp;quot;, &amp;quot;boxer&amp;quot;}&amp;lt;/pre&amp;gt;&lt;br /&gt;
The following statements further constrain the solution. First &#039;&#039;“The job of nurse is held by a male”&#039;&#039;, which we can express using the HoldsJob function and the set MALE by stating that the element of PEOPLE that HoldsJob(&amp;quot;nurse&amp;quot;) points to is also an element of the set MALE.&lt;br /&gt;
&amp;lt;pre&amp;gt;HoldsJob(&amp;quot;nurse&amp;quot;) : MALE&amp;lt;/pre&amp;gt;&lt;br /&gt;
Additionally, we add the next bit of implicit information, which is that typically a distinction is made between actress and actor, and therefore the job name actor implies that it is held by a male. This information is formalized, similarly as above.&lt;br /&gt;
&amp;lt;pre&amp;gt;HoldsJob(&amp;quot;actor&amp;quot;) : MALE&amp;lt;/pre&amp;gt;&lt;br /&gt;
The next sentence: &#039;&#039;“The husband of the chef is the clerk”&#039;&#039; contains two relevant bits of information, based on another implicit assumption, which is that marriage usually is between one female and one male. With this in mind, we know that the chef is female and the clerk is male. One possibility is to do the inference step manually and encode this as:&lt;br /&gt;
&amp;lt;pre&amp;gt;HoldsJob(&amp;quot;chef&amp;quot;) : FEMALE &amp;amp; HoldsJob(&amp;quot;clerk&amp;quot;) : MALE&amp;lt;/pre&amp;gt;&lt;br /&gt;
Alternatively, and in order to stay closer to the text of the puzzle we can add a function Husband that maps from the set FEMALE to the set MALE as a partial injection. We use a partial function, because we do not assume that all elements of FEMALE map to an element of MALE.&lt;br /&gt;
&amp;lt;pre&amp;gt;Husband : FEMALE &amp;gt;+&amp;gt; MALE&amp;lt;/pre&amp;gt;&lt;br /&gt;
To add the constraint using this function we state that the tuple of the person that holds the job as chef and the person that holds the job as clerk are an element of this function when treated as a set of tuples.&lt;br /&gt;
&amp;lt;pre&amp;gt;(HoldsJob(&amp;quot;chef&amp;quot;), HoldsJob(&amp;quot;clerk&amp;quot;)) : Husband&amp;lt;/pre&amp;gt;&lt;br /&gt;
The next piece of information is that &#039;&#039;“Roberta is not a boxer”&#039;&#039;. Using the JobsOf relation we can express this close to the original sentence, by stating: boxer is not one of Roberta’s jobs. This can be expressed using the relational image of the JobsOf relation:&lt;br /&gt;
&amp;lt;pre&amp;gt;&amp;quot;boxer&amp;quot; /: JobsOf[{&amp;quot;Roberta&amp;quot;}]&amp;lt;/pre&amp;gt;&lt;br /&gt;
The next sentence provides the information that &#039;&#039;“Pete has no education past the ninth grade”&#039;&#039;. This again needs some contextual information to be useful in order to find a solution for the puzzle&amp;lt;ref name=&amp;quot;shapiro_jobs_puzzle&amp;quot; /&amp;gt;. To interpret this sentence we need to know that the jobs of police officer, teacher and nurse require an education of more than 9 years. Hence the information we get is that Pete does not hold any of these jobs. Doing this inference step we could, as above, state something along the lines of HoldsJob(&amp;quot;police&amp;quot;) /= &amp;quot;Pete&amp;quot;, etc. for each of the jobs. The solution used here, tries to avoid doing the manual inference step. Although we still need to provide the information needed to draw the conclusion that Pete does not hold any of these three jobs. We create a set of those jobs that need higher education:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;QualifiedJobs = {&amp;quot;police&amp;quot;, &amp;quot;teacher&amp;quot;, &amp;quot;nurse&amp;quot;}&amp;lt;/pre&amp;gt;&lt;br /&gt;
Using the relational image operator we can now say that Pete is not among the ones that hold any of these jobs. The relational image can be used to get the set of items in the range of function or relation for all elements of a subset of the domain.&lt;br /&gt;
&amp;lt;pre&amp;gt;&amp;quot;Pete&amp;quot; /: HoldsJob[QualifiedJobs]&amp;lt;/pre&amp;gt;&lt;br /&gt;
Finally, the last piece of information is that &#039;&#039;“Roberta, the chef, and the police officer went golfing together”&#039;&#039;, from this we can infer that Roberta, the chef, and the police officer are all different persons. We write this in B stating that the set of Roberta, the person that holds the job as chef, and the person that is the police officer has cardinality 3, using a variable for the set for readability.&lt;br /&gt;
&amp;lt;pre&amp;gt;Golfers = {&amp;quot;Roberta&amp;quot;, HoldsJob(&amp;quot;chef&amp;quot;), HoldsJob(&amp;quot;police&amp;quot;)} &amp;amp; card(Golfers) = 3&amp;lt;/pre&amp;gt;&lt;br /&gt;
By building the conjunction of all these statements, ProB searches for a valid assignment to the variables introduced that satisfies all constraints, generating a valid solution that answers the question posed by the puzzle “who holds which job? ” in form of the HoldsJob function. The solution found by ProB is depicted below.&lt;br /&gt;
&lt;br /&gt;
[[File:JobsPuzzleSolutionAsGraph.png|border|center|The solution to the Jobs puzzle, depicted graphically]]&lt;br /&gt;
&lt;br /&gt;
This satisfies, in our eyes, the challenges identified by Shapiro. In the sense that the formalization, is not difficult, although it uses a formal language. The elements of this language are familiar to most programmers or mathematicians and it builds upon well understood and widely known concepts. The brevity of the solution shows that using an expressive high-level language it is possible to encode the puzzle without having tedious tasks in order to be able to solve the puzzle at all.&lt;br /&gt;
The encoding of the sentences follows the structure of the English statements very closely. We avoid the use of quantification wherever possible and use set based expressions that relate closely to the puzzle. We are able to encode the additional knowledge needed to solve puzzle in a straight forward way, that is also close to how this would be expressed as statements in English. Lastly it is worth to note that the formalization of “Each holds exactly two jobs” is the one furthest away from the English expression, using quantifications and set cardinality expressions.&lt;br /&gt;
&lt;br /&gt;
== Related Work ==&lt;br /&gt;
In his paper Shapiro discusses several formalizations of the puzzle with regard to the identified challenges. A further formalization using controlled natural language and answer set programming (ASP) was presented in &#039;&#039;&amp;quot;The jobs puzzle: Taking on the challenge via controlled natural language processing&amp;quot;&#039;&#039; by Schwitter et al.&amp;lt;ref name=&amp;quot;schwitter_jobs_puzzle&amp;quot;&amp;gt;R. Schwitter. The jobs puzzle: Taking on the challenge via controlled natural language processing. Theory and Practice of Logic Programming, 13:487–501, 7 2013.&amp;lt;/ref&amp;gt;&lt;br /&gt;
&lt;br /&gt;
The first of the solutions discussed by Shapiro is a solution from the TPTP website, encoded as a set of clauses and translated to FOL. The main disadvantages of this encoding is that it requires 64 clauses to encode the problem and many of them are needed to define equality among jobs and names. This is in contrast to our B encoding using either enumerated sets or strings, where all elements are implicitly assumed to be different. Thus the user does not have to define the concept of equality for simple atoms.&lt;br /&gt;
&lt;br /&gt;
The second solution discussed by Shapiro uses SNePS&amp;lt;ref&amp;gt;S. C. Shapiro and The SNePS Implementation Group. SNePS 2.7.1 User’s Manual. Department of Computer Science and Engineering University at Buffalo, The State University of New York, Dec. 2010.&amp;lt;/ref&amp;gt;, a common sense and natural language reasoning system designed with the goal to “have a formal logical language that captured the expressibility of the English language”&amp;lt;ref name=&amp;quot;shapiro_jobs_puzzle&amp;quot; /&amp;gt;. The language has a unique name assumption and set arguments making the encoding simpler and less tedious. On the other hand the lack of support for modus tolens requires rewriting some of the statements in order to solve the puzzle.&lt;br /&gt;
&lt;br /&gt;
The last formalization discussed by Shapiro uses Lparse and Smodles&amp;lt;ref&amp;gt;I. Niemelä, P. Simons, and T. Syrjänen. Smodels: A system for answer set programming. CoRR, cs.AI/0003033, 2000.&amp;lt;/ref&amp;gt; which uses stable model semantics with an extended logic programming syntax. According to Shapiro several features of Lparse/Smodels are simmilar to those of SNePS. This formalization also simplifies the encoding of the puzzle, but according to Schwitter et al. both solutions still present a “considerable conceptual gap between the formal notations and the English statements of the puzzle”&amp;lt;ref name=&amp;quot;schwitter_jobs_puzzle&amp;quot; /&amp;gt;.&lt;br /&gt;
&lt;br /&gt;
Schwitter et al. in their paper &#039;&#039;“The jobs puzzle: Taking on the challenge via controlled natural language processing”&#039;&#039;&amp;lt;ref name=&amp;quot;schwitter_jobs_puzzle&amp;quot; /&amp;gt; present a solution to the jobs puzzle using controlled natural language and a translation to ASP to solve the jobs puzzle in a novel way that stays very close to the English statements of the puzzle and satisfying the challenges posed by Shapiro. To avoid the mismatch between natural and controlled natural languages Schwitter et al. describe the use of a development environment that supports the user to input valid statements according to the rules of the controlled language. A solution using a mathematical, but high level language like B avoids this problems by having a formal and, for most, familiar language used to formalize the problem.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
MACHINE JobsPuzzle&lt;br /&gt;
SETS	&lt;br /&gt;
	P = {Roberta, Thelma, Steve, Pete};&lt;br /&gt;
	J = {chef, guard, nurse, clerk, police, teacher, actor, boxer}&lt;br /&gt;
&lt;br /&gt;
CONSTANTS PEOPLE, JOBS, MALE, FEMALE, HoldsJob, Husband, QualifiedJobs, Golfers&lt;br /&gt;
PROPERTIES&lt;br /&gt;
 /* There are four people: Roberta, Thelma, Steve, and Pete.  */&lt;br /&gt;
 PEOPLE={Roberta, Thelma, Steve, Pete}&lt;br /&gt;
 &amp;amp;&lt;br /&gt;
 /* Implicit assumption, names denote gender */&lt;br /&gt;
 FEMALE={Roberta, Thelma} &amp;amp; MALE={Steve, Pete}&lt;br /&gt;
 /* Among them, they hold eight different jobs.  */&lt;br /&gt;
 &amp;amp;&lt;br /&gt;
 HoldsJob : JOBS --&amp;gt;&amp;gt; PEOPLE&lt;br /&gt;
 /* Each holds exactly two jobs.  */&lt;br /&gt;
 &amp;amp;&lt;br /&gt;
 !x.(x : PEOPLE =&amp;gt; card(HoldsJob|&amp;gt;{x}) = 2)&lt;br /&gt;
 &amp;amp;&lt;br /&gt;
 JOBS = {chef, guard, nurse, clerk, police, teacher, actor, boxer}&lt;br /&gt;
 /* The job of nurse is held by a male.  */&lt;br /&gt;
 &amp;amp; &lt;br /&gt;
 HoldsJob(nurse) : MALE&lt;br /&gt;
 /* Implicit assumption -&amp;gt; see slides (gender specific job-name (actor vs. actress?) */&lt;br /&gt;
 &amp;amp; &lt;br /&gt;
 HoldsJob(actor) : MALE&lt;br /&gt;
 /* The husband of the chef is the clerk.  */&lt;br /&gt;
 &amp;amp;&lt;br /&gt;
 Husband : FEMALE &amp;gt;+&amp;gt; MALE&lt;br /&gt;
 &amp;amp;&lt;br /&gt;
 (HoldsJob(chef), HoldsJob(clerk)) : Husband&lt;br /&gt;
 /* Roberta is not a boxer. */&lt;br /&gt;
 &amp;amp;&lt;br /&gt;
 HoldsJob(boxer) /= Roberta&lt;br /&gt;
 /* Pete has no education past the ninth grade.  */&lt;br /&gt;
 &amp;amp; /* Implicit assumption, these jobs require higher education */&lt;br /&gt;
 QualifiedJobs = {police, teacher, nurse}&lt;br /&gt;
 &amp;amp;&lt;br /&gt;
 Pete /: HoldsJob[QualifiedJobs]&lt;br /&gt;
 /* Roberta, the chef, and the police officer went golfing together.  */&lt;br /&gt;
 &amp;amp; Golfers = {Roberta, HoldsJob(chef), HoldsJob(police)} &amp;amp; card(Golfers) = 3&lt;br /&gt;
END&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&amp;lt;hr /&amp;gt;&lt;/div&gt;</summary>
		<author><name>Bivab</name></author>
	</entry>
	<entry>
		<id>https://prob.hhu.de/w/index.php?title=TheJobsPuzzle&amp;diff=3385</id>
		<title>TheJobsPuzzle</title>
		<link rel="alternate" type="text/html" href="https://prob.hhu.de/w/index.php?title=TheJobsPuzzle&amp;diff=3385"/>
		<updated>2016-02-02T10:47:14Z</updated>

		<summary type="html">&lt;p&gt;Bivab: Bivab moved page TheJobsPuzzle to The Jobs Puzzle&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;#REDIRECT [[The Jobs Puzzle]]&lt;/div&gt;</summary>
		<author><name>Bivab</name></author>
	</entry>
	<entry>
		<id>https://prob.hhu.de/w/index.php?title=The_Jobs_Puzzle&amp;diff=3384</id>
		<title>The Jobs Puzzle</title>
		<link rel="alternate" type="text/html" href="https://prob.hhu.de/w/index.php?title=The_Jobs_Puzzle&amp;diff=3384"/>
		<updated>2016-02-02T10:47:14Z</updated>

		<summary type="html">&lt;p&gt;Bivab: Bivab moved page TheJobsPuzzle to The Jobs Puzzle&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;{{DISPLAYTITLE:The Jobs Puzzle}}&lt;br /&gt;
&lt;br /&gt;
This puzzle was originally published in 1984 by Wos et al. &amp;lt;ref&amp;gt;L. Wos, R. Overbeek, E. Lusk, and J. Boyle. Automated Reasoning: Introduction and Applications. Prentice-Hall, Englewood Cliffs, NJ, 1984.&amp;lt;/ref&amp;gt; as part of a collection of puzzles for automatic reasoners. A reference implementation of the puzzle, by one of the authors of the book, using [http://www.mcs.anl.gov/~wos/mathproblems/jobs.txt OTTER]&amp;lt;ref&amp;gt;W. Mccune. Otter 3.3 reference manual, 2003.&amp;lt;/ref&amp;gt;.&lt;br /&gt;
&lt;br /&gt;
The puzzle consists of eight statements that describe the problem domain and provide some constraints on the elements of the domain. The problem is about a set of people and a set of jobs; the question posed by the puzzle is: who holds which job? The text of the puzzle as presented in &#039;&#039;&amp;quot;The jobs puzzle: A challenge for logical expressibility and automated reasoning.&amp;quot;&#039;&#039;&amp;lt;ref name=&amp;quot;shapiro_jobs_puzzle&amp;quot;&amp;gt;S. C. Shapiro. The jobs puzzle: A challenge for logical expressibility and automated reasoning. In AAAI Spring Symposium: Logical Formalizations of Commonsense Reasoning, 2011.&amp;lt;/ref&amp;gt; is as follows:&lt;br /&gt;
&lt;br /&gt;
* There are four people: Roberta, Thelma, Steve, and Pete.&lt;br /&gt;
* Among them, they hold eight different jobs.&lt;br /&gt;
* Each holds exactly two jobs.&lt;br /&gt;
* The jobs are: chef, guard, nurse, clerk, police officer (gender not implied), teacher, actor, and boxer.&lt;br /&gt;
* The job of nurse is held by a male.&lt;br /&gt;
* The husband of the chef is the clerk.&lt;br /&gt;
* Roberta is not a boxer.&lt;br /&gt;
* Pete has no education past the ninth grade.&lt;br /&gt;
* Roberta, the chef, and the police officer went golfing together.&lt;br /&gt;
&lt;br /&gt;
What makes this puzzle interesting for automatic reasoners, is that not all the information required to solve the puzzle is provided explicitly in the text.&lt;br /&gt;
&lt;br /&gt;
The puzzle can only be solved if certain implicit assumptions about the world are taken into account, such as: the names in the puzzle denote gender or that some of the job names imply the gender of the person that holds it.&lt;br /&gt;
&lt;br /&gt;
== Shapiro’s Challenge ==&lt;br /&gt;
Shapiro&amp;lt;ref name=&amp;quot;shapiro_jobs_puzzle&amp;quot; /&amp;gt;, following the original authors’ remarks, that formalizing the puzzle was at times hard and tedious, identified three challenges posed by the puzzle with regard to automatic reasoners. According to Shapiro, the challenges posed by the jobs puzzle are to:&lt;br /&gt;
&lt;br /&gt;
* formalize it in a non-difficult, non-tedious way&lt;br /&gt;
* formalize it in a way that adheres closely to the English statement of the puzzle&lt;br /&gt;
* have an automated general-purpose commonsense reasoner that can accept that formalization and solve the puzzle quickly.&lt;br /&gt;
&lt;br /&gt;
Any formalization also needs to encode the implicit knowledge used to solve the puzzle for the automatic reasoners while still trying to satisfy the aspects mentioned above. Addressing this challenge makes this puzzle a good case-study for the expressiveness of B to formalize such a problem.&lt;br /&gt;
&lt;br /&gt;
== A Solution to the Jobs Puzzle using B ==&lt;br /&gt;
&lt;br /&gt;
The B encoding of the puzzle uses plain predicate logic, combined with set theory and arithmetic. We will show how this enables a very concise encoding of the problem, staying very close to the natural language requirements. Moreover, the puzzle can be quickly solved using the constraint solving capabilities of ProB. Following the order of the sentences in the puzzle we will discuss one or more possibilities to formalize them using B.&lt;br /&gt;
&lt;br /&gt;
To express &#039;&#039;&amp;quot;There are four people: Roberta, Thelma, Steve, and Pete”&#039;&#039; we define a set of people, that holds the list of names:&lt;br /&gt;
&amp;lt;pre&amp;gt;PEOPLE={&amp;quot;Roberta&amp;quot;, &amp;quot;Thelma&amp;quot;, &amp;quot;Steve&amp;quot;, &amp;quot;Pete&amp;quot;}&amp;lt;/pre&amp;gt;&lt;br /&gt;
We are using strings here to describe the elements of the set. This has the advantage, that the elements of the set are implicitly different.&amp;lt;ref&amp;gt;This encoding allows us to input the puzzle directly into the [http://stups.hhu.de/ProB/index.php5/ProB_Logic_Calculator ProB Console].&amp;lt;/ref&amp;gt; Alternatively, we could use enumerated or deferred sets defined in the SETS section of a B machine.&lt;br /&gt;
As stated above we need some additional information that is not included in the puzzle to solve it. The first bit of information is that the names used in the puzzle imply the gender. In order to express this information we create two sets, MALE and FEMALE which are subsets of PEOPLE and contain the corresponding names.&lt;br /&gt;
&amp;lt;pre&amp;gt;FEMALE={&amp;quot;Roberta&amp;quot;, &amp;quot;Thelma&amp;quot;} &amp;amp; MALE={&amp;quot;Steve&amp;quot;, &amp;quot;Pete&amp;quot;}&amp;lt;/pre&amp;gt;&lt;br /&gt;
The next statement of the puzzle is: &#039;&#039;“among them, they hold eight different jobs”&#039;&#039;. This can be formalized in B using a function that maps from a job to the corresponding person that holds this job using a total surjection from JOBS to PEOPLE:&lt;br /&gt;
&amp;lt;pre&amp;gt;HoldsJob : JOBS --&amp;gt;&amp;gt; PEOPLE&amp;lt;/pre&amp;gt;&lt;br /&gt;
Although redundant, as we will see below, to express &#039;&#039;“Among them, they hold eight different jobs”&#039;&#039; we can add the assertion that the cardinality of HoldsJob is 8. This is possible, because in B functions and relations can be treated as sets of pairs, where each pair consists of an element of the domain and the corresponding element from the range of the relation.&lt;br /&gt;
&amp;lt;pre&amp;gt;card(HoldsJob) = 8&amp;lt;/pre&amp;gt;&lt;br /&gt;
Constraining the jobs each person holds, the puzzle states: &#039;&#039;“Each holds exactly two jobs”&#039;&#039;. To express this we use the inverse relation of HoldsJob, it maps a PERSON to the JOBS associated to her. The inverse function or relation is expressed in B using the ~ operator. For readability we assign the inverse of HoldsJob to a variable called JobsOf. JobsOf is in this case is a relation, because, as stated above, each person holds two jobs.&lt;br /&gt;
&amp;lt;pre&amp;gt;JobsOf = HoldsJob~&amp;lt;/pre&amp;gt;&lt;br /&gt;
Because JobsOf is a relation and not a function, in order to read the values, we need to use B’s relational image operator. This operator maps a subset of the domain to a subset of the range, instead of a single value. To read the jobs Steve holds, the relational image of JobsOf is used as shown below:&lt;br /&gt;
&amp;lt;pre&amp;gt;JobsOf[{&amp;quot;Steve&amp;quot;}]&amp;lt;/pre&amp;gt;&lt;br /&gt;
Using the JobsOf relation we can express the third sentence of the puzzle using a universally quantified expression over the set PEOPLE. The Universal quantification operator (∀) is expressed in B using the ! symbol followed by the name of the variable that is quantified. This way of expressing the constraint is close to the original text of the puzzle, saying that the set of jobs each person holds has a cardinality of two.&lt;br /&gt;
&amp;lt;pre&amp;gt;!x.(x : PEOPLE =&amp;gt; card(JobsOf[{x}]) = 2)&amp;lt;/pre&amp;gt;&lt;br /&gt;
The fourth sentence assigns the set of job names to the identifier JOBS. This statement also constraints the cardinality of HoldsJob to 8.&lt;br /&gt;
&amp;lt;pre&amp;gt;JOBS = {&amp;quot;chef&amp;quot;, &amp;quot;guard&amp;quot;, &amp;quot;nurse&amp;quot;, &amp;quot;clerk&amp;quot;, &amp;quot;police&amp;quot;, &amp;quot;teacher&amp;quot;, &amp;quot;actor&amp;quot;, &amp;quot;boxer&amp;quot;}&amp;lt;/pre&amp;gt;&lt;br /&gt;
The following statements further constrain the solution. First &#039;&#039;“The job of nurse is held by a male”&#039;&#039;, which we can express using the HoldsJob function and the set MALE by stating that the element of PEOPLE that HoldsJob(&amp;quot;nurse&amp;quot;) points to is also an element of the set MALE.&lt;br /&gt;
&amp;lt;pre&amp;gt;HoldsJob(&amp;quot;nurse&amp;quot;) : MALE&amp;lt;/pre&amp;gt;&lt;br /&gt;
Additionally, we add the next bit of implicit information, which is that typically a distinction is made between actress and actor, and therefore the job name actor implies that it is held by a male. This information is formalized, similarly as above.&lt;br /&gt;
&amp;lt;pre&amp;gt;HoldsJob(&amp;quot;actor&amp;quot;) : MALE&amp;lt;/pre&amp;gt;&lt;br /&gt;
The next sentence: &#039;&#039;“The husband of the chef is the clerk”&#039;&#039; contains two relevant bits of information, based on another implicit assumption, which is that marriage usually is between one female and one male. With this in mind, we know that the chef is female and the clerk is male. One possibility is to do the inference step manually and encode this as:&lt;br /&gt;
&amp;lt;pre&amp;gt;HoldsJob(&amp;quot;chef&amp;quot;) : FEMALE &amp;amp; HoldsJob(&amp;quot;clerk&amp;quot;) : MALE&amp;lt;/pre&amp;gt;&lt;br /&gt;
Alternatively, and in order to stay closer to the text of the puzzle we can add a function Husband that maps from the set FEMALE to the set MALE as a partial injection. We use a partial function, because we do not assume that all elements of FEMALE map to an element of MALE.&lt;br /&gt;
&amp;lt;pre&amp;gt;Husband : FEMALE &amp;gt;+&amp;gt; MALE&amp;lt;/pre&amp;gt;&lt;br /&gt;
To add the constraint using this function we state that the tuple of the person that holds the job as chef and the person that holds the job as clerk are an element of this function when treated as a set of tuples.&lt;br /&gt;
&amp;lt;pre&amp;gt;(HoldsJob(&amp;quot;chef&amp;quot;), HoldsJob(&amp;quot;clerk&amp;quot;)) : Husband&amp;lt;/pre&amp;gt;&lt;br /&gt;
The next piece of information is that &#039;&#039;“Roberta is not a boxer”&#039;&#039;. Using the JobsOf relation we can express this close to the original sentence, by stating: boxer is not one of Roberta’s jobs. This can be expressed using the relational image of the JobsOf relation:&lt;br /&gt;
&amp;lt;pre&amp;gt;&amp;quot;boxer&amp;quot; /: JobsOf[{&amp;quot;Roberta&amp;quot;}]&amp;lt;/pre&amp;gt;&lt;br /&gt;
The next sentence provides the information that &#039;&#039;“Pete has no education past the ninth grade”&#039;&#039;. This again needs some contextual information to be useful in order to find a solution for the puzzle&amp;lt;ref name=&amp;quot;shapiro_jobs_puzzle&amp;quot; /&amp;gt;. To interpret this sentence we need to know that the jobs of police officer, teacher and nurse require an education of more than 9 years. Hence the information we get is that Pete does not hold any of these jobs. Doing this inference step we could, as above, state something along the lines of HoldsJob(&amp;quot;police&amp;quot;) /= &amp;quot;Pete&amp;quot;, etc. for each of the jobs. The solution used here, tries to avoid doing the manual inference step. Although we still need to provide the information needed to draw the conclusion that Pete does not hold any of these three jobs. We create a set of those jobs that need higher education:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;QualifiedJobs = {&amp;quot;police&amp;quot;, &amp;quot;teacher&amp;quot;, &amp;quot;nurse&amp;quot;}&amp;lt;/pre&amp;gt;&lt;br /&gt;
Using the relational image operator we can now say that Pete is not among the ones that hold any of these jobs. The relational image can be used to get the set of items in the range of function or relation for all elements of a subset of the domain.&lt;br /&gt;
&amp;lt;pre&amp;gt;&amp;quot;Pete&amp;quot; /: HoldsJob[QualifiedJobs]&amp;lt;/pre&amp;gt;&lt;br /&gt;
Finally, the last piece of information is that &#039;&#039;“Roberta, the chef, and the police officer went golfing together”&#039;&#039;, from this we can infer that Roberta, the chef, and the police officer are all different persons. We write this in B stating that the set of Roberta, the person that holds the job as chef, and the person that is the police officer has cardinality 3, using a variable for the set for readability.&lt;br /&gt;
&amp;lt;pre&amp;gt;Golfers = {&amp;quot;Roberta&amp;quot;, HoldsJob(&amp;quot;chef&amp;quot;), HoldsJob(&amp;quot;police&amp;quot;)} &amp;amp; card(Golfers) = 3&amp;lt;/pre&amp;gt;&lt;br /&gt;
By building the conjunction of all these statements, ProB searches for a valid assignment to the variables introduced that satisfies all constraints, generating a valid solution that answers the question posed by the puzzle “who holds which job? ” in form of the HoldsJob function. The solution found by ProB is depicted below.&lt;br /&gt;
&lt;br /&gt;
[[File:JobsPuzzleSolutionAsGraph.png|border|center|The solution to the Jobs puzzle, depicted graphically]]&lt;br /&gt;
&lt;br /&gt;
This satisfies, in our eyes, the challenges identified by Shapiro. In the sense that the formalization, is not difficult, although it uses a formal language. The elements of this language are familiar to most programmers or mathematicians and it builds upon well understood and widely known concepts. The brevity of the solution shows that using an expressive high-level language it is possible to encode the puzzle without having tedious tasks in order to be able to solve the puzzle at all.&lt;br /&gt;
The encoding of the sentences follows the structure of the English statements very closely. We avoid the use of quantification wherever possible and use set based expressions that relate closely to the puzzle. We are able to encode the additional knowledge needed to solve puzzle in a straight forward way, that is also close to how this would be expressed as statements in English. Lastly it is worth to note that the formalization of “Each holds exactly two jobs” is the one furthest away from the English expression, using quantifications and set cardinality expressions.&lt;br /&gt;
&lt;br /&gt;
== Related Work ==&lt;br /&gt;
In his paper Shapiro discusses several formalizations of the puzzle with regard to the identified challenges. A further formalization using controlled natural language and answer set programming (ASP) was presented in &#039;&#039;&amp;quot;The jobs puzzle: Taking on the challenge via controlled natural language processing&amp;quot;&#039;&#039; by Schwitter et al.&amp;lt;ref name=&amp;quot;schwitter_jobs_puzzle&amp;quot;&amp;gt;R. Schwitter. The jobs puzzle: Taking on the challenge via controlled natural language processing. Theory and Practice of Logic Programming, 13:487–501, 7 2013.&amp;lt;/ref&amp;gt;&lt;br /&gt;
&lt;br /&gt;
The first of the solutions discussed by Shapiro is a solution from the TPTP website, encoded as a set of clauses and translated to FOL. The main disadvantages of this encoding is that it requires 64 clauses to encode the problem and many of them are needed to define equality among jobs and names. This is in contrast to our B encoding using either enumerated sets or strings, where all elements are implicitly assumed to be different. Thus the user does not have to define the concept of equality for simple atoms.&lt;br /&gt;
&lt;br /&gt;
The second solution discussed by Shapiro uses SNePS&amp;lt;ref&amp;gt;S. C. Shapiro and The SNePS Implementation Group. SNePS 2.7.1 User’s Manual. Department of Computer Science and Engineering University at Buffalo, The State University of New York, Dec. 2010.&amp;lt;/ref&amp;gt;, a common sense and natural language reasoning system designed with the goal to “have a formal logical language that captured the expressibility of the English language”&amp;lt;ref name=&amp;quot;shapiro_jobs_puzzle&amp;quot; /&amp;gt;. The language has a unique name assumption and set arguments making the encoding simpler and less tedious. On the other hand the lack of support for modus tolens requires rewriting some of the statements in order to solve the puzzle.&lt;br /&gt;
&lt;br /&gt;
The last formalization discussed by Shapiro uses Lparse and Smodles&amp;lt;ref&amp;gt;I. Niemelä, P. Simons, and T. Syrjänen. Smodels: A system for answer set programming. CoRR, cs.AI/0003033, 2000.&amp;lt;/ref&amp;gt; which uses stable model semantics with an extended logic programming syntax. According to Shapiro several features of Lparse/Smodels are simmilar to those of SNePS. This formalization also simplifies the encoding of the puzzle, but according to Schwitter et al. both solutions still present a “considerable conceptual gap between the formal notations and the English statements of the puzzle”&amp;lt;ref name=&amp;quot;schwitter_jobs_puzzle&amp;quot; /&amp;gt;.&lt;br /&gt;
&lt;br /&gt;
Schwitter et al. in their paper &#039;&#039;“The jobs puzzle: Taking on the challenge via controlled natural language processing”&#039;&#039;&amp;lt;ref name=&amp;quot;schwitter_jobs_puzzle&amp;quot; /&amp;gt; present a solution to the jobs puzzle using controlled natural language and a translation to ASP to solve the jobs puzzle in a novel way that stays very close to the English statements of the puzzle and satisfying the challenges posed by Shapiro. To avoid the mismatch between natural and controlled natural languages Schwitter et al. describe the use of a development environment that supports the user to input valid statements according to the rules of the controlled language. A solution using a mathematical, but high level language like B avoids this problems by having a formal and, for most, familiar language used to formalize the problem.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
MACHINE JobsPuzzle&lt;br /&gt;
SETS	&lt;br /&gt;
	P = {Roberta, Thelma, Steve, Pete};&lt;br /&gt;
	J = {chef, guard, nurse, clerk, police, teacher, actor, boxer}&lt;br /&gt;
&lt;br /&gt;
CONSTANTS PEOPLE, JOBS, MALE, FEMALE, HoldsJob, Husband, QualifiedJobs, Golfers&lt;br /&gt;
PROPERTIES&lt;br /&gt;
 /* There are four people: Roberta, Thelma, Steve, and Pete.  */&lt;br /&gt;
 PEOPLE={Roberta, Thelma, Steve, Pete}&lt;br /&gt;
 &amp;amp;&lt;br /&gt;
 /* Implicit assumption, names denote gender */&lt;br /&gt;
 FEMALE={Roberta, Thelma} &amp;amp; MALE={Steve, Pete}&lt;br /&gt;
 /* Among them, they hold eight different jobs.  */&lt;br /&gt;
 &amp;amp;&lt;br /&gt;
 HoldsJob : JOBS --&amp;gt;&amp;gt; PEOPLE&lt;br /&gt;
 /* Each holds exactly two jobs.  */&lt;br /&gt;
 &amp;amp;&lt;br /&gt;
 !x.(x : PEOPLE =&amp;gt; card(HoldsJob|&amp;gt;{x}) = 2)&lt;br /&gt;
 &amp;amp;&lt;br /&gt;
 JOBS = {chef, guard, nurse, clerk, police, teacher, actor, boxer}&lt;br /&gt;
 /* The job of nurse is held by a male.  */&lt;br /&gt;
 &amp;amp; &lt;br /&gt;
 HoldsJob(nurse) : MALE&lt;br /&gt;
 /* Implicit assumption -&amp;gt; see slides (gender specific job-name (actor vs. actress?) */&lt;br /&gt;
 &amp;amp; &lt;br /&gt;
 HoldsJob(actor) : MALE&lt;br /&gt;
 /* The husband of the chef is the clerk.  */&lt;br /&gt;
 &amp;amp;&lt;br /&gt;
 Husband : FEMALE &amp;gt;+&amp;gt; MALE&lt;br /&gt;
 &amp;amp;&lt;br /&gt;
 (HoldsJob(chef), HoldsJob(clerk)) : Husband&lt;br /&gt;
 /* Roberta is not a boxer. */&lt;br /&gt;
 &amp;amp;&lt;br /&gt;
 HoldsJob(boxer) /= Roberta&lt;br /&gt;
 /* Pete has no education past the ninth grade.  */&lt;br /&gt;
 &amp;amp; /* Implicit assumption, these jobs require higher education */&lt;br /&gt;
 QualifiedJobs = {police, teacher, nurse}&lt;br /&gt;
 &amp;amp;&lt;br /&gt;
 Pete /: HoldsJob[QualifiedJobs]&lt;br /&gt;
 /* Roberta, the chef, and the police officer went golfing together.  */&lt;br /&gt;
 &amp;amp; Golfers = {Roberta, HoldsJob(chef), HoldsJob(police)} &amp;amp; card(Golfers) = 3&lt;br /&gt;
END&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&amp;lt;hr /&amp;gt;&lt;/div&gt;</summary>
		<author><name>Bivab</name></author>
	</entry>
	<entry>
		<id>https://prob.hhu.de/w/index.php?title=The_Jobs_Puzzle&amp;diff=3383</id>
		<title>The Jobs Puzzle</title>
		<link rel="alternate" type="text/html" href="https://prob.hhu.de/w/index.php?title=The_Jobs_Puzzle&amp;diff=3383"/>
		<updated>2016-02-02T10:46:50Z</updated>

		<summary type="html">&lt;p&gt;Bivab: &lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;{{DISPLAYTITLE:The Jobs Puzzle}}&lt;br /&gt;
&lt;br /&gt;
This puzzle was originally published in 1984 by Wos et al. &amp;lt;ref&amp;gt;L. Wos, R. Overbeek, E. Lusk, and J. Boyle. Automated Reasoning: Introduction and Applications. Prentice-Hall, Englewood Cliffs, NJ, 1984.&amp;lt;/ref&amp;gt; as part of a collection of puzzles for automatic reasoners. A reference implementation of the puzzle, by one of the authors of the book, using [http://www.mcs.anl.gov/~wos/mathproblems/jobs.txt OTTER]&amp;lt;ref&amp;gt;W. Mccune. Otter 3.3 reference manual, 2003.&amp;lt;/ref&amp;gt;.&lt;br /&gt;
&lt;br /&gt;
The puzzle consists of eight statements that describe the problem domain and provide some constraints on the elements of the domain. The problem is about a set of people and a set of jobs; the question posed by the puzzle is: who holds which job? The text of the puzzle as presented in &#039;&#039;&amp;quot;The jobs puzzle: A challenge for logical expressibility and automated reasoning.&amp;quot;&#039;&#039;&amp;lt;ref name=&amp;quot;shapiro_jobs_puzzle&amp;quot;&amp;gt;S. C. Shapiro. The jobs puzzle: A challenge for logical expressibility and automated reasoning. In AAAI Spring Symposium: Logical Formalizations of Commonsense Reasoning, 2011.&amp;lt;/ref&amp;gt; is as follows:&lt;br /&gt;
&lt;br /&gt;
* There are four people: Roberta, Thelma, Steve, and Pete.&lt;br /&gt;
* Among them, they hold eight different jobs.&lt;br /&gt;
* Each holds exactly two jobs.&lt;br /&gt;
* The jobs are: chef, guard, nurse, clerk, police officer (gender not implied), teacher, actor, and boxer.&lt;br /&gt;
* The job of nurse is held by a male.&lt;br /&gt;
* The husband of the chef is the clerk.&lt;br /&gt;
* Roberta is not a boxer.&lt;br /&gt;
* Pete has no education past the ninth grade.&lt;br /&gt;
* Roberta, the chef, and the police officer went golfing together.&lt;br /&gt;
&lt;br /&gt;
What makes this puzzle interesting for automatic reasoners, is that not all the information required to solve the puzzle is provided explicitly in the text.&lt;br /&gt;
&lt;br /&gt;
The puzzle can only be solved if certain implicit assumptions about the world are taken into account, such as: the names in the puzzle denote gender or that some of the job names imply the gender of the person that holds it.&lt;br /&gt;
&lt;br /&gt;
== Shapiro’s Challenge ==&lt;br /&gt;
Shapiro&amp;lt;ref name=&amp;quot;shapiro_jobs_puzzle&amp;quot; /&amp;gt;, following the original authors’ remarks, that formalizing the puzzle was at times hard and tedious, identified three challenges posed by the puzzle with regard to automatic reasoners. According to Shapiro, the challenges posed by the jobs puzzle are to:&lt;br /&gt;
&lt;br /&gt;
* formalize it in a non-difficult, non-tedious way&lt;br /&gt;
* formalize it in a way that adheres closely to the English statement of the puzzle&lt;br /&gt;
* have an automated general-purpose commonsense reasoner that can accept that formalization and solve the puzzle quickly.&lt;br /&gt;
&lt;br /&gt;
Any formalization also needs to encode the implicit knowledge used to solve the puzzle for the automatic reasoners while still trying to satisfy the aspects mentioned above. Addressing this challenge makes this puzzle a good case-study for the expressiveness of B to formalize such a problem.&lt;br /&gt;
&lt;br /&gt;
== A Solution to the Jobs Puzzle using B ==&lt;br /&gt;
&lt;br /&gt;
The B encoding of the puzzle uses plain predicate logic, combined with set theory and arithmetic. We will show how this enables a very concise encoding of the problem, staying very close to the natural language requirements. Moreover, the puzzle can be quickly solved using the constraint solving capabilities of ProB. Following the order of the sentences in the puzzle we will discuss one or more possibilities to formalize them using B.&lt;br /&gt;
&lt;br /&gt;
To express &#039;&#039;&amp;quot;There are four people: Roberta, Thelma, Steve, and Pete”&#039;&#039; we define a set of people, that holds the list of names:&lt;br /&gt;
&amp;lt;pre&amp;gt;PEOPLE={&amp;quot;Roberta&amp;quot;, &amp;quot;Thelma&amp;quot;, &amp;quot;Steve&amp;quot;, &amp;quot;Pete&amp;quot;}&amp;lt;/pre&amp;gt;&lt;br /&gt;
We are using strings here to describe the elements of the set. This has the advantage, that the elements of the set are implicitly different.&amp;lt;ref&amp;gt;This encoding allows us to input the puzzle directly into the [http://stups.hhu.de/ProB/index.php5/ProB_Logic_Calculator ProB Console].&amp;lt;/ref&amp;gt; Alternatively, we could use enumerated or deferred sets defined in the SETS section of a B machine.&lt;br /&gt;
As stated above we need some additional information that is not included in the puzzle to solve it. The first bit of information is that the names used in the puzzle imply the gender. In order to express this information we create two sets, MALE and FEMALE which are subsets of PEOPLE and contain the corresponding names.&lt;br /&gt;
&amp;lt;pre&amp;gt;FEMALE={&amp;quot;Roberta&amp;quot;, &amp;quot;Thelma&amp;quot;} &amp;amp; MALE={&amp;quot;Steve&amp;quot;, &amp;quot;Pete&amp;quot;}&amp;lt;/pre&amp;gt;&lt;br /&gt;
The next statement of the puzzle is: &#039;&#039;“among them, they hold eight different jobs”&#039;&#039;. This can be formalized in B using a function that maps from a job to the corresponding person that holds this job using a total surjection from JOBS to PEOPLE:&lt;br /&gt;
&amp;lt;pre&amp;gt;HoldsJob : JOBS --&amp;gt;&amp;gt; PEOPLE&amp;lt;/pre&amp;gt;&lt;br /&gt;
Although redundant, as we will see below, to express &#039;&#039;“Among them, they hold eight different jobs”&#039;&#039; we can add the assertion that the cardinality of HoldsJob is 8. This is possible, because in B functions and relations can be treated as sets of pairs, where each pair consists of an element of the domain and the corresponding element from the range of the relation.&lt;br /&gt;
&amp;lt;pre&amp;gt;card(HoldsJob) = 8&amp;lt;/pre&amp;gt;&lt;br /&gt;
Constraining the jobs each person holds, the puzzle states: &#039;&#039;“Each holds exactly two jobs”&#039;&#039;. To express this we use the inverse relation of HoldsJob, it maps a PERSON to the JOBS associated to her. The inverse function or relation is expressed in B using the ~ operator. For readability we assign the inverse of HoldsJob to a variable called JobsOf. JobsOf is in this case is a relation, because, as stated above, each person holds two jobs.&lt;br /&gt;
&amp;lt;pre&amp;gt;JobsOf = HoldsJob~&amp;lt;/pre&amp;gt;&lt;br /&gt;
Because JobsOf is a relation and not a function, in order to read the values, we need to use B’s relational image operator. This operator maps a subset of the domain to a subset of the range, instead of a single value. To read the jobs Steve holds, the relational image of JobsOf is used as shown below:&lt;br /&gt;
&amp;lt;pre&amp;gt;JobsOf[{&amp;quot;Steve&amp;quot;}]&amp;lt;/pre&amp;gt;&lt;br /&gt;
Using the JobsOf relation we can express the third sentence of the puzzle using a universally quantified expression over the set PEOPLE. The Universal quantification operator (∀) is expressed in B using the ! symbol followed by the name of the variable that is quantified. This way of expressing the constraint is close to the original text of the puzzle, saying that the set of jobs each person holds has a cardinality of two.&lt;br /&gt;
&amp;lt;pre&amp;gt;!x.(x : PEOPLE =&amp;gt; card(JobsOf[{x}]) = 2)&amp;lt;/pre&amp;gt;&lt;br /&gt;
The fourth sentence assigns the set of job names to the identifier JOBS. This statement also constraints the cardinality of HoldsJob to 8.&lt;br /&gt;
&amp;lt;pre&amp;gt;JOBS = {&amp;quot;chef&amp;quot;, &amp;quot;guard&amp;quot;, &amp;quot;nurse&amp;quot;, &amp;quot;clerk&amp;quot;, &amp;quot;police&amp;quot;, &amp;quot;teacher&amp;quot;, &amp;quot;actor&amp;quot;, &amp;quot;boxer&amp;quot;}&amp;lt;/pre&amp;gt;&lt;br /&gt;
The following statements further constrain the solution. First &#039;&#039;“The job of nurse is held by a male”&#039;&#039;, which we can express using the HoldsJob function and the set MALE by stating that the element of PEOPLE that HoldsJob(&amp;quot;nurse&amp;quot;) points to is also an element of the set MALE.&lt;br /&gt;
&amp;lt;pre&amp;gt;HoldsJob(&amp;quot;nurse&amp;quot;) : MALE&amp;lt;/pre&amp;gt;&lt;br /&gt;
Additionally, we add the next bit of implicit information, which is that typically a distinction is made between actress and actor, and therefore the job name actor implies that it is held by a male. This information is formalized, similarly as above.&lt;br /&gt;
&amp;lt;pre&amp;gt;HoldsJob(&amp;quot;actor&amp;quot;) : MALE&amp;lt;/pre&amp;gt;&lt;br /&gt;
The next sentence: &#039;&#039;“The husband of the chef is the clerk”&#039;&#039; contains two relevant bits of information, based on another implicit assumption, which is that marriage usually is between one female and one male. With this in mind, we know that the chef is female and the clerk is male. One possibility is to do the inference step manually and encode this as:&lt;br /&gt;
&amp;lt;pre&amp;gt;HoldsJob(&amp;quot;chef&amp;quot;) : FEMALE &amp;amp; HoldsJob(&amp;quot;clerk&amp;quot;) : MALE&amp;lt;/pre&amp;gt;&lt;br /&gt;
Alternatively, and in order to stay closer to the text of the puzzle we can add a function Husband that maps from the set FEMALE to the set MALE as a partial injection. We use a partial function, because we do not assume that all elements of FEMALE map to an element of MALE.&lt;br /&gt;
&amp;lt;pre&amp;gt;Husband : FEMALE &amp;gt;+&amp;gt; MALE&amp;lt;/pre&amp;gt;&lt;br /&gt;
To add the constraint using this function we state that the tuple of the person that holds the job as chef and the person that holds the job as clerk are an element of this function when treated as a set of tuples.&lt;br /&gt;
&amp;lt;pre&amp;gt;(HoldsJob(&amp;quot;chef&amp;quot;), HoldsJob(&amp;quot;clerk&amp;quot;)) : Husband&amp;lt;/pre&amp;gt;&lt;br /&gt;
The next piece of information is that &#039;&#039;“Roberta is not a boxer”&#039;&#039;. Using the JobsOf relation we can express this close to the original sentence, by stating: boxer is not one of Roberta’s jobs. This can be expressed using the relational image of the JobsOf relation:&lt;br /&gt;
&amp;lt;pre&amp;gt;&amp;quot;boxer&amp;quot; /: JobsOf[{&amp;quot;Roberta&amp;quot;}]&amp;lt;/pre&amp;gt;&lt;br /&gt;
The next sentence provides the information that &#039;&#039;“Pete has no education past the ninth grade”&#039;&#039;. This again needs some contextual information to be useful in order to find a solution for the puzzle&amp;lt;ref name=&amp;quot;shapiro_jobs_puzzle&amp;quot; /&amp;gt;. To interpret this sentence we need to know that the jobs of police officer, teacher and nurse require an education of more than 9 years. Hence the information we get is that Pete does not hold any of these jobs. Doing this inference step we could, as above, state something along the lines of HoldsJob(&amp;quot;police&amp;quot;) /= &amp;quot;Pete&amp;quot;, etc. for each of the jobs. The solution used here, tries to avoid doing the manual inference step. Although we still need to provide the information needed to draw the conclusion that Pete does not hold any of these three jobs. We create a set of those jobs that need higher education:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;QualifiedJobs = {&amp;quot;police&amp;quot;, &amp;quot;teacher&amp;quot;, &amp;quot;nurse&amp;quot;}&amp;lt;/pre&amp;gt;&lt;br /&gt;
Using the relational image operator we can now say that Pete is not among the ones that hold any of these jobs. The relational image can be used to get the set of items in the range of function or relation for all elements of a subset of the domain.&lt;br /&gt;
&amp;lt;pre&amp;gt;&amp;quot;Pete&amp;quot; /: HoldsJob[QualifiedJobs]&amp;lt;/pre&amp;gt;&lt;br /&gt;
Finally, the last piece of information is that &#039;&#039;“Roberta, the chef, and the police officer went golfing together”&#039;&#039;, from this we can infer that Roberta, the chef, and the police officer are all different persons. We write this in B stating that the set of Roberta, the person that holds the job as chef, and the person that is the police officer has cardinality 3, using a variable for the set for readability.&lt;br /&gt;
&amp;lt;pre&amp;gt;Golfers = {&amp;quot;Roberta&amp;quot;, HoldsJob(&amp;quot;chef&amp;quot;), HoldsJob(&amp;quot;police&amp;quot;)} &amp;amp; card(Golfers) = 3&amp;lt;/pre&amp;gt;&lt;br /&gt;
By building the conjunction of all these statements, ProB searches for a valid assignment to the variables introduced that satisfies all constraints, generating a valid solution that answers the question posed by the puzzle “who holds which job? ” in form of the HoldsJob function. The solution found by ProB is depicted below.&lt;br /&gt;
&lt;br /&gt;
[[File:JobsPuzzleSolutionAsGraph.png|border|center|The solution to the Jobs puzzle, depicted graphically]]&lt;br /&gt;
&lt;br /&gt;
This satisfies, in our eyes, the challenges identified by Shapiro. In the sense that the formalization, is not difficult, although it uses a formal language. The elements of this language are familiar to most programmers or mathematicians and it builds upon well understood and widely known concepts. The brevity of the solution shows that using an expressive high-level language it is possible to encode the puzzle without having tedious tasks in order to be able to solve the puzzle at all.&lt;br /&gt;
The encoding of the sentences follows the structure of the English statements very closely. We avoid the use of quantification wherever possible and use set based expressions that relate closely to the puzzle. We are able to encode the additional knowledge needed to solve puzzle in a straight forward way, that is also close to how this would be expressed as statements in English. Lastly it is worth to note that the formalization of “Each holds exactly two jobs” is the one furthest away from the English expression, using quantifications and set cardinality expressions.&lt;br /&gt;
&lt;br /&gt;
== Related Work ==&lt;br /&gt;
In his paper Shapiro discusses several formalizations of the puzzle with regard to the identified challenges. A further formalization using controlled natural language and answer set programming (ASP) was presented in &#039;&#039;&amp;quot;The jobs puzzle: Taking on the challenge via controlled natural language processing&amp;quot;&#039;&#039; by Schwitter et al.&amp;lt;ref name=&amp;quot;schwitter_jobs_puzzle&amp;quot;&amp;gt;R. Schwitter. The jobs puzzle: Taking on the challenge via controlled natural language processing. Theory and Practice of Logic Programming, 13:487–501, 7 2013.&amp;lt;/ref&amp;gt;&lt;br /&gt;
&lt;br /&gt;
The first of the solutions discussed by Shapiro is a solution from the TPTP website, encoded as a set of clauses and translated to FOL. The main disadvantages of this encoding is that it requires 64 clauses to encode the problem and many of them are needed to define equality among jobs and names. This is in contrast to our B encoding using either enumerated sets or strings, where all elements are implicitly assumed to be different. Thus the user does not have to define the concept of equality for simple atoms.&lt;br /&gt;
&lt;br /&gt;
The second solution discussed by Shapiro uses SNePS&amp;lt;ref&amp;gt;S. C. Shapiro and The SNePS Implementation Group. SNePS 2.7.1 User’s Manual. Department of Computer Science and Engineering University at Buffalo, The State University of New York, Dec. 2010.&amp;lt;/ref&amp;gt;, a common sense and natural language reasoning system designed with the goal to “have a formal logical language that captured the expressibility of the English language”&amp;lt;ref name=&amp;quot;shapiro_jobs_puzzle&amp;quot; /&amp;gt;. The language has a unique name assumption and set arguments making the encoding simpler and less tedious. On the other hand the lack of support for modus tolens requires rewriting some of the statements in order to solve the puzzle.&lt;br /&gt;
&lt;br /&gt;
The last formalization discussed by Shapiro uses Lparse and Smodles&amp;lt;ref&amp;gt;I. Niemelä, P. Simons, and T. Syrjänen. Smodels: A system for answer set programming. CoRR, cs.AI/0003033, 2000.&amp;lt;/ref&amp;gt; which uses stable model semantics with an extended logic programming syntax. According to Shapiro several features of Lparse/Smodels are simmilar to those of SNePS. This formalization also simplifies the encoding of the puzzle, but according to Schwitter et al. both solutions still present a “considerable conceptual gap between the formal notations and the English statements of the puzzle”&amp;lt;ref name=&amp;quot;schwitter_jobs_puzzle&amp;quot; /&amp;gt;.&lt;br /&gt;
&lt;br /&gt;
Schwitter et al. in their paper &#039;&#039;“The jobs puzzle: Taking on the challenge via controlled natural language processing”&#039;&#039;&amp;lt;ref name=&amp;quot;schwitter_jobs_puzzle&amp;quot; /&amp;gt; present a solution to the jobs puzzle using controlled natural language and a translation to ASP to solve the jobs puzzle in a novel way that stays very close to the English statements of the puzzle and satisfying the challenges posed by Shapiro. To avoid the mismatch between natural and controlled natural languages Schwitter et al. describe the use of a development environment that supports the user to input valid statements according to the rules of the controlled language. A solution using a mathematical, but high level language like B avoids this problems by having a formal and, for most, familiar language used to formalize the problem.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
MACHINE JobsPuzzle&lt;br /&gt;
SETS	&lt;br /&gt;
	P = {Roberta, Thelma, Steve, Pete};&lt;br /&gt;
	J = {chef, guard, nurse, clerk, police, teacher, actor, boxer}&lt;br /&gt;
&lt;br /&gt;
CONSTANTS PEOPLE, JOBS, MALE, FEMALE, HoldsJob, Husband, QualifiedJobs, Golfers&lt;br /&gt;
PROPERTIES&lt;br /&gt;
 /* There are four people: Roberta, Thelma, Steve, and Pete.  */&lt;br /&gt;
 PEOPLE={Roberta, Thelma, Steve, Pete}&lt;br /&gt;
 &amp;amp;&lt;br /&gt;
 /* Implicit assumption, names denote gender */&lt;br /&gt;
 FEMALE={Roberta, Thelma} &amp;amp; MALE={Steve, Pete}&lt;br /&gt;
 /* Among them, they hold eight different jobs.  */&lt;br /&gt;
 &amp;amp;&lt;br /&gt;
 HoldsJob : JOBS --&amp;gt;&amp;gt; PEOPLE&lt;br /&gt;
 /* Each holds exactly two jobs.  */&lt;br /&gt;
 &amp;amp;&lt;br /&gt;
 !x.(x : PEOPLE =&amp;gt; card(HoldsJob|&amp;gt;{x}) = 2)&lt;br /&gt;
 &amp;amp;&lt;br /&gt;
 JOBS = {chef, guard, nurse, clerk, police, teacher, actor, boxer}&lt;br /&gt;
 /* The job of nurse is held by a male.  */&lt;br /&gt;
 &amp;amp; &lt;br /&gt;
 HoldsJob(nurse) : MALE&lt;br /&gt;
 /* Implicit assumption -&amp;gt; see slides (gender specific job-name (actor vs. actress?) */&lt;br /&gt;
 &amp;amp; &lt;br /&gt;
 HoldsJob(actor) : MALE&lt;br /&gt;
 /* The husband of the chef is the clerk.  */&lt;br /&gt;
 &amp;amp;&lt;br /&gt;
 Husband : FEMALE &amp;gt;+&amp;gt; MALE&lt;br /&gt;
 &amp;amp;&lt;br /&gt;
 (HoldsJob(chef), HoldsJob(clerk)) : Husband&lt;br /&gt;
 /* Roberta is not a boxer. */&lt;br /&gt;
 &amp;amp;&lt;br /&gt;
 HoldsJob(boxer) /= Roberta&lt;br /&gt;
 /* Pete has no education past the ninth grade.  */&lt;br /&gt;
 &amp;amp; /* Implicit assumption, these jobs require higher education */&lt;br /&gt;
 QualifiedJobs = {police, teacher, nurse}&lt;br /&gt;
 &amp;amp;&lt;br /&gt;
 Pete /: HoldsJob[QualifiedJobs]&lt;br /&gt;
 /* Roberta, the chef, and the police officer went golfing together.  */&lt;br /&gt;
 &amp;amp; Golfers = {Roberta, HoldsJob(chef), HoldsJob(police)} &amp;amp; card(Golfers) = 3&lt;br /&gt;
END&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&amp;lt;hr /&amp;gt;&lt;/div&gt;</summary>
		<author><name>Bivab</name></author>
	</entry>
	<entry>
		<id>https://prob.hhu.de/w/index.php?title=The_Jobs_Puzzle&amp;diff=3382</id>
		<title>The Jobs Puzzle</title>
		<link rel="alternate" type="text/html" href="https://prob.hhu.de/w/index.php?title=The_Jobs_Puzzle&amp;diff=3382"/>
		<updated>2016-02-02T10:36:48Z</updated>

		<summary type="html">&lt;p&gt;Bivab: Created page with &amp;quot;This puzzle was originally published in 1984 by Wos et al. &amp;lt;ref&amp;gt;L. Wos, R. Overbeek, E. Lusk, and J. Boyle. Automated Reasoning: Introduction and Applications. Prentice-Hall,...&amp;quot;&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;This puzzle was originally published in 1984 by Wos et al. &amp;lt;ref&amp;gt;L. Wos, R. Overbeek, E. Lusk, and J. Boyle. Automated Reasoning: Introduction and Applications. Prentice-Hall, Englewood Cliffs, NJ, 1984.&amp;lt;/ref&amp;gt; as part of a collection of puzzles for automatic reasoners. A reference implementation of the puzzle, by one of the authors of the book, using [http://www.mcs.anl.gov/~wos/mathproblems/jobs.txt OTTER]&amp;lt;ref&amp;gt;W. Mccune. Otter 3.3 reference manual, 2003.&amp;lt;/ref&amp;gt;.&lt;br /&gt;
&lt;br /&gt;
The puzzle consists of eight statements that describe the problem domain and provide some constraints on the elements of the domain. The problem is about a set of people and a set of jobs; the question posed by the puzzle is: who holds which job? The text of the puzzle as presented in &#039;&#039;&amp;quot;The jobs puzzle: A challenge for logical expressibility and automated reasoning.&amp;quot;&#039;&#039;&amp;lt;ref name=&amp;quot;shapiro_jobs_puzzle&amp;quot;&amp;gt;S. C. Shapiro. The jobs puzzle: A challenge for logical expressibility and automated reasoning. In AAAI Spring Symposium: Logical Formalizations of Commonsense Reasoning, 2011.&amp;lt;/ref&amp;gt; is as follows:&lt;br /&gt;
&lt;br /&gt;
* There are four people: Roberta, Thelma, Steve, and Pete.&lt;br /&gt;
* Among them, they hold eight different jobs.&lt;br /&gt;
* Each holds exactly two jobs.&lt;br /&gt;
* The jobs are: chef, guard, nurse, clerk, police officer (gender not implied), teacher, actor, and boxer.&lt;br /&gt;
* The job of nurse is held by a male.&lt;br /&gt;
* The husband of the chef is the clerk.&lt;br /&gt;
* Roberta is not a boxer.&lt;br /&gt;
* Pete has no education past the ninth grade.&lt;br /&gt;
* Roberta, the chef, and the police officer went golfing together.&lt;br /&gt;
&lt;br /&gt;
What makes this puzzle interesting for automatic reasoners, is that not all the information required to solve the puzzle is provided explicitly in the text.&lt;br /&gt;
&lt;br /&gt;
The puzzle can only be solved if certain implicit assumptions about the world are taken into account, such as: the names in the puzzle denote gender or that some of the job names imply the gender of the person that holds it.&lt;br /&gt;
&lt;br /&gt;
== Shapiro’s Challenge ==&lt;br /&gt;
Shapiro&amp;lt;ref name=&amp;quot;shapiro_jobs_puzzle&amp;quot; /&amp;gt;, following the original authors’ remarks, that formalizing the puzzle was at times hard and tedious, identified three challenges posed by the puzzle with regard to automatic reasoners. According to Shapiro, the challenges posed by the jobs puzzle are to:&lt;br /&gt;
&lt;br /&gt;
* formalize it in a non-difficult, non-tedious way&lt;br /&gt;
* formalize it in a way that adheres closely to the English statement of the puzzle&lt;br /&gt;
* have an automated general-purpose commonsense reasoner that can accept that formalization and solve the puzzle quickly.&lt;br /&gt;
&lt;br /&gt;
Any formalization also needs to encode the implicit knowledge used to solve the puzzle for the automatic reasoners while still trying to satisfy the aspects mentioned above. Addressing this challenge makes this puzzle a good case-study for the expressiveness of B to formalize such a problem.&lt;br /&gt;
&lt;br /&gt;
== A Solution to the Jobs Puzzle using B ==&lt;br /&gt;
&lt;br /&gt;
The B encoding of the puzzle uses plain predicate logic, combined with set theory and arithmetic. We will show how this enables a very concise encoding of the problem, staying very close to the natural language requirements. Moreover, the puzzle can be quickly solved using the constraint solving capabilities of ProB. Following the order of the sentences in the puzzle we will discuss one or more possibilities to formalize them using B.&lt;br /&gt;
&lt;br /&gt;
To express &#039;&#039;&amp;quot;There are four people: Roberta, Thelma, Steve, and Pete”&#039;&#039; we define a set of people, that holds the list of names:&lt;br /&gt;
&amp;lt;pre&amp;gt;PEOPLE={&amp;quot;Roberta&amp;quot;, &amp;quot;Thelma&amp;quot;, &amp;quot;Steve&amp;quot;, &amp;quot;Pete&amp;quot;}&amp;lt;/pre&amp;gt;&lt;br /&gt;
We are using strings here to describe the elements of the set. This has the advantage, that the elements of the set are implicitly different.&amp;lt;ref&amp;gt;This encoding allows us to input the puzzle directly into the [http://stups.hhu.de/ProB/index.php5/ProB_Logic_Calculator ProB Console].&amp;lt;/ref&amp;gt; Alternatively, we could use enumerated or deferred sets defined in the SETS section of a B machine.&lt;br /&gt;
As stated above we need some additional information that is not included in the puzzle to solve it. The first bit of information is that the names used in the puzzle imply the gender. In order to express this information we create two sets, MALE and FEMALE which are subsets of PEOPLE and contain the corresponding names.&lt;br /&gt;
&amp;lt;pre&amp;gt;FEMALE={&amp;quot;Roberta&amp;quot;, &amp;quot;Thelma&amp;quot;} &amp;amp; MALE={&amp;quot;Steve&amp;quot;, &amp;quot;Pete&amp;quot;}&amp;lt;/pre&amp;gt;&lt;br /&gt;
The next statement of the puzzle is: &#039;&#039;“among them, they hold eight different jobs”&#039;&#039;. This can be formalized in B using a function that maps from a job to the corresponding person that holds this job using a total surjection from JOBS to PEOPLE:&lt;br /&gt;
&amp;lt;pre&amp;gt;HoldsJob : JOBS --&amp;gt;&amp;gt; PEOPLE&amp;lt;/pre&amp;gt;&lt;br /&gt;
Although redundant, as we will see below, to express &#039;&#039;“Among them, they hold eight different jobs”&#039;&#039; we can add the assertion that the cardinality of HoldsJob is 8. This is possible, because in B functions and relations can be treated as sets of pairs, where each pair consists of an element of the domain and the corresponding element from the range of the relation.&lt;br /&gt;
&amp;lt;pre&amp;gt;card(HoldsJob) = 8&amp;lt;/pre&amp;gt;&lt;br /&gt;
Constraining the jobs each person holds, the puzzle states: &#039;&#039;“Each holds exactly two jobs”&#039;&#039;. To express this we use the inverse relation of HoldsJob, it maps a PERSON to the JOBS associated to her. The inverse function or relation is expressed in B using the ~ operator. For readability we assign the inverse of HoldsJob to a variable called JobsOf. JobsOf is in this case is a relation, because, as stated above, each person holds two jobs.&lt;br /&gt;
&amp;lt;pre&amp;gt;JobsOf = HoldsJob~&amp;lt;/pre&amp;gt;&lt;br /&gt;
Because JobsOf is a relation and not a function, in order to read the values, we need to use B’s relational image operator. This operator maps a subset of the domain to a subset of the range, instead of a single value. To read the jobs Steve holds, the relational image of JobsOf is used as shown below:&lt;br /&gt;
&amp;lt;pre&amp;gt;JobsOf[{&amp;quot;Steve&amp;quot;}]&amp;lt;/pre&amp;gt;&lt;br /&gt;
Using the JobsOf relation we can express the third sentence of the puzzle using a universally quantified expression over the set PEOPLE. The Universal quantification operator (∀) is expressed in B using the ! symbol followed by the name of the variable that is quantified. This way of expressing the constraint is close to the original text of the puzzle, saying that the set of jobs each person holds has a cardinality of two.&lt;br /&gt;
&amp;lt;pre&amp;gt;!x.(x : PEOPLE =&amp;gt; card(JobsOf[{x}]) = 2)&amp;lt;/pre&amp;gt;&lt;br /&gt;
The fourth sentence assigns the set of job names to the identifier JOBS. This statement also constraints the cardinality of HoldsJob to 8.&lt;br /&gt;
&amp;lt;pre&amp;gt;JOBS = {&amp;quot;chef&amp;quot;, &amp;quot;guard&amp;quot;, &amp;quot;nurse&amp;quot;, &amp;quot;clerk&amp;quot;, &amp;quot;police&amp;quot;, &amp;quot;teacher&amp;quot;, &amp;quot;actor&amp;quot;, &amp;quot;boxer&amp;quot;}&amp;lt;/pre&amp;gt;&lt;br /&gt;
The following statements further constrain the solution. First &#039;&#039;“The job of nurse is held by a male”&#039;&#039;, which we can express using the HoldsJob function and the set MALE by stating that the element of PEOPLE that HoldsJob(&amp;quot;nurse&amp;quot;) points to is also an element of the set MALE.&lt;br /&gt;
&amp;lt;pre&amp;gt;HoldsJob(&amp;quot;nurse&amp;quot;) : MALE&amp;lt;/pre&amp;gt;&lt;br /&gt;
Additionally, we add the next bit of implicit information, which is that typically a distinction is made between actress and actor, and therefore the job name actor implies that it is held by a male. This information is formalized, similarly as above.&lt;br /&gt;
&amp;lt;pre&amp;gt;HoldsJob(&amp;quot;actor&amp;quot;) : MALE&amp;lt;/pre&amp;gt;&lt;br /&gt;
The next sentence: &#039;&#039;“The husband of the chef is the clerk”&#039;&#039; contains two relevant bits of information, based on another implicit assumption, which is that marriage usually is between one female and one male. With this in mind, we know that the chef is female and the clerk is male. One possibility is to do the inference step manually and encode this as:&lt;br /&gt;
&amp;lt;pre&amp;gt;HoldsJob(&amp;quot;chef&amp;quot;) : FEMALE &amp;amp; HoldsJob(&amp;quot;clerk&amp;quot;) : MALE&amp;lt;/pre&amp;gt;&lt;br /&gt;
Alternatively, and in order to stay closer to the text of the puzzle we can add a function Husband that maps from the set FEMALE to the set MALE as a partial injection. We use a partial function, because we do not assume that all elements of FEMALE map to an element of MALE.&lt;br /&gt;
&amp;lt;pre&amp;gt;Husband : FEMALE &amp;gt;+&amp;gt; MALE&amp;lt;/pre&amp;gt;&lt;br /&gt;
To add the constraint using this function we state that the tuple of the person that holds the job as chef and the person that holds the job as clerk are an element of this function when treated as a set of tuples.&lt;br /&gt;
&amp;lt;pre&amp;gt;(HoldsJob(&amp;quot;chef&amp;quot;), HoldsJob(&amp;quot;clerk&amp;quot;)) : Husband&amp;lt;/pre&amp;gt;&lt;br /&gt;
The next piece of information is that &#039;&#039;“Roberta is not a boxer”&#039;&#039;. Using the JobsOf relation we can express this close to the original sentence, by stating: boxer is not one of Roberta’s jobs. This can be expressed using the relational image of the JobsOf relation:&lt;br /&gt;
&amp;lt;pre&amp;gt;&amp;quot;boxer&amp;quot; /: JobsOf[{&amp;quot;Roberta&amp;quot;}]&amp;lt;/pre&amp;gt;&lt;br /&gt;
The next sentence provides the information that &#039;&#039;“Pete has no education past the ninth grade”&#039;&#039;. This again needs some contextual information to be useful in order to find a solution for the puzzle&amp;lt;ref name=&amp;quot;shapiro_jobs_puzzle&amp;quot; /&amp;gt;. To interpret this sentence we need to know that the jobs of police officer, teacher and nurse require an education of more than 9 years. Hence the information we get is that Pete does not hold any of these jobs. Doing this inference step we could, as above, state something along the lines of HoldsJob(&amp;quot;police&amp;quot;) /= &amp;quot;Pete&amp;quot;, etc. for each of the jobs. The solution used here, tries to avoid doing the manual inference step. Although we still need to provide the information needed to draw the conclusion that Pete does not hold any of these three jobs. We create a set of those jobs that need higher education:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;QualifiedJobs = {&amp;quot;police&amp;quot;, &amp;quot;teacher&amp;quot;, &amp;quot;nurse&amp;quot;}&amp;lt;/pre&amp;gt;&lt;br /&gt;
Using the relational image operator we can now say that Pete is not among the ones that hold any of these jobs. The relational image can be used to get the set of items in the range of function or relation for all elements of a subset of the domain.&lt;br /&gt;
&amp;lt;pre&amp;gt;&amp;quot;Pete&amp;quot; /: HoldsJob[QualifiedJobs]&amp;lt;/pre&amp;gt;&lt;br /&gt;
Finally, the last piece of information is that &#039;&#039;“Roberta, the chef, and the police officer went golfing together”&#039;&#039;, from this we can infer that Roberta, the chef, and the police officer are all different persons. We write this in B stating that the set of Roberta, the person that holds the job as chef, and the person that is the police officer has cardinality 3, using a variable for the set for readability.&lt;br /&gt;
&amp;lt;pre&amp;gt;Golfers = {&amp;quot;Roberta&amp;quot;, HoldsJob(&amp;quot;chef&amp;quot;), HoldsJob(&amp;quot;police&amp;quot;)} &amp;amp; card(Golfers) = 3&amp;lt;/pre&amp;gt;&lt;br /&gt;
By building the conjunction of all these statements, ProB searches for a valid assignment to the variables introduced that satisfies all constraints, generating a valid solution that answers the question posed by the puzzle “who holds which job? ” in form of the HoldsJob function. The solution found by ProB is depicted below.&lt;br /&gt;
&lt;br /&gt;
[[File:JobsPuzzleSolutionAsGraph.png|border|center|The solution to the Jobs puzzle, depicted graphically]]&lt;br /&gt;
&lt;br /&gt;
This satisfies, in our eyes, the challenges identified by Shapiro. In the sense that the formalization, is not difficult, although it uses a formal language. The elements of this language are familiar to most programmers or mathematicians and it builds upon well understood and widely known concepts. The brevity of the solution shows that using an expressive high-level language it is possible to encode the puzzle without having tedious tasks in order to be able to solve the puzzle at all.&lt;br /&gt;
The encoding of the sentences follows the structure of the English statements very closely. We avoid the use of quantification wherever possible and use set based expressions that relate closely to the puzzle. We are able to encode the additional knowledge needed to solve puzzle in a straight forward way, that is also close to how this would be expressed as statements in English. Lastly it is worth to note that the formalization of “Each holds exactly two jobs” is the one furthest away from the English expression, using quantifications and set cardinality expressions.&lt;br /&gt;
&lt;br /&gt;
== Related Work ==&lt;br /&gt;
In his paper Shapiro discusses several formalizations of the puzzle with regard to the identified challenges. A further formalization using controlled natural language and answer set programming (ASP) was presented in &#039;&#039;&amp;quot;The jobs puzzle: Taking on the challenge via controlled natural language processing&amp;quot;&#039;&#039; by Schwitter et al.&amp;lt;ref name=&amp;quot;schwitter_jobs_puzzle&amp;quot;&amp;gt;R. Schwitter. The jobs puzzle: Taking on the challenge via controlled natural language processing. Theory and Practice of Logic Programming, 13:487–501, 7 2013.&amp;lt;/ref&amp;gt;&lt;br /&gt;
&lt;br /&gt;
The first of the solutions discussed by Shapiro is a solution from the TPTP website, encoded as a set of clauses and translated to FOL. The main disadvantages of this encoding is that it requires 64 clauses to encode the problem and many of them are needed to define equality among jobs and names. This is in contrast to our B encoding using either enumerated sets or strings, where all elements are implicitly assumed to be different. Thus the user does not have to define the concept of equality for simple atoms.&lt;br /&gt;
&lt;br /&gt;
The second solution discussed by Shapiro uses SNePS&amp;lt;ref&amp;gt;S. C. Shapiro and The SNePS Implementation Group. SNePS 2.7.1 User’s Manual. Department of Computer Science and Engineering University at Buffalo, The State University of New York, Dec. 2010.&amp;lt;/ref&amp;gt;, a common sense and natural language reasoning system designed with the goal to “have a formal logical language that captured the expressibility of the English language”&amp;lt;ref name=&amp;quot;shapiro_jobs_puzzle&amp;quot; /&amp;gt;. The language has a unique name assumption and set arguments making the encoding simpler and less tedious. On the other hand the lack of support for modus tolens requires rewriting some of the statements in order to solve the puzzle.&lt;br /&gt;
&lt;br /&gt;
The last formalization discussed by Shapiro uses Lparse and Smodles&amp;lt;ref&amp;gt;I. Niemelä, P. Simons, and T. Syrjänen. Smodels: A system for answer set programming. CoRR, cs.AI/0003033, 2000.&amp;lt;/ref&amp;gt; which uses stable model semantics with an extended logic programming syntax. According to Shapiro several features of Lparse/Smodels are simmilar to those of SNePS. This formalization also simplifies the encoding of the puzzle, but according to Schwitter et al. both solutions still present a “considerable conceptual gap between the formal notations and the English statements of the puzzle”&amp;lt;ref name=&amp;quot;schwitter_jobs_puzzle&amp;quot; /&amp;gt;.&lt;br /&gt;
&lt;br /&gt;
Schwitter et al. in their paper &#039;&#039;“The jobs puzzle: Taking on the challenge via controlled natural language processing”&#039;&#039;&amp;lt;ref name=&amp;quot;schwitter_jobs_puzzle&amp;quot; /&amp;gt; present a solution to the jobs puzzle using controlled natural language and a translation to ASP to solve the jobs puzzle in a novel way that stays very close to the English statements of the puzzle and satisfying the challenges posed by Shapiro. To avoid the mismatch between natural and controlled natural languages Schwitter et al. describe the use of a development environment that supports the user to input valid statements according to the rules of the controlled language. A solution using a mathematical, but high level language like B avoids this problems by having a formal and, for most, familiar language used to formalize the problem.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;hr /&amp;gt;&lt;/div&gt;</summary>
		<author><name>Bivab</name></author>
	</entry>
	<entry>
		<id>https://prob.hhu.de/w/index.php?title=File:JobsPuzzleSolutionAsGraph.png&amp;diff=3381</id>
		<title>File:JobsPuzzleSolutionAsGraph.png</title>
		<link rel="alternate" type="text/html" href="https://prob.hhu.de/w/index.php?title=File:JobsPuzzleSolutionAsGraph.png&amp;diff=3381"/>
		<updated>2016-02-02T10:10:06Z</updated>

		<summary type="html">&lt;p&gt;Bivab: &lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;&lt;/div&gt;</summary>
		<author><name>Bivab</name></author>
	</entry>
	<entry>
		<id>https://prob.hhu.de/w/index.php?title=ProB_Cli&amp;diff=2695</id>
		<title>ProB Cli</title>
		<link rel="alternate" type="text/html" href="https://prob.hhu.de/w/index.php?title=ProB_Cli&amp;diff=2695"/>
		<updated>2015-02-20T11:37:37Z</updated>

		<summary type="html">&lt;p&gt;Bivab: Link to prob.vim on github&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;[[Category:Components]]&lt;br /&gt;
[[Category:ProB Cli]]&lt;br /&gt;
&lt;br /&gt;
The ProB Cli (command-line interface) offers many of the ProB features via command-line. As such, you can run ProB from your shell scripts or in your Makefiles. probcli contains a REPL (Read-Eval-Print-Loop) and you can also integrate probcli into an editor such as [https://github.com/bivab/prob.vim vim].&lt;br /&gt;
probcli can also communicate with other tools or graphical user interfaces via sockets (this is used by [[ProB_for_Rodin | ProB for Rodin]]).&lt;br /&gt;
&lt;br /&gt;
== Documentation ==&lt;br /&gt;
                    &amp;lt;p class=&amp;quot;btn btn-lg btn-outline&amp;quot;&amp;gt;&lt;br /&gt;
		      &amp;lt;i class=&amp;quot;fa fa-user&amp;quot;&amp;gt;&amp;lt;/i&amp;gt; [[Using the Command-Line Version of ProB | User Manual]]&lt;br /&gt;
                    &amp;lt;/p&amp;gt;&lt;br /&gt;
                    &amp;lt;p class=&amp;quot;btn btn-lg btn-outline&amp;quot;&amp;gt;&lt;br /&gt;
		      &amp;lt;i class=&amp;quot;fa fa-cog&amp;quot;&amp;gt;&amp;lt;/i&amp;gt; [[Developer Manual]]&lt;br /&gt;
                    &amp;lt;/p&amp;gt;&lt;/div&gt;</summary>
		<author><name>Bivab</name></author>
	</entry>
	<entry>
		<id>https://prob.hhu.de/w/index.php?title=Bash_Completion&amp;diff=2694</id>
		<title>Bash Completion</title>
		<link rel="alternate" type="text/html" href="https://prob.hhu.de/w/index.php?title=Bash_Completion&amp;diff=2694"/>
		<updated>2015-02-20T11:35:41Z</updated>

		<summary type="html">&lt;p&gt;Bivab: /* Installation */&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;[[Category:User Manual]]&lt;br /&gt;
[[Category:ProB Cli]]&lt;br /&gt;
&lt;br /&gt;
For the [http://en.wikipedia.org/wiki/Bash_(Unix_shell) Bash] Unix Shell we provide command completion support. &lt;br /&gt;
&lt;br /&gt;
Example&lt;br /&gt;
&lt;br /&gt;
 $ probcli -re&amp;lt;TAB&amp;gt;&lt;br /&gt;
     -refchk  -repl&lt;br /&gt;
&lt;br /&gt;
== Installation ==&lt;br /&gt;
&lt;br /&gt;
A generated version of the command completion for Bash is available [http://nightly.cobra.cs.uni-duesseldorf.de/bash/prob_completion.sh here]. To install download the linked file and store it locally on your machine. To enable the completion you need to &#039;&#039;&#039;source&#039;&#039;&#039; the file.&lt;br /&gt;
&lt;br /&gt;
 $ source &amp;lt;path to prob_completion.sh&amp;gt;&lt;br /&gt;
&lt;br /&gt;
To enable the completion automatically add the line above to your Bash settings, e.g. in the &#039;&#039;&#039;.bashrc&#039;&#039;&#039; or &#039;&#039;&#039;.profile&#039;&#039;&#039; files in your home directory.&lt;br /&gt;
&lt;br /&gt;
== Contributing ==&lt;br /&gt;
&lt;br /&gt;
Bugs and improvements can be submitted on the project&#039;s [https://github.com/bivab/prob_bash_completion GitHub Page]&lt;/div&gt;</summary>
		<author><name>Bivab</name></author>
	</entry>
	<entry>
		<id>https://prob.hhu.de/w/index.php?title=Bash_Completion&amp;diff=2693</id>
		<title>Bash Completion</title>
		<link rel="alternate" type="text/html" href="https://prob.hhu.de/w/index.php?title=Bash_Completion&amp;diff=2693"/>
		<updated>2015-02-20T11:34:48Z</updated>

		<summary type="html">&lt;p&gt;Bivab: /* Installation */&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;[[Category:User Manual]]&lt;br /&gt;
[[Category:ProB Cli]]&lt;br /&gt;
&lt;br /&gt;
For the [http://en.wikipedia.org/wiki/Bash_(Unix_shell) Bash] Unix Shell we provide command completion support. &lt;br /&gt;
&lt;br /&gt;
Example&lt;br /&gt;
&lt;br /&gt;
 $ probcli -re&amp;lt;TAB&amp;gt;&lt;br /&gt;
     -refchk  -repl&lt;br /&gt;
&lt;br /&gt;
== Installation ==&lt;br /&gt;
&lt;br /&gt;
A generated version of the command completion for Bash is available [http://nightly.cobra.cs.uni-duesseldorf.de/bash/prob_completion.sh here]. To install download linked file and store it locally on your machine. To enable the completion you need to &#039;&#039;&#039;source&#039;&#039;&#039; the file.&lt;br /&gt;
&lt;br /&gt;
 $ source &amp;lt;path to prob_completion.sh&amp;gt;&lt;br /&gt;
&lt;br /&gt;
To enable the completion automatically add the line above to your Bash settings, e.g. in the &#039;&#039;&#039;.bashrc&#039;&#039;&#039; or &#039;&#039;&#039;.profile&#039;&#039;&#039; files.&lt;br /&gt;
&lt;br /&gt;
== Contributing ==&lt;br /&gt;
&lt;br /&gt;
Bugs and improvements can be submitted on the project&#039;s [https://github.com/bivab/prob_bash_completion GitHub Page]&lt;/div&gt;</summary>
		<author><name>Bivab</name></author>
	</entry>
	<entry>
		<id>https://prob.hhu.de/w/index.php?title=PROBPATH&amp;diff=2692</id>
		<title>PROBPATH</title>
		<link rel="alternate" type="text/html" href="https://prob.hhu.de/w/index.php?title=PROBPATH&amp;diff=2692"/>
		<updated>2015-02-20T11:17:18Z</updated>

		<summary type="html">&lt;p&gt;Bivab: &lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;{{DISPLAYTITLE:The ProB Search Path}}&lt;br /&gt;
&lt;br /&gt;
Starting with version 1.5 of ProB, how the parser resolves referenced can be customized.&lt;br /&gt;
&lt;br /&gt;
By default ProB will try to find files referenced from a machine (using SEES, INCLUDES, DEFINITON-files, etc) resolving paths as relative to the current machine or within the ProB standard library.&lt;br /&gt;
&lt;br /&gt;
Commonly used files can be placed in a shared location, e.g. in the standard library (the stdlib directory in the ProB distribution) or any custom location.&lt;br /&gt;
&lt;br /&gt;
The search path can be customized by defining a PROBPATH environment variable that contains a “:” separated list of directories to be searched, e.g.:&lt;br /&gt;
&lt;br /&gt;
 PROBPATH=~/myproject/common:~/myotherproject/common probcli model.mch&lt;br /&gt;
	&lt;br /&gt;
will resolved referenced files relative to model.mch, then in &#039;&#039;&#039;~/myproject/common&#039;&#039;&#039; then in &#039;&#039;&#039;~/myotherproject/common&#039;&#039;&#039; and finally in the standard library of ProB, stopping as soon as a file with the name being looked up is found.&lt;/div&gt;</summary>
		<author><name>Bivab</name></author>
	</entry>
	<entry>
		<id>https://prob.hhu.de/w/index.php?title=PROBPATH&amp;diff=2691</id>
		<title>PROBPATH</title>
		<link rel="alternate" type="text/html" href="https://prob.hhu.de/w/index.php?title=PROBPATH&amp;diff=2691"/>
		<updated>2015-02-20T11:10:34Z</updated>

		<summary type="html">&lt;p&gt;Bivab: &lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;{{DISPLAYTITLE:The ProB Search Path}}&lt;br /&gt;
&lt;br /&gt;
Starting with version 1.5 of ProB, how the parser resolves referenced can be customized.&lt;br /&gt;
&lt;br /&gt;
By default ProB will try to find files referenced from a machine (using SEES, INCLUDES, DEFINITON-files, etc) resolving paths as relative to the current machine or within the ProB standard library.&lt;br /&gt;
&lt;br /&gt;
Commonly used files can be placed in a shared location, e.g. in the standard library (the stdlib directory in the ProB distribution) or any custom location.&lt;br /&gt;
&lt;br /&gt;
The search path can be customized by defining a PROBPATH environment variable that contains a “:” separated list of directories to be searched, e.g.:&lt;br /&gt;
&lt;br /&gt;
 PROBPATH=~/myproject/common:~/myotherproject/common probcli model.mch&lt;br /&gt;
	&lt;br /&gt;
will resolved referenced files relative to model.mch, then in ~/myproject/common then in ~/myotherproject/common and finally in the standard library of ProB, stopping as soon as a file with the name being looked up is found.&lt;/div&gt;</summary>
		<author><name>Bivab</name></author>
	</entry>
	<entry>
		<id>https://prob.hhu.de/w/index.php?title=PROBPATH&amp;diff=2690</id>
		<title>PROBPATH</title>
		<link rel="alternate" type="text/html" href="https://prob.hhu.de/w/index.php?title=PROBPATH&amp;diff=2690"/>
		<updated>2015-02-20T11:06:14Z</updated>

		<summary type="html">&lt;p&gt;Bivab: Created page with &amp;#039;{{DISPLAYTITLE:The ProB Search Path}}  Starting with version 1.5 of ProB, how the parser resolves files references from machines can be customized.  By default ProB will try to f…&amp;#039;&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;{{DISPLAYTITLE:The ProB Search Path}}&lt;br /&gt;
&lt;br /&gt;
Starting with version 1.5 of ProB, how the parser resolves files references from machines can be customized.&lt;br /&gt;
&lt;br /&gt;
By default ProB will try to find files referenced from a machine (using SEES, INCLUDES, DEFINITON-files, etc) resolving paths as releative to the current machine or within the ProB standard library.&lt;br /&gt;
&lt;br /&gt;
Commonly used files can be placed in a shared location, e.g. in the standard library (the stdlib directory in the ProB distribution) or a custom location.&lt;br /&gt;
&lt;br /&gt;
The search path can be extended by defining a PROBPATH environment variable that contains a “:” separated list of directories to be searched, e.g.:&lt;br /&gt;
&lt;br /&gt;
 PROBPATH=~/myproject/common:~/myotherproject/common probcli model.mch&lt;br /&gt;
	&lt;br /&gt;
will resolved referenced files relative to model.mch, then in ~/myproject/common then in ~/myotherproject/common and finally in the standard library of ProB, stopping as soon as a file with the name being looked up is found.&lt;/div&gt;</summary>
		<author><name>Bivab</name></author>
	</entry>
	<entry>
		<id>https://prob.hhu.de/w/index.php?title=External_Functions&amp;diff=2689</id>
		<title>External Functions</title>
		<link rel="alternate" type="text/html" href="https://prob.hhu.de/w/index.php?title=External_Functions&amp;diff=2689"/>
		<updated>2015-02-20T11:01:26Z</updated>

		<summary type="html">&lt;p&gt;Bivab: /* Standard Libraries provided by ProB */&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;[[Category:User Manual]]&lt;br /&gt;
[[Category: Advanced Feature]]&lt;br /&gt;
&lt;br /&gt;
As of version 1.3.5-beta7 ProB can make use of externally defined functions.&lt;br /&gt;
These functions must currently be written in Prolog (in principle C, Java, Tcl or even other languages can be used via the SICStus Prolog external function interfaces).&lt;br /&gt;
These functions can be used to write &amp;lt;em&amp;gt;expression&amp;lt;/em&amp;gt;, &amp;lt;em&amp;gt;predicates&amp;lt;/em&amp;gt;, or &amp;lt;em&amp;gt;substitutions&amp;lt;/em&amp;gt;.&lt;br /&gt;
The general mechanism that is used is to mark certain DEFINITIONS as external, in which case ProB will make use of external Prolog code rather than using the right-hand-side of the DEFINITION whenever it is used. However, these DEFINITIONS can often (unless they are polymorphic) be wrapped into B (constant) functions. If you just want to use the standard external functions already defined by ProB, then you don&#039;t have to understand this mechanism in detail (or at all).&lt;br /&gt;
&lt;br /&gt;
== Standard Libraries provided by ProB ==&lt;br /&gt;
In a first instance we have predefined a series of external functions and grouped them in various library machines and definition files:&lt;br /&gt;
* &amp;lt;tt&amp;gt;LibraryMath.mch&amp;lt;/tt&amp;gt;: defining sin, cos, tan, sinx, cosx, tanx, logx, gcd, msb, random as well as access to all other Prolog built-in arithmetic functions.&lt;br /&gt;
* &amp;lt;tt&amp;gt;LibraryStrings.mch&amp;lt;/tt&amp;gt;: functions manipulating B STRING objects by providing &amp;lt;tt&amp;gt;length&amp;lt;/tt&amp;gt;, &amp;lt;tt&amp;gt;append&amp;lt;/tt&amp;gt;, &amp;lt;tt&amp;gt;split&amp;lt;/tt&amp;gt; and conversion functions &amp;lt;tt&amp;gt;chars&amp;lt;/tt&amp;gt;, &amp;lt;tt&amp;gt;codes&amp;lt;/tt&amp;gt;.&lt;br /&gt;
* &amp;lt;tt&amp;gt;LibraryFiles.mch&amp;lt;/tt&amp;gt;: various functions to obtain information about files and directories in the underlying file system&lt;br /&gt;
* &amp;lt;tt&amp;gt;LibraryIO.def&amp;lt;/tt&amp;gt;: providing functions to write information to screen or file. Note: these external functions are polymorphic and as such cannot be defined as B constants: you have to use the DEFINITIONS provided in &amp;lt;tt&amp;gt;LibraryIO.def&amp;lt;/tt&amp;gt;.&lt;br /&gt;
* &amp;lt;tt&amp;gt;CHOOSE.def&amp;lt;/tt&amp;gt;: providing the [http://planetmath.org/encyclopedia/HilbertsEpsilonOperator.html Hilbert choice operator] for choosing a designated element from each set. Again, this function is polymorphic and thus cannot be defined as a B function. This function is useful for defining [[Recursively_Defined_Functions|recursive functions]] over sets (see also [[TLA]]). Note that it in ProB it is undefined for the empty set.&lt;br /&gt;
&lt;br /&gt;
Since version 1.5 the standard library is shipped with ProB  and references to machines and DEFINITION-files in the standard library are resolved automatically when referenced (see [[PROBPATH]] for information about how to customize the lookup path).&lt;br /&gt;
&lt;br /&gt;
To use a library machine you can use the &amp;lt;tt&amp;gt;SEES&amp;lt;/tt&amp;gt; mechanism:&lt;br /&gt;
 SEES LibraryMath&lt;br /&gt;
In general you can do the following with an external function, such as &amp;lt;tt&amp;gt;sin&amp;lt;/tt&amp;gt;, wrapped into a constant:&lt;br /&gt;
* apply the function: &amp;lt;tt&amp;gt;sin(x)&amp;lt;/tt&amp;gt;&lt;br /&gt;
* compute the image of the function: &amp;lt;tt&amp;gt;sin[1..100]&amp;lt;/tt&amp;gt;&lt;br /&gt;
* compose the function with a finite relation on the left: &amp;lt;tt&amp;gt;([1..100] ; sin)&amp;lt;/tt&amp;gt;&lt;br /&gt;
* compute the domain of the function: &amp;lt;tt&amp;gt;dom(sin)&amp;lt;/tt&amp;gt;&lt;br /&gt;
To use a library definition file, you need to include the file in the DEFINITIONS clause:&lt;br /&gt;
 DEFINITIONS&lt;br /&gt;
   &amp;quot;LibraryIO.def&amp;quot;&lt;br /&gt;
&lt;br /&gt;
== Overview of the External Function DEFINITION Mechanism ==&lt;br /&gt;
&lt;br /&gt;
Currently, external functions are linked to classical B machines using B DEFINITIONS as follows:&lt;br /&gt;
* one definition, which defines the function as it is seen by tools other than ProB (e.g., Atelier-B). Suppose we want to declare an external cosinus function named &amp;lt;tt&amp;gt;COS&amp;lt;/tt&amp;gt;, then this definition could be &amp;lt;tt&amp;gt;COS(x) == cos(x)&amp;lt;/tt&amp;gt;.&lt;br /&gt;
* one definition declaring the type of the function. For &amp;lt;tt&amp;gt;COS&amp;lt;/tt&amp;gt; this would be &amp;lt;tt&amp;gt;EXTERNAL_FUNCTION_COS == INTEGER --&amp;gt; INTEGER&amp;lt;/tt&amp;gt;.&lt;br /&gt;
* Prolog code which gets called by ProB in place of the right-hand-side of the first definition&lt;br /&gt;
Usually, it is also a good idea to encapsulate the external function inside a CONSTANT which is defined as a lambda abstraction with as body simply the call to the first DEFINITION. For &amp;lt;tt&amp;gt;COS&amp;lt;/tt&amp;gt; this would be &amp;lt;tt&amp;gt;cos = %x.(x:NATURAL|COS(x))&amp;lt;/tt&amp;gt;. Observe that for Atelier-B this is a tautology.&lt;br /&gt;
For ProB, the use of such a constant allows one to have a real B function representing the external function, for which we can compute the domain, range, etc.&lt;br /&gt;
&lt;br /&gt;
For the typing of an external function &amp;lt;tt&amp;gt;NAME&amp;lt;/tt&amp;gt; with type &amp;lt;tt&amp;gt;TYPE&amp;lt;/tt&amp;gt; there are three possibilities, depending on whether the function is a function, a predicate or a substitution:&lt;br /&gt;
* &amp;lt;tt&amp;gt;EXTERNAL_FUNCTION_NAME == TYPE&amp;lt;/tt&amp;gt;&lt;br /&gt;
* &amp;lt;tt&amp;gt;EXTERNAL_PREDICATE_NAME == TYPE&amp;lt;/tt&amp;gt;&lt;br /&gt;
* &amp;lt;tt&amp;gt;EXTERNAL_SUBSTITUTION_NAME == TYPE&amp;lt;/tt&amp;gt;&lt;br /&gt;
&lt;br /&gt;
In case the external function is polymorphic, the &amp;lt;tt&amp;gt;DEFINITION&amp;lt;/tt&amp;gt; can take extra arguments: each argument is treated like a type variable.&lt;br /&gt;
For example, the following is used in &amp;lt;tt&amp;gt;CHOOSE.def&amp;lt;/tt&amp;gt; to declare the [http://planetmath.org/encyclopedia/HilbertsEpsilonOperator.html Hilbert choice operator]:&lt;br /&gt;
* &amp;lt;tt&amp;gt;EXTERNAL_FUNCTION_CHOOSE(T) == (POW(T)--&amp;gt;T) &amp;lt;/tt&amp;gt;&lt;/div&gt;</summary>
		<author><name>Bivab</name></author>
	</entry>
	<entry>
		<id>https://prob.hhu.de/w/index.php?title=External_Functions&amp;diff=2688</id>
		<title>External Functions</title>
		<link rel="alternate" type="text/html" href="https://prob.hhu.de/w/index.php?title=External_Functions&amp;diff=2688"/>
		<updated>2015-02-20T11:00:45Z</updated>

		<summary type="html">&lt;p&gt;Bivab: /* Standard Libraries provided by ProB */&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;[[Category:User Manual]]&lt;br /&gt;
[[Category: Advanced Feature]]&lt;br /&gt;
&lt;br /&gt;
As of version 1.3.5-beta7 ProB can make use of externally defined functions.&lt;br /&gt;
These functions must currently be written in Prolog (in principle C, Java, Tcl or even other languages can be used via the SICStus Prolog external function interfaces).&lt;br /&gt;
These functions can be used to write &amp;lt;em&amp;gt;expression&amp;lt;/em&amp;gt;, &amp;lt;em&amp;gt;predicates&amp;lt;/em&amp;gt;, or &amp;lt;em&amp;gt;substitutions&amp;lt;/em&amp;gt;.&lt;br /&gt;
The general mechanism that is used is to mark certain DEFINITIONS as external, in which case ProB will make use of external Prolog code rather than using the right-hand-side of the DEFINITION whenever it is used. However, these DEFINITIONS can often (unless they are polymorphic) be wrapped into B (constant) functions. If you just want to use the standard external functions already defined by ProB, then you don&#039;t have to understand this mechanism in detail (or at all).&lt;br /&gt;
&lt;br /&gt;
== Standard Libraries provided by ProB ==&lt;br /&gt;
In a first instance we have predefined a series of external functions and grouped them in various library machines and definition files:&lt;br /&gt;
* &amp;lt;tt&amp;gt;LibraryMath.mch&amp;lt;/tt&amp;gt;: defining sin, cos, tan, sinx, cosx, tanx, logx, gcd, msb, random as well as access to all other Prolog built-in arithmetic functions.&lt;br /&gt;
* &amp;lt;tt&amp;gt;LibraryStrings.mch&amp;lt;/tt&amp;gt;: functions manipulating B STRING objects by providing &amp;lt;tt&amp;gt;length&amp;lt;/tt&amp;gt;, &amp;lt;tt&amp;gt;append&amp;lt;/tt&amp;gt;, &amp;lt;tt&amp;gt;split&amp;lt;/tt&amp;gt; and conversion functions &amp;lt;tt&amp;gt;chars&amp;lt;/tt&amp;gt;, &amp;lt;tt&amp;gt;codes&amp;lt;/tt&amp;gt;.&lt;br /&gt;
* &amp;lt;tt&amp;gt;LibraryFiles.mch&amp;lt;/tt&amp;gt;: various functions to obtain information about files and directories in the underlying file system&lt;br /&gt;
* &amp;lt;tt&amp;gt;LibraryIO.def&amp;lt;/tt&amp;gt;: providing functions to write information to screen or file. Note: these external functions are polymorphic and as such cannot be defined as B constants: you have to use the DEFINITIONS provided in &amp;lt;tt&amp;gt;LibraryIO.def&amp;lt;/tt&amp;gt;.&lt;br /&gt;
* &amp;lt;tt&amp;gt;CHOOSE.def&amp;lt;/tt&amp;gt;: providing the [http://planetmath.org/encyclopedia/HilbertsEpsilonOperator.html Hilbert choice operator] for choosing a designated element from each set. Again, this function is polymorphic and thus cannot be defined as a B function. This function is useful for defining [[Recursively_Defined_Functions|recursive functions]] over sets (see also [[TLA]]). Note that it in ProB it is undefined for the empty set.&lt;br /&gt;
&lt;br /&gt;
Since version 1.5 the standard library is shipped with ProB  and references to machines and DEFINITION-files in the standard library are resolved automatically when referenced. (see [[PROBPATH]] for information about how to customize the lookup path).&lt;br /&gt;
&lt;br /&gt;
To use a library machine you can use the &amp;lt;tt&amp;gt;SEES&amp;lt;/tt&amp;gt; mechanism:&lt;br /&gt;
 SEES LibraryMath&lt;br /&gt;
In general you can do the following with an external function, such as &amp;lt;tt&amp;gt;sin&amp;lt;/tt&amp;gt;, wrapped into a constant:&lt;br /&gt;
* apply the function: &amp;lt;tt&amp;gt;sin(x)&amp;lt;/tt&amp;gt;&lt;br /&gt;
* compute the image of the function: &amp;lt;tt&amp;gt;sin[1..100]&amp;lt;/tt&amp;gt;&lt;br /&gt;
* compose the function with a finite relation on the left: &amp;lt;tt&amp;gt;([1..100] ; sin)&amp;lt;/tt&amp;gt;&lt;br /&gt;
* compute the domain of the function: &amp;lt;tt&amp;gt;dom(sin)&amp;lt;/tt&amp;gt;&lt;br /&gt;
To use a library definition file, you need to include the file in the DEFINITIONS clause:&lt;br /&gt;
 DEFINITIONS&lt;br /&gt;
   &amp;quot;LibraryIO.def&amp;quot;&lt;br /&gt;
&lt;br /&gt;
== Overview of the External Function DEFINITION Mechanism ==&lt;br /&gt;
&lt;br /&gt;
Currently, external functions are linked to classical B machines using B DEFINITIONS as follows:&lt;br /&gt;
* one definition, which defines the function as it is seen by tools other than ProB (e.g., Atelier-B). Suppose we want to declare an external cosinus function named &amp;lt;tt&amp;gt;COS&amp;lt;/tt&amp;gt;, then this definition could be &amp;lt;tt&amp;gt;COS(x) == cos(x)&amp;lt;/tt&amp;gt;.&lt;br /&gt;
* one definition declaring the type of the function. For &amp;lt;tt&amp;gt;COS&amp;lt;/tt&amp;gt; this would be &amp;lt;tt&amp;gt;EXTERNAL_FUNCTION_COS == INTEGER --&amp;gt; INTEGER&amp;lt;/tt&amp;gt;.&lt;br /&gt;
* Prolog code which gets called by ProB in place of the right-hand-side of the first definition&lt;br /&gt;
Usually, it is also a good idea to encapsulate the external function inside a CONSTANT which is defined as a lambda abstraction with as body simply the call to the first DEFINITION. For &amp;lt;tt&amp;gt;COS&amp;lt;/tt&amp;gt; this would be &amp;lt;tt&amp;gt;cos = %x.(x:NATURAL|COS(x))&amp;lt;/tt&amp;gt;. Observe that for Atelier-B this is a tautology.&lt;br /&gt;
For ProB, the use of such a constant allows one to have a real B function representing the external function, for which we can compute the domain, range, etc.&lt;br /&gt;
&lt;br /&gt;
For the typing of an external function &amp;lt;tt&amp;gt;NAME&amp;lt;/tt&amp;gt; with type &amp;lt;tt&amp;gt;TYPE&amp;lt;/tt&amp;gt; there are three possibilities, depending on whether the function is a function, a predicate or a substitution:&lt;br /&gt;
* &amp;lt;tt&amp;gt;EXTERNAL_FUNCTION_NAME == TYPE&amp;lt;/tt&amp;gt;&lt;br /&gt;
* &amp;lt;tt&amp;gt;EXTERNAL_PREDICATE_NAME == TYPE&amp;lt;/tt&amp;gt;&lt;br /&gt;
* &amp;lt;tt&amp;gt;EXTERNAL_SUBSTITUTION_NAME == TYPE&amp;lt;/tt&amp;gt;&lt;br /&gt;
&lt;br /&gt;
In case the external function is polymorphic, the &amp;lt;tt&amp;gt;DEFINITION&amp;lt;/tt&amp;gt; can take extra arguments: each argument is treated like a type variable.&lt;br /&gt;
For example, the following is used in &amp;lt;tt&amp;gt;CHOOSE.def&amp;lt;/tt&amp;gt; to declare the [http://planetmath.org/encyclopedia/HilbertsEpsilonOperator.html Hilbert choice operator]:&lt;br /&gt;
* &amp;lt;tt&amp;gt;EXTERNAL_FUNCTION_CHOOSE(T) == (POW(T)--&amp;gt;T) &amp;lt;/tt&amp;gt;&lt;/div&gt;</summary>
		<author><name>Bivab</name></author>
	</entry>
	<entry>
		<id>https://prob.hhu.de/w/index.php?title=Bash_Completion&amp;diff=2686</id>
		<title>Bash Completion</title>
		<link rel="alternate" type="text/html" href="https://prob.hhu.de/w/index.php?title=Bash_Completion&amp;diff=2686"/>
		<updated>2015-02-19T14:32:54Z</updated>

		<summary type="html">&lt;p&gt;Bivab: &lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;[[Category:User Manual]]&lt;br /&gt;
[[Category:ProB Cli]]&lt;br /&gt;
&lt;br /&gt;
For the [http://en.wikipedia.org/wiki/Bash_(Unix_shell) Bash] Unix Shell we provide command completion support. &lt;br /&gt;
&lt;br /&gt;
Example&lt;br /&gt;
&lt;br /&gt;
 $ probcli -re&amp;lt;TAB&amp;gt;&lt;br /&gt;
     -refchk  -repl&lt;br /&gt;
&lt;br /&gt;
== Installation ==&lt;br /&gt;
&lt;br /&gt;
A generated version of the command completion for Bash is available at the [http://nightly.cobra.cs.uni-duesseldorf.de/bash/prob_completion.sh here]. To install download linked file and store it locally on your machine. To enable the completion you need to &#039;&#039;&#039;source&#039;&#039;&#039; the file.&lt;br /&gt;
&lt;br /&gt;
 $ source &amp;lt;path to prob_completion.sh&amp;gt;&lt;br /&gt;
&lt;br /&gt;
To enable the completion automatically add the line above to your Bash settings, e.g. in the &#039;&#039;&#039;.bashrc&#039;&#039;&#039; or &#039;&#039;&#039;.profile&#039;&#039;&#039; files.&lt;br /&gt;
&lt;br /&gt;
== Contributing ==&lt;br /&gt;
&lt;br /&gt;
Bugs and improvements can be submitted on the project&#039;s [https://github.com/bivab/prob_bash_completion GitHub Page]&lt;/div&gt;</summary>
		<author><name>Bivab</name></author>
	</entry>
	<entry>
		<id>https://prob.hhu.de/w/index.php?title=Bash_Completion&amp;diff=2685</id>
		<title>Bash Completion</title>
		<link rel="alternate" type="text/html" href="https://prob.hhu.de/w/index.php?title=Bash_Completion&amp;diff=2685"/>
		<updated>2015-02-19T14:31:06Z</updated>

		<summary type="html">&lt;p&gt;Bivab: Created page with &amp;#039;Category:User Manual Category:ProB Cli  For the [http://en.wikipedia.org/wiki/Bash_(Unix_shell) Bash] Unix Shell we provide command completions support.   == Installation…&amp;#039;&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;[[Category:User Manual]]&lt;br /&gt;
[[Category:ProB Cli]]&lt;br /&gt;
&lt;br /&gt;
For the [http://en.wikipedia.org/wiki/Bash_(Unix_shell) Bash] Unix Shell we provide command completions support. &lt;br /&gt;
&lt;br /&gt;
== Installation ==&lt;br /&gt;
&lt;br /&gt;
A generated version of the command completion for Bash is available at the [http://nightly.cobra.cs.uni-duesseldorf.de/bash/prob_completion.sh here]. To install download linked file and store it locally on your machine. To enable the completion you need to &#039;&#039;&#039;source&#039;&#039;&#039; the file.&lt;br /&gt;
&lt;br /&gt;
 source &amp;lt;path to prob_completion.sh&amp;gt;&lt;br /&gt;
&lt;br /&gt;
To enable the completion automatically add the line above to your Bash settings, e.g. in the &#039;&#039;&#039;.bashrc&#039;&#039;&#039; or &#039;&#039;&#039;.profile&#039;&#039;&#039; files.&lt;br /&gt;
&lt;br /&gt;
== Contributing ==&lt;br /&gt;
&lt;br /&gt;
Bugs and improvements can be submitted on the project&#039;s [https://github.com/bivab/prob_bash_completion GitHub Page]&lt;/div&gt;</summary>
		<author><name>Bivab</name></author>
	</entry>
	<entry>
		<id>https://prob.hhu.de/w/index.php?title=Using_the_Command-Line_Version_of_ProB&amp;diff=2671</id>
		<title>Using the Command-Line Version of ProB</title>
		<link rel="alternate" type="text/html" href="https://prob.hhu.de/w/index.php?title=Using_the_Command-Line_Version_of_ProB&amp;diff=2671"/>
		<updated>2015-02-19T13:59:33Z</updated>

		<summary type="html">&lt;p&gt;Bivab: &lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;[[Category:Tutorial]]&lt;br /&gt;
[[Category:User Manual]]&lt;br /&gt;
[[Category:ProB Cli]]&lt;br /&gt;
&lt;br /&gt;
The command-line version of ProB, called &amp;lt;b&amp;gt;probcli&amp;lt;/b&amp;gt;, offers many of the feature of the standalone Tcl/Tk Version via the command-line. As such, you can run ProB from your shell scripts or in your Makefiles.&lt;br /&gt;
These pages refer to version 1.3.4 and 1.3.5 of ProB. Some features are only available in the nightly build of ProB. You can run &amp;lt;tt&amp;gt;probcli –help&amp;lt;/tt&amp;gt; to find out which commands are supported by your version of ProB. For Bash users we provide [[Bash Completion|command completion]] support.&lt;br /&gt;
&lt;br /&gt;
Note: the order of commands is not relevant for &amp;lt;tt&amp;gt;probcli&amp;lt;/tt&amp;gt; (except within groups of commands such as &amp;lt;tt&amp;gt;-p MAXINT 127&amp;lt;/tt&amp;gt;). Every argument that is not recognised by &amp;lt;tt&amp;gt;probcli&amp;lt;/tt&amp;gt; is treated as a filename to be analysed.&lt;br /&gt;
&lt;br /&gt;
== Conventions used ==&lt;br /&gt;
&lt;br /&gt;
The following conventions are used in this guide:&lt;br /&gt;
&lt;br /&gt;
{| cellpadding=&amp;quot;10&amp;quot;&lt;br /&gt;
| valign=&amp;quot;top&amp;quot; | &amp;lt;replaceme&amp;gt;&lt;br /&gt;
| All values that should be replaced with some value are shown withing &amp;lt; &amp;gt;&lt;br /&gt;
|-&lt;br /&gt;
| valign=&amp;quot;top&amp;quot; | line breaks&lt;br /&gt;
| Command synopsis for command may be broken up on several lines. When typing commands enter all option on the same line.&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
== Synopsis ==&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;probcli [--help]&lt;br /&gt;
&amp;lt;filename&amp;gt; [ &amp;lt;options&amp;gt; ]&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
== Command-line Arguments for ProB Tcl/Tk ==&lt;br /&gt;
&lt;br /&gt;
Note that the stand-alone Tcl/Tk version also supports a limited form of command-line preferences:&lt;br /&gt;
* &#039;&#039;&#039;FILE&#039;&#039;&#039; (the name/path of the file to be loaded)&lt;br /&gt;
* &#039;&#039;&#039;-prefs PREF_FILE&#039;&#039;&#039;  (to use a specific preferences file, rather than the default ProB_Preferences.pl in your home folder)&lt;br /&gt;
* &#039;&#039;&#039;-batch&#039;&#039;&#039; (to instruct ProB not to try to bring up windows, but to print information only to the terminal)&lt;br /&gt;
* &#039;&#039;&#039;-selfcheck&#039;&#039;&#039; (to run the standard unit tests)&lt;br /&gt;
* &#039;&#039;&#039;-t&#039;&#039;&#039; (to perform the Trace Check on the default trace file associated with the specification)&lt;br /&gt;
* &#039;&#039;&#039;-tcl TCL_Command&#039;&#039;&#039; (to run a particular pre-defined Tcl command)&lt;br /&gt;
* &#039;&#039;&#039;-mc&#039;&#039;&#039; (to perform model checking)&lt;br /&gt;
* &#039;&#039;&#039;-c&#039;&#039;&#039; (to compute the coverage)&lt;br /&gt;
* &#039;&#039;&#039;-ref&#039;&#039;&#039; (to perform the default trace refinment check)&lt;br /&gt;
&lt;br /&gt;
However, the comand-line version of ProB, called &#039;&#039;&#039;probcli&#039;&#039;&#039;, provides more features. It also does not depend on Tcl/Tk and can therefore be run on systems without Tcl/Tk.&lt;br /&gt;
&lt;br /&gt;
== Options ==&lt;br /&gt;
&lt;br /&gt;
=== -mc &amp;lt;nr&amp;gt; ===&lt;br /&gt;
&lt;br /&gt;
Description&lt;br /&gt;
&lt;br /&gt;
{| style=&amp;quot;color:black; background-color:#FFFFEF; border:1px solid lightgray;&amp;quot; cellpadding=&amp;quot;10&amp;quot; cellspacing=&amp;quot;0&amp;quot; width=&amp;quot;100%&amp;quot;&lt;br /&gt;
| model check; checking at most &amp;lt;nr&amp;gt; states&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
Example&lt;br /&gt;
&lt;br /&gt;
  probcli my.mch -mc 100&lt;br /&gt;
&lt;br /&gt;
Note: with a value of nr=1 ProB will only inspect the &amp;quot;virtual&amp;quot; root node (and compute its outgoing transitions).&lt;br /&gt;
Also see the related options &amp;lt;tt&amp;gt;-nodead, -noinv, -nogoal, -noass&amp;lt;/tt&amp;gt; to influence which kinds of errors are reported by &amp;lt;tt&amp;gt;-mc&amp;lt;/tt&amp;gt;.&lt;br /&gt;
You can also set a target goal predicate using the &amp;lt;tt&amp;gt;-goal &amp;quot;PRED&amp;quot;&amp;lt;/tt&amp;gt; command and limit the scope of the model checking using the &amp;lt;tt&amp;gt;-scope &amp;quot;PRED&amp;quot;&amp;lt;/tt&amp;gt; command. &lt;br /&gt;
&lt;br /&gt;
=== -model_check ===&lt;br /&gt;
&lt;br /&gt;
The same as &amp;lt;tt&amp;gt;-mc&amp;lt;/tt&amp;gt; but without a limit on the number of nodes checked.&lt;br /&gt;
ProB will run until the entire state space is explored.&lt;br /&gt;
&lt;br /&gt;
=== -no&amp;lt;x&amp;gt; ===&lt;br /&gt;
&lt;br /&gt;
Description&lt;br /&gt;
&lt;br /&gt;
{| style=&amp;quot;color:black; background-color:#FFFFEF; border:1px solid lightgray;&amp;quot; cellpadding=&amp;quot;10&amp;quot; cellspacing=&amp;quot;0&amp;quot; width=&amp;quot;100%&amp;quot;&lt;br /&gt;
| restrict errors reported by model checking with &amp;lt;x&amp;gt;=dead,inv,goal,ass&lt;br /&gt;
-nodead : do not report deadlocks&lt;br /&gt;
-noinv : do not report invariant violations&lt;br /&gt;
-nogoal : do not stop if a state satisfying the GOAL predicate has been found&lt;br /&gt;
-noass : do not report assertion violations&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
Example&lt;br /&gt;
&lt;br /&gt;
  probcli my.mch -mc 1000 -nodead -nogoal&lt;br /&gt;
&lt;br /&gt;
=== -bf ===&lt;br /&gt;
&lt;br /&gt;
Description&lt;br /&gt;
&lt;br /&gt;
{| style=&amp;quot;color:black; background-color:#FFFFEF; border:1px solid lightgray;&amp;quot; cellpadding=&amp;quot;10&amp;quot; cellspacing=&amp;quot;0&amp;quot; width=&amp;quot;100%&amp;quot;&lt;br /&gt;
| proceed breadth-first&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
Example&lt;br /&gt;
&lt;br /&gt;
  probcli my.mch -bf -mc 1000&lt;br /&gt;
&lt;br /&gt;
=== -df ===&lt;br /&gt;
&lt;br /&gt;
Description&lt;br /&gt;
&lt;br /&gt;
{| style=&amp;quot;color:black; background-color:#FFFFEF; border:1px solid lightgray;&amp;quot; cellpadding=&amp;quot;10&amp;quot; cellspacing=&amp;quot;0&amp;quot; width=&amp;quot;100%&amp;quot;&lt;br /&gt;
| proceed depth-first&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
Example&lt;br /&gt;
&lt;br /&gt;
  probcli my.mch -df -mc 1000&lt;br /&gt;
&lt;br /&gt;
=== --timeout &amp;lt;N&amp;gt; ===&lt;br /&gt;
&lt;br /&gt;
Description&lt;br /&gt;
&lt;br /&gt;
{| style=&amp;quot;color:black; background-color:#FFFFEF; border:1px solid lightgray;&amp;quot; cellpadding=&amp;quot;10&amp;quot; cellspacing=&amp;quot;0&amp;quot; width=&amp;quot;100%&amp;quot;&lt;br /&gt;
| Global timeout in ms for model checking and refinement checking. &lt;br /&gt;
This does not influence the timeout used for computing individual transitions/operations.&lt;br /&gt;
This has to be set with the -p TIME_OUT &amp;lt;N&amp;gt;. See the description of the -p option.&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
Example&lt;br /&gt;
&lt;br /&gt;
 probcli my.mch -timeout 10000&lt;br /&gt;
&lt;br /&gt;
=== -t ===&lt;br /&gt;
&lt;br /&gt;
Description&lt;br /&gt;
&lt;br /&gt;
{| style=&amp;quot;color:black; background-color:#FFFFEF; border:1px solid lightgray;&amp;quot; cellpadding=&amp;quot;10&amp;quot; cellspacing=&amp;quot;0&amp;quot; width=&amp;quot;100%&amp;quot;&lt;br /&gt;
| trace check (associated .trace file must exist)&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
Example&lt;br /&gt;
&lt;br /&gt;
 probcli my.mch -t&lt;br /&gt;
&lt;br /&gt;
=== -init ===&lt;br /&gt;
&lt;br /&gt;
Description&lt;br /&gt;
&lt;br /&gt;
{| style=&amp;quot;color:black; background-color:#FFFFEF; border:1px solid lightgray;&amp;quot; cellpadding=&amp;quot;10&amp;quot; cellspacing=&amp;quot;0&amp;quot; width=&amp;quot;100%&amp;quot;&lt;br /&gt;
| initialise specification&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
Example&lt;br /&gt;
&lt;br /&gt;
 probcli my.mch -init&lt;br /&gt;
 nr_of_components(1)&lt;br /&gt;
 % checking_component_properties(1,[])&lt;br /&gt;
 % enumerating_constants_without_constraints([typedval(fd(_24428,ID),global(ID),iv)])&lt;br /&gt;
 % grounding_wait_flags&lt;br /&gt;
 grounding_component(1)&lt;br /&gt;
 grounding_component(2)&lt;br /&gt;
 % found_enumeration_of_constants(0,2)&lt;br /&gt;
 % backtrack(found_enumeration_of_constants(0,2))&lt;br /&gt;
 % found_enumeration_of_constants(0,1)&lt;br /&gt;
 % backtrack(found_enumeration_of_constants(0,1))&lt;br /&gt;
 &amp;lt;- 0: SETUP_CONSTANTS :: root&lt;br /&gt;
 % Could not set up constants with parameters from trace file.&lt;br /&gt;
 % Will attempt any possible initialisation of constants.&lt;br /&gt;
  | 0: SETUP_CONSTANTS success --&amp;gt;0&lt;br /&gt;
  - &amp;lt;- 1: INITIALISATION :: 0&lt;br /&gt;
 % Could not initialise with parameters from trace file.&lt;br /&gt;
 % Will attempt any possible initialisation.&lt;br /&gt;
 ALL OPERATIONS COVERED&lt;br /&gt;
  -  | 1: INITIALISATION success --&amp;gt;2&lt;br /&gt;
  -  - SUCCESS&lt;br /&gt;
&lt;br /&gt;
=== -cbc &amp;lt;OPNAME&amp;gt; ===&lt;br /&gt;
&lt;br /&gt;
Description&lt;br /&gt;
&lt;br /&gt;
{| style=&amp;quot;color:black; background-color:#FFFFEF; border:1px solid lightgray;&amp;quot; cellpadding=&amp;quot;10&amp;quot; cellspacing=&amp;quot;0&amp;quot; width=&amp;quot;100%&amp;quot;&lt;br /&gt;
| constraint-based invariant checking for an operation (also use &amp;lt;OPNAME&amp;gt;=all)&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
Example&lt;br /&gt;
&lt;br /&gt;
 probcli my.mch -cbc all&lt;br /&gt;
&lt;br /&gt;
=== -cbc_deadlock ===&lt;br /&gt;
&lt;br /&gt;
Description&lt;br /&gt;
&lt;br /&gt;
{| style=&amp;quot;color:black; background-color:#FFFFEF; border:1px solid lightgray;&amp;quot; cellpadding=&amp;quot;10&amp;quot; cellspacing=&amp;quot;0&amp;quot; width=&amp;quot;100%&amp;quot;&lt;br /&gt;
| Perform constraint-based deadlock checking (also use -cbc_deadlock_pred PRED)&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
This will try to find a state which satisfies the invariant and properties and where no operation/event is enabled.&lt;br /&gt;
Note: if ProB finds a counter example then the machine cannot be proven to be deadlock free. However, the particular state may not be reachable from the initial state(s). If you want to find a reachable deadlock you have to use the model checker.&lt;br /&gt;
&lt;br /&gt;
=== -cbc_deadlock_pred &amp;lt;PRED&amp;gt; ===&lt;br /&gt;
&lt;br /&gt;
Description&lt;br /&gt;
&lt;br /&gt;
{| style=&amp;quot;color:black; background-color:#FFFFEF; border:1px solid lightgray;&amp;quot; cellpadding=&amp;quot;10&amp;quot; cellspacing=&amp;quot;0&amp;quot; width=&amp;quot;100%&amp;quot;&lt;br /&gt;
| Constraint-based deadlock finding given a predicate&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
This is like -cbc_deadlock but you provide an additional predicate. ProB will only find deadlocks which also make this predicate true.&lt;br /&gt;
&lt;br /&gt;
Example&lt;br /&gt;
&lt;br /&gt;
 probcli my.mch  -cbc_deadlock_pred &amp;quot;n=15&amp;quot;&lt;br /&gt;
&lt;br /&gt;
=== -cbc_assertions ===&lt;br /&gt;
&lt;br /&gt;
Description&lt;br /&gt;
&lt;br /&gt;
{| style=&amp;quot;color:black; background-color:#FFFFEF; border:1px solid lightgray;&amp;quot; cellpadding=&amp;quot;10&amp;quot; cellspacing=&amp;quot;0&amp;quot; width=&amp;quot;100%&amp;quot;&lt;br /&gt;
| Constraint-based checking of assertions on constants&lt;br /&gt;
|}&lt;br /&gt;
This will try and find a solution for the constants which make an assertion (on constants) false.&lt;br /&gt;
&lt;br /&gt;
You can use the command &amp;lt;tt&amp;gt;-cbc_output_file FILE&amp;lt;/tt&amp;gt; to write the result of this check to a file.&lt;br /&gt;
&lt;br /&gt;
=== -cbc_sequence &amp;lt;SEQ&amp;gt; ===&lt;br /&gt;
&lt;br /&gt;
Description&lt;br /&gt;
&lt;br /&gt;
{| style=&amp;quot;color:black; background-color:#FFFFEF; border:1px solid lightgray;&amp;quot; cellpadding=&amp;quot;10&amp;quot; cellspacing=&amp;quot;0&amp;quot; width=&amp;quot;100%&amp;quot;&lt;br /&gt;
| Constraint-based searching for a sequence of operation names (separated by semicolons)&lt;br /&gt;
|}&lt;br /&gt;
This will try and find a solution for the constants, initial variable values and parameters which make execution of the given sequence of operations possible.&lt;br /&gt;
&lt;br /&gt;
Example&lt;br /&gt;
&lt;br /&gt;
 probcli my.mch  -cbc_sequence &amp;quot;op1;op2&amp;quot;&lt;br /&gt;
&lt;br /&gt;
=== -strict ===&lt;br /&gt;
&lt;br /&gt;
Description&lt;br /&gt;
&lt;br /&gt;
{| style=&amp;quot;color:black; background-color:#FFFFEF; border:1px solid lightgray;&amp;quot; cellpadding=&amp;quot;10&amp;quot; cellspacing=&amp;quot;0&amp;quot; width=&amp;quot;100%&amp;quot;&lt;br /&gt;
| raise error if mc finds counter example or trace checking fails&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
Example&lt;br /&gt;
&lt;br /&gt;
 probcli my.mch -t -strict&lt;br /&gt;
&lt;br /&gt;
=== -expcterr &amp;lt;ERR&amp;gt; ===&lt;br /&gt;
&lt;br /&gt;
Description&lt;br /&gt;
&lt;br /&gt;
{| style=&amp;quot;color:black; background-color:#FFFFEF; border:1px solid lightgray;&amp;quot; cellpadding=&amp;quot;10&amp;quot; cellspacing=&amp;quot;0&amp;quot; width=&amp;quot;100%&amp;quot;&lt;br /&gt;
| expect error to occur (&amp;lt;ERR&amp;gt;=cbc,mc,ltl,...)&lt;br /&gt;
Tell ProB that you expect a certain error to occur. Mainly useful for regression tests (in conjunction with the -strict option).&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
Example&lt;br /&gt;
&lt;br /&gt;
 probcli examples/B/Benchmarks/CarlaTravelAgencyErr.mch -mc 1000 -expcterr invariant_violation -strict&lt;br /&gt;
&lt;br /&gt;
=== -animate &amp;lt;Nr&amp;gt;===&lt;br /&gt;
&lt;br /&gt;
Description&lt;br /&gt;
&lt;br /&gt;
{| style=&amp;quot;color:black; background-color:#FFFFEF; border:1px solid lightgray;&amp;quot; cellpadding=&amp;quot;10&amp;quot; cellspacing=&amp;quot;0&amp;quot; width=&amp;quot;100%&amp;quot;&lt;br /&gt;
| random animation (max Nr steps)&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
Animates the machine randomly, maximally Nr of steps. It will stop if a deadlock is reached and report an error. You can also use the command &amp;lt;tt&amp;gt;-animate_all&amp;lt;/tt&amp;gt;, which will only stop at a deadlock (and not report an error). Be careful: &amp;lt;tt&amp;gt;-animate_all&amp;lt;/tt&amp;gt; could run forever.&lt;br /&gt;
&lt;br /&gt;
Example&lt;br /&gt;
&lt;br /&gt;
 probcli my.mch -animate 100&lt;br /&gt;
&lt;br /&gt;
=== -det_check ===&lt;br /&gt;
&lt;br /&gt;
Description&lt;br /&gt;
&lt;br /&gt;
{| style=&amp;quot;color:black; background-color:#FFFFEF; border:1px solid lightgray;&amp;quot; cellpadding=&amp;quot;10&amp;quot; cellspacing=&amp;quot;0&amp;quot; width=&amp;quot;100%&amp;quot;&lt;br /&gt;
| check if animation steps are deterministic&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
Checks if every step of the animation is deterministic (i.e., only one operation is possible, and it can only be executed in one possible way as far as parameters and result is concerned).&lt;br /&gt;
Currently this option has only an effect for the -animate &amp;lt;Nr&amp;gt; and the -init commands.&lt;br /&gt;
&lt;br /&gt;
Example&lt;br /&gt;
&lt;br /&gt;
 probcli my.mch -animate 100 -det_check&lt;br /&gt;
&lt;br /&gt;
=== -det_constants ===&lt;br /&gt;
&lt;br /&gt;
Description&lt;br /&gt;
&lt;br /&gt;
{| style=&amp;quot;color:black; background-color:#FFFFEF; border:1px solid lightgray;&amp;quot; cellpadding=&amp;quot;10&amp;quot; cellspacing=&amp;quot;0&amp;quot; width=&amp;quot;100%&amp;quot;&lt;br /&gt;
| check if animation steps are deterministic&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
Checks if the SETUP_CONSTANTS step is deterministic (i.e., only one way to set up the constants is possible).&lt;br /&gt;
Currently this option has only an effect for the -animate &amp;lt;Nr&amp;gt; and the -init commands.&lt;br /&gt;
&lt;br /&gt;
Example&lt;br /&gt;
&lt;br /&gt;
 probcli my.mch -init -det_constants&lt;br /&gt;
=== -his &amp;lt;FILE&amp;gt;===&lt;br /&gt;
&lt;br /&gt;
Description&lt;br /&gt;
&lt;br /&gt;
{| style=&amp;quot;color:black; background-color:#FFFFEF; border:1px solid lightgray;&amp;quot; cellpadding=&amp;quot;10&amp;quot; cellspacing=&amp;quot;0&amp;quot; width=&amp;quot;100%&amp;quot;&lt;br /&gt;
| save animation history to a file&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
Save the animation (or model checking) history to a text file. Operations are separated by semicolons.&lt;br /&gt;
The output can be adapted using the -his_option command. With -his_option show_states the -his command will also write out all states to the file (in the form of comments before and after operations). With -his_option show_init only the initial state is written out.&lt;br /&gt;
The -his command is executed after the -init, -animate, -t or -mc commands.&lt;br /&gt;
See also the -sptxt command to only write the current values of variables and constants to a file.&lt;br /&gt;
&lt;br /&gt;
Example&lt;br /&gt;
&lt;br /&gt;
 probcli -animate 5 -his history.txt  supersimple.mch&lt;br /&gt;
&lt;br /&gt;
Additionally we can have the initialised variables and constants:&lt;br /&gt;
&lt;br /&gt;
 probcli -animate 5 -his history.txt -his_option show_init supersimple.mch&lt;br /&gt;
&lt;br /&gt;
And we can have in addition the values of the variables in between (and at the end):&lt;br /&gt;
&lt;br /&gt;
 probcli -animate 5 -his history.txt -his_option show_states supersimple.mch&lt;br /&gt;
&lt;br /&gt;
With -his_option trace_file as only option, probcli will write the history in Prolog format, which can later be used by the -t command.&lt;br /&gt;
&lt;br /&gt;
=== -i ===&lt;br /&gt;
&lt;br /&gt;
Description&lt;br /&gt;
&lt;br /&gt;
{| style=&amp;quot;color:black; background-color:#FFFFEF; border:1px solid lightgray;&amp;quot; cellpadding=&amp;quot;10&amp;quot; cellspacing=&amp;quot;0&amp;quot; width=&amp;quot;100%&amp;quot;&lt;br /&gt;
| interactive animation&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
After performing the other commands, ProB stays in interactive mode and allows the user to manually animate the loaded specification.&lt;br /&gt;
&lt;br /&gt;
Example&lt;br /&gt;
&lt;br /&gt;
 probcli my.mch -i&lt;br /&gt;
&lt;br /&gt;
=== -repl ===&lt;br /&gt;
&lt;br /&gt;
Description&lt;br /&gt;
&lt;br /&gt;
{| style=&amp;quot;color:black; background-color:#FFFFEF; border:1px solid lightgray;&amp;quot; cellpadding=&amp;quot;10&amp;quot; cellspacing=&amp;quot;0&amp;quot; width=&amp;quot;100%&amp;quot;&lt;br /&gt;
| start interactive read-eval-print-loop&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
Example&lt;br /&gt;
&lt;br /&gt;
 probcli my.mch -p CLPFD TRUE -repl&lt;br /&gt;
&lt;br /&gt;
A list of commands can be obtained by typing &amp;lt;tt&amp;gt;:help&amp;lt;/tt&amp;gt; (just help for versions 1.3.x of probcli). The interactive read-eval-print-loop can be exited using &amp;lt;tt&amp;gt;:q&amp;lt;/tt&amp;gt; (just typing a return on a blank line for versions 1.3.x of probcli)..&lt;br /&gt;
If in addition you want see a graphical representation of the solutions found you can use the following command and open the &amp;lt;tt&amp;gt;out.dot&amp;lt;/tt&amp;gt; file using dotty or GraphViz:&lt;br /&gt;
 probcli -repl -evaldot ~/out.dot&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
You can also use the &amp;lt;tt&amp;gt;-eval&amp;lt;/tt&amp;gt; command to evaluate specific formulas or expressions:&lt;br /&gt;
 probcli -eval &amp;quot;1+2&amp;quot;&lt;br /&gt;
&lt;br /&gt;
=== -c ===&lt;br /&gt;
&lt;br /&gt;
Description&lt;br /&gt;
&lt;br /&gt;
{| style=&amp;quot;color:black; background-color:#FFFFEF; border:1px solid lightgray;&amp;quot; cellpadding=&amp;quot;10&amp;quot; cellspacing=&amp;quot;0&amp;quot; width=&amp;quot;100%&amp;quot;&lt;br /&gt;
| print coverage statistics&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
Example&lt;br /&gt;
&lt;br /&gt;
 probcli my.mch -mc 1000 -c&lt;br /&gt;
&lt;br /&gt;
You can also use the longer name for the command:&lt;br /&gt;
&lt;br /&gt;
 probcli my.mch -mc 1000 --coverage&lt;br /&gt;
&lt;br /&gt;
There is also a version which prints a shorter summary (and which is much faster for large state spaces):&lt;br /&gt;
&lt;br /&gt;
 probcli my.mch -mc 1000 --coverage_summary&lt;br /&gt;
&lt;br /&gt;
=== -cc &amp;lt;Nr&amp;gt; &amp;lt;Nr&amp;gt; ===&lt;br /&gt;
&lt;br /&gt;
Description&lt;br /&gt;
&lt;br /&gt;
{| style=&amp;quot;color:black; background-color:#FFFFEF; border:1px solid lightgray;&amp;quot; cellpadding=&amp;quot;10&amp;quot; cellspacing=&amp;quot;0&amp;quot; width=&amp;quot;100%&amp;quot;&lt;br /&gt;
| print and check coverage statistics&lt;br /&gt;
Print coverage statistics and check that the given number of nodes and transitions have been computed.&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
Example&lt;br /&gt;
&lt;br /&gt;
 probcli my.mch -mc 1000 -cc 10 25&lt;br /&gt;
&lt;br /&gt;
=== -p &amp;lt;PREFERENCE&amp;gt; &amp;lt;VALUE&amp;gt; ===&lt;br /&gt;
&lt;br /&gt;
Description&lt;br /&gt;
&lt;br /&gt;
{| style=&amp;quot;color:black; background-color:#FFFFEF; border:1px solid lightgray;&amp;quot; cellpadding=&amp;quot;10&amp;quot; cellspacing=&amp;quot;0&amp;quot; width=&amp;quot;100%&amp;quot;&lt;br /&gt;
| Set &amp;lt;PREFERENCE&amp;gt; to &amp;lt;VALUE&amp;gt;. For more information about preferences please have a look at [[Using_the_Command-Line_Version_of_ProB#Preferences | Preferences]]&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
You can also use --pref instead of -p.&lt;br /&gt;
Example&lt;br /&gt;
&lt;br /&gt;
 probcli my.mch -p TIME_OUT 8000 -p CLPFD TRUE -mc 10000&lt;br /&gt;
&lt;br /&gt;
=== -prefs &amp;lt;FILE&amp;gt; ===&lt;br /&gt;
&lt;br /&gt;
Description&lt;br /&gt;
&lt;br /&gt;
{| style=&amp;quot;color:black; background-color:#FFFFEF; border:1px solid lightgray;&amp;quot; cellpadding=&amp;quot;10&amp;quot; cellspacing=&amp;quot;0&amp;quot; width=&amp;quot;100%&amp;quot;&lt;br /&gt;
| Set preferences from preference file &amp;lt;FILE&amp;gt;. The file should be created by the Tcl/Tk version of ProB; this version automatically creates a file called ProB_Preferences.pl. For more information about preferences please have a look at [[Using_the_Command-Line_Version_of_ProB#Preferences | Preferences]]&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
Example&lt;br /&gt;
&lt;br /&gt;
 probcli my.mch -prefs ProB_Preferences.pl&lt;br /&gt;
&lt;br /&gt;
=== -card &amp;lt;GS&amp;gt; &amp;lt;VAL&amp;gt; ===&lt;br /&gt;
&lt;br /&gt;
Description&lt;br /&gt;
&lt;br /&gt;
{| style=&amp;quot;color:black; background-color:#FFFFEF; border:1px solid lightgray;&amp;quot; cellpadding=&amp;quot;10&amp;quot; cellspacing=&amp;quot;0&amp;quot; width=&amp;quot;100%&amp;quot;&lt;br /&gt;
| set cardinality (scope in Alloy terminology) of a B deferred set. This overrides the default cardinality (which can be set using &amp;lt;tt&amp;gt;-p DEFAULT_SETSIZE &amp;lt;VAL&amp;gt;&amp;lt;/tt&amp;gt;).&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
Example&lt;br /&gt;
&lt;br /&gt;
 probcli my.mch -card PID 5&lt;br /&gt;
&lt;br /&gt;
=== -goal &amp;lt;PRED&amp;gt; ===&lt;br /&gt;
&lt;br /&gt;
Description&lt;br /&gt;
&lt;br /&gt;
{| style=&amp;quot;color:black; background-color:#FFFFEF; border:1px solid lightgray;&amp;quot; cellpadding=&amp;quot;10&amp;quot; cellspacing=&amp;quot;0&amp;quot; width=&amp;quot;100%&amp;quot;&lt;br /&gt;
| set GOAL predicate for model checker&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
Example&lt;br /&gt;
&lt;br /&gt;
 probcli my.mch -mc 10000000 -goal &amp;quot;n=18&amp;quot;  -strict -expcterr goal_found&lt;br /&gt;
&lt;br /&gt;
=== -scope &amp;lt;PRED&amp;gt; ===&lt;br /&gt;
&lt;br /&gt;
Description&lt;br /&gt;
&lt;br /&gt;
{| style=&amp;quot;color:black; background-color:#FFFFEF; border:1px solid lightgray;&amp;quot; cellpadding=&amp;quot;10&amp;quot; cellspacing=&amp;quot;0&amp;quot; width=&amp;quot;100%&amp;quot;&lt;br /&gt;
| set SCOPE predicate for model checker; states which do not satisfy the SCOPE predicate will be ignored (invariant will not be checked and no outgoing transitions will be computed)&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
Example&lt;br /&gt;
&lt;br /&gt;
 probcli my.mch -mc 10000000 -scope &amp;quot;n&amp;lt;18&amp;quot;  &lt;br /&gt;
&lt;br /&gt;
=== -s &amp;lt;PORT&amp;gt; ===&lt;br /&gt;
&lt;br /&gt;
Description&lt;br /&gt;
&lt;br /&gt;
{| style=&amp;quot;color:black; background-color:#FFFFEF; border:1px solid lightgray;&amp;quot; cellpadding=&amp;quot;10&amp;quot; cellspacing=&amp;quot;0&amp;quot; width=&amp;quot;100%&amp;quot;&lt;br /&gt;
| start socket server on given port&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
Example&lt;br /&gt;
&lt;br /&gt;
 probcli my.mch ...&lt;br /&gt;
&lt;br /&gt;
=== -ss ===&lt;br /&gt;
&lt;br /&gt;
Description&lt;br /&gt;
&lt;br /&gt;
{| style=&amp;quot;color:black; background-color:#FFFFEF; border:1px solid lightgray;&amp;quot; cellpadding=&amp;quot;10&amp;quot; cellspacing=&amp;quot;0&amp;quot; width=&amp;quot;100%&amp;quot;&lt;br /&gt;
| start socket server on port 9000&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
Example&lt;br /&gt;
&lt;br /&gt;
 probcli my.mch ...&lt;br /&gt;
&lt;br /&gt;
=== -sf ===&lt;br /&gt;
&lt;br /&gt;
Description&lt;br /&gt;
&lt;br /&gt;
{| style=&amp;quot;color:black; background-color:#FFFFEF; border:1px solid lightgray;&amp;quot; cellpadding=&amp;quot;10&amp;quot; cellspacing=&amp;quot;0&amp;quot; width=&amp;quot;100%&amp;quot;&lt;br /&gt;
| start socket server on some free port&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
Example&lt;br /&gt;
&lt;br /&gt;
 probcli my.mch ...&lt;br /&gt;
&lt;br /&gt;
=== -sptxt &amp;lt;FILE&amp;gt;===&lt;br /&gt;
&lt;br /&gt;
Description&lt;br /&gt;
&lt;br /&gt;
{| style=&amp;quot;color:black; background-color:#FFFFEF; border:1px solid lightgray;&amp;quot; cellpadding=&amp;quot;10&amp;quot; cellspacing=&amp;quot;0&amp;quot; width=&amp;quot;100%&amp;quot;&lt;br /&gt;
| save constants and variables to a file&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
Save the values of constants and variables to a text file in classical B syntax.&lt;br /&gt;
The -sptxt command is executed after the -init, -animate, -t or -mc commands.&lt;br /&gt;
The values are fully written out (some sets, e.g., infinite sets may be written out symbolically).&lt;br /&gt;
&lt;br /&gt;
See also the -his command.&lt;br /&gt;
&lt;br /&gt;
Example&lt;br /&gt;
&lt;br /&gt;
 probcli -animate 5 -sptxt state.txt  supersimple.mch&lt;br /&gt;
&lt;br /&gt;
This will write the values of all variables and constants to the file state.txt after animating the machine 5 steps.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
=== -cache &amp;lt;DIRECTORY&amp;gt;===&lt;br /&gt;
&lt;br /&gt;
Description&lt;br /&gt;
&lt;br /&gt;
{| style=&amp;quot;color:black; background-color:#FFFFEF; border:1px solid lightgray;&amp;quot; cellpadding=&amp;quot;10&amp;quot; cellspacing=&amp;quot;0&amp;quot; width=&amp;quot;100%&amp;quot;&lt;br /&gt;
| save constants (and in future also variables) to a file to avoid recomputation&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
This commands saves the values of constants for the current B machine and puts those values into files in the specified directory. The command will also tell ProB to try and reuse constants saved for subsidiary machines (included using SEES for example) whenever possible.&lt;br /&gt;
The purpose of the command is to avoid recomputing constants as much as possible, as this can be very time consuming.&lt;br /&gt;
This also works for values of variables computed in the initialisation or even using operations.&lt;br /&gt;
However, we do not support refinements at the moment.&lt;br /&gt;
&lt;br /&gt;
Note: this command can also be used when starting up the ProB Tcl/Tk version.&lt;br /&gt;
&lt;br /&gt;
=== -l &amp;lt;LogFile&amp;gt; ===&lt;br /&gt;
&lt;br /&gt;
Description&lt;br /&gt;
&lt;br /&gt;
{| style=&amp;quot;color:black; background-color:#FFFFEF; border:1px solid lightgray;&amp;quot; cellpadding=&amp;quot;10&amp;quot; cellspacing=&amp;quot;0&amp;quot; width=&amp;quot;100%&amp;quot;&lt;br /&gt;
| log activities in &amp;lt;LogFile&amp;gt;&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
Example&lt;br /&gt;
&lt;br /&gt;
 probcli my.mch -mc 1000 -l my.log&lt;br /&gt;
&lt;br /&gt;
=== -ll ===&lt;br /&gt;
&lt;br /&gt;
Description&lt;br /&gt;
&lt;br /&gt;
{| style=&amp;quot;color:black; background-color:#FFFFEF; border:1px solid lightgray;&amp;quot; cellpadding=&amp;quot;10&amp;quot; cellspacing=&amp;quot;0&amp;quot; width=&amp;quot;100%&amp;quot;&lt;br /&gt;
| log activities in /tmp/prob_cli_debug.log&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
Example&lt;br /&gt;
&lt;br /&gt;
 probcli my.mch -mc 1000 -ll&lt;br /&gt;
&lt;br /&gt;
=== -lg &amp;lt;LogFile&amp;gt; ===&lt;br /&gt;
&lt;br /&gt;
Description&lt;br /&gt;
&lt;br /&gt;
{| style=&amp;quot;color:black; background-color:#FFFFEF; border:1px solid lightgray;&amp;quot; cellpadding=&amp;quot;10&amp;quot; cellspacing=&amp;quot;0&amp;quot; width=&amp;quot;100%&amp;quot;&lt;br /&gt;
| analyse &amp;lt;LogFile&amp;gt; using gnuplot&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
Example&lt;br /&gt;
&lt;br /&gt;
 probcli my.mch ...&lt;br /&gt;
&lt;br /&gt;
=== -pp &amp;lt;FILE&amp;gt; ===&lt;br /&gt;
&lt;br /&gt;
Description&lt;br /&gt;
&lt;br /&gt;
{| style=&amp;quot;color:black; background-color:#FFFFEF; border:1px solid lightgray;&amp;quot; cellpadding=&amp;quot;10&amp;quot; cellspacing=&amp;quot;0&amp;quot; width=&amp;quot;100%&amp;quot;&lt;br /&gt;
| pretty-print internal representation to &amp;lt;FILE&amp;gt;&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
Example&lt;br /&gt;
&lt;br /&gt;
 probcli my.mch -pp my_pp.mch&lt;br /&gt;
&lt;br /&gt;
=== -ppf &amp;lt;FILE&amp;gt; ===&lt;br /&gt;
&lt;br /&gt;
Description&lt;br /&gt;
&lt;br /&gt;
{| style=&amp;quot;color:black; background-color:#FFFFEF; border:1px solid lightgray;&amp;quot; cellpadding=&amp;quot;10&amp;quot; cellspacing=&amp;quot;0&amp;quot; width=&amp;quot;100%&amp;quot;&lt;br /&gt;
| pretty-print internal representation to &amp;lt;FILE&amp;gt;, force printing of all type infos&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
Example&lt;br /&gt;
&lt;br /&gt;
 probcli my.mch -ppf my_ppf.mch&lt;br /&gt;
&lt;br /&gt;
=== -v ===&lt;br /&gt;
&lt;br /&gt;
Description&lt;br /&gt;
&lt;br /&gt;
{| style=&amp;quot;color:black; background-color:#FFFFEF; border:1px solid lightgray;&amp;quot; cellpadding=&amp;quot;10&amp;quot; cellspacing=&amp;quot;0&amp;quot; width=&amp;quot;100%&amp;quot;&lt;br /&gt;
| set ProB into verbose mode&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
Example&lt;br /&gt;
&lt;br /&gt;
 probcli my.mch -mc 1000 -v&lt;br /&gt;
&lt;br /&gt;
=== -version ===&lt;br /&gt;
&lt;br /&gt;
Description&lt;br /&gt;
&lt;br /&gt;
{| style=&amp;quot;color:black; background-color:#FFFFEF; border:1px solid lightgray;&amp;quot; cellpadding=&amp;quot;10&amp;quot; cellspacing=&amp;quot;0&amp;quot; width=&amp;quot;100%&amp;quot;&lt;br /&gt;
| print version information&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
There is also an alternate command called -svers which just prints the version number of ProB.&lt;br /&gt;
Example&lt;br /&gt;
&lt;br /&gt;
 probcli -version&lt;br /&gt;
 ProB Command Line Interface&lt;br /&gt;
   VERSION 1.3.4-rc1 (9556:9570M)&lt;br /&gt;
   $LastChangedDate: 2011-11-16 18:36:18 +0100 (Wed, 16 Nov 2011) $&lt;br /&gt;
   Prolog: SICStus 4.2.0 (x86_64-darwin-10.6.0): Mon Mar  7 20:03:36 CET 2011&lt;br /&gt;
   Application Path: /Users/leuschel/svn_root/NewProB&lt;br /&gt;
&lt;br /&gt;
 probcli -svers&lt;br /&gt;
 VERSION 1.3.4-rc1 (9556:9570M)&lt;br /&gt;
&lt;br /&gt;
=== -assertions ===&lt;br /&gt;
&lt;br /&gt;
Description&lt;br /&gt;
&lt;br /&gt;
{| style=&amp;quot;color:black; background-color:#FFFFEF; border:1px solid lightgray;&amp;quot; cellpadding=&amp;quot;10&amp;quot; cellspacing=&amp;quot;0&amp;quot; width=&amp;quot;100%&amp;quot;&lt;br /&gt;
| check ASSERTIONS of your machine&lt;br /&gt;
&lt;br /&gt;
If you provide the -t switch, the ASSERTIONS will be checked after executing your trace. Otherwise, they will be checked in an initial state.&lt;br /&gt;
ProB will automatically initialize the machine if you have not provide the -init or -t switch.&lt;br /&gt;
&lt;br /&gt;
You can also use -main_assertions to check only the ASSERTIONS found in the main file.&lt;br /&gt;
&lt;br /&gt;
If your ASSERTIONS are all static (i.e., make no reference to variables), then ProB will remove all CONSTANTS and PROPERTIES from your machine which are not linked (directly or indirectly) to the ASSERTIONS.&lt;br /&gt;
This optimization will only be made if you provide no other switch, such as -mc or -animate which may require the computation of the variables.&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
Example&lt;br /&gt;
&lt;br /&gt;
 probcli my.mch -init -assertions&lt;br /&gt;
&lt;br /&gt;
=== -properties ===&lt;br /&gt;
&lt;br /&gt;
Description&lt;br /&gt;
&lt;br /&gt;
{| style=&amp;quot;color:black; background-color:#FFFFEF; border:1px solid lightgray;&amp;quot; cellpadding=&amp;quot;10&amp;quot; cellspacing=&amp;quot;0&amp;quot; width=&amp;quot;100%&amp;quot;&lt;br /&gt;
| check PROPERTIES&lt;br /&gt;
Note: you should probably first initialise the machine (e.g., with -init).&lt;br /&gt;
If the constants have not yet been set up, probcli will debug the properties.&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
Example&lt;br /&gt;
&lt;br /&gt;
 probcli my.mch -init -properties&lt;br /&gt;
&lt;br /&gt;
=== -dot_output &amp;lt;PATH&amp;gt; ===&lt;br /&gt;
&lt;br /&gt;
Description&lt;br /&gt;
&lt;br /&gt;
{| style=&amp;quot;color:black; background-color:#FFFFEF; border:1px solid lightgray;&amp;quot; cellpadding=&amp;quot;10&amp;quot; cellspacing=&amp;quot;0&amp;quot; width=&amp;quot;100%&amp;quot;&lt;br /&gt;
| define path for generation of dot files for false properties or assertions&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
This option is applicable to -properties and -assertions. It will result in individual dot files being generated for every false or unknown property or assertion. Assertions are numbered A0,A1,... and properties P0,P1,... You can also force to generate dot files for all properties (i.e., also the true ones) using the -dot_all command-line flag.&lt;br /&gt;
&lt;br /&gt;
Example&lt;br /&gt;
&lt;br /&gt;
 probcli my.mch -init -properties -dot_output somewhere/&lt;br /&gt;
&lt;br /&gt;
This will generate files somewhere/my_P0_false.dot, somewhere/my_P1_false.dot, ...&lt;br /&gt;
&lt;br /&gt;
=== -rc ===&lt;br /&gt;
&lt;br /&gt;
Description&lt;br /&gt;
&lt;br /&gt;
{| style=&amp;quot;color:black; background-color:#FFFFEF; border:1px solid lightgray;&amp;quot; cellpadding=&amp;quot;10&amp;quot; cellspacing=&amp;quot;0&amp;quot; width=&amp;quot;100%&amp;quot;&lt;br /&gt;
| runtime checking of types/pre-/post-conditions&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
Example&lt;br /&gt;
&lt;br /&gt;
 probcli my.mch ...&lt;br /&gt;
&lt;br /&gt;
=== -ltlfile &amp;lt;FILE&amp;gt; ===&lt;br /&gt;
&lt;br /&gt;
Description&lt;br /&gt;
&lt;br /&gt;
{| style=&amp;quot;color:black; background-color:#FFFFEF; border:1px solid lightgray;&amp;quot; cellpadding=&amp;quot;10&amp;quot; cellspacing=&amp;quot;0&amp;quot; width=&amp;quot;100%&amp;quot;&lt;br /&gt;
| check LTL formulas in file &amp;lt;FILE&amp;gt;&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
Example&lt;br /&gt;
&lt;br /&gt;
 probcli my.mch ...&lt;br /&gt;
&lt;br /&gt;
=== -ltlassertions ===&lt;br /&gt;
&lt;br /&gt;
Description&lt;br /&gt;
&lt;br /&gt;
{| style=&amp;quot;color:black; background-color:#FFFFEF; border:1px solid lightgray;&amp;quot; cellpadding=&amp;quot;10&amp;quot; cellspacing=&amp;quot;0&amp;quot; width=&amp;quot;100%&amp;quot;&lt;br /&gt;
| check LTL assertions (in DEFINITIONS)&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
Example&lt;br /&gt;
&lt;br /&gt;
 probcli my.mch ...&lt;br /&gt;
&lt;br /&gt;
=== -ltllimit &amp;lt;LIMIT&amp;gt; ===&lt;br /&gt;
&lt;br /&gt;
Description&lt;br /&gt;
&lt;br /&gt;
{| style=&amp;quot;color:black; background-color:#FFFFEF; border:1px solid lightgray;&amp;quot; cellpadding=&amp;quot;10&amp;quot; cellspacing=&amp;quot;0&amp;quot; width=&amp;quot;100%&amp;quot;&lt;br /&gt;
| explore at most &amp;lt;LIMIT&amp;gt; states when model-checking LTL&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
Example&lt;br /&gt;
&lt;br /&gt;
 probcli my.mch ...&lt;br /&gt;
&lt;br /&gt;
=== -save &amp;lt;FILE&amp;gt; ===&lt;br /&gt;
&lt;br /&gt;
Description&lt;br /&gt;
&lt;br /&gt;
{| style=&amp;quot;color:black; background-color:#FFFFEF; border:1px solid lightgray;&amp;quot; cellpadding=&amp;quot;10&amp;quot; cellspacing=&amp;quot;0&amp;quot; width=&amp;quot;100%&amp;quot;&lt;br /&gt;
| save state space for later refinement check&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
Example&lt;br /&gt;
&lt;br /&gt;
 probcli my.mch ...&lt;br /&gt;
&lt;br /&gt;
=== -refchk &amp;lt;FILE&amp;gt; ===&lt;br /&gt;
&lt;br /&gt;
Description&lt;br /&gt;
&lt;br /&gt;
{| style=&amp;quot;color:black; background-color:#FFFFEF; border:1px solid lightgray;&amp;quot; cellpadding=&amp;quot;10&amp;quot; cellspacing=&amp;quot;0&amp;quot; width=&amp;quot;100%&amp;quot;&lt;br /&gt;
| refinement check against previous saved state space&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
Example&lt;br /&gt;
&lt;br /&gt;
 probcli my.mch ...&lt;br /&gt;
&lt;br /&gt;
=== -mcm_tests &amp;lt;Depth&amp;gt; &amp;lt;MaxStates&amp;gt; &amp;lt;EndPredicate&amp;gt; &amp;lt;FILE&amp;gt; ===&lt;br /&gt;
&lt;br /&gt;
Generate test cases for the given specification. Each test case consists of a sequence of operations resp. events (a so-called trace) that&lt;br /&gt;
* start in a state after an initialisation&lt;br /&gt;
* contain a requested operation/event&lt;br /&gt;
* end in a state where the &amp;lt;EndPredicate&amp;gt; is fulfilled&lt;br /&gt;
&lt;br /&gt;
The user can specify what requested operations/events are with the&lt;br /&gt;
option [[#-mcm_cover &amp;lt;Operation(s)&amp;gt;|-mcm_cover]].&lt;br /&gt;
&lt;br /&gt;
ProB uses a &amp;quot;breadth-first&amp;quot; approach to search for test cases. When all requested operations/events are covered by test cases within maximum length M, the algorithm will explore the complete state space with that maximum distance M from the initialisation. It outputs all found traces that satisfy the requirements above.&lt;br /&gt;
&lt;br /&gt;
The algorithm stops if either&lt;br /&gt;
* it has covered all required operations/events with the current search depth&lt;br /&gt;
* or it has reached the maximum search depth or maximum number of explored states.&lt;br /&gt;
&lt;br /&gt;
The required parameters are:&lt;br /&gt;
;Depth&lt;br /&gt;
: The maximum length of traces that the algorithm searches for test until it stops without covering all required operations/events.&lt;br /&gt;
;MaxStates&lt;br /&gt;
: The maximum number of explored states until the algorithm stops without covering all required operations/events.&lt;br /&gt;
;EndPredicate&lt;br /&gt;
: A predicate in B syntax that the last state of a trace must fulfil. If you do not have any restrictions on that state, use a trivially true predicate like &#039;&#039;&#039;1=1&#039;&#039;&#039;&lt;br /&gt;
;FILE&lt;br /&gt;
: The found test cases a written to the XML file &amp;lt;FILE&amp;gt;.&lt;br /&gt;
&lt;br /&gt;
Example&lt;br /&gt;
&lt;br /&gt;
 probcli my.mch -mcm_tests 10 2000 &amp;quot;EndStateVar=TRUE&amp;quot; testcases.xml -mcm_cover op1,op2&lt;br /&gt;
&lt;br /&gt;
generates test cases for the operations &#039;&#039;&#039;op1&#039;&#039;&#039; and &#039;&#039;&#039;op2&#039;&#039;&#039; of the specification &#039;&#039;&#039;my.mch&#039;&#039;&#039;. The maximum length of traces is 10, at most 2000 states are explored. Each test case ends in a state where the predicate &#039;&#039;&#039;EndStateVar=TRUE&#039;&#039;&#039; holds. The found test cases are written to a file &#039;&#039;&#039;testcases.xml&#039;&#039;&#039;.&lt;br /&gt;
&lt;br /&gt;
=== -mcm_cover &amp;lt;Operation(s)&amp;gt; ===&lt;br /&gt;
&lt;br /&gt;
Specify an operation or event that should be covered when generating test cases with the &#039;&#039;&#039;-mcm_test&#039;&#039;&#039; option. Multiple operations/events can be specified by seperating them by comma or by using &#039;&#039;&#039;-mcm_cover&#039;&#039;&#039; several times.&lt;br /&gt;
&lt;br /&gt;
See [[#-mcm_tests &amp;lt;Depth&amp;gt; &amp;lt;MaxStates&amp;gt; &amp;lt;EndPredicate&amp;gt; &amp;lt;FILE&amp;gt;|-mcm-tests]] for further details.&lt;br /&gt;
&lt;br /&gt;
=== -spdot &amp;lt;FILE&amp;gt; ===&lt;br /&gt;
&lt;br /&gt;
Description&lt;br /&gt;
&lt;br /&gt;
{| style=&amp;quot;color:black; background-color:#FFFFEF; border:1px solid lightgray;&amp;quot; cellpadding=&amp;quot;10&amp;quot; cellspacing=&amp;quot;0&amp;quot; width=&amp;quot;100%&amp;quot;&lt;br /&gt;
| Write graph of the state space to a dot &amp;lt;FILE&amp;gt;&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
Example&lt;br /&gt;
&lt;br /&gt;
 probcli my.mch -mc 100 -spdot my_statespace.dot&lt;br /&gt;
&lt;br /&gt;
=== -cbc_tests &amp;lt;Depth&amp;gt; &amp;lt;EndPredicate&amp;gt; &amp;lt;File&amp;gt; ===&lt;br /&gt;
Generate test cases by constraint solving with maximum&lt;br /&gt;
length &#039;&#039;&#039;Depth&#039;&#039;&#039;, the last state satisfies &#039;&#039;&#039;EndPredicate&#039;&#039;&#039;&lt;br /&gt;
and the test cases are written to &#039;&#039;&#039;File&#039;&#039;&#039;. If the predicate is the empty string we assume truth. If the filename is the empty string no file is generated. See also the page on [[Test_Case_Generation]].&lt;br /&gt;
&lt;br /&gt;
=== -cbc_cover &amp;lt;Operation&amp;gt; ===&lt;br /&gt;
When generating CB test cases, &#039;&#039;&#039;Operation&#039;&#039;&#039; should be covered.&lt;br /&gt;
The option can be given multiple times to specify several operations.&lt;br /&gt;
Alternatively, multiple operations can be separated by a comma. You can also use the option &amp;lt;pre&amp;gt;-cbc_cover_match PartialName&amp;lt;/pre&amp;gt; to match all operations whose name contains PartialName. See also the page about [[Test_Case_Generation]].&lt;br /&gt;
&lt;br /&gt;
=== -test_description &amp;lt;File&amp;gt; ===&lt;br /&gt;
Read the options for constraint based test case generation from &#039;&#039;&#039;File&#039;&#039;&#039;.&lt;br /&gt;
&lt;br /&gt;
=== -bmc &amp;lt;Depth&amp;gt; ===&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
{| style=&amp;quot;color:black; background-color:#FFFFEF; border:1px solid lightgray;&amp;quot; cellpadding=&amp;quot;10&amp;quot; cellspacing=&amp;quot;0&amp;quot; width=&amp;quot;100%&amp;quot;&lt;br /&gt;
| Run the [[Bounded_Model_Checking|bounded model checker]] until maximum trace depth &amp;lt;Depth&amp;gt; specified. Looks for invariant violations using the constraint-based test case generation algorithm.&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
Example&lt;br /&gt;
&lt;br /&gt;
 probcli my.mch -bmc 20&lt;br /&gt;
&lt;br /&gt;
=== -csp-guide &amp;lt;File&amp;gt; ===&lt;br /&gt;
Use the CSP File &#039;&#039;&#039;File&#039;&#039;&#039; to guide the B Machine (&amp;quot;CSP||B&amp;quot;).&lt;br /&gt;
(This feature is included since version 1.3.5-beta7.)&lt;br /&gt;
&lt;br /&gt;
== Preferences ==&lt;br /&gt;
&lt;br /&gt;
You can use these preferences within the command:&lt;br /&gt;
&lt;br /&gt;
 -p &amp;lt;PREFERENCE&amp;gt; &amp;lt;VALUE&amp;gt;&lt;br /&gt;
&lt;br /&gt;
{| cellpadding=&amp;quot;5&amp;quot; cellspacing=&amp;quot;1&amp;quot; width=&amp;quot;100%&amp;quot; border=&amp;quot;1&amp;quot;&lt;br /&gt;
!style=&amp;quot;background-color:lightgrey;&amp;quot; | &amp;lt;PREFERENCE&amp;gt;&lt;br /&gt;
!style=&amp;quot;background-color:lightgrey;&amp;quot; | &amp;lt;VALUE&amp;gt;&lt;br /&gt;
|-&lt;br /&gt;
| MAXINT&lt;br /&gt;
| nat ==&amp;gt; MaxInt, used for expressions such as xx::NAT (2147483647 for 4 byte ints)&lt;br /&gt;
|-&lt;br /&gt;
| MININT&lt;br /&gt;
| neg ==&amp;gt; MinInt, used for expressions such as xx::INT (-2147483648 for 4 byte ints)&lt;br /&gt;
|-&lt;br /&gt;
| DEFAULT_SETSIZE&lt;br /&gt;
| nat ==&amp;gt; Size of unspecified deferred sets in SETS section. Will be used if a set s is neither enumerated, has no no card(s)=nr predicate in the PROPERTIES and has no scope_s == Nr DEFINITION.&lt;br /&gt;
|-&lt;br /&gt;
| MAX_INITIALISATIONS&lt;br /&gt;
| nat ==&amp;gt; Max Number of Initialisations and ways to setup constants computed&lt;br /&gt;
|-&lt;br /&gt;
| MAX_OPERATIONS&lt;br /&gt;
| nat ==&amp;gt; Max Number of Enablings per Operation Computed&lt;br /&gt;
|-&lt;br /&gt;
| ANIMATE_SKIP_OPERATIONS&lt;br /&gt;
| bool ==&amp;gt; Animate operations which are skip or PRE C THEN skip&lt;br /&gt;
|-&lt;br /&gt;
| COMPRESSION&lt;br /&gt;
| bool ==&amp;gt; Use more aggressive COMPRESSION when storing states&lt;br /&gt;
|-&lt;br /&gt;
| EXPAND_CLOSURES_FOR_STATE&lt;br /&gt;
| bool ==&amp;gt; Convert lazy form back into explicit form for Variables, Constants, Operation Arguments. ProB will sometimes try to keep certain sets symbolic. If this preference is TRUE then ProB will try to expand those sets for variables and constants after an operation has been executed.&lt;br /&gt;
|-&lt;br /&gt;
| SYMBOLIC&lt;br /&gt;
| bool ==&amp;gt; Lazy expansion of lambdas and set comprehensions. By default ProB will keep certain sets symbolic (e.g., sets it knows are infinite). When this preference is set to TRUE then all set comprehensions and lambda abstractions will at first be kept symbolic and only expanded into explicit form if needed.&lt;br /&gt;
|-&lt;br /&gt;
| CLPFD&lt;br /&gt;
| bool ==&amp;gt; Use CLP(FD) solver for B integers (restricts range to -2^28..2^28-1 on 32 bit computers). Setting this preference to TRUE should substantially improve ProB&#039;s ability to solve complicated predicates involving integers. However, it may cause CLP(FD) overflows in certain circumstances.&lt;br /&gt;
|-&lt;br /&gt;
| SMT&lt;br /&gt;
| bool ==&amp;gt; Enable SMT-Mode (aggressive treatment of : and /: inside predicates). With this predicate set to TRUE ProB will be better at solving certain constraint solving tasks. It should be enabled when doing constraint-based invariant or deadlock checking. ProB Tcl/Tk will turn this preference on automatically for those checks.&lt;br /&gt;
|-&lt;br /&gt;
| STATIC_ORDERING&lt;br /&gt;
| bool ==&amp;gt; Use static ordering to enumerate constants which occur in most PROPERTIES first&lt;br /&gt;
|-&lt;br /&gt;
| SYMMETRY_MODE&lt;br /&gt;
| [off,flood,nauty,hash] ==&amp;gt; Symmetry Mode: off,flood,canon,nauty,hash&lt;br /&gt;
|-&lt;br /&gt;
| TIME_OUT&lt;br /&gt;
| nat1 ==&amp;gt; Time out for computing enabled transitions (in ms)&lt;br /&gt;
|-&lt;br /&gt;
| PROOF_INFO&lt;br /&gt;
| bool ==&amp;gt; Use Proof Information to restrict invariant checking to affected unproven clauses. Most useful in EventB for models exported from Rodin.&lt;br /&gt;
|-&lt;br /&gt;
| TRY_FIND_ABORT&lt;br /&gt;
| bool ==&amp;gt; Try more aggressively to detect ill-defined expressions (e.g. applying function outside of domain), may slow down animator&lt;br /&gt;
|-&lt;br /&gt;
| NUMBER_OF_ANIMATED_ABSTRACTIONS&lt;br /&gt;
| nat ==&amp;gt; How many levels of refined models are animated by default&lt;br /&gt;
|-&lt;br /&gt;
| ALLOW_INCOMPLETE_SETUP_CONSTANTS&lt;br /&gt;
| bool ==&amp;gt; Allow ProB to proceed even if only part of the CONSTANTS have been found.&lt;br /&gt;
|-&lt;br /&gt;
| PARTITION_PROPERTIES&lt;br /&gt;
| bool ==&amp;gt; Partition predicates (PROPERTIES) into components&lt;br /&gt;
|-&lt;br /&gt;
| USE_RECORD_CONSTRUCTION&lt;br /&gt;
| bool ==&amp;gt; Records: Check if axioms/properties describe a record pattern&lt;br /&gt;
|-&lt;br /&gt;
| OPERATION_REUSE&lt;br /&gt;
| bool ==&amp;gt; Try and reuse previously computed operation effects in B/Event-B&lt;br /&gt;
|-&lt;br /&gt;
| SHOW_EVENTB_ANY_VALUES&lt;br /&gt;
| bool ==&amp;gt; Show top-level ANY variable values of B Operations without parameters as parameters&lt;br /&gt;
|-&lt;br /&gt;
| RANDOMISE_OPERATION_ORDER&lt;br /&gt;
| bool ==&amp;gt; Randomise order of operations when computing successor states&lt;br /&gt;
|-&lt;br /&gt;
| EXPAND_FORALL_UPTO&lt;br /&gt;
| nat ==&amp;gt; When analysing predicates: max. domain size for expansion of forall (use 0 to disable expansion)&lt;br /&gt;
|-&lt;br /&gt;
| MAX_DISPLAY_SET&lt;br /&gt;
| int ==&amp;gt; Max size for pretty-printing sets (-1 means no limit)&lt;br /&gt;
|-&lt;br /&gt;
| CSP_STRIP_SOURCE_LOC&lt;br /&gt;
| bool ==&amp;gt; Strip source location for CSP; will speed up model checking&lt;br /&gt;
|-&lt;br /&gt;
| WARN_WHEN_EXPANDING_INFINITE_CLOSURES&lt;br /&gt;
| int ==&amp;gt; Warn when expanding infinite closures if MAXINT larger than:&lt;br /&gt;
|-&lt;br /&gt;
| TRACE_INFO&lt;br /&gt;
| bool ==&amp;gt; Provide various tracing information on the terminal/console.&lt;br /&gt;
|-&lt;br /&gt;
| DOUBLE_EVALUATION&lt;br /&gt;
| bool ==&amp;gt; Evaluate PREDICATES positively and negatively when analyzing assertions or properties&lt;br /&gt;
|-&lt;br /&gt;
| RECURSIVE&lt;br /&gt;
| bool ==&amp;gt; Lazy expansion of *Recursive* set Comprehensions and lambdas&lt;br /&gt;
|-&lt;br /&gt;
| IGNORE_HASH_COLLISIONS&lt;br /&gt;
| bool ==&amp;gt; Ignore Hash Collisions (if true not all states may be computed, visited states are not memorised !)&lt;br /&gt;
|-&lt;br /&gt;
| FORGET_STATE_SPACE&lt;br /&gt;
| bool ==&amp;gt; Do not remember state space (mainly useful in conjunction with Ignore Hash Collisions)&lt;br /&gt;
|-&lt;br /&gt;
| NEGATED_INVARIANT_CHECKING&lt;br /&gt;
| bool ==&amp;gt; Perform double evaluation (positive and negative) when checking invariants&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
Example&lt;br /&gt;
&lt;br /&gt;
 probcli my.mch -p TIME_OUT 5000 -p CLPFD TRUE -p SYMMETRY_MODE hash -mc 1000&lt;br /&gt;
&lt;br /&gt;
== Some probcli examples ==&lt;br /&gt;
&lt;br /&gt;
To load a file My.mch, setup the constants and initialize it do:&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
probcli -init My.mch&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
To load a file M.mch, setup the constants, initialize and then check all assertions with Atelier-B&#039;s default values for MININT and MAXINT and an increased timeout of 5 seconds do:&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
probcli -init -assertions -p MAXINT 2147483647 -p MININT -2147483647 -p TIME_OUT 5000 M.mch&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
To model check a specification M.mch while trying to minimize memory consumption and using symmtery reduction (and accepting hash collisions) do:&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
probcli -p IGNORE_HASH_COLLISIONS TRUE -p FORGET_STATE_SPACE TRUE -p SYMMETRY_MODE hash -mc 999999 M.mch &lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
{{Feedback}}&lt;/div&gt;</summary>
		<author><name>Bivab</name></author>
	</entry>
	<entry>
		<id>https://prob.hhu.de/w/index.php?title=Template:User_Manual_Index&amp;diff=1491</id>
		<title>Template:User Manual Index</title>
		<link rel="alternate" type="text/html" href="https://prob.hhu.de/w/index.php?title=Template:User_Manual_Index&amp;diff=1491"/>
		<updated>2012-02-28T09:59:32Z</updated>

		<summary type="html">&lt;p&gt;Bivab: Link to test case generation&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;* [[Installation]]&lt;br /&gt;
* [[Current Limitations]]&lt;br /&gt;
* [[General Presentation (tcl/tk)]]&lt;br /&gt;
* [[Graphical Viewer]]&lt;br /&gt;
* [[Graphical Visualization]]&lt;br /&gt;
* [[State Space Visualization]]&lt;br /&gt;
* [[Consistency Checking]]&lt;br /&gt;
* [[Constraint Based Checking]]&lt;br /&gt;
* [[Refinement Checking]]&lt;br /&gt;
* [[LTL Model Checking]]&lt;br /&gt;
* [[Using ProB with Atelier B]]&lt;br /&gt;
* [[CSP-M|Using CSP-M in ProB]]&lt;br /&gt;
* [[ProZ|Using ProZ for Animation and Model Checking of Z Specifications]]&lt;br /&gt;
* [[TLA|Using ProB for TLA Specifications]]&lt;br /&gt;
* [[Other languages|Using ProB with Promela and other languages]]&lt;br /&gt;
* [[Symmetry Reduction]]&lt;br /&gt;
* [[Recursively Defined Functions]]&lt;br /&gt;
* [[Test Case Generation]]&lt;br /&gt;
* [[FAQ]]&lt;br /&gt;
* [[Troubleshooting]]&lt;br /&gt;
* [[Tips: Writing Models for ProB]]&lt;br /&gt;
* [[Using the Command-Line Version of ProB]]&lt;/div&gt;</summary>
		<author><name>Bivab</name></author>
	</entry>
	<entry>
		<id>https://prob.hhu.de/w/index.php?title=Test_Case_Generation&amp;diff=1490</id>
		<title>Test Case Generation</title>
		<link rel="alternate" type="text/html" href="https://prob.hhu.de/w/index.php?title=Test_Case_Generation&amp;diff=1490"/>
		<updated>2012-02-28T09:58:06Z</updated>

		<summary type="html">&lt;p&gt;Bivab: Add to user manual category&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;[[Category:User Manual]]&lt;br /&gt;
&lt;br /&gt;
Constraint based test case generation allows to explore the state space for a&lt;br /&gt;
machine and generate traces of operations that cover certain user defined&lt;br /&gt;
operations and meet a given condition to end the search.&lt;br /&gt;
&lt;br /&gt;
We will use the following B Machine as an example, which is stored in a file called &amp;lt;tt&amp;gt;simplecounter.mch&amp;lt;/tt&amp;gt;.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
MACHINE SimpleCounter&lt;br /&gt;
DEFINITIONS MAX==4&lt;br /&gt;
VARIABLES count&lt;br /&gt;
INVARIANT&lt;br /&gt;
 count: 1..MAX&lt;br /&gt;
INITIALISATION count := 1&lt;br /&gt;
OPERATIONS&lt;br /&gt;
  Increase(y) = PRE y: 1..(MAX-count) THEN&lt;br /&gt;
     count := count+y&lt;br /&gt;
  END;&lt;br /&gt;
  Reset = BEGIN count := 1 END&lt;br /&gt;
END&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
== How To run ==&lt;br /&gt;
&lt;br /&gt;
To start the test case generation there are two alternatives. We can either provide all settings as command line arguments or in a test description file.&lt;br /&gt;
&lt;br /&gt;
=== From the command line  ===&lt;br /&gt;
From the command line there are four relevant settings to configure the test case&lt;br /&gt;
generation&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
-cb_tests Depth EndPredicate File&lt;br /&gt;
        generate test cases by constraint solving with maximum&lt;br /&gt;
        length Depth, the last state satisfies EndPredicate&lt;br /&gt;
        and the test cases are written to File&lt;br /&gt;
&lt;br /&gt;
-cb_cover Operation&lt;br /&gt;
        when generating CB test cases, Operation should be covered. Each&lt;br /&gt;
        operation to be covered needs to be specified separately.&lt;br /&gt;
&lt;br /&gt;
-p CLPFD&lt;br /&gt;
        flag to enable the CLPFD constraint solver to search the state space, which is highly recommended.&lt;br /&gt;
-p TIME_OUT&lt;br /&gt;
        time out in milliseconds to abort the exploration of each possible trace&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;Example:&#039;&#039;&#039;&lt;br /&gt;
To generate test cases that cover the event &amp;lt;tt&amp;gt;Increase&amp;lt;/tt&amp;gt; in the machine above, leading to a state where&lt;br /&gt;
&amp;lt;tt&amp;gt;count = MAX-1&amp;lt;/tt&amp;gt; is true and the explored paths do not have a depth of more than 5 operations we would specify this as follows, where we use CLPFD and have a timeout of 2000 ms. for each explored trace:&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
./probcli.sh simeplecounter.mch -cb_tests 5 count=MAX-1 test_results.xml -cb_cover Increase -p CLPFD true -p TIME_OUT 2000&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
The generated test cases are stored in a file called test_results.xml.&lt;br /&gt;
&lt;br /&gt;
=== Test Generation Description ===&lt;br /&gt;
The configuration for the test case generation can also be provided as an XML file.&lt;br /&gt;
The format is shown below:&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
&amp;lt;test-generation-description&amp;gt;&lt;br /&gt;
  &amp;lt;output-file&amp;gt;OUTPUT FILE NAME&amp;lt;/output-file&amp;gt;&lt;br /&gt;
  &amp;lt;event-coverage&amp;gt;&lt;br /&gt;
    &amp;lt;event&amp;gt;EVENT 1&amp;lt;/event&amp;gt;&lt;br /&gt;
    &amp;lt;event&amp;gt;EVENT 2&amp;lt;/event&amp;gt;&lt;br /&gt;
  &amp;lt;/event-coverage&amp;gt;&lt;br /&gt;
  &amp;lt;target&amp;gt;TARGET PREDICATE&amp;lt;/target&amp;gt;&lt;br /&gt;
  &amp;lt;!-- the parameters section contains parameters that are very ProB-specific --&amp;gt;&lt;br /&gt;
  &amp;lt;parameters&amp;gt;&lt;br /&gt;
    &amp;lt;!-- the maximum depth is the maximum length of a trace of operations/event,&lt;br /&gt;
         the algorithm might stop earlier when all events are covered --&amp;gt;&lt;br /&gt;
    &amp;lt;maximum-depth&amp;gt;N&amp;lt;/maximum-depth&amp;gt;&lt;br /&gt;
    &amp;lt;!-- any ProB preference can be set that is listed when calling &amp;quot;probcli -help -v&amp;quot; --&amp;gt;&lt;br /&gt;
    &amp;lt;!-- other probably interesting preferences are MININT, MAXINT and TIME_OUT --&amp;gt;&lt;br /&gt;
  &amp;lt;/parameters&amp;gt;&lt;br /&gt;
&amp;lt;/test-generation-description&amp;gt;&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;Example:&#039;&#039;&#039;&lt;br /&gt;
For our example the description file would look as follows.&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
&amp;lt;test-generation-description&amp;gt;&lt;br /&gt;
  &amp;lt;output-file&amp;gt;test_results.xml&amp;lt;/output-file&amp;gt;&lt;br /&gt;
  &amp;lt;event-coverage&amp;gt;&lt;br /&gt;
    &amp;lt;event&amp;gt;Increase&amp;lt;/event&amp;gt;&lt;br /&gt;
  &amp;lt;/event-coverage&amp;gt;&lt;br /&gt;
  &amp;lt;target&amp;gt;count = MAX - 1&amp;lt;/target&amp;gt;&lt;br /&gt;
  &amp;lt;parameters&amp;gt;&lt;br /&gt;
    &amp;lt;maximum-depth&amp;gt;5&amp;lt;/maximum-depth&amp;gt;&lt;br /&gt;
    &amp;lt;!-- Please note: TIME_OUT (in milliseconds) is not a global time out, it is per trace --&amp;gt;&lt;br /&gt;
    &amp;lt;preference name=&amp;quot;CLPFD&amp;quot; value=&amp;quot;true&amp;quot;/&amp;gt;&lt;br /&gt;
    &amp;lt;!-- Please note: TIME_OUT (in milliseconds) is not a global time out, it is per trace --&amp;gt;&lt;br /&gt;
    &amp;lt;preference name=&amp;quot;TIME_OUT&amp;quot; value=&amp;quot;2000&amp;quot;/&amp;gt;&lt;br /&gt;
  &amp;lt;/parameters&amp;gt;&lt;br /&gt;
&amp;lt;/test-generation-description&amp;gt;&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Assuming the test description above is stored in file named&lt;br /&gt;
&amp;lt;tt&amp;gt;simple_counter_test_description.xml&amp;lt;/tt&amp;gt;, we start the test case generation&lt;br /&gt;
with the following call.&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
./probcli.sh simplecounter.mch -test_description simple_counter_test_description.xml&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;/div&gt;</summary>
		<author><name>Bivab</name></author>
	</entry>
	<entry>
		<id>https://prob.hhu.de/w/index.php?title=Bivab:Testcase_Generation&amp;diff=1489</id>
		<title>Bivab:Testcase Generation</title>
		<link rel="alternate" type="text/html" href="https://prob.hhu.de/w/index.php?title=Bivab:Testcase_Generation&amp;diff=1489"/>
		<updated>2012-02-28T09:54:04Z</updated>

		<summary type="html">&lt;p&gt;Bivab: moved Bivab:Testcase Generation to Test Case Generation&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;#REDIRECT [[Test Case Generation]]&lt;/div&gt;</summary>
		<author><name>Bivab</name></author>
	</entry>
	<entry>
		<id>https://prob.hhu.de/w/index.php?title=Test_Case_Generation&amp;diff=1488</id>
		<title>Test Case Generation</title>
		<link rel="alternate" type="text/html" href="https://prob.hhu.de/w/index.php?title=Test_Case_Generation&amp;diff=1488"/>
		<updated>2012-02-28T09:54:04Z</updated>

		<summary type="html">&lt;p&gt;Bivab: moved Bivab:Testcase Generation to Test Case Generation&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;Constraint based test case generation allows to explore the state space for a&lt;br /&gt;
machine and generate traces of operations that cover certain user defined&lt;br /&gt;
operations and meet a given condition to end the search.&lt;br /&gt;
&lt;br /&gt;
We will use the following B Machine as an example, which is stored in a file called &amp;lt;tt&amp;gt;simplecounter.mch&amp;lt;/tt&amp;gt;.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
MACHINE SimpleCounter&lt;br /&gt;
DEFINITIONS MAX==4&lt;br /&gt;
VARIABLES count&lt;br /&gt;
INVARIANT&lt;br /&gt;
 count: 1..MAX&lt;br /&gt;
INITIALISATION count := 1&lt;br /&gt;
OPERATIONS&lt;br /&gt;
  Increase(y) = PRE y: 1..(MAX-count) THEN&lt;br /&gt;
     count := count+y&lt;br /&gt;
  END;&lt;br /&gt;
  Reset = BEGIN count := 1 END&lt;br /&gt;
END&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
== How To run ==&lt;br /&gt;
&lt;br /&gt;
To start the test case generation there are two alternatives. We can either provide all settings as command line arguments or in a test description file.&lt;br /&gt;
&lt;br /&gt;
=== From the command line  ===&lt;br /&gt;
From the command line there are four relevant settings to configure the test case&lt;br /&gt;
generation&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
-cb_tests Depth EndPredicate File&lt;br /&gt;
        generate test cases by constraint solving with maximum&lt;br /&gt;
        length Depth, the last state satisfies EndPredicate&lt;br /&gt;
        and the test cases are written to File&lt;br /&gt;
&lt;br /&gt;
-cb_cover Operation&lt;br /&gt;
        when generating CB test cases, Operation should be covered. Each&lt;br /&gt;
        operation to be covered needs to be specified separately.&lt;br /&gt;
&lt;br /&gt;
-p CLPFD&lt;br /&gt;
        flag to enable the CLPFD constraint solver to search the state space, which is highly recommended.&lt;br /&gt;
-p TIME_OUT&lt;br /&gt;
        time out in milliseconds to abort the exploration of each possible trace&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;Example:&#039;&#039;&#039;&lt;br /&gt;
To generate test cases that cover the event &amp;lt;tt&amp;gt;Increase&amp;lt;/tt&amp;gt; in the machine above, leading to a state where&lt;br /&gt;
&amp;lt;tt&amp;gt;count = MAX-1&amp;lt;/tt&amp;gt; is true and the explored paths do not have a depth of more than 5 operations we would specify this as follows, where we use CLPFD and have a timeout of 2000 ms. for each explored trace:&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
./probcli.sh simeplecounter.mch -cb_tests 5 count=MAX-1 test_results.xml -cb_cover Increase -p CLPFD true -p TIME_OUT 2000&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
The generated test cases are stored in a file called test_results.xml.&lt;br /&gt;
&lt;br /&gt;
=== Test Generation Description ===&lt;br /&gt;
The configuration for the test case generation can also be provided as an XML file.&lt;br /&gt;
The format is shown below:&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
&amp;lt;test-generation-description&amp;gt;&lt;br /&gt;
  &amp;lt;output-file&amp;gt;OUTPUT FILE NAME&amp;lt;/output-file&amp;gt;&lt;br /&gt;
  &amp;lt;event-coverage&amp;gt;&lt;br /&gt;
    &amp;lt;event&amp;gt;EVENT 1&amp;lt;/event&amp;gt;&lt;br /&gt;
    &amp;lt;event&amp;gt;EVENT 2&amp;lt;/event&amp;gt;&lt;br /&gt;
  &amp;lt;/event-coverage&amp;gt;&lt;br /&gt;
  &amp;lt;target&amp;gt;TARGET PREDICATE&amp;lt;/target&amp;gt;&lt;br /&gt;
  &amp;lt;!-- the parameters section contains parameters that are very ProB-specific --&amp;gt;&lt;br /&gt;
  &amp;lt;parameters&amp;gt;&lt;br /&gt;
    &amp;lt;!-- the maximum depth is the maximum length of a trace of operations/event,&lt;br /&gt;
         the algorithm might stop earlier when all events are covered --&amp;gt;&lt;br /&gt;
    &amp;lt;maximum-depth&amp;gt;N&amp;lt;/maximum-depth&amp;gt;&lt;br /&gt;
    &amp;lt;!-- any ProB preference can be set that is listed when calling &amp;quot;probcli -help -v&amp;quot; --&amp;gt;&lt;br /&gt;
    &amp;lt;!-- other probably interesting preferences are MININT, MAXINT and TIME_OUT --&amp;gt;&lt;br /&gt;
  &amp;lt;/parameters&amp;gt;&lt;br /&gt;
&amp;lt;/test-generation-description&amp;gt;&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;Example:&#039;&#039;&#039;&lt;br /&gt;
For our example the description file would look as follows.&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
&amp;lt;test-generation-description&amp;gt;&lt;br /&gt;
  &amp;lt;output-file&amp;gt;test_results.xml&amp;lt;/output-file&amp;gt;&lt;br /&gt;
  &amp;lt;event-coverage&amp;gt;&lt;br /&gt;
    &amp;lt;event&amp;gt;Increase&amp;lt;/event&amp;gt;&lt;br /&gt;
  &amp;lt;/event-coverage&amp;gt;&lt;br /&gt;
  &amp;lt;target&amp;gt;count = MAX - 1&amp;lt;/target&amp;gt;&lt;br /&gt;
  &amp;lt;parameters&amp;gt;&lt;br /&gt;
    &amp;lt;maximum-depth&amp;gt;5&amp;lt;/maximum-depth&amp;gt;&lt;br /&gt;
    &amp;lt;!-- Please note: TIME_OUT (in milliseconds) is not a global time out, it is per trace --&amp;gt;&lt;br /&gt;
    &amp;lt;preference name=&amp;quot;CLPFD&amp;quot; value=&amp;quot;true&amp;quot;/&amp;gt;&lt;br /&gt;
    &amp;lt;!-- Please note: TIME_OUT (in milliseconds) is not a global time out, it is per trace --&amp;gt;&lt;br /&gt;
    &amp;lt;preference name=&amp;quot;TIME_OUT&amp;quot; value=&amp;quot;2000&amp;quot;/&amp;gt;&lt;br /&gt;
  &amp;lt;/parameters&amp;gt;&lt;br /&gt;
&amp;lt;/test-generation-description&amp;gt;&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Assuming the test description above is stored in file named&lt;br /&gt;
&amp;lt;tt&amp;gt;simple_counter_test_description.xml&amp;lt;/tt&amp;gt;, we start the test case generation&lt;br /&gt;
with the following call.&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
./probcli.sh simplecounter.mch -test_description simple_counter_test_description.xml&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;/div&gt;</summary>
		<author><name>Bivab</name></author>
	</entry>
	<entry>
		<id>https://prob.hhu.de/w/index.php?title=Test_Case_Generation&amp;diff=1487</id>
		<title>Test Case Generation</title>
		<link rel="alternate" type="text/html" href="https://prob.hhu.de/w/index.php?title=Test_Case_Generation&amp;diff=1487"/>
		<updated>2012-02-28T09:53:47Z</updated>

		<summary type="html">&lt;p&gt;Bivab: &lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;Constraint based test case generation allows to explore the state space for a&lt;br /&gt;
machine and generate traces of operations that cover certain user defined&lt;br /&gt;
operations and meet a given condition to end the search.&lt;br /&gt;
&lt;br /&gt;
We will use the following B Machine as an example, which is stored in a file called &amp;lt;tt&amp;gt;simplecounter.mch&amp;lt;/tt&amp;gt;.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
MACHINE SimpleCounter&lt;br /&gt;
DEFINITIONS MAX==4&lt;br /&gt;
VARIABLES count&lt;br /&gt;
INVARIANT&lt;br /&gt;
 count: 1..MAX&lt;br /&gt;
INITIALISATION count := 1&lt;br /&gt;
OPERATIONS&lt;br /&gt;
  Increase(y) = PRE y: 1..(MAX-count) THEN&lt;br /&gt;
     count := count+y&lt;br /&gt;
  END;&lt;br /&gt;
  Reset = BEGIN count := 1 END&lt;br /&gt;
END&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
== How To run ==&lt;br /&gt;
&lt;br /&gt;
To start the test case generation there are two alternatives. We can either provide all settings as command line arguments or in a test description file.&lt;br /&gt;
&lt;br /&gt;
=== From the command line  ===&lt;br /&gt;
From the command line there are four relevant settings to configure the test case&lt;br /&gt;
generation&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
-cb_tests Depth EndPredicate File&lt;br /&gt;
        generate test cases by constraint solving with maximum&lt;br /&gt;
        length Depth, the last state satisfies EndPredicate&lt;br /&gt;
        and the test cases are written to File&lt;br /&gt;
&lt;br /&gt;
-cb_cover Operation&lt;br /&gt;
        when generating CB test cases, Operation should be covered. Each&lt;br /&gt;
        operation to be covered needs to be specified separately.&lt;br /&gt;
&lt;br /&gt;
-p CLPFD&lt;br /&gt;
        flag to enable the CLPFD constraint solver to search the state space, which is highly recommended.&lt;br /&gt;
-p TIME_OUT&lt;br /&gt;
        time out in milliseconds to abort the exploration of each possible trace&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;Example:&#039;&#039;&#039;&lt;br /&gt;
To generate test cases that cover the event &amp;lt;tt&amp;gt;Increase&amp;lt;/tt&amp;gt; in the machine above, leading to a state where&lt;br /&gt;
&amp;lt;tt&amp;gt;count = MAX-1&amp;lt;/tt&amp;gt; is true and the explored paths do not have a depth of more than 5 operations we would specify this as follows, where we use CLPFD and have a timeout of 2000 ms. for each explored trace:&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
./probcli.sh simeplecounter.mch -cb_tests 5 count=MAX-1 test_results.xml -cb_cover Increase -p CLPFD true -p TIME_OUT 2000&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
The generated test cases are stored in a file called test_results.xml.&lt;br /&gt;
&lt;br /&gt;
=== Test Generation Description ===&lt;br /&gt;
The configuration for the test case generation can also be provided as an XML file.&lt;br /&gt;
The format is shown below:&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
&amp;lt;test-generation-description&amp;gt;&lt;br /&gt;
  &amp;lt;output-file&amp;gt;OUTPUT FILE NAME&amp;lt;/output-file&amp;gt;&lt;br /&gt;
  &amp;lt;event-coverage&amp;gt;&lt;br /&gt;
    &amp;lt;event&amp;gt;EVENT 1&amp;lt;/event&amp;gt;&lt;br /&gt;
    &amp;lt;event&amp;gt;EVENT 2&amp;lt;/event&amp;gt;&lt;br /&gt;
  &amp;lt;/event-coverage&amp;gt;&lt;br /&gt;
  &amp;lt;target&amp;gt;TARGET PREDICATE&amp;lt;/target&amp;gt;&lt;br /&gt;
  &amp;lt;!-- the parameters section contains parameters that are very ProB-specific --&amp;gt;&lt;br /&gt;
  &amp;lt;parameters&amp;gt;&lt;br /&gt;
    &amp;lt;!-- the maximum depth is the maximum length of a trace of operations/event,&lt;br /&gt;
         the algorithm might stop earlier when all events are covered --&amp;gt;&lt;br /&gt;
    &amp;lt;maximum-depth&amp;gt;N&amp;lt;/maximum-depth&amp;gt;&lt;br /&gt;
    &amp;lt;!-- any ProB preference can be set that is listed when calling &amp;quot;probcli -help -v&amp;quot; --&amp;gt;&lt;br /&gt;
    &amp;lt;!-- other probably interesting preferences are MININT, MAXINT and TIME_OUT --&amp;gt;&lt;br /&gt;
  &amp;lt;/parameters&amp;gt;&lt;br /&gt;
&amp;lt;/test-generation-description&amp;gt;&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;Example:&#039;&#039;&#039;&lt;br /&gt;
For our example the description file would look as follows.&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
&amp;lt;test-generation-description&amp;gt;&lt;br /&gt;
  &amp;lt;output-file&amp;gt;test_results.xml&amp;lt;/output-file&amp;gt;&lt;br /&gt;
  &amp;lt;event-coverage&amp;gt;&lt;br /&gt;
    &amp;lt;event&amp;gt;Increase&amp;lt;/event&amp;gt;&lt;br /&gt;
  &amp;lt;/event-coverage&amp;gt;&lt;br /&gt;
  &amp;lt;target&amp;gt;count = MAX - 1&amp;lt;/target&amp;gt;&lt;br /&gt;
  &amp;lt;parameters&amp;gt;&lt;br /&gt;
    &amp;lt;maximum-depth&amp;gt;5&amp;lt;/maximum-depth&amp;gt;&lt;br /&gt;
    &amp;lt;!-- Please note: TIME_OUT (in milliseconds) is not a global time out, it is per trace --&amp;gt;&lt;br /&gt;
    &amp;lt;preference name=&amp;quot;CLPFD&amp;quot; value=&amp;quot;true&amp;quot;/&amp;gt;&lt;br /&gt;
    &amp;lt;!-- Please note: TIME_OUT (in milliseconds) is not a global time out, it is per trace --&amp;gt;&lt;br /&gt;
    &amp;lt;preference name=&amp;quot;TIME_OUT&amp;quot; value=&amp;quot;2000&amp;quot;/&amp;gt;&lt;br /&gt;
  &amp;lt;/parameters&amp;gt;&lt;br /&gt;
&amp;lt;/test-generation-description&amp;gt;&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Assuming the test description above is stored in file named&lt;br /&gt;
&amp;lt;tt&amp;gt;simple_counter_test_description.xml&amp;lt;/tt&amp;gt;, we start the test case generation&lt;br /&gt;
with the following call.&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
./probcli.sh simplecounter.mch -test_description simple_counter_test_description.xml&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;/div&gt;</summary>
		<author><name>Bivab</name></author>
	</entry>
	<entry>
		<id>https://prob.hhu.de/w/index.php?title=Test_Case_Generation&amp;diff=1486</id>
		<title>Test Case Generation</title>
		<link rel="alternate" type="text/html" href="https://prob.hhu.de/w/index.php?title=Test_Case_Generation&amp;diff=1486"/>
		<updated>2012-02-28T09:48:27Z</updated>

		<summary type="html">&lt;p&gt;Bivab: &lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;Constraint based test case generation allows to explore the state space for a&lt;br /&gt;
machine and generate traces of operations that cover certain user defined&lt;br /&gt;
operations and meet a given condition to end the search.&lt;br /&gt;
&lt;br /&gt;
We will use the following B Machine as an example, which is stored in a file called &amp;lt;tt&amp;gt;simplecounter.mch&amp;lt;/tt&amp;gt;&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
MACHINE SimpleCounter&lt;br /&gt;
DEFINITIONS MAX==4&lt;br /&gt;
VARIABLES count&lt;br /&gt;
INVARIANT&lt;br /&gt;
 count: 1..MAX&lt;br /&gt;
INITIALISATION count := 1&lt;br /&gt;
OPERATIONS&lt;br /&gt;
  Increase(y) = PRE y: 1..(MAX-count) THEN&lt;br /&gt;
     count := count+y&lt;br /&gt;
  END;&lt;br /&gt;
  Reset = BEGIN count := 1 END&lt;br /&gt;
END&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
== How To run ==&lt;br /&gt;
&lt;br /&gt;
There are two methods to generate test cases. Either by specifying the search&lt;br /&gt;
criteria on the command line or by providing a test_description file.&lt;br /&gt;
&lt;br /&gt;
=== From the command line  ===&lt;br /&gt;
From the command line there are four relevant settings to configure the test case&lt;br /&gt;
generation&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
-cb_tests Depth EndPredicate File&lt;br /&gt;
        generate test cases by constraint solving with maximum&lt;br /&gt;
        length Depth, the last state satisfies EndPredicate&lt;br /&gt;
        and the test cases are written to File&lt;br /&gt;
&lt;br /&gt;
-cb_cover Operation&lt;br /&gt;
        when generating CB test cases, Operation should be covered. Each&lt;br /&gt;
        operation to be covered needs to be specified separately.&lt;br /&gt;
&lt;br /&gt;
-p CLPFD&lt;br /&gt;
        flag to enable the CLPFD constraint solver to search the state space&lt;br /&gt;
-p TIME_OUT&lt;br /&gt;
        time out in milliseconds to abort the exploration of each possible trace&lt;br /&gt;
&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;Example:&#039;&#039;&#039;&lt;br /&gt;
To generate test cases that cover the event &amp;lt;tt&amp;gt;increase&amp;lt;/tt&amp;gt; leading to a state where&lt;br /&gt;
&amp;lt;tt&amp;gt;count = MAX-1&amp;lt;/tt&amp;gt; and do not have a depth of more than 5 we would specify this as follows&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
./probcli.sh simeplecounter.mch -cb_tests 5 count=MAX-1 test_results.xml -cb_cover Increase -p CLPFD true -p TIME_OUT 2000&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
The generated test cases are stored in a file called test_results.xml.&lt;br /&gt;
&lt;br /&gt;
=== Test Generation Description ===&lt;br /&gt;
The configuration for the test case generation can also be provided as an XML file.&lt;br /&gt;
The format is shown below:&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
&amp;lt;test-generation-description&amp;gt;&lt;br /&gt;
  &amp;lt;output-file&amp;gt;OUTPUT FILE NAME&amp;lt;/output-file&amp;gt;&lt;br /&gt;
  &amp;lt;event-coverage&amp;gt;&lt;br /&gt;
    &amp;lt;event&amp;gt;EVENT 1&amp;lt;/event&amp;gt;&lt;br /&gt;
    &amp;lt;event&amp;gt;EVENT 2&amp;lt;/event&amp;gt;&lt;br /&gt;
  &amp;lt;/event-coverage&amp;gt;&lt;br /&gt;
  &amp;lt;target&amp;gt;TARGET PREDICATE&amp;lt;/target&amp;gt;&lt;br /&gt;
  &amp;lt;!-- the parameters section contains parameters that are very ProB-specific --&amp;gt;&lt;br /&gt;
  &amp;lt;parameters&amp;gt;&lt;br /&gt;
    &amp;lt;!-- the maximum depth is the maximum length of a trace of operations/event,&lt;br /&gt;
         the algorithm might stop earlier when all events are covered --&amp;gt;&lt;br /&gt;
    &amp;lt;maximum-depth&amp;gt;N&amp;lt;/maximum-depth&amp;gt;&lt;br /&gt;
    &amp;lt;!-- any ProB preference can be set that is listed when calling &amp;quot;probcli -help -v&amp;quot; --&amp;gt;&lt;br /&gt;
    &amp;lt;!-- other probably interesting preferences are MININT, MAXINT and TIME_OUT --&amp;gt;&lt;br /&gt;
  &amp;lt;/parameters&amp;gt;&lt;br /&gt;
&amp;lt;/test-generation-description&amp;gt;&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;Example:&#039;&#039;&#039;&lt;br /&gt;
For our example the description file would look as follows:&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
&amp;lt;test-generation-description&amp;gt;&lt;br /&gt;
  &amp;lt;output-file&amp;gt;test_results.xml&amp;lt;/output-file&amp;gt;&lt;br /&gt;
  &amp;lt;event-coverage&amp;gt;&lt;br /&gt;
    &amp;lt;event&amp;gt;Increase&amp;lt;/event&amp;gt;&lt;br /&gt;
  &amp;lt;/event-coverage&amp;gt;&lt;br /&gt;
  &amp;lt;target&amp;gt;count = MAX - 1&amp;lt;/target&amp;gt;&lt;br /&gt;
  &amp;lt;parameters&amp;gt;&lt;br /&gt;
    &amp;lt;maximum-depth&amp;gt;5&amp;lt;/maximum-depth&amp;gt;&lt;br /&gt;
    &amp;lt;!-- Please note: TIME_OUT (in milliseconds) is not a global time out, it is per trace --&amp;gt;&lt;br /&gt;
    &amp;lt;preference name=&amp;quot;CLPFD&amp;quot; value=&amp;quot;true&amp;quot;/&amp;gt;&lt;br /&gt;
    &amp;lt;!-- Please note: TIME_OUT (in milliseconds) is not a global time out, it is per trace --&amp;gt;&lt;br /&gt;
    &amp;lt;preference name=&amp;quot;TIME_OUT&amp;quot; value=&amp;quot;2000&amp;quot;/&amp;gt;&lt;br /&gt;
  &amp;lt;/parameters&amp;gt;&lt;br /&gt;
&amp;lt;/test-generation-description&amp;gt;&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Assuming the test description above is stored in file named&lt;br /&gt;
&amp;lt;tt&amp;gt;simple_counter_test_description.xml&amp;lt;/tt&amp;gt;, we start the test case generation&lt;br /&gt;
with the following call.&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
./probcli.sh simplecounter.mch -test_description simple_counter_test_description.xml&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;/div&gt;</summary>
		<author><name>Bivab</name></author>
	</entry>
	<entry>
		<id>https://prob.hhu.de/w/index.php?title=Test_Case_Generation&amp;diff=1485</id>
		<title>Test Case Generation</title>
		<link rel="alternate" type="text/html" href="https://prob.hhu.de/w/index.php?title=Test_Case_Generation&amp;diff=1485"/>
		<updated>2012-02-28T09:47:53Z</updated>

		<summary type="html">&lt;p&gt;Bivab: /* Test Generation Description */&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;&lt;br /&gt;
Constraint based test case generation allows to explore the state space for a&lt;br /&gt;
machine and generate traces of operations that cover certain user defined&lt;br /&gt;
operations and meet a given condition to end the search.&lt;br /&gt;
&lt;br /&gt;
We will use the following B Machine as an example, which is stored in a file called &amp;lt;tt&amp;gt;simplecounter.mch&amp;lt;/tt&amp;gt;&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
MACHINE SimpleCounter&lt;br /&gt;
DEFINITIONS MAX==4&lt;br /&gt;
VARIABLES count&lt;br /&gt;
INVARIANT&lt;br /&gt;
 count: 1..MAX&lt;br /&gt;
INITIALISATION count := 1&lt;br /&gt;
OPERATIONS&lt;br /&gt;
  Increase(y) = PRE y: 1..(MAX-count) THEN&lt;br /&gt;
     count := count+y&lt;br /&gt;
  END;&lt;br /&gt;
  Reset = BEGIN count := 1 END&lt;br /&gt;
END&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
== How To run ==&lt;br /&gt;
&lt;br /&gt;
There are two methods to generate test cases. Either by specifying the search&lt;br /&gt;
criteria on the command line or by providing a test_description file.&lt;br /&gt;
&lt;br /&gt;
=== From the command line  ===&lt;br /&gt;
From the command line there are four relevant settings to configure the test case&lt;br /&gt;
generation&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
-cb_tests Depth EndPredicate File&lt;br /&gt;
        generate test cases by constraint solving with maximum&lt;br /&gt;
        length Depth, the last state satisfies EndPredicate&lt;br /&gt;
        and the test cases are written to File&lt;br /&gt;
&lt;br /&gt;
-cb_cover Operation&lt;br /&gt;
        when generating CB test cases, Operation should be covered. Each&lt;br /&gt;
        operation to be covered needs to be specified separately.&lt;br /&gt;
&lt;br /&gt;
-p CLPFD&lt;br /&gt;
        flag to enable the CLPFD constraint solver to search the state space&lt;br /&gt;
-p TIME_OUT&lt;br /&gt;
        time out in milliseconds to abort the exploration of each possible trace&lt;br /&gt;
&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;Example:&#039;&#039;&#039;&lt;br /&gt;
To generate test cases that cover the event &amp;lt;tt&amp;gt;increase&amp;lt;/tt&amp;gt; leading to a state where&lt;br /&gt;
&amp;lt;tt&amp;gt;count = MAX-1&amp;lt;/tt&amp;gt; and do not have a depth of more than 5 we would specify this as follows&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
./probcli.sh simeplecounter.mch -cb_tests 5 count=MAX-1 test_results.xml -cb_cover Increase -p CLPFD true -p TIME_OUT 2000&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
The generated test cases are stored in a file called test_results.xml.&lt;br /&gt;
&lt;br /&gt;
=== Test Generation Description ===&lt;br /&gt;
The configuration for the test case generation can also be provided as an XML file.&lt;br /&gt;
The format is shown below:&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
&amp;lt;test-generation-description&amp;gt;&lt;br /&gt;
  &amp;lt;output-file&amp;gt;OUTPUT FILE NAME&amp;lt;/output-file&amp;gt;&lt;br /&gt;
  &amp;lt;event-coverage&amp;gt;&lt;br /&gt;
    &amp;lt;event&amp;gt;EVENT 1&amp;lt;/event&amp;gt;&lt;br /&gt;
    &amp;lt;event&amp;gt;EVENT 2&amp;lt;/event&amp;gt;&lt;br /&gt;
  &amp;lt;/event-coverage&amp;gt;&lt;br /&gt;
  &amp;lt;target&amp;gt;TARGET PREDICATE&amp;lt;/target&amp;gt;&lt;br /&gt;
  &amp;lt;!-- the parameters section contains parameters that are very ProB-specific --&amp;gt;&lt;br /&gt;
  &amp;lt;parameters&amp;gt;&lt;br /&gt;
    &amp;lt;!-- the maximum depth is the maximum length of a trace of operations/event,&lt;br /&gt;
         the algorithm might stop earlier when all events are covered --&amp;gt;&lt;br /&gt;
    &amp;lt;maximum-depth&amp;gt;N&amp;lt;/maximum-depth&amp;gt;&lt;br /&gt;
    &amp;lt;!-- any ProB preference can be set that is listed when calling &amp;quot;probcli -help -v&amp;quot; --&amp;gt;&lt;br /&gt;
    &amp;lt;!-- other probably interesting preferences are MININT, MAXINT and TIME_OUT --&amp;gt;&lt;br /&gt;
  &amp;lt;/parameters&amp;gt;&lt;br /&gt;
&amp;lt;/test-generation-description&amp;gt;&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
For our example the description file would look as follows:&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
&amp;lt;test-generation-description&amp;gt;&lt;br /&gt;
  &amp;lt;output-file&amp;gt;test_results.xml&amp;lt;/output-file&amp;gt;&lt;br /&gt;
  &amp;lt;event-coverage&amp;gt;&lt;br /&gt;
    &amp;lt;event&amp;gt;Increase&amp;lt;/event&amp;gt;&lt;br /&gt;
  &amp;lt;/event-coverage&amp;gt;&lt;br /&gt;
  &amp;lt;target&amp;gt;count = MAX - 1&amp;lt;/target&amp;gt;&lt;br /&gt;
  &amp;lt;parameters&amp;gt;&lt;br /&gt;
    &amp;lt;maximum-depth&amp;gt;5&amp;lt;/maximum-depth&amp;gt;&lt;br /&gt;
    &amp;lt;!-- Please note: TIME_OUT (in milliseconds) is not a global time out, it is per trace --&amp;gt;&lt;br /&gt;
    &amp;lt;preference name=&amp;quot;CLPFD&amp;quot; value=&amp;quot;true&amp;quot;/&amp;gt;&lt;br /&gt;
    &amp;lt;!-- Please note: TIME_OUT (in milliseconds) is not a global time out, it is per trace --&amp;gt;&lt;br /&gt;
    &amp;lt;preference name=&amp;quot;TIME_OUT&amp;quot; value=&amp;quot;2000&amp;quot;/&amp;gt;&lt;br /&gt;
  &amp;lt;/parameters&amp;gt;&lt;br /&gt;
&amp;lt;/test-generation-description&amp;gt;&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;Example:&#039;&#039;&#039;&lt;br /&gt;
Assuming the test description above is stored in file named&lt;br /&gt;
&amp;lt;tt&amp;gt;simple_counter_test_description.xml&amp;lt;/tt&amp;gt;, we start the test case generation&lt;br /&gt;
with the following call.&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
./probcli.sh simplecounter.mch -test_description simple_counter_test_description.xml&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;/div&gt;</summary>
		<author><name>Bivab</name></author>
	</entry>
	<entry>
		<id>https://prob.hhu.de/w/index.php?title=Test_Case_Generation&amp;diff=1484</id>
		<title>Test Case Generation</title>
		<link rel="alternate" type="text/html" href="https://prob.hhu.de/w/index.php?title=Test_Case_Generation&amp;diff=1484"/>
		<updated>2012-02-28T09:47:18Z</updated>

		<summary type="html">&lt;p&gt;Bivab: &lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;&lt;br /&gt;
Constraint based test case generation allows to explore the state space for a&lt;br /&gt;
machine and generate traces of operations that cover certain user defined&lt;br /&gt;
operations and meet a given condition to end the search.&lt;br /&gt;
&lt;br /&gt;
We will use the following B Machine as an example, which is stored in a file called &amp;lt;tt&amp;gt;simplecounter.mch&amp;lt;/tt&amp;gt;&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
MACHINE SimpleCounter&lt;br /&gt;
DEFINITIONS MAX==4&lt;br /&gt;
VARIABLES count&lt;br /&gt;
INVARIANT&lt;br /&gt;
 count: 1..MAX&lt;br /&gt;
INITIALISATION count := 1&lt;br /&gt;
OPERATIONS&lt;br /&gt;
  Increase(y) = PRE y: 1..(MAX-count) THEN&lt;br /&gt;
     count := count+y&lt;br /&gt;
  END;&lt;br /&gt;
  Reset = BEGIN count := 1 END&lt;br /&gt;
END&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
== How To run ==&lt;br /&gt;
&lt;br /&gt;
There are two methods to generate test cases. Either by specifying the search&lt;br /&gt;
criteria on the command line or by providing a test_description file.&lt;br /&gt;
&lt;br /&gt;
=== From the command line  ===&lt;br /&gt;
From the command line there are four relevant settings to configure the test case&lt;br /&gt;
generation&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
-cb_tests Depth EndPredicate File&lt;br /&gt;
        generate test cases by constraint solving with maximum&lt;br /&gt;
        length Depth, the last state satisfies EndPredicate&lt;br /&gt;
        and the test cases are written to File&lt;br /&gt;
&lt;br /&gt;
-cb_cover Operation&lt;br /&gt;
        when generating CB test cases, Operation should be covered. Each&lt;br /&gt;
        operation to be covered needs to be specified separately.&lt;br /&gt;
&lt;br /&gt;
-p CLPFD&lt;br /&gt;
        flag to enable the CLPFD constraint solver to search the state space&lt;br /&gt;
-p TIME_OUT&lt;br /&gt;
        time out in milliseconds to abort the exploration of each possible trace&lt;br /&gt;
&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;Example:&#039;&#039;&#039;&lt;br /&gt;
To generate test cases that cover the event &amp;lt;tt&amp;gt;increase&amp;lt;/tt&amp;gt; leading to a state where&lt;br /&gt;
&amp;lt;tt&amp;gt;count = MAX-1&amp;lt;/tt&amp;gt; and do not have a depth of more than 5 we would specify this as follows&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
./probcli.sh simeplecounter.mch -cb_tests 5 count=MAX-1 test_results.xml -cb_cover Increase -p CLPFD true -p TIME_OUT 2000&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
The generated test cases are stored in a file called test_results.xml.&lt;br /&gt;
&lt;br /&gt;
=== Test Generation Description ===&lt;br /&gt;
The configuration for the test case generation can also be provided in an XML file.&lt;br /&gt;
The format is shown below:&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
&amp;lt;test-generation-description&amp;gt;&lt;br /&gt;
  &amp;lt;output-file&amp;gt;OUTPUT FILE NAME&amp;lt;/output-file&amp;gt;&lt;br /&gt;
  &amp;lt;event-coverage&amp;gt;&lt;br /&gt;
    &amp;lt;event&amp;gt;EVENT 1&amp;lt;/event&amp;gt;&lt;br /&gt;
    &amp;lt;event&amp;gt;EVENT 2&amp;lt;/event&amp;gt;&lt;br /&gt;
  &amp;lt;/event-coverage&amp;gt;&lt;br /&gt;
  &amp;lt;target&amp;gt;TARGET PREDICATE&amp;lt;/target&amp;gt;&lt;br /&gt;
  &amp;lt;!-- the parameters section contains parameters that are very ProB-specific --&amp;gt;&lt;br /&gt;
  &amp;lt;parameters&amp;gt;&lt;br /&gt;
    &amp;lt;!-- the maximum depth is the maximum length of a trace of operations/event,&lt;br /&gt;
         the algorithm might stop earlier when all events are covered --&amp;gt;&lt;br /&gt;
    &amp;lt;maximum-depth&amp;gt;N&amp;lt;/maximum-depth&amp;gt;&lt;br /&gt;
    &amp;lt;!-- any ProB preference can be set that is listed when calling &amp;quot;probcli -help -v&amp;quot; --&amp;gt;&lt;br /&gt;
    &amp;lt;!-- other probably interesting preferences are MININT, MAXINT and TIME_OUT --&amp;gt;&lt;br /&gt;
  &amp;lt;/parameters&amp;gt;&lt;br /&gt;
&amp;lt;/test-generation-description&amp;gt;&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
For our example the description file would look as follows:&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
&amp;lt;test-generation-description&amp;gt;&lt;br /&gt;
  &amp;lt;output-file&amp;gt;test_results.xml&amp;lt;/output-file&amp;gt;&lt;br /&gt;
  &amp;lt;event-coverage&amp;gt;&lt;br /&gt;
    &amp;lt;event&amp;gt;Increase&amp;lt;/event&amp;gt;&lt;br /&gt;
  &amp;lt;/event-coverage&amp;gt;&lt;br /&gt;
  &amp;lt;target&amp;gt;count = MAX - 1&amp;lt;/target&amp;gt;&lt;br /&gt;
  &amp;lt;parameters&amp;gt;&lt;br /&gt;
    &amp;lt;maximum-depth&amp;gt;5&amp;lt;/maximum-depth&amp;gt;&lt;br /&gt;
    &amp;lt;!-- Please note: TIME_OUT (in milliseconds) is not a global time out, it is per trace --&amp;gt;&lt;br /&gt;
    &amp;lt;preference name=&amp;quot;CLPFD&amp;quot; value=&amp;quot;true&amp;quot;/&amp;gt;&lt;br /&gt;
    &amp;lt;!-- Please note: TIME_OUT (in milliseconds) is not a global time out, it is per trace --&amp;gt;&lt;br /&gt;
    &amp;lt;preference name=&amp;quot;TIME_OUT&amp;quot; value=&amp;quot;2000&amp;quot;/&amp;gt;&lt;br /&gt;
  &amp;lt;/parameters&amp;gt;&lt;br /&gt;
&amp;lt;/test-generation-description&amp;gt;&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;Example:&#039;&#039;&#039;&lt;br /&gt;
Assuming the test description above is stored in file named&lt;br /&gt;
&amp;lt;tt&amp;gt;simple_counter_test_description.xml&amp;lt;/tt&amp;gt;, we start the test case generation&lt;br /&gt;
with the following call.&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
./probcli.sh simplecounter.mch -test_description simple_counter_test_description.xml&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;/div&gt;</summary>
		<author><name>Bivab</name></author>
	</entry>
	<entry>
		<id>https://prob.hhu.de/w/index.php?title=Test_Case_Generation&amp;diff=1483</id>
		<title>Test Case Generation</title>
		<link rel="alternate" type="text/html" href="https://prob.hhu.de/w/index.php?title=Test_Case_Generation&amp;diff=1483"/>
		<updated>2012-02-28T09:36:00Z</updated>

		<summary type="html">&lt;p&gt;Bivab: Created page with &amp;#039; Constraint Based Test case generation allows to explore the state space for a machine and generate traces of operations that cover certain user defined operations and meet a giv…&amp;#039;&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;&lt;br /&gt;
Constraint Based Test case generation allows to explore the state space for a&lt;br /&gt;
machine and generate traces of operations that cover certain user defined&lt;br /&gt;
operations and meet a given condition to end the search.&lt;br /&gt;
&lt;br /&gt;
We will use the following B Machine as an example, which is stored in a file called &amp;lt;tt&amp;gt;simplecounter.mch&amp;lt;/tt&amp;gt;&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
MACHINE SimpleCounter&lt;br /&gt;
DEFINITIONS MAX==4&lt;br /&gt;
VARIABLES count&lt;br /&gt;
INVARIANT&lt;br /&gt;
 count: 1..MAX&lt;br /&gt;
INITIALISATION count := 1&lt;br /&gt;
OPERATIONS&lt;br /&gt;
  Increase(y) = PRE y: 1..(MAX-count) THEN&lt;br /&gt;
     count := count+y&lt;br /&gt;
  END;&lt;br /&gt;
  Reset = BEGIN count := 1 END&lt;br /&gt;
END&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
== How To run ==&lt;br /&gt;
&lt;br /&gt;
There are two methods to generate test cases. Either by specifying the search&lt;br /&gt;
criteria on the commandline or by prviding a test_description file.&lt;br /&gt;
&lt;br /&gt;
=== From the commandline  ===&lt;br /&gt;
From the commandline there are three relevant settings to configure the test case&lt;br /&gt;
generation&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
-cb_tests Depth EndPredicate File&lt;br /&gt;
        generate test cases by constraint solving with maximum&lt;br /&gt;
        length Depth, the last state satisfies EndPredicate&lt;br /&gt;
        and the test cases are written to File&lt;br /&gt;
&lt;br /&gt;
-cb_cover Operation&lt;br /&gt;
        when generating CB test cases, Operation should be covered&lt;br /&gt;
-XXXflag_for_CLPFD&lt;br /&gt;
        flag to enable the CLPFD constraint solver to search the state space&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;Example:&#039;&#039;&#039;&lt;br /&gt;
To generate testcases that cover the event &amp;lt;tt&amp;gt;increase&amp;lt;/tt&amp;gt; leading to a state where&lt;br /&gt;
&amp;lt;tt&amp;gt;count = MAX-1&amp;lt;/tt&amp;gt; and do not have a depth of more than 5 we would specify this as follows&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
./probcli.sh simeplecounter.mch -cb_tests 5 count=MAX-1 test_results.xml -cb_cover Increase --XXXflag_for_clpfd&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
The generated test cases are stored in a file called test_results.xml.&lt;br /&gt;
&lt;br /&gt;
=== Test Generation Description ===&lt;br /&gt;
The configuration for the test case generation can also be provided in an XML file.&lt;br /&gt;
The format is shown below:&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
&amp;lt;test-generation-description&amp;gt;&lt;br /&gt;
  &amp;lt;output-file&amp;gt;OUTPUT FILE NAME&amp;lt;/output-file&amp;gt;&lt;br /&gt;
  &amp;lt;event-coverage&amp;gt;&lt;br /&gt;
    &amp;lt;event&amp;gt;EVENT 1&amp;lt;/event&amp;gt;&lt;br /&gt;
    &amp;lt;event&amp;gt;EVENT 2&amp;lt;/event&amp;gt;&lt;br /&gt;
  &amp;lt;/event-coverage&amp;gt;&lt;br /&gt;
  &amp;lt;target&amp;gt;TARGET PREDICATE&amp;lt;/target&amp;gt;&lt;br /&gt;
  &amp;lt;!-- the parameters section contains parameters that are very ProB-specific --&amp;gt;&lt;br /&gt;
  &amp;lt;parameters&amp;gt;&lt;br /&gt;
    &amp;lt;!-- the maximum depth is the maximum length of a trace of operations/event,&lt;br /&gt;
         the algorithm might stop earlier when all events are covered --&amp;gt;&lt;br /&gt;
    &amp;lt;maximum-depth&amp;gt;N&amp;lt;/maximum-depth&amp;gt;&lt;br /&gt;
    &amp;lt;!-- any ProB preference can be set that is listed when calling &amp;quot;probcli -help -v&amp;quot; --&amp;gt;&lt;br /&gt;
    &amp;lt;!-- other probably interesting preferences are MININT, MAXINT and TIME_OUT --&amp;gt;&lt;br /&gt;
    &amp;lt;!-- Please note: TIME_OUT (in milliseconds) is not a global time out, it is per trace --&amp;gt;&lt;br /&gt;
  &amp;lt;/parameters&amp;gt;&lt;br /&gt;
&amp;lt;/test-generation-description&amp;gt;&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
For our example the description file would look as follows:&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
&amp;lt;test-generation-description&amp;gt;&lt;br /&gt;
  &amp;lt;output-file&amp;gt;test_results.xml&amp;lt;/output-file&amp;gt;&lt;br /&gt;
  &amp;lt;event-coverage&amp;gt;&lt;br /&gt;
    &amp;lt;event&amp;gt;Increase&amp;lt;/event&amp;gt;&lt;br /&gt;
  &amp;lt;/event-coverage&amp;gt;&lt;br /&gt;
  &amp;lt;target&amp;gt;count = MAX - 1&amp;lt;/target&amp;gt;&lt;br /&gt;
  &amp;lt;parameters&amp;gt;&lt;br /&gt;
    &amp;lt;maximum-depth&amp;gt;5&amp;lt;/maximum-depth&amp;gt;&lt;br /&gt;
    &amp;lt;preference name=&amp;quot;CLPFD&amp;quot; value=&amp;quot;true&amp;quot;/&amp;gt;&lt;br /&gt;
    &amp;lt;preference name=&amp;quot;TIME_OUT&amp;quot; value=&amp;quot;2000&amp;quot;/&amp;gt;&lt;br /&gt;
  &amp;lt;/parameters&amp;gt;&lt;br /&gt;
&amp;lt;/test-generation-description&amp;gt;&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;Example:&#039;&#039;&#039;&lt;br /&gt;
Asuming the test description above is stored in file named &amp;lt;tt&amp;gt;simple_counter_test_description.xml&amp;lt;/tt&amp;gt;, we start the test case generation with the following call.&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
./probcli.sh simplecounter.mch -test_description simple_counter_test_description.xml&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;/div&gt;</summary>
		<author><name>Bivab</name></author>
	</entry>
	<entry>
		<id>https://prob.hhu.de/w/index.php?title=File:ProB_While_INV_Violation.png&amp;diff=1459</id>
		<title>File:ProB While INV Violation.png</title>
		<link rel="alternate" type="text/html" href="https://prob.hhu.de/w/index.php?title=File:ProB_While_INV_Violation.png&amp;diff=1459"/>
		<updated>2012-02-27T16:08:52Z</updated>

		<summary type="html">&lt;p&gt;Bivab: uploaded a new version of &amp;quot;File:ProB While INV Violation.png&amp;quot;&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;&lt;/div&gt;</summary>
		<author><name>Bivab</name></author>
	</entry>
	<entry>
		<id>https://prob.hhu.de/w/index.php?title=File:GraphicalViewerSiemensSaoPauloL9.png&amp;diff=1447</id>
		<title>File:GraphicalViewerSiemensSaoPauloL9.png</title>
		<link rel="alternate" type="text/html" href="https://prob.hhu.de/w/index.php?title=File:GraphicalViewerSiemensSaoPauloL9.png&amp;diff=1447"/>
		<updated>2012-02-27T15:47:40Z</updated>

		<summary type="html">&lt;p&gt;Bivab: uploaded a new version of &amp;quot;File:GraphicalViewerSiemensSaoPauloL9.png&amp;quot;&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;&lt;/div&gt;</summary>
		<author><name>Bivab</name></author>
	</entry>
	<entry>
		<id>https://prob.hhu.de/w/index.php?title=File:GraphicalViewerSiemensSaoPauloL9.png&amp;diff=1445</id>
		<title>File:GraphicalViewerSiemensSaoPauloL9.png</title>
		<link rel="alternate" type="text/html" href="https://prob.hhu.de/w/index.php?title=File:GraphicalViewerSiemensSaoPauloL9.png&amp;diff=1445"/>
		<updated>2012-02-27T15:43:01Z</updated>

		<summary type="html">&lt;p&gt;Bivab: uploaded a new version of &amp;quot;File:GraphicalViewerSiemensSaoPauloL9.png&amp;quot;:&amp;amp;#32;Reverted to version as of 12:58, 25 October 2010&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;&lt;/div&gt;</summary>
		<author><name>Bivab</name></author>
	</entry>
	<entry>
		<id>https://prob.hhu.de/w/index.php?title=File:GraphicalViewerSiemensSaoPauloL9.png&amp;diff=1444</id>
		<title>File:GraphicalViewerSiemensSaoPauloL9.png</title>
		<link rel="alternate" type="text/html" href="https://prob.hhu.de/w/index.php?title=File:GraphicalViewerSiemensSaoPauloL9.png&amp;diff=1444"/>
		<updated>2012-02-27T15:42:03Z</updated>

		<summary type="html">&lt;p&gt;Bivab: uploaded a new version of &amp;quot;File:GraphicalViewerSiemensSaoPauloL9.png&amp;quot;:&amp;amp;#32;Reverted to version as of 12:58, 25 October 2010&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;&lt;/div&gt;</summary>
		<author><name>Bivab</name></author>
	</entry>
	<entry>
		<id>https://prob.hhu.de/w/index.php?title=File:ClicknProveDoubleCounter.png&amp;diff=1443</id>
		<title>File:ClicknProveDoubleCounter.png</title>
		<link rel="alternate" type="text/html" href="https://prob.hhu.de/w/index.php?title=File:ClicknProveDoubleCounter.png&amp;diff=1443"/>
		<updated>2012-02-27T15:35:23Z</updated>

		<summary type="html">&lt;p&gt;Bivab: uploaded a new version of &amp;quot;File:ClicknProveDoubleCounter.png&amp;quot;:&amp;amp;#32;Reverted to version as of 13:23, 1 March 2011&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;&lt;/div&gt;</summary>
		<author><name>Bivab</name></author>
	</entry>
	<entry>
		<id>https://prob.hhu.de/w/index.php?title=File:ClicknProveDoubleCounter.png&amp;diff=1442</id>
		<title>File:ClicknProveDoubleCounter.png</title>
		<link rel="alternate" type="text/html" href="https://prob.hhu.de/w/index.php?title=File:ClicknProveDoubleCounter.png&amp;diff=1442"/>
		<updated>2012-02-27T15:34:45Z</updated>

		<summary type="html">&lt;p&gt;Bivab: uploaded a new version of &amp;quot;File:ClicknProveDoubleCounter.png&amp;quot;&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;&lt;/div&gt;</summary>
		<author><name>Bivab</name></author>
	</entry>
	<entry>
		<id>https://prob.hhu.de/w/index.php?title=File:GraphicalViewerSiemensSaoPauloL9.png&amp;diff=1441</id>
		<title>File:GraphicalViewerSiemensSaoPauloL9.png</title>
		<link rel="alternate" type="text/html" href="https://prob.hhu.de/w/index.php?title=File:GraphicalViewerSiemensSaoPauloL9.png&amp;diff=1441"/>
		<updated>2012-02-27T15:29:23Z</updated>

		<summary type="html">&lt;p&gt;Bivab: uploaded a new version of &amp;quot;File:GraphicalViewerSiemensSaoPauloL9.png&amp;quot;&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;&lt;/div&gt;</summary>
		<author><name>Bivab</name></author>
	</entry>
	<entry>
		<id>https://prob.hhu.de/w/index.php?title=File:GraphicalViewerSiemensSaoPauloL9.png&amp;diff=1440</id>
		<title>File:GraphicalViewerSiemensSaoPauloL9.png</title>
		<link rel="alternate" type="text/html" href="https://prob.hhu.de/w/index.php?title=File:GraphicalViewerSiemensSaoPauloL9.png&amp;diff=1440"/>
		<updated>2012-02-27T15:27:34Z</updated>

		<summary type="html">&lt;p&gt;Bivab: uploaded a new version of &amp;quot;File:GraphicalViewerSiemensSaoPauloL9.png&amp;quot;&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;&lt;/div&gt;</summary>
		<author><name>Bivab</name></author>
	</entry>
	<entry>
		<id>https://prob.hhu.de/w/index.php?title=File:GraphicalViewerSiemensSaoPauloL9.png&amp;diff=1439</id>
		<title>File:GraphicalViewerSiemensSaoPauloL9.png</title>
		<link rel="alternate" type="text/html" href="https://prob.hhu.de/w/index.php?title=File:GraphicalViewerSiemensSaoPauloL9.png&amp;diff=1439"/>
		<updated>2012-02-27T15:26:23Z</updated>

		<summary type="html">&lt;p&gt;Bivab: uploaded a new version of &amp;quot;File:GraphicalViewerSiemensSaoPauloL9.png&amp;quot;&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;&lt;/div&gt;</summary>
		<author><name>Bivab</name></author>
	</entry>
	<entry>
		<id>https://prob.hhu.de/w/index.php?title=File:ProB_WhileAfterLoad.png&amp;diff=1438</id>
		<title>File:ProB WhileAfterLoad.png</title>
		<link rel="alternate" type="text/html" href="https://prob.hhu.de/w/index.php?title=File:ProB_WhileAfterLoad.png&amp;diff=1438"/>
		<updated>2012-02-27T15:02:51Z</updated>

		<summary type="html">&lt;p&gt;Bivab: uploaded a new version of &amp;quot;File:ProB WhileAfterLoad.png&amp;quot;&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;&lt;/div&gt;</summary>
		<author><name>Bivab</name></author>
	</entry>
	<entry>
		<id>https://prob.hhu.de/w/index.php?title=File:ProBRodinAfterOpChoose.png&amp;diff=1437</id>
		<title>File:ProBRodinAfterOpChoose.png</title>
		<link rel="alternate" type="text/html" href="https://prob.hhu.de/w/index.php?title=File:ProBRodinAfterOpChoose.png&amp;diff=1437"/>
		<updated>2012-02-27T14:59:30Z</updated>

		<summary type="html">&lt;p&gt;Bivab: uploaded a new version of &amp;quot;File:ProBRodinAfterOpChoose.png&amp;quot;&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;&lt;/div&gt;</summary>
		<author><name>Bivab</name></author>
	</entry>
	<entry>
		<id>https://prob.hhu.de/w/index.php?title=File:ProBRodinOpChoose.png&amp;diff=1436</id>
		<title>File:ProBRodinOpChoose.png</title>
		<link rel="alternate" type="text/html" href="https://prob.hhu.de/w/index.php?title=File:ProBRodinOpChoose.png&amp;diff=1436"/>
		<updated>2012-02-27T14:59:00Z</updated>

		<summary type="html">&lt;p&gt;Bivab: uploaded a new version of &amp;quot;File:ProBRodinOpChoose.png&amp;quot;&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;&lt;/div&gt;</summary>
		<author><name>Bivab</name></author>
	</entry>
	<entry>
		<id>https://prob.hhu.de/w/index.php?title=File:ProBRodinInit.png&amp;diff=1435</id>
		<title>File:ProBRodinInit.png</title>
		<link rel="alternate" type="text/html" href="https://prob.hhu.de/w/index.php?title=File:ProBRodinInit.png&amp;diff=1435"/>
		<updated>2012-02-27T14:58:27Z</updated>

		<summary type="html">&lt;p&gt;Bivab: uploaded a new version of &amp;quot;File:ProBRodinInit.png&amp;quot;&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;&lt;/div&gt;</summary>
		<author><name>Bivab</name></author>
	</entry>
	<entry>
		<id>https://prob.hhu.de/w/index.php?title=File:ProBRodinStart.png&amp;diff=1434</id>
		<title>File:ProBRodinStart.png</title>
		<link rel="alternate" type="text/html" href="https://prob.hhu.de/w/index.php?title=File:ProBRodinStart.png&amp;diff=1434"/>
		<updated>2012-02-27T14:57:38Z</updated>

		<summary type="html">&lt;p&gt;Bivab: uploaded a new version of &amp;quot;File:ProBRodinStart.png&amp;quot;&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;&lt;/div&gt;</summary>
		<author><name>Bivab</name></author>
	</entry>
</feed>