D7net Mini Sh3LL v1

 
OFF  |  cURL : OFF  |  WGET : ON  |  Perl : ON  |  Python : OFF
Directory (0755) :  /usr/share/doc/thin-provisioning-tools/../libicu66/../liblab-gamut1/../maria-doc/html/

 Home   ☍ Command   ☍ Upload File   ☍Info Server   ☍ Buat File   ☍ Mass deface   ☍ Jumping   ☍ Config   ☍ Symlink   ☍ About 

Current File : //usr/share/doc/thin-provisioning-tools/../libicu66/../liblab-gamut1/../maria-doc/html/maria_3.html
<!DOCTYPE html PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN" "http://www.w3.org/TR/html401/loose.dtd">
<html>
<!-- Created on March 22, 2020 by texi2html 1.82
texi2html was written by: 
            Lionel Cons <Lionel.Cons@cern.ch> (original author)
            Karl Berry  <karl@freefriends.org>
            Olaf Bachmann <obachman@mathematik.uni-kl.de>
            and many others.
Maintained by: Many creative people.
Send bugs and suggestions to <texi2html-bug@nongnu.org>
-->
<head>
<title>Maria: 2. Reachability Analysis with Maria</title>

<meta name="description" content="Maria: 2. Reachability Analysis with Maria">
<meta name="keywords" content="Maria: 2. Reachability Analysis with Maria">
<meta name="resource-type" content="document">
<meta name="distribution" content="global">
<meta name="Generator" content="texi2html 1.82">
<meta http-equiv="Content-Type" content="text/html; charset=utf-8">
<style type="text/css">
<!--
a.summary-letter {text-decoration: none}
blockquote.smallquotation {font-size: smaller}
pre.display {font-family: serif}
pre.format {font-family: serif}
pre.menu-comment {font-family: serif}
pre.menu-preformatted {font-family: serif}
pre.smalldisplay {font-family: serif; font-size: smaller}
pre.smallexample {font-size: smaller}
pre.smallformat {font-family: serif; font-size: smaller}
pre.smalllisp {font-size: smaller}
span.roman {font-family:serif; font-weight:normal;}
span.sansserif {font-family:sans-serif; font-weight:normal;}
ul.toc {list-style: none}
-->
</style>


</head>

<body lang="en" bgcolor="#FFFFFF" text="#000000" link="#0000FF" vlink="#800080" alink="#FF0000">

<a name="Analysis"></a>
<table cellpadding="1" cellspacing="1" border="0">
<tr><td valign="middle" align="left">[<a href="maria_2.html#Scoping" title="Previous section in reading order"> &lt; </a>]</td>
<td valign="middle" align="left">[<a href="#Invoking-Maria" title="Next section in reading order"> &gt; </a>]</td>
<td valign="middle" align="left"> &nbsp; </td>
<td valign="middle" align="left">[<a href="maria_2.html#Modeling" title="Beginning of this chapter or previous chapter"> &lt;&lt; </a>]</td>
<td valign="middle" align="left">[<a href="maria.html#Top" title="Up section"> Up </a>]</td>
<td valign="middle" align="left">[<a href="maria_4.html#Algorithms" title="Next chapter"> &gt;&gt; </a>]</td>
<td valign="middle" align="left"> &nbsp; </td>
<td valign="middle" align="left"> &nbsp; </td>
<td valign="middle" align="left"> &nbsp; </td>
<td valign="middle" align="left"> &nbsp; </td>
<td valign="middle" align="left">[<a href="maria.html#Top" title="Cover (top) of document">Top</a>]</td>
<td valign="middle" align="left">[<a href="maria_toc.html#SEC_Contents" title="Table of contents">Contents</a>]</td>
<td valign="middle" align="left">[<a href="maria_10.html#Index" title="Index">Index</a>]</td>
<td valign="middle" align="left">[<a href="maria_abt.html#SEC_About" title="About (help)"> ? </a>]</td>
</tr></table>
<a name="Reachability-Analysis-with-Maria"></a>
<h1 class="chapter">2. Reachability Analysis with Maria</h1>
<a name="index-reachability-analysis"></a>

<p>Determining all interesting behaviors of a concurrent system is done by
computing a graph of all system states reachable from the initial state.
This process is called <em>reachability analysis</em>.  Once a (possibly
incomplete) reachability graph has been generated, it can be examined,
and one can verify temporal properties from it.
</p>
<p>It is also possible to verify temporal properties during the generation
of the reachability graph (see section <a href="maria_4.html#Model-Checking">Model Checking Algorithms</a>).  This can guide the
search and speed up the analysis, but verifying another temporal
property from the system will usually require the reachability analysis
to be performed again.
</p>
<table class="menu" border="0" cellspacing="0">
<tr><td align="left" valign="top"><a href="#Invoking-Maria">2.1 Invoking Maria</a></td><td>&nbsp;&nbsp;</td><td align="left" valign="top">      Starting the reachability analysis
</td></tr>
<tr><td align="left" valign="top"><a href="#Interrupting">2.1.1 Interrupting the Reachability Analysis</a></td><td>&nbsp;&nbsp;</td><td align="left" valign="top">        Interrupting the reachability analysis
</td></tr>
<tr><td align="left" valign="top"><a href="#Maria-Shell">2.2 The Maria Shell</a></td><td>&nbsp;&nbsp;</td><td align="left" valign="top">         Examining the reachability graph interactively
</td></tr>
<tr><td align="left" valign="top"><a href="#Emacs">2.3 Editing Petri Nets with GNU Emacs</a></td><td>&nbsp;&nbsp;</td><td align="left" valign="top"></td></tr>
</table>

<hr size="6">
<a name="Invoking-Maria"></a>
<table cellpadding="1" cellspacing="1" border="0">
<tr><td valign="middle" align="left">[<a href="#Analysis" title="Previous section in reading order"> &lt; </a>]</td>
<td valign="middle" align="left">[<a href="#Interrupting" title="Next section in reading order"> &gt; </a>]</td>
<td valign="middle" align="left"> &nbsp; </td>
<td valign="middle" align="left">[<a href="#Analysis" title="Beginning of this chapter or previous chapter"> &lt;&lt; </a>]</td>
<td valign="middle" align="left">[<a href="#Analysis" title="Up section"> Up </a>]</td>
<td valign="middle" align="left">[<a href="maria_4.html#Algorithms" title="Next chapter"> &gt;&gt; </a>]</td>
<td valign="middle" align="left"> &nbsp; </td>
<td valign="middle" align="left"> &nbsp; </td>
<td valign="middle" align="left"> &nbsp; </td>
<td valign="middle" align="left"> &nbsp; </td>
<td valign="middle" align="left">[<a href="maria.html#Top" title="Cover (top) of document">Top</a>]</td>
<td valign="middle" align="left">[<a href="maria_toc.html#SEC_Contents" title="Table of contents">Contents</a>]</td>
<td valign="middle" align="left">[<a href="maria_10.html#Index" title="Index">Index</a>]</td>
<td valign="middle" align="left">[<a href="maria_abt.html#SEC_About" title="About (help)"> ? </a>]</td>
</tr></table>
<a name="Invoking-Maria-1"></a>
<h2 class="section">2.1 Invoking Maria</h2>
<a name="index-reachability-graph_002c-generating"></a>
<a name="index-command-line-options_002c-maria"></a>
<a name="index-invoking-maria"></a>

<p>The usual way to invoke Maria is as follows:
</p>
<table><tr><td>&nbsp;</td><td><pre class="example">maria -b <var>model</var>
</pre></td></tr></table>

<p>Here <var>model</var> is the Petri Net file name, which usually ends in
&lsquo;<samp>.pn</samp>&rsquo;.  The base name for reachability graph files (see section <a href="maria_6.html#Graph-Files">The Graph Files</a>) is generated by removing the directory name part and the file
name suffix (the last part of the name starting with a period &lsquo;<samp>.</samp>&rsquo;)
from the Petri Net file name.  Three files will be generated using the
base name, with the suffixes &lsquo;<samp>.rgd</samp>&rsquo;, &lsquo;<samp>.rgs</samp>&rsquo;, &lsquo;<samp>.rga</samp>&rsquo; and
&lsquo;<samp>.rgh</samp>&rsquo;.  Thus, &lsquo;<samp>maria -b dining.pn</samp>&rsquo; yields &lsquo;<tt>dining.rgd</tt>&rsquo;,
&lsquo;<tt>dining.rgs</tt>&rsquo;, &lsquo;<tt>dining.rga</tt>&rsquo; and &lsquo;<tt>dining.rgh</tt>&rsquo;, and
&lsquo;<samp>maria -d test/order.pn</samp>&rsquo; yields &lsquo;<tt>order.rgd</tt>&rsquo;, &lsquo;<tt>order.rgs</tt>&rsquo;,
&lsquo;<tt>order.rga</tt>&rsquo; and &lsquo;<tt>order.rgh</tt>&rsquo;, in the current directory.
</p>
<table class="menu" border="0" cellspacing="0">
<tr><td align="left" valign="top"><a href="#Interrupting">2.1.1 Interrupting the Reachability Analysis</a></td><td>&nbsp;&nbsp;</td><td align="left" valign="top">                Interrupting the reachability analysis
</td></tr>
<tr><td align="left" valign="top"><a href="#Maria-Options">2.1.2 Options</a></td><td>&nbsp;&nbsp;</td><td align="left" valign="top">               All the options described in detail,
                                  in alphabetical order by short options.
</td></tr>
<tr><td align="left" valign="top"><a href="#Maria-Option-Cross-Key">2.1.3 Option Cross Key</a></td><td>&nbsp;&nbsp;</td><td align="left" valign="top">      Alphabetical list of long options.
</td></tr>
</table>

<hr size="6">
<a name="Interrupting"></a>
<table cellpadding="1" cellspacing="1" border="0">
<tr><td valign="middle" align="left">[<a href="#Invoking-Maria" title="Previous section in reading order"> &lt; </a>]</td>
<td valign="middle" align="left">[<a href="#Maria-Options" title="Next section in reading order"> &gt; </a>]</td>
<td valign="middle" align="left"> &nbsp; </td>
<td valign="middle" align="left">[<a href="#Analysis" title="Beginning of this chapter or previous chapter"> &lt;&lt; </a>]</td>
<td valign="middle" align="left">[<a href="#Invoking-Maria" title="Up section"> Up </a>]</td>
<td valign="middle" align="left">[<a href="maria_4.html#Algorithms" title="Next chapter"> &gt;&gt; </a>]</td>
<td valign="middle" align="left"> &nbsp; </td>
<td valign="middle" align="left"> &nbsp; </td>
<td valign="middle" align="left"> &nbsp; </td>
<td valign="middle" align="left"> &nbsp; </td>
<td valign="middle" align="left">[<a href="maria.html#Top" title="Cover (top) of document">Top</a>]</td>
<td valign="middle" align="left">[<a href="maria_toc.html#SEC_Contents" title="Table of contents">Contents</a>]</td>
<td valign="middle" align="left">[<a href="maria_10.html#Index" title="Index">Index</a>]</td>
<td valign="middle" align="left">[<a href="maria_abt.html#SEC_About" title="About (help)"> ? </a>]</td>
</tr></table>
<a name="Interrupting-the-Reachability-Analysis"></a>
<h3 class="subsection">2.1.1 Interrupting the Reachability Analysis</h3>

<p>Maria traps the interrupt signal (<code>SIGINT</code>), which is usually bound
to <kbd>C-c</kbd>.  When it catches the signal, it will stop processing new
states.  After Maria has finished with the state it is currently
processing, analyzing all the enabled transition instances and
generating the successor states, it will update the reachability graph
directory and stop the analysis.
</p>
<p>Analyzing and firing enabled transition instances in a state may take a
long time.  Be patient or issue a <code>SIGQUIT</code> (normally bound to
<kbd>C-\</kbd>) or a <code>SIGKILL</code> signal to abort the process immediately,
leaving the reachability graph files in an inconsistent state.
</p>
<hr size="6">
<a name="Maria-Options"></a>
<table cellpadding="1" cellspacing="1" border="0">
<tr><td valign="middle" align="left">[<a href="#Interrupting" title="Previous section in reading order"> &lt; </a>]</td>
<td valign="middle" align="left">[<a href="#Maria-Option-Cross-Key" title="Next section in reading order"> &gt; </a>]</td>
<td valign="middle" align="left"> &nbsp; </td>
<td valign="middle" align="left">[<a href="#Analysis" title="Beginning of this chapter or previous chapter"> &lt;&lt; </a>]</td>
<td valign="middle" align="left">[<a href="#Invoking-Maria" title="Up section"> Up </a>]</td>
<td valign="middle" align="left">[<a href="maria_4.html#Algorithms" title="Next chapter"> &gt;&gt; </a>]</td>
<td valign="middle" align="left"> &nbsp; </td>
<td valign="middle" align="left"> &nbsp; </td>
<td valign="middle" align="left"> &nbsp; </td>
<td valign="middle" align="left"> &nbsp; </td>
<td valign="middle" align="left">[<a href="maria.html#Top" title="Cover (top) of document">Top</a>]</td>
<td valign="middle" align="left">[<a href="maria_toc.html#SEC_Contents" title="Table of contents">Contents</a>]</td>
<td valign="middle" align="left">[<a href="maria_10.html#Index" title="Index">Index</a>]</td>
<td valign="middle" align="left">[<a href="maria_abt.html#SEC_About" title="About (help)"> ? </a>]</td>
</tr></table>
<a name="Options"></a>
<h3 class="subsection">2.1.2 Options</h3>

