Line 28: | Line 28: | ||
* <tt>\probrepl{CMD}</tt> command takes a probcli REPL command <tt>CMD</tt>as argument and executes it. By default it shows only the output of the execution, e.g., in case it is a predicate TRUE or FALSE. Example: <tt>\probrepl{let DOM = 1..3}</tt>. | * <tt>\probrepl{CMD}</tt> command takes a probcli REPL command <tt>CMD</tt>as argument and executes it. By default it shows only the output of the execution, e.g., in case it is a predicate TRUE or FALSE. Example: <tt>\probrepl{let DOM = 1..3}</tt>. | ||
* <tt>\probtable{EXRP}</tt> command takes a B expression <tt>EXPR</tt>as argument, evaluates it and shows it as a Latex table. | * <tt>\probtable{EXRP}</tt> command takes a B expression <tt>EXPR</tt>as argument, evaluates it and shows it as a Latex table. | ||
* <tt>\ | * <tt>\probdot{DOT}{File1}</tt> command takes a B expression <tt>EXPR</tt>as argument, evaluates it as a graph and writes a dot file <tt>File1</tt>. You can provide a second File as argument, in which case <tt>dot</tt> is called to generate a PDF document. | ||
* <tt>\probprint{EXRP}</tt> command takes a B expression or predicate <tt>EXPR</tt>as argument and pretty prints it. | * <tt>\probprint{EXRP}</tt> command takes a B expression or predicate <tt>EXPR</tt>as argument and pretty prints it. | ||
* <tt>\probif{EXPR}{Then}{Else}</tt> command takes an expression or predicate <tt>EXPR</tt> and two Latex texts. If the expression evaluates to TRUE the first branch <tt>Then</tt> is processed, otherwise the other one <tt>Else</tt> is processed. | * <tt>\probif{EXPR}{Then}{Else}</tt> command takes an expression or predicate <tt>EXPR</tt> and two Latex texts. If the expression evaluates to TRUE the first branch <tt>Then</tt> is processed, otherwise the other one <tt>Else</tt> is processed. | ||
* <tt>\probfor{ID}{Set}{Body}</tt> command takes an identifier <tt>ID</tt>, a set expression <tt>Set</tt> and a Latex text <tt>Body</tt>, | * <tt>\probfor{ID}{Set}{Body}</tt> command takes an identifier <tt>ID</tt>, a set expression <tt>Set</tt> and a Latex text <tt>Body</tt>, | ||
and processes the Latex text for every element of the set expression, setting the identifier to a value of the set. | and processes the Latex text for every element of the set expression, setting the identifier to a value of the set. |
ProB can (as of version 1.6.1) be used to process Latex files, i.e., the command-line tool probcli scans a given Latex file and replaces certain commands by processed results.
A typical usage would be as follows:
probcli FILE -init -latex Raw.tex Final.tex
Note: the FILE and -init commands are optional; they are required in case you want to process the commands in the context of a certain model. Currently the probcli Latex commands mainly support B and Event-B models, TLA+ and Z models can also be processed but all commands below expect B syntax. You can add more commands if you wish, e.g., set preferences using -p PREF VAL or run model checking --model-check. The Latex processing will take place after most other commands, such as model checking.
You will probably want to put the probcli call into a Makefile, in particular when you want to generate dot graphics using ProB.
The distribution folder of ProB contains an example with a Makefile, producing the following file, which at the same time documents the core features:
The commands are described in the PDF document above. Here is a short summary of some of the commands:
By default it shows the B expression and the value of the expression. Example: \probexpr{{1}\/{2**10}} will be replaced by {1,1024}
and processes the Latex text for every element of the set expression, setting the identifier to a value of the set.