Caching Constants and Operations: Difference between revisions

(Created page with "ProB can store the values of constants and operations in a cache file. Compared to [Memoization_for_Functions|memoization for functions], this caching is persistant across dif...")
 
No edit summary
Line 1: Line 1:
ProB can store the values of constants and operations in a cache file.
ProB can store the values of constants and operations in a cache file.
Compared to [Memoization_for_Functions|memoization for functions], this caching is persistant across different runs of probcli or ProB Tcl/Tk and is applicable to the constant setup and operations, not at the level of (constant) functions.
Compared to [[Memoization_for_Functions|memoization for functions]], this caching is persistent across different runs of probcli or ProB Tcl/Tk and is applicable to the constant setup and operations, not at the level of (constant) functions.
(It thus may make sense to activate both of these features.)
(It thus may make sense to activate both of these features.)


Line 7: Line 7:
In the  [[Using_the_Command-Line_Version_of_ProB|command-line version probcli]] the cache can be activated using the option
In the  [[Using_the_Command-Line_Version_of_ProB|command-line version probcli]] the cache can be activated using the option
* -cache DIRECTORY
* -cache DIRECTORY
This means that cache results will be stored in that directory.
This means that cache results will be stored in that directory.
The directory may contain multiple files, namely one file per B machine.
The directory may contain multiple files, namely one file per B machine.
The files contain a hash to detect whether they are still up-to-date.
The files contain a hash to detect whether they are still up-to-date.
=== Inspecting the Cache ===
In the  [[Using_the_Command-Line_Version_of_ProB|command-line version probcli]] a summary of the cache can be displayed using this option (together with the -cache option mentioned above).
* -show_cache
In verbose mode (-v flag) more details are displayed.

Revision as of 06:31, 15 May 2021

ProB can store the values of constants and operations in a cache file. Compared to memoization for functions, this caching is persistent across different runs of probcli or ProB Tcl/Tk and is applicable to the constant setup and operations, not at the level of (constant) functions. (It thus may make sense to activate both of these features.)

Activating Caching

In the command-line version probcli the cache can be activated using the option

  • -cache DIRECTORY

This means that cache results will be stored in that directory. The directory may contain multiple files, namely one file per B machine. The files contain a hash to detect whether they are still up-to-date.

Inspecting the Cache

In the command-line version probcli a summary of the cache can be displayed using this option (together with the -cache option mentioned above).

  • -show_cache

In verbose mode (-v flag) more details are displayed.