<p>Maria supports both traditional single-letter options and mnemonic long
option names (if compiled with &lsquo;<samp>getopt_long</samp>&rsquo;, see section <a href="maria_7.html#Compiling">Compiling Maria</a>).
Long option names are indicated with &lsquo;<samp>--</samp>&rsquo; instead of &lsquo;<samp>-</samp>&rsquo;.
Abbreviations for option names are allowed as long as they are unique.
When a long option takes an argument, like &lsquo;<samp>--include</samp>&rsquo;, connect the
option name and the argument with &lsquo;<samp>=</samp>&rsquo; or provide the argument in
the immediately following command line argument.
</p>
<p>The options are interpreted in the order they are entered on the
command line.  In other words, the options for interpreting a model
should be specified before loading the model.  For instance,
&lsquo;<samp>maria -b dbm.pn -DUNUSED</samp>&rsquo; does not make much sense, while
&lsquo;<samp>maria -DUNUSED -b dbm.pn</samp>&rsquo; does.
</p>
<p>Here is a list of options that can be used with Maria, alphabetized by
short option.  It is followed by a cross key alphabetized by long
option.
</p>
<dl compact="compact">
<dt> &lsquo;<samp>-a <var>limit</var></samp>&rsquo;</dt>
<dt> &lsquo;<samp>--array-limit=<var>limit</var></samp>&rsquo;</dt>
<dd><p>Limit the size of array index types to <var>limit</var> possible values.  A
limit of 0 disables the checks.
</p>
</dd>
<dt> &lsquo;<samp>-b <var>model</var></samp>&rsquo;</dt>
<dt> &lsquo;<samp>--breadth-first-search=<var>model</var></samp>&rsquo;</dt>
<dd><p>Generate the reachability graph of <var>model</var> using breadth-first search.
Equivalent to &lsquo;<samp>-m <var>model</var> -e breadth</samp>&rsquo;.
</p>
</dd>
<dt> &lsquo;<samp>-C <var>directory</var></samp>&rsquo;</dt>
<dt> &lsquo;<samp>--compile=<var>directory</var></samp>&rsquo;</dt>
<dd><p>Generate C code in <var>directory</var> for evaluating expressions and for
the low-level routines of the transition instance analysis algorithm
(see section <a href="maria_4.html#Instance-Analysis">Transition Instance Analysis</a>).  In order for this option to work, the
program must have been compiled with support for compiled expressions
enabled (see section <a href="maria_7.html#Compiling">Compiling Maria</a>).  Also, the compilation script
&lsquo;<tt><var>progname</var>-cso</tt>&rsquo; must be found in the search path, where
&lsquo;<tt><var>progname</var></tt>&rsquo; is the name used to invoke the analyzer.  It is a
good idea to have a look at the compilation script, and to adjust the
variable definition <code>INCLUDES</code>, so that the required header files
can always be found.
</p>
<p>You may also want to adjust the variables <code>DEFINES</code>, <code>CC</code>,
<code>CFLAGS</code>, <code>LD</code> and <code>LDFLAGS</code> either in the script or in the
environment of the reachability analyzer.  For instance, if you are
using Bourne shell or one of its descendants, prefixing the command line
for invoking Maria with &lsquo;<samp>DEFINES=&quot;&quot; CFLAGS=&quot;&quot;</samp>&rsquo; disables all
compiler optimizations for the model being analyzed.  This may be useful
if the optimization algorithms of the C compiler would consume too many
resources.
</p>
<p>Applying this option should not affect the behaviour of the model
(i.e. it is a bug if it does).  When this option is used, evaluation
errors are reported in a slightly different way.  The interpreter
displays the valuation and expression that caused the first error in a
state; the compiled code displays the number of errors.  For performance
reasons, the generated code does not check for overflow errors when
adding items to multi-sets.
</p>
</dd>
<dt> &lsquo;<samp>-c</samp>&rsquo;</dt>
<dt> &lsquo;<samp>--no-compile</samp>&rsquo;</dt>
<dd><p>The opposite of &lsquo;<samp>-C</samp>&rsquo;.  Evaluate all expressions in the built-in
interpreter.  This is the default behavior.
</p>
</dd>
<dt> &lsquo;<samp>-D <var>symbol</var></samp>&rsquo;</dt>
<dt> &lsquo;<samp>--define=<var>symbol</var></samp>&rsquo;</dt>
<dd><p>Define the preprocessor symbol <var>symbol</var>.  See section <a href="maria_2.html#Conditions">Conditional Processing</a>.
</p>
</dd>
<dt> &lsquo;<samp>-d <var>model</var></samp>&rsquo;</dt>
<dt> &lsquo;<samp>--depth-first-search=<var>model</var></samp>&rsquo;</dt>
<dd><p>Generate the reachability graph of <var>model</var> using depth-first search.
Equivalent to &lsquo;<samp>-m <var>model</var> -e depth</samp>&rsquo;.
</p>
</dd>
<dt> &lsquo;<samp>-E <var>interval</var></samp>&rsquo;</dt>
<dt> &lsquo;<samp>--edges=<var>interval</var></samp>&rsquo;</dt>
<dd><p>When generating the reachability graph, report the size of the graph
after every <var>interval</var> generated edges.
</p>
</dd>
<dt> &lsquo;<samp>-e <var>string</var></samp>&rsquo;</dt>
<dt> &lsquo;<samp>--execute=<var>string</var></samp>&rsquo;</dt>
<dd><p>Execute <var>string</var>.  See section <a href="#Maria-Shell">The Maria Shell</a>.
</p>
</dd>
<dt> &lsquo;<samp>-g <var>graphfile</var></samp>&rsquo;</dt>
<dt> &lsquo;<samp>--graph=<var>graphfile</var></samp>&rsquo;</dt>
<dd><p>Load a previously generated reachability graph from
&lsquo;<tt><var>graphfile</var>.rgh</tt>&rsquo;.
</p>
</dd>
<dt> &lsquo;<samp>-H <var>h</var>[,<var>f</var>[,<var>t</var>]]</samp>&rsquo;</dt>
<dt> &lsquo;<samp>--hashes=<var>h</var>[,<var>f</var>[,<var>t</var>]]</samp>&rsquo;</dt>
<dd><p>Configure the parameters for lossy verification (&lsquo;<samp>-P</samp>&rsquo; or
&lsquo;<samp>-M</samp>&rsquo;).  For &lsquo;<samp>-P</samp>&rsquo;, allocate <var>t</var> universal hash functions
of <var>f</var> elements and corresponding hash tables of <var>h</var> bits
each.  For &lsquo;<samp>-M</samp>&rsquo;, allocate a <var>f</var> bytes for all <var>h</var>
elements of the hash table.  The value <var>h</var> (and for &lsquo;<samp>-P</samp>&rsquo;,
also the value <var>f</var>) will be rounded up to suitable values.
</p>
</dd>
<dt> &lsquo;<samp>-?</samp>&rsquo;</dt>
<dt> &lsquo;<samp>-h</samp>&rsquo;</dt>
<dt> &lsquo;<samp>--help</samp>&rsquo;</dt>
<dd><p>Print a summary of the command-line options to Maria and exit.
</p>
</dd>
<dt> &lsquo;<samp>-I <var>directory</var></samp>&rsquo;</dt>
<dt> &lsquo;<samp>--include=<var>directory</var></samp>&rsquo;</dt>
<dd><p>Append <var>directory</var> to the list of directories searched for include
files.
</p>
</dd>
<dt> &lsquo;<samp>-i <var>columns</var></samp>&rsquo;</dt>
<dt> &lsquo;<samp>--width=<var>columns</var></samp>&rsquo;</dt>
<dd><p>Set the right margin of the output to <var>columns</var>.  The default is 80.
</p>
</dd>
<dt> &lsquo;<samp>-j <var>processes</var></samp>&rsquo;</dt>
<dt> &lsquo;<samp>--jobs=<var>processes</var></samp>&rsquo;</dt>
<dd><p>When checking safety properties (options &lsquo;<samp>-L</samp>&rsquo;, &lsquo;<samp>-M</samp>&rsquo; and
&lsquo;<samp>-P</samp>&rsquo;), use this many worker processes to speed up the analysis on
a multiprocessor computer.  See also &lsquo;<samp>-k</samp>&rsquo; and &lsquo;<samp>-Z</samp>&rsquo;.  Note
that on Digital UNIX, this option may not work properly if the
model is generating successor states too fast (especially when using
the &lsquo;<samp>-C</samp>&rsquo; option).
</p>
</dd>
<dt> &lsquo;<samp>-k <var>port</var>[/<var>host</var>]</samp>&rsquo;</dt>
<dt> &lsquo;<samp>--connect=<var>port</var>[/<var>host</var>]</samp>&rsquo;</dt>
<dd><p>Distribute safety model checking (options &lsquo;<samp>-L</samp>&rsquo;, &lsquo;<samp>-M</samp>&rsquo; and
&lsquo;<samp>-P</samp>&rsquo;) in a TCP/IP network.  For the server, only <var>port</var> is
specified as a 16-bit unsigned integer, usually between 1024 and
65535.  For the worker processes, <var>port</var>/<var>host</var> specifies the
port and the address of the server.  See also &lsquo;<samp>-j</samp>&rsquo;.
</p>
<p>All processes should use the same command line options, except that on
the server, the &lsquo;<samp>-k</samp>&rsquo; switch takes only the <var>port</var> argument, and
the worker processes exit after executing the &lsquo;<samp>breadth</samp>&rsquo; or
&lsquo;<samp>depth</samp>&rsquo; command.  To gain best performance, start the server and
one client on the fastest computer of the network.
</p>
<p>Note that when a computer arranges machine words in the big endian byte
order, all computers must be big endian and have the same word length.
Little endian computers interoperate regardless of their word lengths.
</p>
</dd>
<dt> &lsquo;<samp>-L <var>model</var></samp>&rsquo;</dt>
<dt> &lsquo;<samp>--lossless=<var>model</var></samp>&rsquo;</dt>
<dd><p>Load <var>model</var> and prepare for analysing it by constructing a set of
reachable states in disk files.  See also &lsquo;<samp>-M</samp>&rsquo;, &lsquo;<samp>-P</samp>&rsquo;,
&lsquo;<samp>-j</samp>&rsquo; and &lsquo;<samp>-k</samp>&rsquo;.
</p>
</dd>
<dt> &lsquo;<samp>-m <var>model</var></samp>&rsquo;</dt>
<dt> &lsquo;<samp>--model=<var>model</var></samp>&rsquo;</dt>
<dd><p>Load <var>model</var> and clear its reachability graph.  See also &lsquo;<samp>-b</samp>&rsquo;
and &lsquo;<samp>-d</samp>&rsquo;.
</p>
</dd>
<dt> &lsquo;<samp>-M <var>model</var></samp>&rsquo;</dt>
<dt> &lsquo;<samp>--md5-compacted=<var>model</var></samp>&rsquo;</dt>
<dd><p>Load <var>model</var> and prepare for analysing it by constructing an
overapproximation of the set of reachable states in the main memory
by using a technique called <em>hash compaction</em>.  See also &lsquo;<samp>-P</samp>&rsquo;,
&lsquo;<samp>-L</samp>&rsquo;, &lsquo;<samp>-j</samp>&rsquo; and &lsquo;<samp>-k</samp>&rsquo;.
</p>
</dd>
<dt> &lsquo;<samp>-N <var>c</var><var>regexp</var></samp>&rsquo;</dt>
<dt> &lsquo;<samp>--name=<var>c</var><var>regexp</var></samp>&rsquo;</dt>
<dd><p>Specify the names allowed in context <var>c</var> as the extended regular
expression <var>regexp</var>; See <a href="../grep/Regular-Expressions.html#Regular-Expressions">(grep)Regular Expressions</a> section &lsquo;Regular Expressions&rsquo; in <cite>GNU GREP Manual</cite>.  In order for this option to work,
the program must have been compiled with the POSIX regular expression
library enabled (see section <a href="maria_7.html#Compiling">Compiling Maria</a>).  The context is identified by the
first character of the parameter string; the succeeding characters
constitute the regular expression that allowed names must match:
</p><dl compact="compact">
<dt> &lsquo;<samp>P</samp>&rsquo;</dt>
<dd><p>place name
</p></dd>
<dt> &lsquo;<samp>T</samp>&rsquo;</dt>
<dd><p>transition name
</p></dd>
<dt> &lsquo;<samp>t</samp>&rsquo;</dt>
<dd><p>type name
</p></dd>
<dt> &lsquo;<samp>e</samp>&rsquo;</dt>
<dd><p>name of enumeration constant
</p></dd>
<dt> &lsquo;<samp>c</samp>&rsquo;</dt>
<dd><p>name of struct or union component
</p></dd>
<dt> &lsquo;<samp>f</samp>&rsquo;</dt>
<dd><p>function name
</p></dd>
<dt> &lsquo;<samp>p</samp>&rsquo;</dt>
<dd><p>function parameter name
</p></dd>
<dt> &lsquo;<samp>v</samp>&rsquo;</dt>
<dd><p>transition variable name
</p></dd>
<dt> &lsquo;<samp>i</samp>&rsquo;</dt>
<dd><p>iterator variable name
</p></dd>
</dl>

</dd>
<dt> &lsquo;<samp>-n <var>c</var><var>regexp</var></samp>&rsquo;</dt>
<dt> &lsquo;<samp>--no-name=<var>c</var><var>regexp</var></samp>&rsquo;</dt>
<dd><p>Specify the names not allowed in context <var>c</var> as the extended regular
expression <var>regexp</var>.
</p>
<p>If both &lsquo;<samp>-N</samp>&rsquo; and and &lsquo;<samp>-n</samp>&rsquo; are specified for a context <var>c</var>,
then the allowing match takes precedence.  For instance, to require that
all user defined type names be terminated with &lsquo;<samp>_t</samp>&rsquo;, specify
&lsquo;<samp>-nt -Nt'_t$'</samp>&rsquo;.  The quotes in the latter parameter are required to
remove the special meaning from &lsquo;<samp>$</samp>&rsquo; in the command line shell you
are probably using to invoke Maria.
</p>
</dd>
<dt> &lsquo;<samp>-P <var>model</var></samp>&rsquo;</dt>
<dt> &lsquo;<samp>--probabilistic=<var>model</var></samp>&rsquo;</dt>
<dd><p>Load <var>model</var> and prepare for analysing it by constructing an
overapproximation of the set of reachable states in the main memory by
using a technique called <em>bitstate hashing</em>.  See also &lsquo;<samp>-M</samp>&rsquo;,
&lsquo;<samp>-L</samp>&rsquo;, &lsquo;<samp>-j</samp>&rsquo; and &lsquo;<samp>-k</samp>&rsquo;.
</p>
</dd>
<dt> &lsquo;<samp>-p <var>command</var></samp>&rsquo;</dt>
<dt> &lsquo;<samp>--property-translator=<var>command</var></samp>&rsquo;</dt>
<dd><p>Specify the command to use for translating property automata.  The
command should read a formula from the standard input and write a
corresponding automaton description to the standard output.  The
translator &lsquo;<tt>lbt</tt>&rsquo; (available separately) is compatible with this
option.
</p>
</dd>
<dt> &lsquo;<samp>-q <var>limit</var></samp>&rsquo;</dt>
<dt> &lsquo;<samp>--quantification-limit=<var>limit</var></samp>&rsquo;</dt>
<dd><p>Prevent quantification (multi-set sum) of types having more than
<var>limit</var> possible values.  A limit of 0 disables the checks.
</p>
</dd>
<dt> &lsquo;<samp>-R</samp>&rsquo;</dt>
<dt> &lsquo;<samp>--modular</samp>&rsquo;</dt>
<dd><p>Explore the state space in a modular way.  See section <a href="maria_2.html#Subnets">Defining Subnets for Modular State Space Exploration</a>.
</p>
</dd>
<dt> &lsquo;<samp>-r</samp>&rsquo;</dt>
<dt> &lsquo;<samp>--no-modular</samp>&rsquo;</dt>
<dd><p>Consider only one state space.  This is the default.
</p>
</dd>
<dt> &lsquo;<samp>-t <var>limit</var></samp>&rsquo;</dt>
<dt> &lsquo;<samp>--tolerance=<var>limit</var></samp>&rsquo;</dt>
<dd><p>Abort the analysis when <var>limit</var> non-fatal errors have been
reported.  A limit of 0, the default, allows an infinite number of
errors to occur.
</p>
</dd>
<dt> &lsquo;<samp>-U <var>symbol</var></samp>&rsquo;</dt>
<dt> &lsquo;<samp>--undefine=<var>symbol</var></samp>&rsquo;</dt>
<dd><p>Undefine the preprocessor symbol <var>symbol</var>.  See section <a href="maria_2.html#Conditions">Conditional Processing</a>.
</p>
</dd>
<dt> &lsquo;<samp>-u [M][<var>f</var>[<var>outfile</var>]]</samp>&rsquo;</dt>
<dt> &lsquo;<samp>--unfold=[M][<var>f</var>[<var>outfile</var>]]</samp>&rsquo;</dt>
<dd><p>Unfold the net (optionally reducing it by constructing a
<em>coverable marking</em> (&lsquo;<samp>M</samp>&rsquo;)) and write it in format <var>f</var> to
<var>outfile</var>.  If <var>outfile</var> is not specified, dump the unfolded
net to the standard output.  Possible formats are &lsquo;<samp>m</samp>&rsquo; (Maria
(human-readable), default), &lsquo;<samp>l</samp>&rsquo; (LoLA), &lsquo;<samp>p</samp>&rsquo; (PEP), and
&lsquo;<samp>r</samp>&rsquo; (PROD).
</p>
<p>When the PROD output is chosen, <var>outfile</var> must be specified and end
in &lsquo;<samp>.net</samp>&rsquo;.  Since PROD has no low-level input format, the
transitions in the low-level net are grouped to equivalence classes
based on the input and output arc weights.  Each equivalence class is
folded to a high-level transition.  The translation makes use of tables
that are written to a separate file.  If <var>outfile</var> is
&lsquo;<tt><var>out</var>.net</tt>&rsquo;, the tables are written to
&lsquo;<tt><var>out</var>.src/tables.c</tt>&rsquo;.
</p>
</dd>
<dt> &lsquo;<samp>-V</samp>&rsquo;</dt>
<dt> &lsquo;<samp>--version</samp>&rsquo;</dt>
<dd><p>Print the version number of Maria and exit.
</p>
</dd>
<dt> &lsquo;<samp>-v</samp>&rsquo;</dt>
<dt> &lsquo;<samp>--verbose</samp>&rsquo;</dt>
<dd><p>Display verbose information on different stages of the analysis.
</p>
</dd>
<dt> &lsquo;<samp>-W</samp>&rsquo;</dt>
<dt> &lsquo;<samp>--warnings</samp>&rsquo;</dt>
<dd><p>Enable warnings about suspicious net constructs.  This is the default
behavior.
</p>
</dd>
<dt> &lsquo;<samp>-w</samp>&rsquo;</dt>
<dt> &lsquo;<samp>--no-warnings</samp>&rsquo;</dt>
<dd><p>The opposite of &lsquo;<samp>-W</samp>&rsquo;.  Disable all warnings.
</p>
</dd>
<dt> &lsquo;<samp>-x <var>numberbase</var></samp>&rsquo;</dt>
<dt> &lsquo;<samp>--radix=<var>numberbase</var></samp>&rsquo;</dt>
<dd><p>Specify the number base for diagnostic output.  Allowed values for
<var>numberbase</var> are &lsquo;<samp>oct</samp>&rsquo;, &lsquo;<samp>octal</samp>&rsquo;, &lsquo;<samp>8</samp>&rsquo;, &lsquo;<samp>hex</samp>&rsquo;,
&lsquo;<samp>hexadecimal</samp>&rsquo;, &lsquo;<samp>16</samp>&rsquo;, &lsquo;<samp>dec</samp>&rsquo;, &lsquo;<samp>decimal</samp>&rsquo; and &lsquo;<samp>10</samp>&rsquo;.
The default is to use decimal numbers.
</p>
</dd>
<dt> &lsquo;<samp>-Y</samp>&rsquo;</dt>
<dt> &lsquo;<samp>--compress-hidden</samp>&rsquo;</dt>
<dd><p>Reduce the set of reachable states by not storing the successor states
of transitions instances for which a &lsquo;<samp>hide</samp>&rsquo; condition holds.  The
hidden successors are stored to a separate state set.  This option may
save memory (&lsquo;<samp>-L</samp>&rsquo; or &lsquo;<samp>-m</samp>&rsquo;) or reduce the probability that
states are omitted (&lsquo;<samp>-M</samp>&rsquo; or &lsquo;<samp>-P</samp>&rsquo;), and it may improve the
efficiency of parallel analysis (&lsquo;<samp>-j</samp>&rsquo; or &lsquo;<samp>-k</samp>&rsquo;), but it may
also considerably increase the processor time requirement.  The option
also works with liveness model checking, but there is no guarantee
that the truth values of liveness properties remain unchanged.  This
option can be combined with &lsquo;<samp>-Z</samp>&rsquo;.
</p>
</dd>
<dt> &lsquo;<samp>-y</samp>&rsquo;</dt>
<dt> &lsquo;<samp>--no-compress-hidden</samp>&rsquo;</dt>
<dd><p>The opposite of &lsquo;<samp>-Y</samp>&rsquo;.  This is the default behavior.
</p>
</dd>
<dt> &lsquo;<samp>-Z</samp>&rsquo;</dt>
<dt> &lsquo;<samp>--compress-paths</samp>&rsquo;</dt>
<dd><p>Reduce the set of reachable states by not storing intermediate states
that have at most one successor.  This option may save memory
(&lsquo;<samp>-L</samp>&rsquo; or &lsquo;<samp>-m</samp>&rsquo;) or reduce the probability that states are
omitted (&lsquo;<samp>-M</samp>&rsquo; or &lsquo;<samp>-P</samp>&rsquo;), and it may improve the efficiency of
parallel analysis (&lsquo;<samp>-j</samp>&rsquo; or &lsquo;<samp>-k</samp>&rsquo;), but it may also
considerably increase the processor time requirement.  The option also
works with liveness model checking, but there is no guarantee that the
truth values of liveness properties remain unchanged.  This option can
be combined with &lsquo;<samp>-Y</samp>&rsquo;.
</p>
</dd>
<dt> &lsquo;<samp>-z</samp>&rsquo;</dt>
<dt> &lsquo;<samp>--no-compress-paths</samp>&rsquo;</dt>
<dd><p>The opposite of &lsquo;<samp>-Z</samp>&rsquo;.  This is the default behavior.
</p></dd>
</dl>

<hr size="6">
<a name="Maria-Option-Cross-Key"></a>
<table cellpadding="1" cellspacing="1" border="0">
<tr><td valign="middle" align="left">[<a href="#Maria-Options" title="Previous section in reading order"> &lt; </a>]</td>
<td valign="middle" align="left">[<a href="#Maria-Shell" title="Next section in reading order"> &gt; </a>]</td>
<td valign="middle" align="left"> &nbsp; </td>
<td valign="middle" align="left">[<a href="#Analysis" title="Beginning of this chapter or previous chapter"> &lt;&lt; </a>]</td>
<td valign="middle" align="left">[<a href="#Invoking-Maria" title="Up section"> Up </a>]</td>
<td valign="middle" align="left">[<a href="maria_4.html#Algorithms" title="Next chapter"> &gt;&gt; </a>]</td>
<td valign="middle" align="left"> &nbsp; </td>
<td valign="middle" align="left"> &nbsp; </td>
<td valign="middle" align="left"> &nbsp; </td>
<td valign="middle" align="left"> &nbsp; </td>
<td valign="middle" align="left">[<a href="maria.html#Top" title="Cover (top) of document">Top</a>]</td>
<td valign="middle" align="left">[<a href="maria_toc.html#SEC_Contents" title="Table of contents">Contents</a>]</td>
<td valign="middle" align="left">[<a href="maria_10.html#Index" title="Index">Index</a>]</td>
<td valign="middle" align="left">[<a href="maria_abt.html#SEC_About" title="About (help)"> ? </a>]</td>
</tr></table>
<a name="Option-Cross-Key"></a>
<h3 class="subsection">2.1.3 Option Cross Key</h3>

