<?xml version="1.0" encoding="UTF-8"?>
<rss version="2.0"
	xmlns:content="http://purl.org/rss/1.0/modules/content/"
	xmlns:wfw="http://wellformedweb.org/CommentAPI/"
	xmlns:dc="http://purl.org/dc/elements/1.1/"
	xmlns:atom="http://www.w3.org/2005/Atom"
	xmlns:sy="http://purl.org/rss/1.0/modules/syndication/"
	xmlns:slash="http://purl.org/rss/1.0/modules/slash/"
	>

<channel>
	<title>TLA+ &#124; The way to specify&#187; switch</title>
	<atom:link href="http://www.tlaplus.net/tags/switch/feed/" rel="self" type="application/rss+xml" />
	<link>http://www.tlaplus.net</link>
	<description>The TLA+ and PlusCal Resource</description>
	<lastBuildDate>Fri, 20 Jan 2012 20:26:41 +0000</lastBuildDate>
	<language>en</language>
	<sy:updatePeriod>hourly</sy:updatePeriod>
	<sy:updateFrequency>1</sy:updateFrequency>
	<generator>http://wordpress.org/?v=3.2.1</generator>
		<item>
		<title>Command Line Switches</title>
		<link>http://www.tlaplus.net/posts/2009/08/command-line-switches/</link>
		<comments>http://www.tlaplus.net/posts/2009/08/command-line-switches/#comments</comments>
		<pubDate>Tue, 04 Aug 2009 08:11:25 +0000</pubDate>
		<dc:creator>Simon Zambrovski</dc:creator>
				<category><![CDATA[Featured]]></category>
		<category><![CDATA[Tools]]></category>
		<category><![CDATA[Tutorials]]></category>
		<category><![CDATA[argument]]></category>
		<category><![CDATA[command line]]></category>
		<category><![CDATA[PlusCal]]></category>
		<category><![CDATA[sany]]></category>
		<category><![CDATA[switch]]></category>
		<category><![CDATA[tlatex]]></category>
		<category><![CDATA[tlc]]></category>

		<guid isPermaLink="false">http://www.tlaplus.net/?p=116</guid>
		<description><![CDATA[This tutorial describes the command line switches accepted by the console-based TLA+ Tools: SANY, TLC, and the PlusCal Translator. Most users will run the tools from the Toolbox, in which case the switches for SANY and TLC are irrelevant. When running the Toolbox, command line switches for the PlusCal translator can be provided in a [...]]]></description>
			<content:encoded><![CDATA[<p><img style="float: left; margin: 10px;" title="Command Line Switches" src="/wp-content/uploads/2009/08/switch-150x150.jpg" alt="Command Line Switches" width="100" height="100" /><br />
This tutorial describes the command line switches accepted by the console-based TLA+ Tools: SANY, TLC, and the PlusCal Translator.  Most users will run the tools from the Toolbox, in which case the switches for SANY and TLC are irrelevant.  When running the Toolbox, command line switches for the PlusCal translator can be provided in a specification&#8217;s <code>Preferences</code> menu.  However, starting with Version 1.5 of the translator, the most useful options can be specified in the module containing the algorithm.  (See the language manual.)</p>
<p>The command line switches are detected, by the fact that they begin with a &#8216;-&#8217; character. Once the first command line element that is not a switch is encountered, the rest are presumed to be file names.<span id="more-116"></span></p>
<h3>SANY, the Syntax Analyzer</h3>
<pre class="brush: bash; title: ; notranslate">
java tla2sany.SANY [-S] [-L] [-D] [-STAT] FILES
</pre>
<p>where <code>FILES</code> is a list of modules separated by spaces and</p>
<ul>
<li><code>-S</code>: disable semantic analysis</li>
<li><code>-L</code>: disable level checking</li>
<li><code>-D</code>: enable debugging</li>
<li><code>-STAT</code>: print statistics</li>
</ul>
<p>The switches are useful for finding errors in SANY ony and are not providing particular helpful features for the user.</p>
<h3>TLC, the Model Checker</h3>
<p>The model checker (TLC) provides the following functionalities:</p>
<ul>
<li>Model checking of TLA+ specs</li>
<li>Simulation of TLA+ specs</li>
</ul>
<p>The program can be executed by typing the following to the console</p>
<pre class="brush: bash; title: ; notranslate">
java tlc2.TLC [GENERAL-SWITCHES] [MODE-SWITCHES] SPEC
</pre>
<p>where <code>SPEC</code> is the name of the specification&#8217;s root module (the .tla extension can be omitted) and the optional <code>GENERAL-SWITCHES</code> are:</p>
<ul>
<li><code>-cleanup</code>: clean up the states directory</li>
<li><code>-config file</code>: provide the config file. Defaults to .cfg if not provided.</li>
<li><code>-continue</code>: continue running even when invariant is violated. Defaults to stop at the first violation if not specified.</li>
<li><code>-coverage minutes</code>: collect coverage information on the spec, print out the information every minutes. Defaults to no coverage if not specified.</li>
<li><code>-deadlock</code>: do not check for deadlock. Defaults to checking deadlock if not specified.</li>
<li><code>-difftrace</code>: when printing trace, show only the differences between successive states. Defaults to printing full state descriptions if not specified.</li>
<li><code>-dump file</code>: dump all the states into file</li>
<li><code>-fp num</code>: use the num&#8217;th irreducible polynomial from the list stored in the class FP64.</li>
<li><code>-gzip</code>: control if gzip is applied to value input/output stream. Defaults to use gzip.</li>
<li><code>-metadir path</code>: store metadata in the directory at path. Defaults to specdir/states if not specified.</li>
<li><code>-nowarning</code>: disable all the warnings. Defaults to report warnings if not specified</li>
<li><code>-recover path</code>: recover from the checkpoint at path. Defaults to scratch run if not specified.</li>
<li><code>-terse</code>: do not expand values in Print statement. Defaults to expand value if not specified.</li>
<li><code>-workers num</code>: the number of TLC worker threads. Defaults to 1.</li>
</ul>
<p>By default TLC starts in the model checking mode using breadth-first approach for state space exploration. This can be changed using the <code>MODE-SWITCHES</code>. In contrast to the <code>GENERAL-SWITCHES</code> these can be used if applied in certain combinations only:</p>
<pre class="brush: bash; title: ; notranslate">
{[-dfid num][ -view]|-simulate[ -depth num][ -aril num][ -seed num]}
</pre>
<ul>
<li><code>-modelcheck</code>: run model checking and explore the state space in breadth first manner. This is a default mode.</li>
<li><code>-dfid num</code>: run model checking and use depth-first iterative deepening with initial depth num</li>
<li><code>-view</code>: apply <code>VIEW</code> (if provided) when printing out states. Applicable only in model checking mode.</li>
<li><code>-simulate</code>: run simulation</li>
<li><code>-depth num</code>: specify the depth of random simulation. Defaults to 100 if not specified, relevant for simulation mode only.</li>
<li><code>-seed num</code>: provide the seed for random simulation. Defaults to a random seed if not specified, relevant for simulation mode only.</li>
<li><code>-aril num</code>: adjust the seed for random simulation. Defaults to 0 if not specified, relevant for simulation mode only.</li>
</ul>
<h2>PlusCal, the Translator</h2>
<p>The PlusCal translator translates a PlusCal algorithm into a TLA+ specification. The translator is called by typing</p>
<pre class="brush: bash; title: ; notranslate">
java pcal.trans [SWITCHES] SPEC
</pre>
<p>where SPEC is a TLA+ file (the extension .tla need not be typed)<br />
containing the algorithm. See the PlusCal manual for an explanation of<br />
what the TLA+ file must contain. The possible options are</p>
<ul>
<li><code>-help</code>: Prints out the usage instead of running the translator.</li>
<li><code>-wf</code>: Conjoin to formula <code>Spec</code> weak fairness of each process&#8217;s next-state action</li>
<li><code>-sf</code>: Conjoin to formula <code>Spec</code> strong fairness of each process&#8217;s next-state action</li>
<li><code>-wfNext</code>: Conjoin to formula <code>Spec</code> weak fairness of the entire next-state action</li>
<li><code>-nof</code>: Conjoin no fairness formula to <code>Spec</code>. This is the default, except when the <code>-termination</code> option is chosen.</li>
<li><code>-termination</code>: Add to the .cfg file the command <code>PROPERTY Termination</code> With this option, the default fairness option becomes <code>-wf</code>.</li>
<li><code>-nocfg</code>: Suppress writing of the .cfg file.</li>
<li><code>-label</code>: Tells the translator to add missing labels. This is the default only for a uniprocess algorithm in which the user has typed no labels.</li>
<li><code>-reportLabels</code>: True if the translator should print the names and locations of all labels it adds. Like <code>-label</code>, it tells the translator to add missing labels.</li>
<li><code>-labelRoot name</code>: If the translator adds missing labels, it names them name1, name2, etc. The default value is &#8220;Lbl_&#8221;.</li>
<li><code>-unixEOL</code>: Forces the use of Unix end-of-line convention, regardless of the system&#8217;s default. Without this, when run on Windows, the files it writes seem to have a &#8220;^M&#8221; at the end of every line when viewed with Emacs.</li>
<li><code>-debug</code>: This is useful only for maintainers of the program and has no effect on normal execution.</li>
<li><code>-reportLabels</code>: True if the translator should print the names and locations of all labels it adds.  Like -label, it tells the translator to add missing labels.</li>
<li><code>-lineWidth</code>: The translation tries to perform the translation so lines have this maximum width.  (It will often fail.)  Default is 78, minimum value is 60.</li>
<li><code>-version</code>: The version of PlusCal for which this algorithm is written.  If the language is ever changed to make algorithms written for earlier versions no longer legal, then the translator should do the appropriate thing when the earlier version number is specified.</li>
</ul>
<p>Starting with Version 1.5, the following options no longer work.  They can be used only if the <code>-version 1.4</code> option is also used.  Moreover, the <code>-writeAST</code> option does not work from the Toolbox.  If there is any demand, these options may be made to work again in later versions.</p>
<ul>
<li><code>-spec name</code>: Uses TLC and the TLA+ specification name.tla to do the translation. It copies the files name.tla and name.cfg from the directory containing the translator&#8217;s Java source files to the current directory; it writes in the current director the file AST.tla that defines `fairness&#8217; to equal the fairness option and `ast&#8217; to equal the the AST data structure representing the algorithm; and it runs TLC on name.tla to produce the translation.</li>
<li><code>-myspec name</code>: Like <code>-spec</code>, except it finds the files names.tla and names.cfg in the current directory, instead of writing them there.</li>
<li><code>-spec2 name</code>: Like <code>-spec</code>, except it uses TLC2 insead of the old version of TLC (aka TLC1).</li>
<li><code>-myspec2 name</code>: Like <code>-myspec</code>, except it uses TLC2 instead of TLC (aka TLC1).</li>
<li><code>-writeAST</code>: Writes the AST file as in the <code>-spec</code> option, but does not perform the translation.</li>
</ul>
]]></content:encoded>
			<wfw:commentRss>http://www.tlaplus.net/posts/2009/08/command-line-switches/feed/</wfw:commentRss>
		<slash:comments>5</slash:comments>
		</item>
	</channel>
</rss>

