No edit summary |
|||
Line 15: | Line 15: | ||
Now, you need to clone or download the [http://www3.hhu.de/stups/downloads/prob/source/ ProB Prolog sources]. | Now, you need to clone or download the [http://www3.hhu.de/stups/downloads/prob/source/ ProB Prolog sources]. | ||
=== Building ProB Extensions === | |||
Before using ProB for the first time from source you should build the extensions. The minimal extensions are counter and user_signal. You can build them using | |||
cd extensions/counter | |||
make | |||
cd ../user_signal | |||
make | |||
You could also build all extensions at once by going to the top of the prob_prolog tree (i.e., the directory containing src and lib as sub-directories) and then type | |||
make | |||
On Mac you may have to add a symbolic link to gawk in order to build the ProZ fuzz extension: | |||
sudo ln -s /usr/bin/awk /usr/bin/gawk | |||
Now you can start the testing console using <tt>test</tt>. You can e.g. type the number of a unit test to run it, or a test category such as <tt>tickets</tt> to run all tests in that category. | |||
Line 39: | Line 55: | ||
To start probcli from source define this alias, where <tt> PROB_SOURCE_DIR </tt> and <tt>SICSTUSDIR</tt> must be defined: | To start probcli from source define this alias, where <tt> PROB_SOURCE_DIR </tt> and <tt>SICSTUSDIR</tt> must be defined: | ||
alias probsli='rlwrap $SICSTUSDIR/bin/sicstus -l $PROB_SOURCE_DIR/prob_cli.pl --goal "go_cli." -a' | alias probsli='rlwrap $SICSTUSDIR/bin/sicstus -l $PROB_SOURCE_DIR/prob_cli.pl --goal "go_cli." -a' | ||
(It is recommended to install rlwrap so that you get a history of your commands. If you don't want to install rlwrap just remove it from the line above.) | |||
You can now use probsli just like probcli, e.g., | You can now use probsli just like probcli, e.g., | ||
probsli M.mch --model-check | probsli M.mch --model-check | ||
or | or | ||
probsli --repl | probsli --repl | ||
=== Running the Prolog Tests === | === Running the Prolog Tests === | ||
Line 75: | Line 73: | ||
There is a specific <tt>test_runner.pl</tt> file for running all Prolog unit and integration tests. The test_runner also provides a REPL (read-eval-print-loop) for running tests and collection of tests. | There is a specific <tt>test_runner.pl</tt> file for running all Prolog unit and integration tests. The test_runner also provides a REPL (read-eval-print-loop) for running tests and collection of tests. | ||
To start the Unit Test REPL, add the following to your <tt>.bash_login</tt> file (at least on Mac OS): | |||
alias tests='cd $PROBDIR; rlwrap sicstus -Dprob_safe_mode=true -l $PROB_SOURCE_DIR/test_runner.pl --goal "test_repl."' | |||
alias | |||
Now you can start the test runner: | (It is recommended to install rlwrap so that you get a history of your commands. If you don't want to install rlwrap just remove it from the line above.) | ||
Now you can start the test runner like this: | |||
tests | |||
or you can already specify tests to be run: | |||
tests last | |||
Here is a sample sesssion of running the test REPL: | |||
<pre> | <pre> | ||
$ | $ tests | ||
... | ... | ||
SICStus 4.2.3 (x86_64-darwin-11.4.2): Fri Oct 5 15:58:35 CEST 2012 | SICStus 4.2.3 (x86_64-darwin-11.4.2): Fri Oct 5 15:58:35 CEST 2012 | ||
Line 91: | Line 96: | ||
</pre> | </pre> | ||
Some useful commands are: | Some useful commands in the REPL are: | ||
* last to run the last test added to <tt>testcases.pl</tt> | * last to run the last test added to <tt>testcases.pl</tt> | ||
* all to run all tests | * all to run all tests | ||
Line 105: | Line 110: | ||
== ProB Prolog compile time flags == | == ProB Prolog compile time flags == |
The kernel of ProB is written in Prolog and you can download the latest Prolog sourcecode snapshot from: https://stups.hhu-hosting.de/downloads/prob/source/
You may also wish to obtain related Java sources:
You first need to download and install SICStus Prolog. Evaluation licenses (30-days) are available. We currently compile with SICStus 4.6.0 (as of January 2021).
You need the password to download SICStus then run sudo ./InstallSICStus and provide the site name, license code and expiration date. Be sure to add the SICStus binaries to your PATH.
Now, you need to clone or download the ProB Prolog sources.
Before using ProB for the first time from source you should build the extensions. The minimal extensions are counter and user_signal. You can build them using
cd extensions/counter make cd ../user_signal make
You could also build all extensions at once by going to the top of the prob_prolog tree (i.e., the directory containing src and lib as sub-directories) and then type
make
On Mac you may have to add a symbolic link to gawk in order to build the ProZ fuzz extension:
sudo ln -s /usr/bin/awk /usr/bin/gawk
Now you can start the testing console using test. You can e.g. type the number of a unit test to run it, or a test category such as tickets to run all tests in that category.
Probably you should first install a recent Active Tcl distribution, in particular on macOS. Check the Download download page for which version is required or recommended.
You can then start ProB Tcl/Tk by changing into the prob_prolog directory of the Prolog sources and type:
sicstus -Dprob_profile=true -l src/prob_tcltk.pl --goal "go."'
To simplify starting ProB, add the following to your .bash_login file (or similar configuration file; supposing you cloned the Git repository into ~/git_root):
export PROBDIR=~/git_root/prob_prolog export PROB_SOURCE_DIR=$PROBDIR/src alias prob='cd sicstus -Dprob_profile=true -l $PROB_SOURCE_DIR/prob_tcltk.pl --goal "go."'
Now, you can simply start ProB from the command-line and from source with the prob alias command.
The command-line version of ProB does not require a Tcl/Tk distribution.
To start probcli from source define this alias, where PROB_SOURCE_DIR and SICSTUSDIR must be defined:
alias probsli='rlwrap $SICSTUSDIR/bin/sicstus -l $PROB_SOURCE_DIR/prob_cli.pl --goal "go_cli." -a'
(It is recommended to install rlwrap so that you get a history of your commands. If you don't want to install rlwrap just remove it from the line above.)
You can now use probsli just like probcli, e.g.,
probsli M.mch --model-check
or
probsli --repl
All Prolog tests are stored as facts in the file test cases.pl. Every test has
There is a specific test_runner.pl file for running all Prolog unit and integration tests. The test_runner also provides a REPL (read-eval-print-loop) for running tests and collection of tests. To start the Unit Test REPL, add the following to your .bash_login file (at least on Mac OS):
alias tests='cd $PROBDIR; rlwrap sicstus -Dprob_safe_mode=true -l $PROB_SOURCE_DIR/test_runner.pl --goal "test_repl."'
(It is recommended to install rlwrap so that you get a history of your commands. If you don't want to install rlwrap just remove it from the line above.)
Now you can start the test runner like this:
tests
or you can already specify tests to be run:
tests last
Here is a sample sesssion of running the test REPL:
$ tests ... SICStus 4.2.3 (x86_64-darwin-11.4.2): Fri Oct 5 15:58:35 CEST 2012 Licensed to SP4phil-fak.uni-duesseldorf.de TEST ==> last. ... All tests successful. Walltime: 100 ms
Some useful commands in the REPL are:
By giving sicstus a command-line option -Dflag=true you can set certain compile time flags, namely:
prob_profile (enables B operation profiling to be displayed in ProB Tcl/Tk in Debug menu) prob_safe_mode (performs additional checking, in particular that ASTs are well-formed) prob_data_validation_mode (deprecated, replaced by DATA_VALIDATION preference) prob_release (removes certain tests from the code) no_terminal_colors (disable terminal colors) debug_kodkod (write dot files for kodkod interval analysis) no_wd_checking (disable WD checking for function application)