<p>Here is a list of options, alphabetized by long option, to help you find
the corresponding short option.
</p>

<table><tr><td>&nbsp;</td><td><pre class="example">--array-limit=<var>limit</var>                     -a <var>limit</var>
--breadth-first-search=<var>model</var>            -b <var>model</var>
--compile=<var>directory</var>                     -C <var>directory</var>
--compress-hidden                       -Y
--compress-paths                        -Z
--connect=<var>port</var>[/<var>host</var>]                   -k <var>port</var>[/<var>host</var>]
--define=<var>symbol</var>                         -D <var>symbol</var>
--depth-first-search=<var>model</var>              -d <var>model</var>
--edges=<var>interval</var>                        -E <var>interval</var>
--execute=<var>string</var>                        -e <var>string</var>
--graph=<var>graphfile</var>                       -g <var>graphfile</var>
--hashes=<var>h</var>[,<var>f</var>[,<var>t</var>]]                      -H <var>h</var>[,<var>f</var>[,<var>t</var>]]
--help                                  -h
--include=<var>directory</var>                     -I <var>directory</var>
--jobs=<var>processes</var>                        -j <var>processes</var>
--lossless=<var>model</var>                        -L <var>model</var>
--md5-compacted=<var>model</var>                   -M <var>model</var>
--model=<var>model</var>                           -m <var>model</var>
--modular                               -R
--name=<var>c</var><var>regexp</var>                          -N <var>c</var><var>regexp</var>
--no-compile                            -c
--no-compress-hidden                    -y
--no-compress-paths                     -z
--no-modular                            -r
--no-name=<var>c</var><var>regexp</var>                       -n <var>c</var><var>regexp</var>
--no-warnings                           -w
--probabilistic=<var>model</var>                   -P <var>model</var>
--property-translator=<var>command</var>           -p <var>command</var>
--quantification-limit=<var>limit</var>            -q <var>limit</var>
--radix=<var>numberbase</var>                      -x <var>numberbase</var>
--tolerance=<var>limit</var>                       -t <var>limit</var>
--undefine=<var>symbol</var>                       -U <var>symbol</var>
--unfold=[M][<var>f</var>[<var>outfile</var>]]                -u [M][<var>f</var>[<var>outfile</var>]]
--verbose                               -v
--version                               -V
--warnings                              -W
--width=<var>columns</var>                         -i <var>columns</var>
</pre></td></tr></table>

<hr size="6">
<a name="Maria-Shell"></a>
<table cellpadding="1" cellspacing="1" border="0">
<tr><td valign="middle" align="left">[<a href="#Maria-Option-Cross-Key" title="Previous section in reading order"> &lt; </a>]</td>
<td valign="middle" align="left">[<a href="#Line-Editor" title="Next section in reading order"> &gt; </a>]</td>
<td valign="middle" align="left"> &nbsp; </td>
<td valign="middle" align="left">[<a href="#Analysis" title="Beginning of this chapter or previous chapter"> &lt;&lt; </a>]</td>
<td valign="middle" align="left">[<a href="#Analysis" title="Up section"> Up </a>]</td>
<td valign="middle" align="left">[<a href="maria_4.html#Algorithms" title="Next chapter"> &gt;&gt; </a>]</td>
<td valign="middle" align="left"> &nbsp; </td>
<td valign="middle" align="left"> &nbsp; </td>
<td valign="middle" align="left"> &nbsp; </td>
<td valign="middle" align="left"> &nbsp; </td>
<td valign="middle" align="left">[<a href="maria.html#Top" title="Cover (top) of document">Top</a>]</td>
<td valign="middle" align="left">[<a href="maria_toc.html#SEC_Contents" title="Table of contents">Contents</a>]</td>
<td valign="middle" align="left">[<a href="maria_10.html#Index" title="Index">Index</a>]</td>
<td valign="middle" align="left">[<a href="maria_abt.html#SEC_About" title="About (help)"> ? </a>]</td>
</tr></table>
<a name="The-Maria-Shell"></a>
<h2 class="section">2.2 The Maria Shell</h2>
<a name="index-reachability-graph_002c-examining"></a>

<p>The Maria shell can be used to interactively examine the reachability
graph of a model or to check temporal properties in it.
</p>
<table class="menu" border="0" cellspacing="0">
<tr><td align="left" valign="top"><a href="#Line-Editor">2.2.1 The Line Editor</a></td><td>&nbsp;&nbsp;</td><td align="left" valign="top">                 The command line editor
</td></tr>
<tr><td align="left" valign="top"><a href="#Query-Language">2.2.2 The Query Language</a></td><td>&nbsp;&nbsp;</td><td align="left" valign="top">              The query language
</td></tr>
<tr><td align="left" valign="top"><a href="#Quirks">2.2.3 Some Quirks with the Query Language</a></td><td>&nbsp;&nbsp;</td><td align="left" valign="top">                      Some considerations on the preprocessor
</td></tr>
<tr><td align="left" valign="top"><a href="#Visual">2.2.4 Visualizing Graphs and Paths</a></td><td>&nbsp;&nbsp;</td><td align="left" valign="top">                      Visualizing the results
</td></tr>
</table>

<hr size="6">
<a name="Line-Editor"></a>
<table cellpadding="1" cellspacing="1" border="0">
<tr><td valign="middle" align="left">[<a href="#Maria-Shell" title="Previous section in reading order"> &lt; </a>]</td>
<td valign="middle" align="left">[<a href="#Name-Completion" title="Next section in reading order"> &gt; </a>]</td>
<td valign="middle" align="left"> &nbsp; </td>
<td valign="middle" align="left">[<a href="#Analysis" title="Beginning of this chapter or previous chapter"> &lt;&lt; </a>]</td>
<td valign="middle" align="left">[<a href="#Maria-Shell" title="Up section"> Up </a>]</td>
<td valign="middle" align="left">[<a href="maria_4.html#Algorithms" title="Next chapter"> &gt;&gt; </a>]</td>
<td valign="middle" align="left"> &nbsp; </td>
<td valign="middle" align="left"> &nbsp; </td>
<td valign="middle" align="left"> &nbsp; </td>
<td valign="middle" align="left"> &nbsp; </td>
<td valign="middle" align="left">[<a href="maria.html#Top" title="Cover (top) of document">Top</a>]</td>
<td valign="middle" align="left">[<a href="maria_toc.html#SEC_Contents" title="Table of contents">Contents</a>]</td>
<td valign="middle" align="left">[<a href="maria_10.html#Index" title="Index">Index</a>]</td>
<td valign="middle" align="left">[<a href="maria_abt.html#SEC_About" title="About (help)"> ? </a>]</td>
</tr></table>
<a name="The-Line-Editor"></a>
<h3 class="subsection">2.2.1 The Line Editor</h3>
<a name="index-command-line-interface"></a>

<p>The Maria shell has a command-line driven user interface.  When support
for the GNU Readline library has been enabled at compile time
(see section <a href="maria_7.html#Compiling">Compiling Maria</a>), using the command line is pretty comfortable.
Without Readline, you have to cope with the system&rsquo;s default line
editor, which certainly lacks command line history and completion
features.
</p>
<p>When invoked, Maria will greet you with the prompt &lsquo;<samp>@0$</samp>&rsquo;, where
&lsquo;<samp>0</samp>&rsquo; is the number of the current state, or &lsquo;<samp>$</samp>&rsquo; if no model has
been loaded.  The initial state always has the number zero.  Command
lines may be split over multiple physical lines.  When there is an
unbalanced single or double quote or a multi-line (C-style) comment, or
when the line ends in a backslash &lsquo;<samp>\</samp>&rsquo;, Maria will present the
continuation prompt &lsquo;<samp>@<var>n</var>&gt;</samp>&rsquo;.  In case of a typing mistake,
<kbd>EOF</kbd> will tell Maria to abort reading continuation lines.
</p>
<table class="menu" border="0" cellspacing="0">
<tr><td align="left" valign="top"><a href="#Name-Completion">2.2.1.1 Name Completion</a></td><td>&nbsp;&nbsp;</td><td align="left" valign="top">             Features of the Readline library
</td></tr>
</table>

<hr size="6">
<a name="Name-Completion"></a>
<table cellpadding="1" cellspacing="1" border="0">
<tr><td valign="middle" align="left">[<a href="#Line-Editor" title="Previous section in reading order"> &lt; </a>]</td>
<td valign="middle" align="left">[<a href="#Query-Language" title="Next section in reading order"> &gt; </a>]</td>
<td valign="middle" align="left"> &nbsp; </td>
<td valign="middle" align="left">[<a href="#Analysis" title="Beginning of this chapter or previous chapter"> &lt;&lt; </a>]</td>
<td valign="middle" align="left">[<a href="#Line-Editor" title="Up section"> Up </a>]</td>
<td valign="middle" align="left">[<a href="maria_4.html#Algorithms" title="Next chapter"> &gt;&gt; </a>]</td>
<td valign="middle" align="left"> &nbsp; </td>
<td valign="middle" align="left"> &nbsp; </td>
<td valign="middle" align="left"> &nbsp; </td>
<td valign="middle" align="left"> &nbsp; </td>
<td valign="middle" align="left">[<a href="maria.html#Top" title="Cover (top) of document">Top</a>]</td>
<td valign="middle" align="left">[<a href="maria_toc.html#SEC_Contents" title="Table of contents">Contents</a>]</td>
<td valign="middle" align="left">[<a href="maria_10.html#Index" title="Index">Index</a>]</td>
<td valign="middle" align="left">[<a href="maria_abt.html#SEC_About" title="About (help)"> ? </a>]</td>
</tr></table>
<a name="Name-Completion-1"></a>
<h4 class="subsubsection">2.2.1.1 Name Completion</h4>
<a name="index-Readline"></a>
<a name="index-completion-of-names"></a>
<a name="index-names_002c-completion-of"></a>

<p>This is by no means a complete list of Readline features.  See <a href="../readline/Command-Line-Editing.html#Command-Line-Editing">(readline)Command Line Editing</a> section &lsquo;Command Line Editing&rsquo; in <cite>GNU Readline Library</cite>,
if you are not familiar with Readline.
</p>
<p>One of the nicest features of the Readline library is context-sensitive
completion of names.  The Maria shell completes names of data types
(immediately following the &lsquo;<samp>is</samp>&rsquo; keyword), places (following
&lsquo;<samp>place</samp>&rsquo;), transitions (&lsquo;<samp>trans</samp>&rsquo;), and keywords.  Let us now
assume that you have generated the reachability graph for the dining
philosopher example (see section <a href="maria_8.html#Dining">Dining Philosophers (&lsquo;<tt>dining.pn</tt>&rsquo;)</a>).  The following example illustrates
how the context-sensitive completion of names works.
</p>
<table><tr><td>&nbsp;</td><td><pre class="example"><b>$</b>graph dining<kbd>RET</kbd>
<b>@0$</b>pa<kbd>TAB</kbd>
<b>@0$</b>pa<b>th </b>@29 pl<kbd>TAB</kbd>
<b>@0$</b>path @29 pl<b>ace &quot;</b>f<kbd>TAB</kbd>
<b>@0$</b>path @29 place &quot;f<b>ork&quot; </b>eq<kbd>TAB</kbd>
<b>@0$</b>path @29 place &quot;fork&quot; eq<b>uals </b>em<kbd>TAB</kbd>
<b>@0$</b>path @29 place &quot;fork&quot; equals em<b>pty </b><kbd>RET</kbd>
<b>shortest path from condition to @29 (2 nodes):</b>
</pre><pre class="example"><b>@74:state (</b>
<b> state:</b>
<b>  {3,thinking},{1,hungry},{4,hungry},{5,hungry},{2,eating}</b>
<b>)</b>
<b>4 predecessors</b>
<b>1 successor</b>
</pre><pre class="example"><b>transition finish-&gt;@29</b>
<b>&lt;</b>
<b> p:2</b>
<b>&gt;</b>
</pre><pre class="example"><b>@29:state (</b>
<b> fork:</b>
<b>  2,3</b>
<b> state:</b>
<b>  {2,thinking},{3,thinking},{1,hungry},{4,hungry},{5,hungry}</b>
<b>)</b>
<b>4 predecessors</b>
<b>3 successors</b>
</pre><pre class="example"><b>@0$</b>exit <kbd>RET</kbd>
</pre></td></tr></table>

<p>Unfortunately backslash-quoted names cannot be completed.  This is due
to a limitation of the Readline library, which will only call the
dequoting function if its built-in filename completion function is being
used.  This is why the keyword completer adds a double quotation mark
after keywords that are likely to be followed by a name.
</p>
<hr size="6">
<a name="Query-Language"></a>
<table cellpadding="1" cellspacing="1" border="0">
<tr><td valign="middle" align="left">[<a href="#Name-Completion" title="Previous section in reading order"> &lt; </a>]</td>
<td valign="middle" align="left">[<a href="#Graph-and-Model" title="Next section in reading order"> &gt; </a>]</td>
<td valign="middle" align="left"> &nbsp; </td>
<td valign="middle" align="left">[<a href="#Analysis" title="Beginning of this chapter or previous chapter"> &lt;&lt; </a>]</td>
<td valign="middle" align="left">[<a href="#Maria-Shell" title="Up section"> Up </a>]</td>
<td valign="middle" align="left">[<a href="maria_4.html#Algorithms" title="Next chapter"> &gt;&gt; </a>]</td>
<td valign="middle" align="left"> &nbsp; </td>
<td valign="middle" align="left"> &nbsp; </td>
<td valign="middle" align="left"> &nbsp; </td>
<td valign="middle" align="left"> &nbsp; </td>
<td valign="middle" align="left">[<a href="maria.html#Top" title="Cover (top) of document">Top</a>]</td>
<td valign="middle" align="left">[<a href="maria_toc.html#SEC_Contents" title="Table of contents">Contents</a>]</td>
<td valign="middle" align="left">[<a href="maria_10.html#Index" title="Index">Index</a>]</td>
<td valign="middle" align="left">[<a href="maria_abt.html#SEC_About" title="About (help)"> ? </a>]</td>
</tr></table>
<a name="The-Query-Language"></a>
<h3 class="subsection">2.2.2 The Query Language</h3>
<a name="index-query-language"></a>

<p>Maria uses a script language in which statements are separated by
semicolons (&lsquo;<samp>;</samp>&rsquo;).  See section <a href="#Separating-Statements">Separating Statements</a>, for other
considerations.
</p>
<p>There are commands for moving around in the graph and for evaluating
formulae in different graph nodes.  Maria shell commands are reserved
words only in the beginning of a statement: there is no need to quote a
place name &lsquo;<samp>exit</samp>&rsquo;, for instance.
</p>
<table class="menu" border="0" cellspacing="0">
<tr><td align="left" valign="top"><a href="#Graph-and-Model">2.2.2.1 Loading a Model</a></td><td>&nbsp;&nbsp;</td><td align="left" valign="top">     Loading a reachability graph or model
</td></tr>
<tr><td align="left" valign="top"><a href="#Dump">2.2.2.2 Displaying a Model</a></td><td>&nbsp;&nbsp;</td><td align="left" valign="top">                Displaying a model
</td></tr>
<tr><td align="left" valign="top"><a href="#Unfold">2.2.2.3 Unfolding a Model</a></td><td>&nbsp;&nbsp;</td><td align="left" valign="top">              Unfolding a model
</td></tr>
<tr><td align="left" valign="top"><a href="#LSTS">2.2.2.4 Exporting a Labelled State Transition System</a></td><td>&nbsp;&nbsp;</td><td align="left" valign="top"></td></tr>
<tr><td align="left" valign="top"><a href="#Dumpgraph">2.2.2.5 Exporting the Reachability Graph</a></td><td>&nbsp;&nbsp;</td><td align="left" valign="top">           Exporting a reachability graph
</td></tr>
<tr><td align="left" valign="top"><a href="#Depth-and-Breadth">2.2.2.6 Exhaustive Analysis</a></td><td>&nbsp;&nbsp;</td><td align="left" valign="top">   Exhaustive reachability analysis
</td></tr>
<tr><td align="left" valign="top"><a href="#Eval">2.2.2.7 Evaluating Expressions and Formulae</a></td><td>&nbsp;&nbsp;</td><td align="left" valign="top">                Evaluating expressions and formulae
</td></tr>
<tr><td align="left" valign="top"><a href="#Show">2.2.2.8 Displaying Markings</a></td><td>&nbsp;&nbsp;</td><td align="left" valign="top">                Displaying markings
</td></tr>
<tr><td align="left" valign="top"><a href="#Hide">2.2.2.9 Excluding Places from Displayed Markings</a></td><td>&nbsp;&nbsp;</td><td align="left" valign="top">                Omitting places from markings
</td></tr>
<tr><td align="left" valign="top"><a href="#Subnet">2.2.2.10 Selecting the Active Subnet</a></td><td>&nbsp;&nbsp;</td><td align="left" valign="top">              Selecting the active subnet
</td></tr>
<tr><td align="left" valign="top"><a href="#Succ">2.2.2.11 Listing Successor Nodes</a></td><td>&nbsp;&nbsp;</td><td align="left" valign="top">                Listing successor nodes
</td></tr>
<tr><td align="left" valign="top"><a href="#Pred">2.2.2.12 Listing Predecessor Nodes</a></td><td>&nbsp;&nbsp;</td><td align="left" valign="top">                Listing predecessor nodes
</td></tr>
<tr><td align="left" valign="top"><a href="#Go">2.2.2.13 Moving in the Graph</a></td><td>&nbsp;&nbsp;</td><td align="left" valign="top">                  Moving between nodes
</td></tr>
<tr><td align="left" valign="top"><a href="#Trans">2.2.2.14 Anonymous Transitions</a></td><td>&nbsp;&nbsp;</td><td align="left" valign="top">               Defining and firing an anonymous transition
</td></tr>
<tr><td align="left" valign="top"><a href="#Function">2.2.2.15 Defining Functions</a></td><td>&nbsp;&nbsp;</td><td align="left" valign="top">            Defining functions
</td></tr>
<tr><td align="left" valign="top"><a href="#Strong">2.2.2.16 Strongly Connected Components</a></td><td>&nbsp;&nbsp;</td><td align="left" valign="top">              Strongly connected components
</td></tr>
<tr><td align="left" valign="top"><a href="#Path">2.2.2.17 Shortest Paths</a></td><td>&nbsp;&nbsp;</td><td align="left" valign="top">                Shortest paths
</td></tr>
<tr><td align="left" valign="top"><a href="#Misc">2.2.2.18 Miscellanous Commands</a></td><td>&nbsp;&nbsp;</td><td align="left" valign="top">                Miscellanous commands
</td></tr>
<tr><td align="left" valign="top"><a href="#Exit">2.2.2.19 Exiting</a></td><td>&nbsp;&nbsp;</td><td align="left" valign="top"></td></tr>
</table>

