Script Variables
The proof script language supports script variables. These are variables that are managed by the interpreter and are not part of the explicit proof object—in contrast to the variables of the Java program and the logical variables of first oder logic formulas.
As Java or logic variables, we bind the assignments script variables to a sequences. If a script variable is not assigned in the current selected goal, we look up its value in the sequence’s ancestors, recursively.
Types
Each variables has a type. Following simple types are defined:
int– arbitrary precision integersbool– true or falsestring– string ("")
For the interoperability with KeY we allow that parameterized term types TERM<S>,
where S is a KeY sort (already defined by in the KeY namespace).
The type hierarchy is fixed.
TERM– for an unknown sortTERM<S>– with sortS(e.g. int, locset)
Special Variables
During the design of our scripting language we arrived at a point, in which we need access to configuration options of the underlying theorem prover. We decided to implement an access to these options via variables. The variable access has advantages over built-in commands. The main advantage is that you can do conditions other these options.
Here we give a list of the current special variables
KeY Options
__KEY_DEP : BOOL = trueToggles dependency tracking for the prover.
__KEY_MAX_STEPS : INT = 10000Must be positive; limits rule applications in automatic proof search.
__KEY_METHOD_OPTION : STRING = "method"Selects the method treatment used by the strategy (
methodby default).__KEY_NON_LINEAR_ARITHMETIC : STRING = "none"Selects the non-linear arithmetic mode.
__KEY_QUERY : BOOL = falseEnables query mode.
__KEY_SMT__ACTIVE_SOLVER : STRING = ""Name of the active SMT solver; empty means no solver.
__KEY_SMT__CHECK_FOR_SUPPORT : BOOL = trueCheck that the selected solver supports the required features.
__KEY_SMT__INT_BOUND : INT = 3Bit-length bound for integer translation.
__KEY_SMT__INVARIANT_ALL : BOOL = falseTranslate all invariants rather than only the relevant ones.
__KEY_SMT__LOCSET_BOUND : INT = 3Bit-length bound for location-set translation.
__KEY_SMT__MAX_CONCURRENT_PROCESSES : INT = 5Maximum number of concurrent SMT solver processes.
__KEY_SMT__MAX_GENERIC_SORTS : INT = 2Maximum number of generic sorts in the translation.
__KEY_SMT__MAX_INTEGER : INT = 2147483645Largest integer used for bounded integer translation.
__KEY_SMT__MIN_INTEGER : INT = -2147483645Smallest integer used for bounded integer translation.
__KEY_SMT__MODE_OF_PROGRESS_DIALOG : INT = 0Controls the SMT progress dialog.
__KEY_SMT__OBJECT_BOUND : INT = 3Bit-length bound for object translation.
__KEY_SMT__PATH_FOR_SMT_TRANSLATION : STRING = ""Directory for stored SMT translations; empty disables storing.
__KEY_SMT__SEQ_BOUND : INT = 3Bit-length bound for sequence translation.
__KEY_SMT__SHOW_RESULTS_AFTER_EXECUTION : BOOL = falseShow SMT solver results after execution.
__KEY_SMT__STORE_TRANSLATION_TO_FILE : BOOL = falseWrite the SMT translation to a file.
__KEY_SMT__TIMEOUT : INT = 5000SMT solver timeout in milliseconds.
__KEY_SMT__USE_BUILTIN_UNIQUENESS : BOOL = falseUse the solver’s built-in uniqueness for objects.
__KEY_SMT__USE_CONSTANTS_FOR_INTEGERS : BOOL = trueUse constants for integers in the translation.
__KEY_SMT__USE_UI_MULTIPLICATION : BOOL = trueUse uninterpreted multiplication.
__KEY_SMT__heapBound : INT = 3Bit-length bound for heap translation.
__KEY_SMT__useExplicitTypeHierarchy : BOOL = falseTranslate the type hierarchy explicitly.
__KEY_SMT__useNullInstantiation : BOOL = trueInstantiate null predicates in the translation.
__KEY_STOP_MODE : STRING = "default"Stop mode used by the strategy.
__KEY_TIMEOUT : INT = -1Prover timeout in milliseconds;
-1disables the timeout.
Interpreter Options
__MAX_ITERATIONS_REPEAT : INT = 10000Sets the the upper limit for iterations in repeat loops. Default value is really high.
__STRICT_MODE : BOOL = falseDefines if the interpreter is in strict or relax mode.
In strict mode the interpreter throws an exception in following cases:
- access to undeclared or unassigned variable
- application of non-applicable rule
In non-strict mode these errors are ignored—a warning is given on the console.