<hr size="6">
<a name="Graph-and-Model"></a>
<table cellpadding="1" cellspacing="1" border="0">
<tr><td valign="middle" align="left">[<a href="#Query-Language" title="Previous section in reading order"> &lt; </a>]</td>
<td valign="middle" align="left">[<a href="#Dump" title="Next section in reading order"> &gt; </a>]</td>
<td valign="middle" align="left"> &nbsp; </td>
<td valign="middle" align="left">[<a href="#Analysis" title="Beginning of this chapter or previous chapter"> &lt;&lt; </a>]</td>
<td valign="middle" align="left">[<a href="#Query-Language" title="Up section"> Up </a>]</td>
<td valign="middle" align="left">[<a href="maria_4.html#Algorithms" title="Next chapter"> &gt;&gt; </a>]</td>
<td valign="middle" align="left"> &nbsp; </td>
<td valign="middle" align="left"> &nbsp; </td>
<td valign="middle" align="left"> &nbsp; </td>
<td valign="middle" align="left"> &nbsp; </td>
<td valign="middle" align="left">[<a href="maria.html#Top" title="Cover (top) of document">Top</a>]</td>
<td valign="middle" align="left">[<a href="maria_toc.html#SEC_Contents" title="Table of contents">Contents</a>]</td>
<td valign="middle" align="left">[<a href="maria_10.html#Index" title="Index">Index</a>]</td>
<td valign="middle" align="left">[<a href="maria_abt.html#SEC_About" title="About (help)"> ? </a>]</td>
</tr></table>
<a name="Loading-a-Model"></a>
<h4 class="subsubsection">2.2.2.1 Loading a Model</h4>
<a name="index-graph_002c-query-language"></a>
<a name="index-model_002c-query-language"></a>

<table><tr><td>&nbsp;</td><td><pre class="example">statement:
        GRAPH name
        |
        MODEL name
</pre></td></tr></table>

<p>The &lsquo;<samp>graph</samp>&rsquo; command loads a previously generated reachability
graph.  The supplied name must exclude the &lsquo;<samp>.rgh</samp>&rsquo; suffix.
</p>
<p>The &lsquo;<samp>model</samp>&rsquo; command loads a Petri net model and initializes its
reachability graph.  Be careful with this command; it will delete a
previously generated reachability graph of the model, if one exists in
the current directory.
</p>
<hr size="6">
<a name="Dump"></a>
<table cellpadding="1" cellspacing="1" border="0">
<tr><td valign="middle" align="left">[<a href="#Graph-and-Model" title="Previous section in reading order"> &lt; </a>]</td>
<td valign="middle" align="left">[<a href="#Unfold" title="Next section in reading order"> &gt; </a>]</td>
<td valign="middle" align="left"> &nbsp; </td>
<td valign="middle" align="left">[<a href="#Analysis" title="Beginning of this chapter or previous chapter"> &lt;&lt; </a>]</td>
<td valign="middle" align="left">[<a href="#Query-Language" title="Up section"> Up </a>]</td>
<td valign="middle" align="left">[<a href="maria_4.html#Algorithms" title="Next chapter"> &gt;&gt; </a>]</td>
<td valign="middle" align="left"> &nbsp; </td>
<td valign="middle" align="left"> &nbsp; </td>
<td valign="middle" align="left"> &nbsp; </td>
<td valign="middle" align="left"> &nbsp; </td>
<td valign="middle" align="left">[<a href="maria.html#Top" title="Cover (top) of document">Top</a>]</td>
<td valign="middle" align="left">[<a href="maria_toc.html#SEC_Contents" title="Table of contents">Contents</a>]</td>
<td valign="middle" align="left">[<a href="maria_10.html#Index" title="Index">Index</a>]</td>
<td valign="middle" align="left">[<a href="maria_abt.html#SEC_About" title="About (help)"> ? </a>]</td>
</tr></table>
<a name="Displaying-a-Model"></a>
<h4 class="subsubsection">2.2.2.2 Displaying a Model</h4>
<a name="index-visual_002c-query-language"></a>
<a name="index-dump_002c-query-language"></a>

<table><tr><td>&nbsp;</td><td><pre class="example">statement:
        [ VISUAL ] DUMP
</pre></td></tr></table>

<p>The &lsquo;<samp>dump</samp>&rsquo; command displays the syntax tree of the current model in
the modelling language.  When the &lsquo;<samp>visual</samp>&rsquo; prefix is present, the
Petri net will be displayed graphically (see section <a href="#Visual">Visualizing Graphs and Paths</a>).  This command
may be useful when trying to find out how Maria expands multi-set
summations (see section <a href="maria_2.html#Multi_002dSets">Operations on Multi-Sets</a>) or quantifications (see section <a href="maria_2.html#Logic">Boolean Logic</a>).
</p>
<hr size="6">
<a name="Unfold"></a>
<table cellpadding="1" cellspacing="1" border="0">
<tr><td valign="middle" align="left">[<a href="#Dump" title="Previous section in reading order"> &lt; </a>]</td>
<td valign="middle" align="left">[<a href="#LSTS" title="Next section in reading order"> &gt; </a>]</td>
<td valign="middle" align="left"> &nbsp; </td>
<td valign="middle" align="left">[<a href="#Analysis" title="Beginning of this chapter or previous chapter"> &lt;&lt; </a>]</td>
<td valign="middle" align="left">[<a href="#Query-Language" title="Up section"> Up </a>]</td>
<td valign="middle" align="left">[<a href="maria_4.html#Algorithms" title="Next chapter"> &gt;&gt; </a>]</td>
<td valign="middle" align="left"> &nbsp; </td>
<td valign="middle" align="left"> &nbsp; </td>
<td valign="middle" align="left"> &nbsp; </td>
<td valign="middle" align="left"> &nbsp; </td>
<td valign="middle" align="left">[<a href="maria.html#Top" title="Cover (top) of document">Top</a>]</td>
<td valign="middle" align="left">[<a href="maria_toc.html#SEC_Contents" title="Table of contents">Contents</a>]</td>
<td valign="middle" align="left">[<a href="maria_10.html#Index" title="Index">Index</a>]</td>
<td valign="middle" align="left">[<a href="maria_abt.html#SEC_About" title="About (help)"> ? </a>]</td>
</tr></table>
<a name="Unfolding-a-Model"></a>
<h4 class="subsubsection">2.2.2.3 Unfolding a Model</h4>
<a name="index-unfold_002c-query-language"></a>

<table><tr><td>&nbsp;</td><td><pre class="example">statement:
        UNFOLD [ name ]
</pre></td></tr></table>

<p>The &lsquo;<samp>unfold</samp>&rsquo; command unfolds the currently loaded Petri net model.
The argument takes the same format as the command line option &lsquo;<samp>-u</samp>&rsquo;
(see section <a href="#Maria-Options">Options</a>).
</p>
<hr size="6">
<a name="LSTS"></a>
<table cellpadding="1" cellspacing="1" border="0">
<tr><td valign="middle" align="left">[<a href="#Unfold" title="Previous section in reading order"> &lt; </a>]</td>
<td valign="middle" align="left">[<a href="#Dumpgraph" title="Next section in reading order"> &gt; </a>]</td>
<td valign="middle" align="left"> &nbsp; </td>
<td valign="middle" align="left">[<a href="#Analysis" title="Beginning of this chapter or previous chapter"> &lt;&lt; </a>]</td>
<td valign="middle" align="left">[<a href="#Query-Language" title="Up section"> Up </a>]</td>
<td valign="middle" align="left">[<a href="maria_4.html#Algorithms" title="Next chapter"> &gt;&gt; </a>]</td>
<td valign="middle" align="left"> &nbsp; </td>
<td valign="middle" align="left"> &nbsp; </td>
<td valign="middle" align="left"> &nbsp; </td>
<td valign="middle" align="left"> &nbsp; </td>
<td valign="middle" align="left">[<a href="maria.html#Top" title="Cover (top) of document">Top</a>]</td>
<td valign="middle" align="left">[<a href="maria_toc.html#SEC_Contents" title="Table of contents">Contents</a>]</td>
<td valign="middle" align="left">[<a href="maria_10.html#Index" title="Index">Index</a>]</td>
<td valign="middle" align="left">[<a href="maria_abt.html#SEC_About" title="About (help)"> ? </a>]</td>
</tr></table>
<a name="Exporting-a-Labelled-State-Transition-System"></a>
<h4 class="subsubsection">2.2.2.4 Exporting a Labelled State Transition System</h4>
<a name="index-lsts_002c-query-language"></a>

<table><tr><td>&nbsp;</td><td><pre class="example">statement:
        LSTS [ name ]
</pre></td></tr></table>

<p>Maria is able to export the reachability graph or parts thereof as a
labelled state transition system.  The &lsquo;<samp>lsts</samp>&rsquo; command specifies a
file name for an LSTS.  When the command is invoked without a file name,
any currently open LSTS files are closed and the function cancelled.
</p>
<p>The &lsquo;<samp>lsts</samp>&rsquo; command affects exhaustive analysis (see section <a href="#Depth-and-Breadth">Exhaustive Analysis</a>), non-visual path queries (see section <a href="#Path">Shortest Paths</a>) and the representation
of counterexample paths of liveness properties (see section <a href="maria_4.html#Liveness">Checking Liveness Properties</a>).
</p>
<p>In exhaustive analysis, the command should be invoked before any states
have been explored, right after the model has been loaded.  When using
the path commands, the &lsquo;<samp>lsts</samp>&rsquo; command should be issued right before
generating the counterexample.  These measures are necessary, because
for efficiency reasons, the &lsquo;<samp>lsts</samp>&rsquo; command has been implemented so
that all generated states and arcs are exported to LSTS files if ones
have been opened.  The path query commands export results to LSTS if the
files are open, and close the files immediately after that.  It is
impossible to combine several query results into one exported LSTS.
</p>
<p>The LSTS output can be controlled by hiding variables or transition
instances (see section <a href="maria_2.html#Transitions">Transition Definition: &lsquo;<samp>trans</samp>&rsquo;</a>) and by specifying state propositions
(see section <a href="maria_2.html#Propositions">Specifying State Propositions for LSTS Output</a>).
</p>
<hr size="6">
<a name="Dumpgraph"></a>
<table cellpadding="1" cellspacing="1" border="0">
<tr><td valign="middle" align="left">[<a href="#LSTS" title="Previous section in reading order"> &lt; </a>]</td>
<td valign="middle" align="left">[<a href="#Depth-and-Breadth" title="Next section in reading order"> &gt; </a>]</td>
<td valign="middle" align="left"> &nbsp; </td>
<td valign="middle" align="left">[<a href="#Analysis" title="Beginning of this chapter or previous chapter"> &lt;&lt; </a>]</td>
<td valign="middle" align="left">[<a href="#Query-Language" title="Up section"> Up </a>]</td>
<td valign="middle" align="left">[<a href="maria_4.html#Algorithms" title="Next chapter"> &gt;&gt; </a>]</td>
<td valign="middle" align="left"> &nbsp; </td>
<td valign="middle" align="left"> &nbsp; </td>
<td valign="middle" align="left"> &nbsp; </td>
<td valign="middle" align="left"> &nbsp; </td>
<td valign="middle" align="left">[<a href="maria.html#Top" title="Cover (top) of document">Top</a>]</td>
<td valign="middle" align="left">[<a href="maria_toc.html#SEC_Contents" title="Table of contents">Contents</a>]</td>
<td valign="middle" align="left">[<a href="maria_10.html#Index" title="Index">Index</a>]</td>
<td valign="middle" align="left">[<a href="maria_abt.html#SEC_About" title="About (help)"> ? </a>]</td>
</tr></table>
<a name="Exporting-the-Reachability-Graph"></a>
<h4 class="subsubsection">2.2.2.5 Exporting the Reachability Graph</h4>
<a name="index-dumpgraph_002c-query-language"></a>
<a name="index-visual_002c-query-language-1"></a>

<table><tr><td>&nbsp;</td><td><pre class="example">statement:
        [ VISUAL ] DUMPGRAPH
</pre></td></tr></table>

<p>The command &lsquo;<samp>dumpgraph</samp>&rsquo; exports the portion of the reachability
graph that has been generated so far.  When the &lsquo;<samp>visual</samp>&rsquo; prefix
is present, the reachability graph will be displayed graphically
(see section <a href="#Visual">Visualizing Graphs and Paths</a>).  See section <a href="#Depth-and-Breadth">Exhaustive Analysis</a>, for information on
generating the reachability graph.
</p>
<hr size="6">
<a name="Depth-and-Breadth"></a>
<table cellpadding="1" cellspacing="1" border="0">
<tr><td valign="middle" align="left">[<a href="#Dumpgraph" title="Previous section in reading order"> &lt; </a>]</td>
<td valign="middle" align="left">[<a href="#Eval" title="Next section in reading order"> &gt; </a>]</td>
<td valign="middle" align="left"> &nbsp; </td>
<td valign="middle" align="left">[<a href="#Analysis" title="Beginning of this chapter or previous chapter"> &lt;&lt; </a>]</td>
<td valign="middle" align="left">[<a href="#Query-Language" title="Up section"> Up </a>]</td>
<td valign="middle" align="left">[<a href="maria_4.html#Algorithms" title="Next chapter"> &gt;&gt; </a>]</td>
<td valign="middle" align="left"> &nbsp; </td>
<td valign="middle" align="left"> &nbsp; </td>
<td valign="middle" align="left"> &nbsp; </td>
<td valign="middle" align="left"> &nbsp; </td>
<td valign="middle" align="left">[<a href="maria.html#Top" title="Cover (top) of document">Top</a>]</td>
<td valign="middle" align="left">[<a href="maria_toc.html#SEC_Contents" title="Table of contents">Contents</a>]</td>
<td valign="middle" align="left">[<a href="maria_10.html#Index" title="Index">Index</a>]</td>
<td valign="middle" align="left">[<a href="maria_abt.html#SEC_About" title="About (help)"> ? </a>]</td>
</tr></table>
<a name="Exhaustive-Analysis"></a>
<h4 class="subsubsection">2.2.2.6 Exhaustive Analysis</h4>
<a name="index-breadth_002c-query-language"></a>
<a name="index-depth_002c-query-language"></a>
<a name="index-visual_002c-query-language-2"></a>

<table><tr><td>&nbsp;</td><td><pre class="example">statement:
        BREADTH [ STATE ]
        |
        DEPTH [ STATE ]
</pre></td></tr></table>

<p>The commands &lsquo;<samp>breadth</samp>&rsquo; and &lsquo;<samp>depth</samp>&rsquo; generate all states that
are reachable either from the current state or from a specified state.
This exhaustive search will only be performed if the successors of the
state have not already been generated.
</p>
<table><tr><td>&nbsp;</td><td><pre class="example"><b>$</b>model &quot;dining.pn&quot;
<b>@0$</b>breadth
<b>&quot;dining.pn&quot;: 82 states (3..6 bytes), 265 arcs</b>
</pre></td></tr></table>

<p>At the end of the search, the numbers of generated states and events are
reported.  The byte range indicates the minimum and maximum lengths of
encoded state representations.  This number is affected by modelling
techniques, such as the use of capacity constraints and invariants
(see section <a href="maria_2.html#Places">Place Definition: &lsquo;<samp>place</samp>&rsquo;</a>), and by not folding places unnecessarily.  For this
particular model (see section <a href="maria_8.html#Dining">Dining Philosophers (&lsquo;<tt>dining.pn</tt>&rsquo;)</a>), the maximum length of encoded states
can be reduced from 6 to 4 bytes by splitting the place that holds pairs
of philosophers and their states (thinking, hungry, eating) to three
places, holding a set of those philosophers that are in the state, and
by defining an invariant initialisation expression for the &quot;thinking&quot;
place.
</p>
<p>The &lsquo;<samp>breadth</samp>&rsquo; and &lsquo;<samp>depth</samp>&rsquo; commands can be also used in
purely state-based safety verification (command-line options
&lsquo;<samp>-L</samp>&rsquo;, &lsquo;<samp>-M</samp>&rsquo; and &lsquo;<samp>-P</samp>&rsquo;), without generating a reachability
graph.  If either command is given a safety LTL formula as an
argument, the model contained in the file will be verified against the
property.  When the command is preceded by a &lsquo;<samp>visual</samp>&rsquo; keyword,
any path that violates the formula will be displayed graphically
(see section <a href="#Visual">Visualizing Graphs and Paths</a>).
</p>
<table><tr><td>&nbsp;</td><td><pre class="example">statement:
        [ VISUAL ] BREADTH formula
        |
        [ VISUAL ] DEPTH formula
</pre></td></tr></table>

<hr size="6">
<a name="Eval"></a>
<table cellpadding="1" cellspacing="1" border="0">
<tr><td valign="middle" align="left">[<a href="#Depth-and-Breadth" title="Previous section in reading order"> &lt; </a>]</td>
<td valign="middle" align="left">[<a href="#Show" title="Next section in reading order"> &gt; </a>]</td>
<td valign="middle" align="left"> &nbsp; </td>
<td valign="middle" align="left">[<a href="#Analysis" title="Beginning of this chapter or previous chapter"> &lt;&lt; </a>]</td>
<td valign="middle" align="left">[<a href="#Query-Language" title="Up section"> Up </a>]</td>
<td valign="middle" align="left">[<a href="maria_4.html#Algorithms" title="Next chapter"> &gt;&gt; </a>]</td>
<td valign="middle" align="left"> &nbsp; </td>
<td valign="middle" align="left"> &nbsp; </td>
<td valign="middle" align="left"> &nbsp; </td>
<td valign="middle" align="left"> &nbsp; </td>
<td valign="middle" align="left">[<a href="maria.html#Top" title="Cover (top) of document">Top</a>]</td>
<td valign="middle" align="left">[<a href="maria_toc.html#SEC_Contents" title="Table of contents">Contents</a>]</td>
<td valign="middle" align="left">[<a href="maria_10.html#Index" title="Index">Index</a>]</td>
<td valign="middle" align="left">[<a href="maria_abt.html#SEC_About" title="About (help)"> ? </a>]</td>
</tr></table>
<a name="Evaluating-Expressions-and-Formulae"></a>
<h4 class="subsubsection">2.2.2.7 Evaluating Expressions and Formulae</h4>
<a name="index-expressions_002c-evaluating"></a>
<a name="index-model-checking"></a>
<a name="index-visual_002c-query-language-3"></a>
<a name="index-eval_002c-query-language"></a>

<table><tr><td>&nbsp;</td><td><pre class="example">statement:
        [ VISUAL ] [ EVAL ] [ STATE ] formula
</pre></td></tr></table>

<p>Expressions and formulae can be evaluated either in the current state or
in a given state.
</p>
<table><tr><td>&nbsp;</td><td><pre class="example"><b>@0$</b>place fork
<b>fork:</b>
<b> 1,2,3,4,5</b>
</pre><pre class="example"><b>@0$</b>eval @4 place fork
<b>fork:</b>
<b> 1,2,3,5</b>
</pre></td></tr></table>

<p>When the &lsquo;<samp>visual</samp>&rsquo; keyword is present and a temporal formula is
being evaluated, a path violating the formula is displayed graphically
(see section <a href="#Visual">Visualizing Graphs and Paths</a>).
</p>
<hr size="6">
<a name="Show"></a>
<table cellpadding="1" cellspacing="1" border="0">
<tr><td valign="middle" align="left">[<a href="#Eval" title="Previous section in reading order"> &lt; </a>]</td>
<td valign="middle" align="left">[<a href="#Hide" title="Next section in reading order"> &gt; </a>]</td>
<td valign="middle" align="left"> &nbsp; </td>
<td valign="middle" align="left">[<a href="#Analysis" title="Beginning of this chapter or previous chapter"> &lt;&lt; </a>]</td>
<td valign="middle" align="left">[<a href="#Query-Language" title="Up section"> Up </a>]</td>
<td valign="middle" align="left">[<a href="maria_4.html#Algorithms" title="Next chapter"> &gt;&gt; </a>]</td>
<td valign="middle" align="left"> &nbsp; </td>
<td valign="middle" align="left"> &nbsp; </td>
<td valign="middle" align="left"> &nbsp; </td>
<td valign="middle" align="left"> &nbsp; </td>
<td valign="middle" align="left">[<a href="maria.html#Top" title="Cover (top) of document">Top</a>]</td>
<td valign="middle" align="left">[<a href="maria_toc.html#SEC_Contents" title="Table of contents">Contents</a>]</td>
<td valign="middle" align="left">[<a href="maria_10.html#Index" title="Index">Index</a>]</td>
<td valign="middle" align="left">[<a href="maria_abt.html#SEC_About" title="About (help)"> ? </a>]</td>
</tr></table>
<a name="Displaying-Markings"></a>
<h4 class="subsubsection">2.2.2.8 Displaying Markings</h4>
<a name="index-visual_002c-query-language-4"></a>
<a name="index-show_002c-query-language"></a>

<p>With the &lsquo;<samp>show</samp>&rsquo; command it is possible to view the marking of a
node in the reachability graph.  When a node is not specified, the
current node will be shown.
</p>
<p>The command can also be used to view the nodes in a strongly connected
component (see section <a href="#Strong">Strongly Connected Components</a>).  It is possible to specify a Boolean
condition to select a subset of the states in the strongly connected
component to be displayed.
</p>
<table><tr><td>&nbsp;</td><td><pre class="example">statement:
        [ VISUAL ] SHOW [ STATE ]
        |
        [ VISUAL ] [ SHOW ] COMP [ expr ]
        |
        [ VISUAL ] SHOW STATE STATE ( STATE )*
</pre></td></tr></table>

<p>When the keyword &lsquo;<samp>show</samp>&rsquo; is followed by a sequence of at least two
state numbers, Maria displays the sequence of states in the same way as
the &lsquo;<samp>path</samp>&rsquo; command does (see section <a href="#Path">Shortest Paths</a>).  This command is most
useful with the &lsquo;<samp>visual</samp>&rsquo; prefix, since it can be used for
visualizing a previously reported path.
</p>
<table><tr><td>&nbsp;</td><td><pre class="example"><b>@0$</b>show @4
<b>@4:state (</b>
<b> fork:</b>
<b>  1,2,3,5</b>
<b> state:</b>
<b>  {1,thinking},{2,thinking},{3,thinking},{5,thinking},{4,hungry}</b>
<b>)</b>
<b>4 predecessors</b>
<b>5 successors</b>
</pre></td></tr></table>

<hr size="6">
<a name="Hide"></a>
<table cellpadding="1" cellspacing="1" border="0">
<tr><td valign="middle" align="left">[<a href="#Show" title="Previous section in reading order"> &lt; </a>]</td>
<td valign="middle" align="left">[<a href="#Subnet" title="Next section in reading order"> &gt; </a>]</td>
<td valign="middle" align="left"> &nbsp; </td>
<td valign="middle" align="left">[<a href="#Analysis" title="Beginning of this chapter or previous chapter"> &lt;&lt; </a>]</td>
<td valign="middle" align="left">[<a href="#Query-Language" title="Up section"> Up </a>]</td>
<td valign="middle" align="left">[<a href="maria_4.html#Algorithms" title="Next chapter"> &gt;&gt; </a>]</td>
<td valign="middle" align="left"> &nbsp; </td>
<td valign="middle" align="left"> &nbsp; </td>
<td valign="middle" align="left"> &nbsp; </td>
<td valign="middle" align="left"> &nbsp; </td>
<td valign="middle" align="left">[<a href="maria.html#Top" title="Cover (top) of document">Top</a>]</td>
<td valign="middle" align="left">[<a href="maria_toc.html#SEC_Contents" title="Table of contents">Contents</a>]</td>
<td valign="middle" align="left">[<a href="maria_10.html#Index" title="Index">Index</a>]</td>
<td valign="middle" align="left">[<a href="maria_abt.html#SEC_About" title="About (help)"> ? </a>]</td>
</tr></table>
<a name="Excluding-Places-from-Displayed-Markings"></a>
<h4 class="subsubsection">2.2.2.9 Excluding Places from Displayed Markings</h4>
<a name="index-hide_002c-query-language"></a>

<p>Petri net models often contain a large number of places whose contents
are of less significance when investigating a particular property of the
model.  The &lsquo;<samp>hide</samp>&rsquo; command controls which places are displayed by
the &lsquo;<samp>show</samp>&rsquo; command (see section <a href="#Show">Displaying Markings</a>) and in the graphical interface
(see section <a href="#Visual">Visualizing Graphs and Paths</a>).
</p>
<table><tr><td>&nbsp;</td><td><pre class="example">statement:
        HIDE [ '!' ] [ [ PLACE ] name ( ',' [ PLACE ] name )* ]
</pre></td></tr></table>

<p>When followed by an exclamation point, the command selects places to be
shown (instead of to be hidden).  An empty list of place names selects
all places.  Typically, one can issue the command &lsquo;<samp>hide</samp>&rsquo; followed
by &lsquo;<samp>hide ! <var>placename</var></samp>&rsquo; for each place to be shown.
</p>
<hr size="6">
<a name="Subnet"></a>
<table cellpadding="1" cellspacing="1" border="0">
<tr><td valign="middle" align="left">[<a href="#Hide" title="Previous section in reading order"> &lt; </a>]</td>
<td valign="middle" align="left">[<a href="#Succ" title="Next section in reading order"> &gt; </a>]</td>
<td valign="middle" align="left"> &nbsp; </td>
<td valign="middle" align="left">[<a href="#Analysis" title="Beginning of this chapter or previous chapter"> &lt;&lt; </a>]</td>
<td valign="middle" align="left">[<a href="#Query-Language" title="Up section"> Up </a>]</td>
<td valign="middle" align="left">[<a href="maria_4.html#Algorithms" title="Next chapter"> &gt;&gt; </a>]</td>
<td valign="middle" align="left"> &nbsp; </td>
<td valign="middle" align="left"> &nbsp; </td>
<td valign="middle" align="left"> &nbsp; </td>
<td valign="middle" align="left"> &nbsp; </td>
<td valign="middle" align="left">[<a href="maria.html#Top" title="Cover (top) of document">Top</a>]</td>
<td valign="middle" align="left">[<a href="maria_toc.html#SEC_Contents" title="Table of contents">Contents</a>]</td>
<td valign="middle" align="left">[<a href="maria_10.html#Index" title="Index">Index</a>]</td>
<td valign="middle" align="left">[<a href="maria_abt.html#SEC_About" title="About (help)"> ? </a>]</td>
</tr></table>
<a name="Selecting-the-Active-Subnet"></a>
<h4 class="subsubsection">2.2.2.10 Selecting the Active Subnet</h4>
<a name="index-subnet_002c-query-language"></a>
<a name="index-modules-2"></a>

<p>When the model contains subnets (see section <a href="#Subnet">Selecting the Active Subnet</a>) and Maria has been
told to generate a reachability graph and apply modular analysis
(see section <a href="#Invoking-Maria">Invoking Maria</a>), the &lsquo;<samp>subnet</samp>&rsquo; command can be used for
navigating in the state spaces of the modules.
</p>
<p>The &lsquo;<samp>subnet</samp>&rsquo; command can be used for navigating in the hierarchy
tree in a similar way as the &lsquo;<samp>cd</samp>&rsquo; command navigates in the
directory tree.  It takes a sequence of subnet identifiers separated
by slashes.  The string &lsquo;<samp>..</samp>&rsquo; denotes the parent net.
</p>
<p>When invoked without parameters, &lsquo;<samp>subnet</samp>&rsquo; selects the root net,
which represents the whole system.  If the parameter string starts
with a slash, the tree is selected relative to the root net.
Otherwise, it is selected relative to the currently selected net.
</p>
<p>Nets that have been given a name (see section <a href="#Subnet">Selecting the Active Subnet</a>) can be referred to
by that name.  All nets can be referred to by their index number in
the parent net.  The subnets are numbered starting from zero.
</p>
<table><tr><td>&nbsp;</td><td><pre class="example">statement:
        SUBNET [ [ netid ] ( '/'+ netid )* '/'* ]
</pre><pre class="example">netid:  '..' | name | number
</pre></td></tr></table>

<hr size="6">
<a name="Succ"></a>
<table cellpadding="1" cellspacing="1" border="0">
<tr><td valign="middle" align="left">[<a href="#Subnet" title="Previous section in reading order"> &lt; </a>]</td>
<td valign="middle" align="left">[<a href="#Pred" title="Next section in reading order"> &gt; </a>]</td>
<td valign="middle" align="left"> &nbsp; </td>
<td valign="middle" align="left">[<a href="#Analysis" title="Beginning of this chapter or previous chapter"> &lt;&lt; </a>]</td>
<td valign="middle" align="left">[<a href="#Query-Language" title="Up section"> Up </a>]</td>
<td valign="middle" align="left">[<a href="maria_4.html#Algorithms" title="Next chapter"> &gt;&gt; </a>]</td>
<td valign="middle" align="left"> &nbsp; </td>
<td valign="middle" align="left"> &nbsp; </td>
<td valign="middle" align="left"> &nbsp; </td>
<td valign="middle" align="left"> &nbsp; </td>
<td valign="middle" align="left">[<a href="maria.html#Top" title="Cover (top) of document">Top</a>]</td>
<td valign="middle" align="left">[<a href="maria_toc.html#SEC_Contents" title="Table of contents">Contents</a>]</td>
<td valign="middle" align="left">[<a href="maria_10.html#Index" title="Index">Index</a>]</td>
<td valign="middle" align="left">[<a href="maria_abt.html#SEC_About" title="About (help)"> ? </a>]</td>
</tr></table>
<a name="Listing-Successor-Nodes"></a>
<h4 class="subsubsection">2.2.2.11 Listing Successor Nodes</h4>
<a name="index-visual_002c-query-language-5"></a>
<a name="index-succ_002c-query-language"></a>
<a name="index-simulating"></a>

<p>The &lsquo;<samp>succ</samp>&rsquo; command lists all successors of a state, or possible
events in the state.  If no successors have been generated for the
state, they will be generated on demand.  This makes Maria suitable for
simulating or debugging a Petri Net model without generating the
complete reachability graph: to create the interesting part of the
reachability graph, one can keep listing the successors of the states he
is interested in.
</p>
<p>The command can also be used to view the successors of a strongly
connected component (see section <a href="#Strong">Strongly Connected Components</a>).
</p>
<table><tr><td>&nbsp;</td><td><pre class="example">statement:
        [ VISUAL ] SUCC [ '!' ] [ STATE ]
        |
        [ VISUAL ] SUCC COMP
</pre></td></tr></table>

<p>When the &lsquo;<samp>visual</samp>&rsquo; keyword is present, the successor states or
components are displayed graphically (see section <a href="#Visual">Visualizing Graphs and Paths</a>).
</p>
<p>When the &lsquo;<samp>succ</samp>&rsquo; keyword is followed by an exclamation point
(&lsquo;<samp>!</samp>&rsquo;), Maria will follow the chain of successor states until a
state with several successors is encountered.
</p>
<table><tr><td>&nbsp;</td><td><pre class="example"><b>@0$</b>succ
<b>transition left-&gt;@1</b>
<b>&lt;</b>
<b> p:1</b>
<b>&gt;</b>
</pre><pre class="example"><b>transition left-&gt;@2</b>
<b>&lt;</b>
<b> p:2</b>
<b>&gt;</b>
</pre><pre class="example"><b>transition left-&gt;@3</b>
<b>&lt;</b>
<b> p:3</b>
<b>&gt;</b>
</pre><pre class="example"><b>transition left-&gt;@4</b>
<b>&lt;</b>
<b> p:4</b>
<b>&gt;</b>
</pre><pre class="example"><b>transition left-&gt;@5</b>
<b>&lt;</b>
<b> p:5</b>
<b>&gt;</b>
</pre></td></tr></table>

<hr size="6">
<a name="Pred"></a>
<table cellpadding="1" cellspacing="1" border="0">
<tr><td valign="middle" align="left">[<a href="#Succ" title="Previous section in reading order"> &lt; </a>]</td>
<td valign="middle" align="left">[<a href="#Go" title="Next section in reading order"> &gt; </a>]</td>
<td valign="middle" align="left"> &nbsp; </td>
<td valign="middle" align="left">[<a href="#Analysis" title="Beginning of this chapter or previous chapter"> &lt;&lt; </a>]</td>
<td valign="middle" align="left">[<a href="#Query-Language" title="Up section"> Up </a>]</td>
<td valign="middle" align="left">[<a href="maria_4.html#Algorithms" title="Next chapter"> &gt;&gt; </a>]</td>
<td valign="middle" align="left"> &nbsp; </td>
<td valign="middle" align="left"> &nbsp; </td>
<td valign="middle" align="left"> &nbsp; </td>
<td valign="middle" align="left"> &nbsp; </td>
<td valign="middle" align="left">[<a href="maria.html#Top" title="Cover (top) of document">Top</a>]</td>
<td valign="middle" align="left">[<a href="maria_toc.html#SEC_Contents" title="Table of contents">Contents</a>]</td>
<td valign="middle" align="left">[<a href="maria_10.html#Index" title="Index">Index</a>]</td>
<td valign="middle" align="left">[<a href="maria_abt.html#SEC_About" title="About (help)"> ? </a>]</td>
</tr></table>
<a name="Listing-Predecessor-Nodes"></a>
<h4 class="subsubsection">2.2.2.12 Listing Predecessor Nodes</h4>
<a name="index-visual_002c-query-language-6"></a>
<a name="index-pred_002c-query-language"></a>

<p>The &lsquo;<samp>pred</samp>&rsquo; command lists all the generated predecessors of a state,
or all events leading to the state.
</p>
<p>The command can also be used to view the predecessors of a strongly
connected component (see section <a href="#Strong">Strongly Connected Components</a>).
</p>
<table><tr><td>&nbsp;</td><td><pre class="example">statement:
        [ VISUAL ] PRED [ '!' ] [ STATE ]
        |
        [ VISUAL ] PRED COMP
</pre></td></tr></table>

<p>When the &lsquo;<samp>visual</samp>&rsquo; keyword is present, the predecessor states or
components are displayed graphically (see section <a href="#Visual">Visualizing Graphs and Paths</a>).
</p>
<p>When the &lsquo;<samp>pred</samp>&rsquo; keyword is followed by an exclamation point
(&lsquo;<samp>!</samp>&rsquo;), Maria will follow the chain of predecessor states until a
state with several predecessors is encountered.
</p>
<table><tr><td>&nbsp;</td><td><pre class="example"><b>@0$</b>pred
<b>transition finish&lt;-@20</b>
<b>&lt;</b>
<b> p:5</b>
<b>&gt;</b>
</pre><pre class="example"><b>transition finish&lt;-@18</b>
<b>&lt;</b>
<b> p:4</b>
<b>&gt;</b>
</pre><pre class="example"><b>transition finish&lt;-@15</b>
<b>&lt;</b>
<b> p:3</b>
<b>&gt;</b>
</pre><pre class="example"><b>transition finish&lt;-@11</b>
<b>&lt;</b>
<b> p:2</b>
<b>&gt;</b>
</pre><pre class="example"><b>transition finish&lt;-@6</b>
<b>&lt;</b>
<b> p:1</b>
<b>&gt;</b>
</pre></td></tr></table>

<hr size="6">
<a name="Go"></a>
<table cellpadding="1" cellspacing="1" border="0">
<tr><td valign="middle" align="left">[<a href="#Pred" title="Previous section in reading order"> &lt; </a>]</td>
<td valign="middle" align="left">[<a href="#Trans" title="Next section in reading order"> &gt; </a>]</td>
<td valign="middle" align="left"> &nbsp; </td>
<td valign="middle" align="left">[<a href="#Analysis" title="Beginning of this chapter or previous chapter"> &lt;&lt; </a>]</td>
<td valign="middle" align="left">[<a href="#Query-Language" title="Up section"> Up </a>]</td>
<td valign="middle" align="left">[<a href="maria_4.html#Algorithms" title="Next chapter"> &gt;&gt; </a>]</td>
<td valign="middle" align="left"> &nbsp; </td>
<td valign="middle" align="left"> &nbsp; </td>
<td valign="middle" align="left"> &nbsp; </td>
<td valign="middle" align="left"> &nbsp; </td>
<td valign="middle" align="left">[<a href="maria.html#Top" title="Cover (top) of document">Top</a>]</td>
<td valign="middle" align="left">[<a href="maria_toc.html#SEC_Contents" title="Table of contents">Contents</a>]</td>
<td valign="middle" align="left">[<a href="maria_10.html#Index" title="Index">Index</a>]</td>
<td valign="middle" align="left">[<a href="maria_abt.html#SEC_About" title="About (help)"> ? </a>]</td>
</tr></table>
<a name="Moving-in-the-Graph"></a>
<h4 class="subsubsection">2.2.2.13 Moving in the Graph</h4>
<a name="index-go_002c-query-language"></a>

<p>Moving from a state to another is as simple as entering the state
number.  To make scripts more readable, you may also use the &lsquo;<samp>go</samp>&rsquo;
keyword.
</p>
<table><tr><td>&nbsp;</td><td><pre class="example">statement:
        [ GO ] STATE
</pre></td></tr></table>

<table><tr><td>&nbsp;</td><td><pre class="example"><b>@0$</b>@4
<b>@4$</b>go @0
<b>@0$</b>
</pre></td></tr></table>

<hr size="6">
<a name="Trans"></a>
<table cellpadding="1" cellspacing="1" border="0">
<tr><td valign="middle" align="left">[<a href="#Go" title="Previous section in reading order"> &lt; </a>]</td>
<td valign="middle" align="left">[<a href="#Function" title="Next section in reading order"> &gt; </a>]</td>
<td valign="middle" align="left"> &nbsp; </td>
<td valign="middle" align="left">[<a href="#Analysis" title="Beginning of this chapter or previous chapter"> &lt;&lt; </a>]</td>
<td valign="middle" align="left">[<a href="#Query-Language" title="Up section"> Up </a>]</td>
<td valign="middle" align="left">[<a href="maria_4.html#Algorithms" title="Next chapter"> &gt;&gt; </a>]</td>
<td valign="middle" align="left"> &nbsp; </td>
<td valign="middle" align="left"> &nbsp; </td>
<td valign="middle" align="left"> &nbsp; </td>
<td valign="middle" align="left"> &nbsp; </td>
<td valign="middle" align="left">[<a href="maria.html#Top" title="Cover (top) of document">Top</a>]</td>
<td valign="middle" align="left">[<a href="maria_toc.html#SEC_Contents" title="Table of contents">Contents</a>]</td>
<td valign="middle" align="left">[<a href="maria_10.html#Index" title="Index">Index</a>]</td>
<td valign="middle" align="left">[<a href="maria_abt.html#SEC_About" title="About (help)"> ? </a>]</td>
</tr></table>
<a name="Anonymous-Transitions"></a>
<h4 class="subsubsection">2.2.2.14 Anonymous Transitions</h4>
<a name="index-trans_002c-query-language"></a>

<p>Sometimes, when modelling a complex system, it may be useful to
specify a different initial state as a starting point for the
analysis.  For instance, one might want to slightly modify the marking
of an erroneous state to see how the analysis would proceed from
there.
</p>
<p>In Maria, new states can be computed by entering an anonymous
transition that will be evaluated in a specified state, or in the
current state if no state is specified.  No arcs will be added to the
reachability graph.  The generated states will be displayed either
textually or graphically.
</p>
<table><tr><td>&nbsp;</td><td><pre class="example">statement:
        [ VISUAL ] [ STATE ] TRANS atrans*
</pre><pre class="example">atrans:
        '{' [ avar_expr ( delim avar_expr )* [ delim ] ] '}'
        |
        IN trans_places
        |
        OUT trans_places
        |
        GATE expr ( ',' expr )*
</pre><pre class="example">avar_expr:
        typereference name
        |
        typereference name '!' [ '(' expr ')' ]
</pre></td></tr></table>

<table><tr><td>&nbsp;</td><td><pre class="example"><b>@0$</b>trans in { place fork: 1 } out { place fork: 2 }
<b>@82:unprocessed state (</b>
<b> fork:</b>
<b>  2#2,3,4,5</b>
<b> state:</b>
<b>  {1,thinking},{2,thinking},{3,thinking},{4,thinking},{5,thinking}</b>
<b>)</b>
<b>@0$</b>
</pre></td></tr></table>

<hr size="6">
<a name="Function"></a>
<table cellpadding="1" cellspacing="1" border="0">
<tr><td valign="middle" align="left">[<a href="#Trans" title="Previous section in reading order"> &lt; </a>]</td>
<td valign="middle" align="left">[<a href="#Strong" title="Next section in reading order"> &gt; </a>]</td>
<td valign="middle" align="left"> &nbsp; </td>
<td valign="middle" align="left">[<a href="#Analysis" title="Beginning of this chapter or previous chapter"> &lt;&lt; </a>]</td>
<td valign="middle" align="left">[<a href="#Query-Language" title="Up section"> Up </a>]</td>
<td valign="middle" align="left">[<a href="maria_4.html#Algorithms" title="Next chapter"> &gt;&gt; </a>]</td>
<td valign="middle" align="left"> &nbsp; </td>
<td valign="middle" align="left"> &nbsp; </td>
<td valign="middle" align="left"> &nbsp; </td>
<td valign="middle" align="left"> &nbsp; </td>
<td valign="middle" align="left">[<a href="maria.html#Top" title="Cover (top) of document">Top</a>]</td>
<td valign="middle" align="left">[<a href="maria_toc.html#SEC_Contents" title="Table of contents">Contents</a>]</td>
<td valign="middle" align="left">[<a href="maria_10.html#Index" title="Index">Index</a>]</td>
<td valign="middle" align="left">[<a href="maria_abt.html#SEC_About" title="About (help)"> ? </a>]</td>
</tr></table>
<a name="Defining-Functions"></a>
<h4 class="subsubsection">2.2.2.15 Defining Functions</h4>
<a name="index-functions_002c-defining-1"></a>
<a name="index-function_002c-query-language"></a>

<p>All the functions defined in the Petri Net are available in the query
tool.  It is also possible to define additional functions by using the
&lsquo;<samp>function</samp>&rsquo; keyword.
</p>
<table><tr><td>&nbsp;</td><td><pre class="example">statement:
        FUNCTION function
</pre></td></tr></table>

<table><tr><td>&nbsp;</td><td><pre class="example"><b>@0$</b>function bool assert (bool f) f || fatal
<b>@0$</b>assert (false);
<b>&lt;fatalExpression:</b>
<b>  fatal</b>
<b>&gt;</b>
</pre></td></tr></table>

<p>If there are many function definitions, it is advisable to write them in
a Maria command file, e.g. &lsquo;<tt>dining</tt>&rsquo;:
</p>
<table><tr><td>&nbsp;</td><td><pre class="example">#!<var>/usr/local/bin/maria</var>
graph dining;
function bool assert (bool f) f || fatal;
</pre></td></tr></table>

<p>The definitions can be loaded in at least three different ways:
</p>
<table><tr><td>&nbsp;</td><td><pre class="example"><b>$</b>maria dining
<b>@0$</b>exit
</pre><pre class="example"><b>$</b>./dining #<span class="roman">the script must be executable</span>
<b>@0$</b>exit
</pre><pre class="example"><b>$</b>maria
<b>$</b>#include &quot;dining&quot;
</pre></td></tr></table>

<hr size="6">
<a name="Strong"></a>
<table cellpadding="1" cellspacing="1" border="0">
<tr><td valign="middle" align="left">[<a href="#Function" title="Previous section in reading order"> &lt; </a>]</td>
<td valign="middle" align="left">[<a href="#Path" title="Next section in reading order"> &gt; </a>]</td>
<td valign="middle" align="left"> &nbsp; </td>
<td valign="middle" align="left">[<a href="#Analysis" title="Beginning of this chapter or previous chapter"> &lt;&lt; </a>]</td>
<td valign="middle" align="left">[<a href="#Query-Language" title="Up section"> Up </a>]</td>
<td valign="middle" align="left">[<a href="maria_4.html#Algorithms" title="Next chapter"> &gt;&gt; </a>]</td>
<td valign="middle" align="left"> &nbsp; </td>
<td valign="middle" align="left"> &nbsp; </td>
<td valign="middle" align="left"> &nbsp; </td>
<td valign="middle" align="left"> &nbsp; </td>
<td valign="middle" align="left">[<a href="maria.html#Top" title="Cover (top) of document">Top</a>]</td>
<td valign="middle" align="left">[<a href="maria_toc.html#SEC_Contents" title="Table of contents">Contents</a>]</td>
<td valign="middle" align="left">[<a href="maria_10.html#Index" title="Index">Index</a>]</td>
<td valign="middle" align="left">[<a href="maria_abt.html#SEC_About" title="About (help)"> ? </a>]</td>
</tr></table>
<a name="Strongly-Connected-Components"></a>
<h4 class="subsubsection">2.2.2.16 Strongly Connected Components</h4>
<a name="index-visual_002c-query-language-7"></a>
<a name="index-strong_002c-query-language"></a>
<a name="index-terminal_002c-query-language"></a>
<a name="index-components_002c-query-language"></a>
<a name="index-strongly-connected-components"></a>
<a name="index-trivial-component"></a>
<a name="index-terminal-component"></a>

<p>A <em>strongly connected component</em> of a directed graph (e.g. a
reachability graph) is a set of nodes that are reachable from each other
by following the arcs.  If the reachability graph of a model has only
one strongly connected component, it is guaranteed to be free of
deadlocks, since the initial state is reachable from all states.
</p>
<p>A strongly connected component, or a node of a <em>component graph</em>,
may be <em>trivial</em>, meaning that it contains only one node of the
underlying graph.  A <em>terminal component</em> does not have any
successors.
</p>
<p>Maria computes the strongly connected components by starting from a
specified state (by default, the current state) and considering a
transitive closure of its generated successors in the reachability
graph.  It is possible to limit the transitive closure by specifying a
condition.  States for which the condition does not evaluate to
&lsquo;<samp>true</samp>&rsquo; are ignored by the search algorithm.
</p>
<p>Once the component graph has been generated, it is possible to list all
its non-trivial terminal components, or all components.  Also the
&lsquo;<samp>show</samp>&rsquo;, &lsquo;<samp>succ</samp>&rsquo; and &lsquo;<samp>prev</samp>&rsquo; commands can be used to examine
the component graph.  The &lsquo;<samp>visual</samp>&rsquo; keyword selects graphical
display (see section <a href="#Visual">Visualizing Graphs and Paths</a>).
</p>
<table><tr><td>&nbsp;</td><td><pre class="example">statement:
        STRONG [ STATE ] [ expr ]
        |
        TERMINAL
        |
        [ VISUAL ] COMPONENTS
        |
</pre><pre class="example">        [ VISUAL ] [ SHOW ] COMP [ expr ]
        |
        [ VISUAL ] ( SUCC | PRED ) COMP
</pre></td></tr></table>

<table><tr><td>&nbsp;</td><td><pre class="example"><b>@0$</b>strong
<b>dining: 82 states (3..6 bytes), 265 arcs, 2 components, 1
 terminal component</b>
<b>@0$</b>@@0
<b>terminal trivial strongly connected component @@0: @71</b>
<b>@0$</b>pred @@0
<b>@@1</b>
</pre></td></tr></table>

<p>Maria deploys Tarjan&rsquo;s algorithm for computing strongly connected
components.  The algorithm was implemented in Prod by Vesa Hirvisalo and
initially ported to Maria by Emil Falck.  His port was rewritten by
Marko M&auml;kel&auml; to optimize memory usage.  The implementation requires
two bits for each node in the reachability graph, and one search stack
whose length is limited by the length of the longest cycle or acyclic
path in the generated reachability graph.  Everything else is managed in
disk files.
</p>
<hr size="6">
<a name="Path"></a>
<table cellpadding="1" cellspacing="1" border="0">
<tr><td valign="middle" align="left">[<a href="#Strong" title="Previous section in reading order"> &lt; </a>]</td>
<td valign="middle" align="left">[<a href="#Misc" title="Next section in reading order"> &gt; </a>]</td>
<td valign="middle" align="left"> &nbsp; </td>
<td valign="middle" align="left">[<a href="#Analysis" title="Beginning of this chapter or previous chapter"> &lt;&lt; </a>]</td>
<td valign="middle" align="left">[<a href="#Query-Language" title="Up section"> Up </a>]</td>
<td valign="middle" align="left">[<a href="maria_4.html#Algorithms" title="Next chapter"> &gt;&gt; </a>]</td>
<td valign="middle" align="left"> &nbsp; </td>
<td valign="middle" align="left"> &nbsp; </td>
<td valign="middle" align="left"> &nbsp; </td>
<td valign="middle" align="left"> &nbsp; </td>
<td valign="middle" align="left">[<a href="maria.html#Top" title="Cover (top) of document">Top</a>]</td>
<td valign="middle" align="left">[<a href="maria_toc.html#SEC_Contents" title="Table of contents">Contents</a>]</td>
<td valign="middle" align="left">[<a href="maria_10.html#Index" title="Index">Index</a>]</td>
<td valign="middle" align="left">[<a href="maria_abt.html#SEC_About" title="About (help)"> ? </a>]</td>
</tr></table>
<a name="Shortest-Paths"></a>
<h4 class="subsubsection">2.2.2.17 Shortest Paths</h4>
<a name="index-visual_002c-query-language-8"></a>
<a name="index-path_002c-query-language"></a>

<p>The &lsquo;<samp>path</samp>&rsquo; command lets one to find out the shortest path between a
specific state and a set of states.
</p>
<table><tr><td>&nbsp;</td><td><pre class="example">statement:
        [ VISUAL ] PATH ( STATE | COMP | expr ) [ STATE ] [ ',' expr ]
        |
        [ VISUAL ] PATH STATE ( COMP | expr ) [ ',' expr ]
</pre></td></tr></table>

<p>The command takes up to three arguments: the target state, the source
state, and an optional condition that all states on the path must
fulfill.  If the source state is omitted, the command finds out the
shortest path to the given target state.  Either the source or the
target state must be specified; the other end of the path may be
identified with a state formula or with a strongly connected component
number.
</p>
<p>When the &lsquo;<samp>visual</samp>&rsquo; keyword is present, the path is displayed
graphically (see section <a href="#Visual">Visualizing Graphs and Paths</a>).
</p>
<table><tr><td>&nbsp;</td><td><pre class="example"><b>@0$</b>path @6
<b>shortest path from @0 to @6 (3 nodes):</b>
</pre><pre class="example"><b>@0:state (</b>
<b> fork:</b>
<b>  1,2,3,4,5</b>
<b> state:</b>
<b>  {1,thinking},{2,thinking},{3,thinking},{4,thinking},{5,thinking}</b>
<b>)</b>
<b>5 predecessors</b>
<b>5 successors</b>
</pre><pre class="example"><b>transition left-&gt;@2</b>
<b>&lt;</b>
<b> p:2</b>
<b>&gt;</b>
</pre><pre class="example"><b>@2:state (</b>
<b> fork:</b>
<b>  1,3,4,5</b>
<b> state:</b>
<b>  {1,thinking},{3,thinking},{4,thinking},{5,thinking},{2,hungry}</b>
<b>)</b>
<b>4 predecessors</b>
<b>5 successors</b>
</pre><pre class="example"><b>transition left-&gt;@6</b>
<b>&lt;</b>
<b> p:1</b>
<b>&gt;</b>
</pre><pre class="example"><b>@6:state (</b>
<b> fork:</b>
<b>  3,4,5</b>
<b> state:</b>
<b>  {3,thinking},{4,thinking},{5,thinking},{1,hungry},{2,hungry}</b>
<b>)</b>
<b>4 predecessors</b>
<b>4 successors</b>
</pre></td></tr></table>

<p>A third variant of the &lsquo;<samp>path</samp>&rsquo; command finds the shortest path from
the current state to a loop.  In order to avoid an ambiguity in the
grammar, the loop must consist of at least three states.
</p>
<table><tr><td>&nbsp;</td><td><pre class="example">statement:
        [ VISUAL ] PATH STATE STATE STATE ( STATE )* [ ',' expr ]
</pre></td></tr></table>

<p>Maria does not check whether the given states really form a loop; it
just finds the shortest path to any of the specified states so that the
optional condition holds in all states along the path.  When the path
enters a state that is not the first (and last) state specified, the
loop is shifted.  The result is an acyclic path leading to a cycle,
resembling the shape of the number 6.
</p>
<hr size="6">
<a name="Misc"></a>
<table cellpadding="1" cellspacing="1" border="0">
<tr><td valign="middle" align="left">[<a href="#Path" title="Previous section in reading order"> &lt; </a>]</td>
<td valign="middle" align="left">[<a href="#Exit" title="Next section in reading order"> &gt; </a>]</td>
<td valign="middle" align="left"> &nbsp; </td>
<td valign="middle" align="left">[<a href="#Analysis" title="Beginning of this chapter or previous chapter"> &lt;&lt; </a>]</td>
<td valign="middle" align="left">[<a href="#Query-Language" title="Up section"> Up </a>]</td>
<td valign="middle" align="left">[<a href="maria_4.html#Algorithms" title="Next chapter"> &gt;&gt; </a>]</td>
<td valign="middle" align="left"> &nbsp; </td>
<td valign="middle" align="left"> &nbsp; </td>
<td valign="middle" align="left"> &nbsp; </td>
<td valign="middle" align="left"> &nbsp; </td>
<td valign="middle" align="left">[<a href="maria.html#Top" title="Cover (top) of document">Top</a>]</td>
<td valign="middle" align="left">[<a href="maria_toc.html#SEC_Contents" title="Table of contents">Contents</a>]</td>
<td valign="middle" align="left">[<a href="maria_10.html#Index" title="Index">Index</a>]</td>
<td valign="middle" align="left">[<a href="maria_abt.html#SEC_About" title="About (help)"> ? </a>]</td>
</tr></table>
<a name="Miscellanous-Commands"></a>
<h4 class="subsubsection">2.2.2.18 Miscellanous Commands</h4>
<a name="index-help_002c-query-language"></a>
<a name="index-stats_002c-query-language"></a>
<a name="index-time_002c-query-language"></a>
<a name="index-cd_002c-query-language"></a>
<a name="index-translator_002c-query-language"></a>
<a name="index-compiledir_002c-query-language"></a>
<a name="index-log_002c-query-language"></a>
<a name="index-prompt_002c-query-language"></a>

<p>The &lsquo;<samp>help</samp>&rsquo; command displays a short list of all commands.  The
&lsquo;<samp>stats</samp>&rsquo; command displays some statistical information of the graph
being analyzed.  The &lsquo;<samp>time</samp>&rsquo; command displays timing statistics
since the last invocation of the &lsquo;<samp>time</samp>&rsquo; command, or since the time
when the analyzer was started.
</p>
<p>The &lsquo;<samp>cd</samp>&rsquo; command can be used to switch the current
directory.  Without a parameter, it tries to switch to the directory the
environment variable <code>HOME</code> expands to.  The &lsquo;<samp>translator</samp>&rsquo;
command is used to specify the program for translating temporal logic
formulae into property automata.  When the command is invoked without
arguments, the verification of temporal formulae is disabled.
</p>
<p>In order for the &lsquo;<samp>compiledir</samp>&rsquo; command to work, Maria must have been
compiled with support for compiled expressions enabled
(see section <a href="maria_7.html#Compiling">Compiling Maria</a>).  This command specifies the directory that will be
used for generating executable code from the model.  Invoking the
command without arguments disables the code generator.
</p>
<p>The &lsquo;<samp>log</samp>&rsquo; command allows the textual output of query language
commands to be redirected to a file, or to the standard error stream
when no file name is specified to the command.
</p>
<p>The &lsquo;<samp>prompt</samp>&rsquo; command may be useful when Maria is executed as a
subprocess.  When the command is invoked with a non-null character
constant argument, this character will be echoed on its own line
before the command prompt is shown.  The plain &lsquo;<samp>prompt</samp>&rsquo; command
disables this feature again.
</p>
<table><tr><td>&nbsp;</td><td><pre class="example">        HELP
        |
</pre><pre class="example">        STATS
        |
</pre><pre class="example">        TIME
        |
</pre><pre class="example">        CD [ name ]
        |
</pre><pre class="example">        TRANSLATOR [ name ]
        |
</pre><pre class="example">        COMPILEDIR [ name ]
        |
</pre><pre class="example">        LOG [ name ]
	|
</pre><pre class="example">        PROMPT [ 'c' ]
</pre></td></tr></table>

<table><tr><td>&nbsp;</td><td><pre class="example"><b>@0$</b>stats
<b>dining: 82 states (3..4 bytes), 265 arcs</b>
</pre></td></tr></table>

<hr size="6">
<a name="Exit"></a>
<table cellpadding="1" cellspacing="1" border="0">
<tr><td valign="middle" align="left">[<a href="#Misc" title="Previous section in reading order"> &lt; </a>]</td>
<td valign="middle" align="left">[<a href="#Quirks" title="Next section in reading order"> &gt; </a>]</td>
<td valign="middle" align="left"> &nbsp; </td>
<td valign="middle" align="left">[<a href="#Analysis" title="Beginning of this chapter or previous chapter"> &lt;&lt; </a>]</td>
<td valign="middle" align="left">[<a href="#Query-Language" title="Up section"> Up </a>]</td>
<td valign="middle" align="left">[<a href="maria_4.html#Algorithms" title="Next chapter"> &gt;&gt; </a>]</td>
<td valign="middle" align="left"> &nbsp; </td>
<td valign="middle" align="left"> &nbsp; </td>
<td valign="middle" align="left"> &nbsp; </td>
<td valign="middle" align="left"> &nbsp; </td>
<td valign="middle" align="left">[<a href="maria.html#Top" title="Cover (top) of document">Top</a>]</td>
<td valign="middle" align="left">[<a href="maria_toc.html#SEC_Contents" title="Table of contents">Contents</a>]</td>
<td valign="middle" align="left">[<a href="maria_10.html#Index" title="Index">Index</a>]</td>
<td valign="middle" align="left">[<a href="maria_abt.html#SEC_About" title="About (help)"> ? </a>]</td>
</tr></table>
<a name="Exiting"></a>
<h4 class="subsubsection">2.2.2.19 Exiting</h4>
<a name="index-exit_002c-query-language"></a>

<p>The query tool can be exited either by issuing the command &lsquo;<samp>exit</samp>&rsquo;
or by typing the end-of-file character <kbd>EOF</kbd> at the command prompt.
</p>
<hr size="6">
<a name="Quirks"></a>
<table cellpadding="1" cellspacing="1" border="0">
<tr><td valign="middle" align="left">[<a href="#Exit" title="Previous section in reading order"> &lt; </a>]</td>
<td valign="middle" align="left">[<a href="#Separating-Statements" title="Next section in reading order"> &gt; </a>]</td>
<td valign="middle" align="left"> &nbsp; </td>
<td valign="middle" align="left">[<a href="#Analysis" title="Beginning of this chapter or previous chapter"> &lt;&lt; </a>]</td>
<td valign="middle" align="left">[<a href="#Maria-Shell" title="Up section"> Up </a>]</td>
<td valign="middle" align="left">[<a href="maria_4.html#Algorithms" title="Next chapter"> &gt;&gt; </a>]</td>
<td valign="middle" align="left"> &nbsp; </td>
<td valign="middle" align="left"> &nbsp; </td>
<td valign="middle" align="left"> &nbsp; </td>
<td valign="middle" align="left"> &nbsp; </td>
<td valign="middle" align="left">[<a href="maria.html#Top" title="Cover (top) of document">Top</a>]</td>
<td valign="middle" align="left">[<a href="maria_toc.html#SEC_Contents" title="Table of contents">Contents</a>]</td>
<td valign="middle" align="left">[<a href="maria_10.html#Index" title="Index">Index</a>]</td>
<td valign="middle" align="left">[<a href="maria_abt.html#SEC_About" title="About (help)"> ? </a>]</td>
</tr></table>
<a name="Some-Quirks-with-the-Query-Language"></a>
<h3 class="subsection">2.2.3 Some Quirks with the Query Language</h3>

<p>Due to the way the query language and the preprocessor
(see section <a href="maria_2.html#Preprocessor">Preprocessor Directives</a>) have been implemented, there are some things that
are not obvious for the novice user.
</p>
<table class="menu" border="0" cellspacing="0">
<tr><td align="left" valign="top"><a href="#Separating-Statements">2.2.3.1 Separating Statements</a></td><td>&nbsp;&nbsp;</td><td align="left" valign="top">       Why is a semicolon mandatory here?
</td></tr>
<tr><td align="left" valign="top"><a href="#Conditional-Processing">2.2.3.2 Conditional Processing in the Editor</a></td><td>&nbsp;&nbsp;</td><td align="left" valign="top">      Using #ifdef on the command line
</td></tr>
</table>

<hr size="6">
<a name="Separating-Statements"></a>
<table cellpadding="1" cellspacing="1" border="0">
<tr><td valign="middle" align="left">[<a href="#Quirks" title="Previous section in reading order"> &lt; </a>]</td>
<td valign="middle" align="left">[<a href="#Conditional-Processing" title="Next section in reading order"> &gt; </a>]</td>
<td valign="middle" align="left"> &nbsp; </td>
<td valign="middle" align="left">[<a href="#Analysis" title="Beginning of this chapter or previous chapter"> &lt;&lt; </a>]</td>
<td valign="middle" align="left">[<a href="#Quirks" title="Up section"> Up </a>]</td>
<td valign="middle" align="left">[<a href="maria_4.html#Algorithms" title="Next chapter"> &gt;&gt; </a>]</td>
<td valign="middle" align="left"> &nbsp; </td>
<td valign="middle" align="left"> &nbsp; </td>
<td valign="middle" align="left"> &nbsp; </td>
<td valign="middle" align="left"> &nbsp; </td>
<td valign="middle" align="left">[<a href="maria.html#Top" title="Cover (top) of document">Top</a>]</td>
<td valign="middle" align="left">[<a href="maria_toc.html#SEC_Contents" title="Table of contents">Contents</a>]</td>
<td valign="middle" align="left">[<a href="maria_10.html#Index" title="Index">Index</a>]</td>
<td valign="middle" align="left">[<a href="maria_abt.html#SEC_About" title="About (help)"> ? </a>]</td>
</tr></table>
<a name="Separating-Statements-1"></a>
<h4 class="subsubsection">2.2.3.1 Separating Statements</h4>

<p>Maria uses a script language in which statements are separated by
semicolons (&lsquo;<samp>;</samp>&rsquo;).  The separator is optional at the end of input.
In the interactive mode, every logical line is parsed separately and
semicolons are only required when issuing multiple commands on one
command line.  In script files, semicolons are mandatory between the
statements.  Consider the following example:
</p>
<table><tr><td>&nbsp;</td><td><pre class="example">#!<var>/usr/local/bin/maria</var>
graph dining;
function bool eval () false;
eval;
eval
</pre></td></tr></table>

<p>This example will evaluate the function twice.  If the semicolon was
omitted, the function would be evaluated only once, since &lsquo;<samp>eval</samp>&rsquo;
would be treated as a keyword in that case.
</p>
<hr size="6">
<a name="Conditional-Processing"></a>
<table cellpadding="1" cellspacing="1" border="0">
<tr><td valign="middle" align="left">[<a href="#Separating-Statements" title="Previous section in reading order"> &lt; </a>]</td>
<td valign="middle" align="left">[<a href="#Visual" title="Next section in reading order"> &gt; </a>]</td>
<td valign="middle" align="left"> &nbsp; </td>
<td valign="middle" align="left">[<a href="#Analysis" title="Beginning of this chapter or previous chapter"> &lt;&lt; </a>]</td>
<td valign="middle" align="left">[<a href="#Quirks" title="Up section"> Up </a>]</td>
<td valign="middle" align="left">[<a href="maria_4.html#Algorithms" title="Next chapter"> &gt;&gt; </a>]</td>
<td valign="middle" align="left"> &nbsp; </td>
<td valign="middle" align="left"> &nbsp; </td>
<td valign="middle" align="left"> &nbsp; </td>
<td valign="middle" align="left"> &nbsp; </td>
<td valign="middle" align="left">[<a href="maria.html#Top" title="Cover (top) of document">Top</a>]</td>
<td valign="middle" align="left">[<a href="maria_toc.html#SEC_Contents" title="Table of contents">Contents</a>]</td>
<td valign="middle" align="left">[<a href="maria_10.html#Index" title="Index">Index</a>]</td>
<td valign="middle" align="left">[<a href="maria_abt.html#SEC_About" title="About (help)"> ? </a>]</td>
</tr></table>
<a name="Conditional-Processing-in-the-Editor"></a>
<h4 class="subsubsection">2.2.3.2 Conditional Processing in the Editor</h4>
<a name="index-conditional-processing_002c-interactively"></a>

<p>The line editor of Maria performs simple lexical analysis to find out
whether the line entered is complete.  For instance, if the line
contains an unbalanced amount of quotes, a continuation prompt will be
presented and further lines will be read until all quotes and multi-line
comments are balanced or the entry is aborted by typing <kbd>EOF</kbd> at the
beginning of a continuation line.
</p>
<p>However, preprocessor directives for conditional processing are not
detected by the command line interpreter.  In case you want to enter
conditional statements (which must span several physical lines)
interactively, you must enter the physical lines as one logical line by
quoting all newline characters but the last one.  This can be achieved
on many systems by typing <kbd>C-v C-j</kbd>.
</p>
<hr size="6">
<a name="Visual"></a>
<table cellpadding="1" cellspacing="1" border="0">
<tr><td valign="middle" align="left">[<a href="#Conditional-Processing" title="Previous section in reading order"> &lt; </a>]</td>
<td valign="middle" align="left">[<a href="#GraphViz" title="Next section in reading order"> &gt; </a>]</td>
<td valign="middle" align="left"> &nbsp; </td>
<td valign="middle" align="left">[<a href="#Analysis" title="Beginning of this chapter or previous chapter"> &lt;&lt; </a>]</td>
<td valign="middle" align="left">[<a href="#Maria-Shell" title="Up section"> Up </a>]</td>
<td valign="middle" align="left">[<a href="maria_4.html#Algorithms" title="Next chapter"> &gt;&gt; </a>]</td>
<td valign="middle" align="left"> &nbsp; </td>
<td valign="middle" align="left"> &nbsp; </td>
<td valign="middle" align="left"> &nbsp; </td>
<td valign="middle" align="left"> &nbsp; </td>
<td valign="middle" align="left">[<a href="maria.html#Top" title="Cover (top) of document">Top</a>]</td>
<td valign="middle" align="left">[<a href="maria_toc.html#SEC_Contents" title="Table of contents">Contents</a>]</td>
<td valign="middle" align="left">[<a href="maria_10.html#Index" title="Index">Index</a>]</td>
<td valign="middle" align="left">[<a href="maria_abt.html#SEC_About" title="About (help)"> ? </a>]</td>
</tr></table>
<a name="Visualizing-Graphs-and-Paths"></a>
<h3 class="subsection">2.2.4 Visualizing Graphs and Paths</h3>
<a name="index-visual_002c-query-language-9"></a>

<p>Many commands in the query language can be preceded by the &lsquo;<samp>visual</samp>&rsquo;
keyword.  When this keyword is present, the results of the command will
be displayed in a separate visualization process.  The visual variant
often displays more information, such as edge attributes (transition
names and valuations) in displayed paths.
</p>
<table class="menu" border="0" cellspacing="0">
<tr><td align="left" valign="top"><a href="#GraphViz">2.2.4.1 GraphViz, the Graph Visualizer</a></td><td>&nbsp;&nbsp;</td><td align="left" valign="top">            The interface to the graph visualizer
</td></tr>
<tr><td align="left" valign="top"><a href="#Visual-Caveats">2.2.4.2 Known Bugs in the Visualizer</a></td><td>&nbsp;&nbsp;</td><td align="left" valign="top">      Exceptional situations in visualization
</td></tr>
</table>

<hr size="6">
<a name="GraphViz"></a>
<table cellpadding="1" cellspacing="1" border="0">
<tr><td valign="middle" align="left">[<a href="#Visual" title="Previous section in reading order"> &lt; </a>]</td>
<td valign="middle" align="left">[<a href="#Visual-Caveats" title="Next section in reading order"> &gt; </a>]</td>
<td valign="middle" align="left"> &nbsp; </td>
<td valign="middle" align="left">[<a href="#Analysis" title="Beginning of this chapter or previous chapter"> &lt;&lt; </a>]</td>
<td valign="middle" align="left">[<a href="#Visual" title="Up section"> Up </a>]</td>
<td valign="middle" align="left">[<a href="maria_4.html#Algorithms" title="Next chapter"> &gt;&gt; </a>]</td>
<td valign="middle" align="left"> &nbsp; </td>
<td valign="middle" align="left"> &nbsp; </td>
<td valign="middle" align="left"> &nbsp; </td>
<td valign="middle" align="left"> &nbsp; </td>
<td valign="middle" align="left">[<a href="maria.html#Top" title="Cover (top) of document">Top</a>]</td>
<td valign="middle" align="left">[<a href="maria_toc.html#SEC_Contents" title="Table of contents">Contents</a>]</td>
<td valign="middle" align="left">[<a href="maria_10.html#Index" title="Index">Index</a>]</td>
<td valign="middle" align="left">[<a href="maria_abt.html#SEC_About" title="About (help)"> ? </a>]</td>
</tr></table>
<a name="GraphViz_002c-the-Graph-Visualizer"></a>
<h4 class="subsubsection">2.2.4.1 GraphViz, the Graph Visualizer</h4>
<a name="index-GraphViz"></a>
<a name="index-printing"></a>

<p>In order for this option to work, a software package for drawing graphs
called Graphviz (<a href="http://www.graphviz.org">http://www.graphviz.org</a>) must be installed.  The
&lsquo;<tt>lefty</tt>&rsquo; command, belonging to the package, must be in the search
path, and the script &lsquo;<tt>dotty.lefty</tt>&rsquo; must be located either in the
default &lsquo;<tt>lefty</tt>&rsquo; search path or in a directory specified in
<code>LEFTYPATH</code>.  Also, the visualization script
&lsquo;<tt><var>progname</var>-vis</tt>&rsquo; must be found in the search path, where
&lsquo;<tt><var>progname</var></tt>&rsquo; is the name used to invoke the analyzer.
</p>
<p>On the Microsoft Windows platform, Maria does not invoke GraphViz as a
subprocess.  Instead, it writes the visualization data to the file
&lsquo;<tt>maria-vis.out</tt>&rsquo; in the current directory.  This file must be
slightly edited before feeding it to the &lsquo;<tt>dotty</tt>&rsquo; or &lsquo;<tt>dot</tt>&rsquo;
programs of GraphViz.
</p>
<p>The visualization program reacts to some keyboard and mouse commands.
Pressing the left or middle mouse button while the mouse pointer is
located on a graph node requests for the successors or predecessors of
the node to be generated.  Holding down the right mouse button brings up
a menu whose contents depends on whether the mouse pointer is located
above a node, an edge or somewhere else in the graph.  There exist
keyboard short-cuts for most menu entries.
</p>
<p>The visualization program communicates fully asynchronously with Maria
via its standard input and output.  It reads commands and graph
descriptions from standard input and writes Maria commands to standard
output.  Maria is ready to read and execute these commands whenever it
is sitting in the command prompt waiting for input.
</p>
<p>Maria uses two commands of the visualization program.  It issues the
&lsquo;<samp>new();</samp>&rsquo; command followed by a graph description whenever a query
language command is preprended with a &lsquo;<samp>visual</samp>&rsquo; keyword.  This
command causes a new graph to be displayed.  The &lsquo;<samp>add();</samp>&rsquo; command
is issued whenever a query language command is prepended with several
&lsquo;<samp>visual</samp>&rsquo; keywords.  This command causes the visualization program
to merge the immediately following graph description with the last graph
the user has interacted with.  The visualization program always issues
query language commands prepended with &lsquo;<samp>visual visual</samp>&rsquo;, causing the
currently displayed graph to be extended.
</p>
<p>If you want to access the visualization commands generated by Maria, you
can rename the &lsquo;<tt>maria-vis</tt>&rsquo; script and replace it with something
like the following script:
</p>
<table><tr><td>&nbsp;</td><td><pre class="example">#!/bin/sh
tee <var>/tmp/maria-vis.out</var> | exec <var>maria-vis-orig</var> &quot;$@&quot;
</pre></td></tr></table>

<p>In order to print a visualized graph, you can save it to a file by
selecting a command in the graphical user interface, and then input this
file to the &lsquo;<tt>dot</tt>&rsquo; command.  Alternatively, you can use a script
like the above one and extract the graph descriptions from the
intercepted log file.  As the &lsquo;<tt>dot</tt>&rsquo; command does not directly
support the DIN A4 paper size, you may want to try out one of the
following command lines:
</p>
<table><tr><td>&nbsp;</td><td><pre class="example">dot -Gsize=11.69,8.26 -Gcenter=1 -Gmargin=0 -Grotate=90 -Tps
dot -Gsize=8.26,11.69 -Gcenter=1 -Gmargin=0 -Tps
</pre></td></tr></table>

<p>The former line is for horizontal layouts and the latter is for vertical
layouts.  You may want to add &lsquo;<samp>-Grankdir=LR</samp>&rsquo; to force left-to-right
layouting of the graph instead of the default top-to-bottom.  The
attributes in the graph file override the command line switches.
</p>
<p>Both command lines act as filters, reading the graph description from
standard input and writing the Postscript code to standard output.  The
Postscript can be printed directly as such, or embedded in a document,
since it follows the Encapsulated Postscript conventions.
</p>
<hr size="6">
<a name="Visual-Caveats"></a>
<table cellpadding="1" cellspacing="1" border="0">
<tr><td valign="middle" align="left">[<a href="#GraphViz" title="Previous section in reading order"> &lt; </a>]</td>
<td valign="middle" align="left">[<a href="#Emacs" title="Next section in reading order"> &gt; </a>]</td>
<td valign="middle" align="left"> &nbsp; </td>
<td valign="middle" align="left">[<a href="#Analysis" title="Beginning of this chapter or previous chapter"> &lt;&lt; </a>]</td>
<td valign="middle" align="left">[<a href="#Visual" title="Up section"> Up </a>]</td>
<td valign="middle" align="left">[<a href="maria_4.html#Algorithms" title="Next chapter"> &gt;&gt; </a>]</td>
<td valign="middle" align="left"> &nbsp; </td>
<td valign="middle" align="left"> &nbsp; </td>
<td valign="middle" align="left"> &nbsp; </td>
<td valign="middle" align="left"> &nbsp; </td>
<td valign="middle" align="left">[<a href="maria.html#Top" title="Cover (top) of document">Top</a>]</td>
<td valign="middle" align="left">[<a href="maria_toc.html#SEC_Contents" title="Table of contents">Contents</a>]</td>
<td valign="middle" align="left">[<a href="maria_10.html#Index" title="Index">Index</a>]</td>
<td valign="middle" align="left">[<a href="maria_abt.html#SEC_About" title="About (help)"> ? </a>]</td>
</tr></table>
<a name="Known-Bugs-in-the-Visualizer"></a>
<h4 class="subsubsection">2.2.4.2 Known Bugs in the Visualizer</h4>

<p>Graphical user interfaces are more challenging to program than plain
textual programs.  We have avoided most of the problems by choosing an
external tool that lays out directed graphs.  The GraphViz developer
team has been very responsive and nice towards us, even though it has
limited resources.
</p>
<p>Two bugs that may not be fixed soon concern labels in the graph.  Some
GraphViz utilities fail if labels are longer than about one thousand
characters.  You can use the &lsquo;<samp>hide</samp>&rsquo; command (see section <a href="#Hide">Excluding Places from Displayed Markings</a>) to
shorten node labels.  Also backslash characters in labels may be handled
incorrectly.
</p>
<p>There are also some known bugs in Maria.  Presently, Maria identifies
paths only by state numbers.  When a path is displayed graphically,
Maria displays all transitions between each neighboring state along the
path.
</p>
<p>This treatment of transitions may be confusing especially when
displaying counterexample paths (see section <a href="maria_4.html#Liveness">Checking Liveness Properties</a>), since Maria omits
the property automaton states from the counterexample.  Effectively, it
projects the product of the reachability graph and the property
automaton on the reachability graph.  If there are several enabled
actions between two states, or if fairness constraints are present, the
presented counterexample path may contain extraneous transitions.
</p>
<hr size="6">
<a name="Emacs"></a>
<table cellpadding="1" cellspacing="1" border="0">
<tr><td valign="middle" align="left">[<a href="#Visual-Caveats" title="Previous section in reading order"> &lt; </a>]</td>
<td valign="middle" align="left">[<a href="#pn_002dmode" title="Next section in reading order"> &gt; </a>]</td>
<td valign="middle" align="left"> &nbsp; </td>
<td valign="middle" align="left">[<a href="#Analysis" title="Beginning of this chapter or previous chapter"> &lt;&lt; </a>]</td>
<td valign="middle" align="left">[<a href="#Analysis" title="Up section"> Up </a>]</td>
<td valign="middle" align="left">[<a href="maria_4.html#Algorithms" title="Next chapter"> &gt;&gt; </a>]</td>
<td valign="middle" align="left"> &nbsp; </td>
<td valign="middle" align="left"> &nbsp; </td>
<td valign="middle" align="left"> &nbsp; </td>
<td valign="middle" align="left"> &nbsp; </td>
<td valign="middle" align="left">[<a href="maria.html#Top" title="Cover (top) of document">Top</a>]</td>
<td valign="middle" align="left">[<a href="maria_toc.html#SEC_Contents" title="Table of contents">Contents</a>]</td>
<td valign="middle" align="left">[<a href="maria_10.html#Index" title="Index">Index</a>]</td>
<td valign="middle" align="left">[<a href="maria_abt.html#SEC_About" title="About (help)"> ? </a>]</td>
</tr></table>
<a name="Editing-Petri-Nets-with-GNU-Emacs"></a>
<h2 class="section">2.3 Editing Petri Nets with GNU Emacs</h2>
<a name="index-Emacs"></a>

<p>We recommend that you use GNU Emacs for editing Petri Net models.
There is an Emacs major mode for editing Maria Petri Nets.  Its main
features are context-sensitive indentation and syntax highlighting.  If
you are not familiar with these features of Emacs, it is recommended
that you read the Emacs tutorial (press <kbd>C-h t</kbd>, that is, first hold
down the <kbd>Control</kbd> key, press <kbd>h</kbd>, then release <kbd>Control</kbd>
and press <kbd>t</kbd>) and learn about these features from the on-line help
system of Emacs e.g. with the commands <kbd>C-h i</kbd> (<kbd>M-x info</kbd>)
and <kbd>C-h a</kbd> (<kbd>M-x apropos-command</kbd>).
</p>
<table class="menu" border="0" cellspacing="0">
<tr><td align="left" valign="top"><a href="#pn_002dmode">2.3.1 Installing the Petri Net mode</a></td><td>&nbsp;&nbsp;</td><td align="left" valign="top"></td></tr>
<tr><td align="left" valign="top"><a href="#Highlighting">2.3.2 Syntax Highlighting</a></td><td>&nbsp;&nbsp;</td><td align="left" valign="top">                Syntax highlighting
</td></tr>
<tr><td align="left" valign="top"><a href="#Fine_002dTuning">2.3.3 Customizing Emacs</a></td><td>&nbsp;&nbsp;</td><td align="left" valign="top">                 Other things to customize in Emacs
</td></tr>
</table>

<hr size="6">
<a name="pn_002dmode"></a>
<table cellpadding="1" cellspacing="1" border="0">
<tr><td valign="middle" align="left">[<a href="#Emacs" title="Previous section in reading order"> &lt; </a>]</td>
<td valign="middle" align="left">[<a href="#Highlighting" title="Next section in reading order"> &gt; </a>]</td>
<td valign="middle" align="left"> &nbsp; </td>
<td valign="middle" align="left">[<a href="#Analysis" title="Beginning of this chapter or previous chapter"> &lt;&lt; </a>]</td>
<td valign="middle" align="left">[<a href="#Emacs" title="Up section"> Up </a>]</td>
<td valign="middle" align="left">[<a href="maria_4.html#Algorithms" title="Next chapter"> &gt;&gt; </a>]</td>
<td valign="middle" align="left"> &nbsp; </td>
<td valign="middle" align="left"> &nbsp; </td>
<td valign="middle" align="left"> &nbsp; </td>
<td valign="middle" align="left"> &nbsp; </td>
<td valign="middle" align="left">[<a href="maria.html#Top" title="Cover (top) of document">Top</a>]</td>
<td valign="middle" align="left">[<a href="maria_toc.html#SEC_Contents" title="Table of contents">Contents</a>]</td>
<td valign="middle" align="left">[<a href="maria_10.html#Index" title="Index">Index</a>]</td>
<td valign="middle" align="left">[<a href="maria_abt.html#SEC_About" title="About (help)"> ? </a>]</td>
</tr></table>
<a name="Installing-the-Petri-Net-mode"></a>
<h3 class="subsection">2.3.1 Installing the Petri Net mode</h3>
<a name="index-Petri-Net-mode"></a>
<a name="index-indentation"></a>
<a name="index-syntax-highlighting"></a>

<p>The Petri Net mode &lsquo;<samp>pn-mode</samp>&rsquo; has been written for GNU Emacs,
versions 20.3 and 21.  It does not work in version 19.34, which lacks
&lsquo;<samp>cc-mode</samp>&rsquo; and some features of &lsquo;<samp>font-lock-mode</samp>&rsquo; the Petri
Net mode requires.
</p>
<p>Installing the Petri Net mode is simple.  Just add the name of the
directory containing &lsquo;<tt>pn-mode.el</tt>&rsquo; to <var>load-path</var> and do
&lsquo;<samp>(require 'pn-mode)</samp>&rsquo;.  To do this, you can add e.g. the following
lines to your &lsquo;<tt>.emacs</tt>&rsquo; file.
</p>
<table><tr><td>&nbsp;</td><td><pre class="lisp">(cond ((&gt;= emacs-major-version 20)
       (let ((pn-lisp-dir (expand-file-name &quot;<var>~/elisp</var>&quot;)))
         (cond ((file-readable-p pn-lisp-dir)
                (add-to-list 'load-path pn-lisp-dir))
                (require 'pn-mode)
                (setq pn-font-lock-extra-types
                      '(&quot;token&quot; &quot;\\sw+_t&quot;)))))))
</pre></td></tr></table>

<p>In this example, we also set the variable <var>pn-font-lock-extra-types</var>
so that the word &lsquo;<samp>token</samp>&rsquo; and all words ending in &lsquo;<samp>_t</samp>&rsquo; will be
treated as type names.
</p>
<hr size="6">
<a name="Highlighting"></a>
<table cellpadding="1" cellspacing="1" border="0">
<tr><td valign="middle" align="left">[<a href="#pn_002dmode" title="Previous section in reading order"> &lt; </a>]</td>
<td valign="middle" align="left">[<a href="#Fine_002dTuning" title="Next section in reading order"> &gt; </a>]</td>
<td valign="middle" align="left"> &nbsp; </td>
<td valign="middle" align="left">[<a href="#Analysis" title="Beginning of this chapter or previous chapter"> &lt;&lt; </a>]</td>
<td valign="middle" align="left">[<a href="#Emacs" title="Up section"> Up </a>]</td>
<td valign="middle" align="left">[<a href="maria_4.html#Algorithms" title="Next chapter"> &gt;&gt; </a>]</td>
<td valign="middle" align="left"> &nbsp; </td>
<td valign="middle" align="left"> &nbsp; </td>
<td valign="middle" align="left"> &nbsp; </td>
<td valign="middle" align="left"> &nbsp; </td>
<td valign="middle" align="left">[<a href="maria.html#Top" title="Cover (top) of document">Top</a>]</td>
<td valign="middle" align="left">[<a href="maria_toc.html#SEC_Contents" title="Table of contents">Contents</a>]</td>
<td valign="middle" align="left">[<a href="maria_10.html#Index" title="Index">Index</a>]</td>
<td valign="middle" align="left">[<a href="maria_abt.html#SEC_About" title="About (help)"> ? </a>]</td>
</tr></table>
<a name="Syntax-Highlighting"></a>
<h3 class="subsection">2.3.2 Syntax Highlighting</h3>
<a name="index-syntax-highlighting-1"></a>

<p>If you are not familiar with the current syntax highlighting features of
Emacs (&lsquo;<samp>font-lock-mode</samp>&rsquo;), you should read the documentation (using
the Info system and maybe also the <kbd>C-h f</kbd> and <kbd>C-h v</kbd>
commands).
</p>
<p>Adding the following declarations to your &lsquo;<tt>.emacs</tt>&rsquo; file will enable
maximum degree of syntax highlighting in all Emacs modes.  You may want
to consult the documentation of the variable
<var>font-lock-maximum-decoration</var> if you want to limit the degree of
highlighting in some modes.
</p>
<table><tr><td>&nbsp;</td><td><pre class="lisp">(global-font-lock-mode t)
(setq font-lock-maximum-decoration t)
(turn-on-font-lock)
</pre></td></tr></table>

<hr size="6">
<a name="Fine_002dTuning"></a>
<table cellpadding="1" cellspacing="1" border="0">
<tr><td valign="middle" align="left">[<a href="#Highlighting" title="Previous section in reading order"> &lt; </a>]</td>
<td valign="middle" align="left">[<a href="maria_4.html#Algorithms" title="Next section in reading order"> &gt; </a>]</td>
<td valign="middle" align="left"> &nbsp; </td>
<td valign="middle" align="left">[<a href="#Analysis" title="Beginning of this chapter or previous chapter"> &lt;&lt; </a>]</td>
<td valign="middle" align="left">[<a href="#Emacs" title="Up section"> Up </a>]</td>
<td valign="middle" align="left">[<a href="maria_4.html#Algorithms" title="Next chapter"> &gt;&gt; </a>]</td>
<td valign="middle" align="left"> &nbsp; </td>
<td valign="middle" align="left"> &nbsp; </td>
<td valign="middle" align="left"> &nbsp; </td>
<td valign="middle" align="left"> &nbsp; </td>
<td valign="middle" align="left">[<a href="maria.html#Top" title="Cover (top) of document">Top</a>]</td>
<td valign="middle" align="left">[<a href="maria_toc.html#SEC_Contents" title="Table of contents">Contents</a>]</td>
<td valign="middle" align="left">[<a href="maria_10.html#Index" title="Index">Index</a>]</td>
<td valign="middle" align="left">[<a href="maria_abt.html#SEC_About" title="About (help)"> ? </a>]</td>
</tr></table>
<a name="Customizing-Emacs"></a>
<h3 class="subsection">2.3.3 Customizing Emacs</h3>
<a name="index-Emacs_002c-customizing"></a>

<p>One of the most frequent problems of Emacs newcomers is how to convince
Emacs to use 8-bit characters, as in the character set standardized by
ISO 8859-1, also known as the Latin-1 alphabet.  The default 7-bit
character set will suffice for editing Petri Net models.  But since this
section is about fine-tuning, here is something for your &lsquo;<tt>.emacs</tt>&rsquo;
file:
</p>
<table><tr><td>&nbsp;</td><td><pre class="lisp">(standard-display-european t)
(set-input-mode nil nil 'dummy)
(cond ((&lt; emacs-major-version 20)
       (require 'iso-syntax))
      (t
       (setq default-enable-multibyte-characters nil)
       (set-language-environment &quot;Latin-1&quot;)))
</pre></td></tr></table>

<p>In the following you will see some more definitions from my
&lsquo;<tt>.emacs</tt>&rsquo; file.  Feel free to use any of them.  In order for
&lsquo;<samp>pn-mode</samp>&rsquo; to automatically register the &lsquo;<tt>.pn</tt>&rsquo; extension with
&lsquo;<samp>speedbar</samp>&rsquo;, the latter should be loaded first.
</p>
<table><tr><td>&nbsp;</td><td><pre class="lisp">(setq next-line-add-newlines nil);<span class="roman">no accidentally inserted empty lines</span>
(setq make-backup-files nil)     ;<span class="roman">unless you like the &lsquo;<samp>~</samp>&rsquo; files</span>
(setq mouse-yank-at-point t)     ;<span class="roman">for more accurate yanking (pasting)</span>
(setq inhibit-startup-message t) ;<span class="roman">disable the startup message</span>
</pre><pre class="lisp">(if (null window-system)
    (menu-bar-mode -1)           ;<span class="roman">hide the menu line in text mode</span>
  (if (&gt;= emacs-major-version 20)
      (speedbar-frame-mode t)))  ;<span class="roman">enable speedbar, the navigator</span>
</pre><pre class="lisp">(setq visible-bell t)    ;<span class="roman">do not beep---flash instead</span>
(line-number-mode t)     ;<span class="roman">show line numbers in the mode line</span>
(column-number-mode t)   ;<span class="roman">show column numbers in the mode line</span>
(show-paren-mode t)      ;<span class="roman">highlight matching parentheses</span>
(auto-compression-mode t);<span class="roman">transparently (de)compress &lsquo;<samp>.gz</samp>&rsquo; files</span>
</pre></td></tr></table>

<hr size="6">
<table cellpadding="1" cellspacing="1" border="0">
<tr><td valign="middle" align="left">[<a href="#Analysis" title="Beginning of this chapter or previous chapter"> &lt;&lt; </a>]</td>
<td valign="middle" align="left">[<a href="maria_4.html#Algorithms" title="Next chapter"> &gt;&gt; </a>]</td>
<td valign="middle" align="left"> &nbsp; </td>
<td valign="middle" align="left"> &nbsp; </td>
<td valign="middle" align="left"> &nbsp; </td>
<td valign="middle" align="left"> &nbsp; </td>
<td valign="middle" align="left"> &nbsp; </td>
<td valign="middle" align="left">[<a href="maria.html#Top" title="Cover (top) of document">Top</a>]</td>
<td valign="middle" align="left">[<a href="maria_toc.html#SEC_Contents" title="Table of contents">Contents</a>]</td>
<td valign="middle" align="left">[<a href="maria_10.html#Index" title="Index">Index</a>]</td>
<td valign="middle" align="left">[<a href="maria_abt.html#SEC_About" title="About (help)"> ? </a>]</td>
</tr></table>
<p>
 <font size="-1">
  This document was generated by <em>root</em> on <em>March 22, 2020</em> using <a href="http://www.nongnu.org/texi2html/"><em>texi2html 1.82</em></a>.
 </font>
 <br>

</p>
</body>
</html>

AnonSec - 2021 | Recode By D7net