Skip to content
Snippets Groups Projects
Commit d8b83600 authored by dgelessus's avatar dgelessus
Browse files

Stop displaying machine dependency graph when loading

parent 6f5a772f
Branches
Tags
No related merge requests found
%% Cell type:code id: tags: %% Cell type:code id: tags:
``` prob ``` prob
:help :browse :help :browse
``` ```
%% Output %% Output
``` ```
:browse :browse
``` ```
Show information about the current state. Show information about the current state.
The output shows the names of all sets, constants, and variables defined by the current machine, as well as a list of transitions that are available in the current state. Each transition has a numeric ID, which can be passed to `:exec` to execute that transition. The output shows the names of all sets, constants, and variables defined by the current machine, as well as a list of transitions that are available in the current state. Each transition has a numeric ID, which can be passed to `:exec` to execute that transition.
``` ```
:browse :browse
``` ```
Show information about the current state. Show information about the current state.
The output shows the names of all sets, constants, and variables defined by the current machine, as well as a list of transitions that are available in the current state. Each transition has a numeric ID, which can be passed to `:exec` to execute that transition. The output shows the names of all sets, constants, and variables defined by the current machine, as well as a list of transitions that are available in the current state. Each transition has a numeric ID, which can be passed to `:exec` to execute that transition.
%% Cell type:code id: tags: %% Cell type:code id: tags:
``` prob ``` prob
:help :exec :help :exec
``` ```
%% Output %% Output
``` ```
:exec OPERATION [PREDICATE] :exec OPERATION [PREDICATE]
:exec OPERATION_ID :exec OPERATION_ID
``` ```
Execute an operation with the specified predicate, or by its ID. Execute an operation with the specified predicate, or by its ID.
In the first form, the given operation is executed. If the optional predicate is specified, a transition is found for which the predicate is $\mathit{TRUE}$. The predicate can be used to restrict what values the operation's parameters or the variables in the next state may have. In the first form, the given operation is executed. If the optional predicate is specified, a transition is found for which the predicate is $\mathit{TRUE}$. The predicate can be used to restrict what values the operation's parameters or the variables in the next state may have.
In the second form, a known transition with the given numeric ID is executed. A list of the current state's available transitions and their IDs can be viewed using `:browse`. Only transition IDs from the current state can be executed. In the second form, a known transition with the given numeric ID is executed. A list of the current state's available transitions and their IDs can be viewed using `:browse`. Only transition IDs from the current state can be executed.
``` ```
:exec OPERATION [PREDICATE] :exec OPERATION [PREDICATE]
:exec OPERATION_ID :exec OPERATION_ID
``` ```
Execute an operation with the specified predicate, or by its ID. Execute an operation with the specified predicate, or by its ID.
In the first form, the given operation is executed. If the optional predicate is specified, a transition is found for which the predicate is $\mathit{TRUE}$. The predicate can be used to restrict what values the operation's parameters or the variables in the next state may have. In the first form, the given operation is executed. If the optional predicate is specified, a transition is found for which the predicate is $\mathit{TRUE}$. The predicate can be used to restrict what values the operation's parameters or the variables in the next state may have.
In the second form, a known transition with the given numeric ID is executed. A list of the current state's available transitions and their IDs can be viewed using `:browse`. Only transition IDs from the current state can be executed. In the second form, a known transition with the given numeric ID is executed. A list of the current state's available transitions and their IDs can be viewed using `:browse`. Only transition IDs from the current state can be executed.
%% Cell type:code id: tags: %% Cell type:code id: tags:
``` prob ``` prob
:help :constants :help :constants
``` ```
%% Output %% Output
``` ```
:constants [PREDICATE] :constants [PREDICATE]
``` ```
Set up the current machine's constants. Set up the current machine's constants.
This is a shorthand for `:exec SETUP_CONSTANTS [PREDICATE]`. This is a shorthand for `:exec SETUP_CONSTANTS [PREDICATE]`.
``` ```
:constants [PREDICATE] :constants [PREDICATE]
``` ```
Set up the current machine's constants. Set up the current machine's constants.
This is a shorthand for `:exec SETUP_CONSTANTS [PREDICATE]`. This is a shorthand for `:exec SETUP_CONSTANTS [PREDICATE]`.
%% Cell type:code id: tags: %% Cell type:code id: tags:
``` prob ``` prob
:help :init :help :init
``` ```
%% Output %% Output
``` ```
:init [PREDICATE] :init [PREDICATE]
``` ```
Initialise the current machine with the specified predicate Initialise the current machine with the specified predicate
This is a shorthand for `:exec INITIALISATION [PREDICATE]`. This is a shorthand for `:exec INITIALISATION [PREDICATE]`.
``` ```
:init [PREDICATE] :init [PREDICATE]
``` ```
Initialise the current machine with the specified predicate Initialise the current machine with the specified predicate
This is a shorthand for `:exec INITIALISATION [PREDICATE]`. This is a shorthand for `:exec INITIALISATION [PREDICATE]`.
%% Cell type:code id: tags: %% Cell type:code id: tags:
``` prob ``` prob
:browse :browse
``` ```
%% Output %% Output
Machine: repl Machine: repl
Sets: (none) Sets: (none)
Constants: (none) Constants: (none)
Variables: (none) Variables: (none)
Operations: Operations:
0: $initialise_machine() 0: $initialise_machine()
%% Cell type:code id: tags: %% Cell type:code id: tags:
``` prob ``` prob
::load ::load
MACHINE Counter MACHINE Counter
CONSTANTS min_value, max_value CONSTANTS min_value, max_value
PROPERTIES min_value : MININT..0 & max_value : 0..MAXINT & min_value <= max_value PROPERTIES min_value : MININT..0 & max_value : 0..MAXINT & min_value <= max_value
VARIABLES value VARIABLES value
INVARIANT value : min_value..max_value INVARIANT value : min_value..max_value
INITIALISATION value :: min_value..max_value INITIALISATION value :: min_value..max_value
OPERATIONS OPERATIONS
add(diff) = SELECT add(diff) = SELECT
value+diff : min_value..max_value value+diff : min_value..max_value
THEN THEN
value := value+diff value := value+diff
END END
END END
``` ```
%% Output %% Output
Loaded machine: Counter : [] Loaded machine: Counter
%% Cell type:code id: tags: %% Cell type:code id: tags:
``` prob ``` prob
:browse :browse
``` ```
%% Output %% Output
Machine: Counter Machine: Counter
Sets: (none) Sets: (none)
Constants: min_value, max_value Constants: min_value, max_value
Variables: value Variables: value
Operations: Operations:
0: $setup_constants() 0: $setup_constants()
1: $setup_constants() 1: $setup_constants()
2: $setup_constants() 2: $setup_constants()
3: $setup_constants() 3: $setup_constants()
More operations may be available (MAX_OPERATIONS/MAX_INITIALISATIONS reached) More operations may be available (MAX_OPERATIONS/MAX_INITIALISATIONS reached)
%% Cell type:code id: tags: %% Cell type:code id: tags:
``` prob ``` prob
min_value..max_value min_value..max_value
``` ```
%% Output %% Output
:eval: NOT-INITIALISED :eval: NOT-INITIALISED
%% Cell type:code id: tags: %% Cell type:code id: tags:
``` prob ``` prob
value value
``` ```
%% Output %% Output
:eval: NOT-INITIALISED :eval: NOT-INITIALISED
%% Cell type:code id: tags: %% Cell type:code id: tags:
``` prob ``` prob
:constants min_value=5 & max_value=-5 :constants min_value=5 & max_value=-5
``` ```
%% Output %% Output
:constants: Could not setup constants with the specified predicate :constants: Could not setup constants with the specified predicate
%% Cell type:code id: tags: %% Cell type:code id: tags:
``` prob ``` prob
:constants min_value=-1 & max_value=2 :constants min_value=-1 & max_value=2
``` ```
%% Output %% Output
Machine constants set up using operation 2: $setup_constants() Machine constants set up using operation 2: $setup_constants()
%% Cell type:code id: tags: %% Cell type:code id: tags:
``` prob ``` prob
:browse :browse
``` ```
%% Output %% Output
Machine: Counter Machine: Counter
Sets: (none) Sets: (none)
Constants: min_value, max_value Constants: min_value, max_value
Variables: value Variables: value
Operations: Operations:
4: $initialise_machine() 4: $initialise_machine()
5: $initialise_machine() 5: $initialise_machine()
6: $initialise_machine() 6: $initialise_machine()
7: $initialise_machine() 7: $initialise_machine()
More operations may be available (MAX_OPERATIONS/MAX_INITIALISATIONS reached) More operations may be available (MAX_OPERATIONS/MAX_INITIALISATIONS reached)
%% Cell type:code id: tags: %% Cell type:code id: tags:
``` prob ``` prob
min_value..max_value min_value..max_value
``` ```
%% Output %% Output
$\{-1,0,1,2\}$ $\{-1,0,1,2\}$
{−1,0,1,2} {−1,0,1,2}
%% Cell type:code id: tags: %% Cell type:code id: tags:
``` prob ``` prob
value value
``` ```
%% Output %% Output
:eval: NOT-INITIALISED :eval: NOT-INITIALISED
%% Cell type:code id: tags: %% Cell type:code id: tags:
``` prob ``` prob
:init value=-100 :init value=-100
``` ```
%% Output %% Output
Error from ProB: ProB reported Errors Error from ProB: ProB reported Errors
Error: INITIALISATION FAILS (/Users/Shared/Uni/SHK/ProB2/prob2-jupyter-kernel/notebooks/tests:6:15 to 6:44) Error: INITIALISATION FAILS (/Users/Shared/Uni/SHK/ProB2/prob2-jupyter-kernel/notebooks/tests/from_string.mch:6:15 to 6:44)
%% Cell type:code id: tags: %% Cell type:code id: tags:
``` prob ``` prob
:init value=2 :init value=2
``` ```
%% Output %% Output
Machine initialised using operation 7: $initialise_machine() Machine initialised using operation 7: $initialise_machine()
%% Cell type:code id: tags: %% Cell type:code id: tags:
``` prob ``` prob
:browse :browse
``` ```
%% Output %% Output
Machine: Counter Machine: Counter
Sets: (none) Sets: (none)
Constants: min_value, max_value Constants: min_value, max_value
Variables: value Variables: value
Operations: Operations:
8: add(-3) 8: add(-3)
9: add(-2) 9: add(-2)
10: add(-1) 10: add(-1)
11: add(0) 11: add(0)
%% Cell type:code id: tags: %% Cell type:code id: tags:
``` prob ``` prob
value value
``` ```
%% Output %% Output
$2$ $2$
2 2
%% Cell type:code id: tags: %% Cell type:code id: tags:
``` prob ``` prob
:exec add diff=-1 :exec add diff=-1
``` ```
%% Output %% Output
Executed operation 10: add(-1) Executed operation 10: add(-1)
%% Cell type:code id: tags: %% Cell type:code id: tags:
``` prob ``` prob
:browse :browse
``` ```
%% Output %% Output
Machine: Counter Machine: Counter
Sets: (none) Sets: (none)
Constants: min_value, max_value Constants: min_value, max_value
Variables: value Variables: value
Operations: Operations:
12: add(-2) 12: add(-2)
13: add(-1) 13: add(-1)
14: add(0) 14: add(0)
15: add(1) 15: add(1)
%% Cell type:code id: tags: %% Cell type:code id: tags:
``` prob ``` prob
value value
``` ```
%% Output %% Output
$1$ $1$
1 1
%% Cell type:code id: tags: %% Cell type:code id: tags:
``` prob ``` prob
:exec 15 :exec 15
``` ```
%% Output %% Output
Executed operation 15: add(1) Executed operation 15: add(1)
%% Cell type:code id: tags: %% Cell type:code id: tags:
``` prob ``` prob
:browse :browse
``` ```
%% Output %% Output
Machine: Counter Machine: Counter
Sets: (none) Sets: (none)
Constants: min_value, max_value Constants: min_value, max_value
Variables: value Variables: value
Operations: Operations:
8: add(-3) 8: add(-3)
9: add(-2) 9: add(-2)
10: add(-1) 10: add(-1)
11: add(0) 11: add(0)
%% Cell type:code id: tags: %% Cell type:code id: tags:
``` prob ``` prob
:exec 10 1=1 :exec 10 1=1
``` ```
%% Output %% Output
:exec: Cannot specify a predicate when executing an operation by ID :exec: Cannot specify a predicate when executing an operation by ID
%% Cell type:markdown id: tags: %% Cell type:markdown id: tags:
Useful error messages are shown when an operation cannot be executed. Useful error messages are shown when an operation cannot be executed.
%% Cell type:code id: tags: %% Cell type:code id: tags:
``` prob ``` prob
:constants :constants
``` ```
%% Output %% Output
:constants: Machine constants are already set up :constants: Machine constants are already set up
%% Cell type:code id: tags: %% Cell type:code id: tags:
``` prob ``` prob
:init :init
``` ```
%% Output %% Output
:init: Machine is already initialised :init: Machine is already initialised
%% Cell type:code id: tags: %% Cell type:code id: tags:
``` prob ``` prob
:exec nope :exec nope
``` ```
%% Output %% Output
:exec: Could not execute operation nope :exec: Could not execute operation nope
%% Cell type:code id: tags: %% Cell type:code id: tags:
``` prob ``` prob
:exec add 1=0 :exec add 1=0
``` ```
%% Output %% Output
:exec: Could not execute operation add with the given predicate :exec: Could not execute operation add with the given predicate
%% Cell type:code id: tags: %% Cell type:code id: tags:
``` prob ``` prob
::load ::load
MACHINE NoConstants MACHINE NoConstants
VARIABLES z VARIABLES z
INVARIANT z : MININT..MAXINT INVARIANT z : MININT..MAXINT
INITIALISATION z :: {0, 1} INITIALISATION z :: {0, 1}
END END
``` ```
%% Output %% Output
Loaded machine: NoConstants : [] Loaded machine: NoConstants
%% Cell type:code id: tags: %% Cell type:code id: tags:
``` prob ``` prob
:constants :constants
``` ```
%% Output %% Output
:constants: Machine has no constants, use :init instead :constants: Machine has no constants, use :init instead
%% Cell type:code id: tags: %% Cell type:code id: tags:
``` prob ``` prob
:init z = -1 :init z = -1
``` ```
%% Output %% Output
Error from ProB: ProB reported Errors Error from ProB: ProB reported Errors
Error: INITIALISATION FAILS (/Users/Shared/Uni/SHK/ProB2/prob2-jupyter-kernel/notebooks/tests:4:15 to 4:26) Error: INITIALISATION FAILS (/Users/Shared/Uni/SHK/ProB2/prob2-jupyter-kernel/notebooks/tests/from_string.mch:4:15 to 4:26)
%% Cell type:markdown id: tags: %% Cell type:markdown id: tags:
`SETUP_CONSTANTS` and `INITIALISATION` can be used as operation names. `SETUP_CONSTANTS` and `INITIALISATION` can be used as operation names.
%% Cell type:code id: tags: %% Cell type:code id: tags:
``` prob ``` prob
::load ::load
MACHINE Foo MACHINE Foo
CONSTANTS x CONSTANTS x
PROPERTIES x : MININT..MAXINT PROPERTIES x : MININT..MAXINT
VARIABLES y VARIABLES y
INVARIANT y : MININT..MAXINT INVARIANT y : MININT..MAXINT
INITIALISATION y :: MININT..MAXINT INITIALISATION y :: MININT..MAXINT
END END
``` ```
%% Output %% Output
Loaded machine: Foo : [] Loaded machine: Foo
%% Cell type:code id: tags: %% Cell type:code id: tags:
``` prob ``` prob
:exec SETUP_CONSTANTS x = 1 :exec SETUP_CONSTANTS x = 1
``` ```
%% Output %% Output
Executed operation 2: $setup_constants() Executed operation 2: $setup_constants()
%% Cell type:code id: tags: %% Cell type:code id: tags:
``` prob ``` prob
:exec INITIALISATION y = 2 :exec INITIALISATION y = 2
``` ```
%% Output %% Output
Executed operation 7: $initialise_machine() Executed operation 7: $initialise_machine()
%% Cell type:code id: tags: %% Cell type:code id: tags:
``` prob ``` prob
x x
``` ```
%% Output %% Output
$1$ $1$
1 1
%% Cell type:code id: tags: %% Cell type:code id: tags:
``` prob ``` prob
y y
``` ```
%% Output %% Output
$2$ $2$
2 2
......
%% Cell type:code id: tags: %% Cell type:code id: tags:
``` prob ``` prob
::load ::load
MACHINE Jupyter MACHINE Jupyter
DEFINITIONS "LibraryMeta.def"; "LibraryStrings.def" DEFINITIONS "LibraryMeta.def"; "LibraryStrings.def"
END END
``` ```
%% Output %% Output
Loaded machine: Jupyter : [] Loaded machine: Jupyter
%% Cell type:code id: tags: %% Cell type:code id: tags:
``` prob ``` prob
PROB_INFO_STR("prob-version") PROB_INFO_STR("prob-version")
``` ```
%% Output %% Output
"1.8.1-beta4" $\text{"1.8.1-beta5"}$
"1.8.1-beta5"
%% Cell type:code id: tags: %% Cell type:code id: tags:
``` prob ``` prob
PROB_INFO_STR("java-version") PROB_INFO_STR("java-version")
``` ```
%% Output %% Output
$\text{"1.8.0_172-b11"}$
"1.8.0_172-b11" "1.8.0_172-b11"
%% Cell type:code id: tags: %% Cell type:code id: tags:
``` prob ``` prob
PROB_INFO_STR("prob-revision") PROB_INFO_STR("prob-revision")
``` ```
%% Output %% Output
"c6264c505a07e8df7a9f0a7631c9d503c125bd8e" $\text{"6cab2e5307bb683bbd71b9482804663da21d9ba7"}$
"6cab2e5307bb683bbd71b9482804663da21d9ba7"
%% Cell type:code id: tags: %% Cell type:code id: tags:
``` prob ``` prob
PROB_STATISTICS("states") PROB_STATISTICS("states")
``` ```
%% Output %% Output
$1$
1 1
%% Cell type:code id: tags: %% Cell type:code id: tags:
``` prob ``` prob
PROB_STATISTICS("prolog-memory-bytes-used") PROB_STATISTICS("prolog-memory-bytes-used")
``` ```
%% Output %% Output
150627280 $150833600$
150833600
%% Cell type:markdown id: tags: %% Cell type:markdown id: tags:
The following fails because Java parser not available from within probcli: The following fails because Java parser not available from within probcli:
%% Cell type:code id: tags: %% Cell type:code id: tags:
``` prob ``` prob
PROB_INFO_STR("parser-version") PROB_INFO_STR("parser-version")
``` ```
%% Output %% Output
:eval: NOT-WELL-DEFINED: :eval: NOT-WELL-DEFINED:
Unexpected error while parsing machine: Unexpected error while parsing machine:
Additional information: Fehler: Hauptklasse de.prob.cliparser.CliBParser konnte nicht gefunden oder geladen werden Additional information: Fehler: Hauptklasse de.prob.cliparser.CliBParser konnte nicht gefunden oder geladen werden
Java B parser (probcliparser.jar) is missing from lib directory in: /Users/david/.prob/prob2-3.2.10-SNAPSHOT/ Java B parser (probcliparser.jar) is missing from lib directory in: /Users/david/.prob/prob2-3.2.10-SNAPSHOT/
......
%% Cell type:code id: tags: %% Cell type:code id: tags:
``` prob ``` prob
:help ::load :help ::load
``` ```
%% Output %% Output
``` ```
::load [PREF=VALUE ...] ::load [PREF=VALUE ...]
MACHINE MACHINE
... ...
END END
``` ```
Load the machine source code given in the cell body. Load the machine source code given in the cell body.
There must be a newline between the `::load` command name and the machine code. There must be a newline between the `::load` command name and the machine code.
Any number of preference assignments may be included after `::load` (only on the first line). Preferences can also be changed on a loaded machine using the `:pref` command, however certain preferences do not take full effect when set using `:pref` and must be set when the machine is loaded. Any number of preference assignments may be included after `::load` (only on the first line). Preferences can also be changed on a loaded machine using the `:pref` command, however certain preferences do not take full effect when set using `:pref` and must be set when the machine is loaded.
``` ```
::load [PREF=VALUE ...] ::load [PREF=VALUE ...]
MACHINE MACHINE
... ...
END END
``` ```
Load the machine source code given in the cell body. Load the machine source code given in the cell body.
There must be a newline between the `::load` command name and the machine code. There must be a newline between the `::load` command name and the machine code.
Any number of preference assignments may be included after `::load` (only on the first line). Preferences can also be changed on a loaded machine using the `:pref` command, however certain preferences do not take full effect when set using `:pref` and must be set when the machine is loaded. Any number of preference assignments may be included after `::load` (only on the first line). Preferences can also be changed on a loaded machine using the `:pref` command, however certain preferences do not take full effect when set using `:pref` and must be set when the machine is loaded.
%% Cell type:markdown id: tags: %% Cell type:markdown id: tags:
Machines can be loaded from code in the notebook. Machines can be loaded from code in the notebook.
%% Cell type:code id: tags: %% Cell type:code id: tags:
``` prob ``` prob
::load ::load
MACHINE things MACHINE things
SETS THINGS = {ONE, TWO, THREE, FOUR} SETS THINGS = {ONE, TWO, THREE, FOUR}
END END
``` ```
%% Output %% Output
Loaded machine: things : [] Loaded machine: things
%% Cell type:code id: tags: %% Cell type:code id: tags:
``` prob ``` prob
THINGS THINGS
``` ```
%% Output %% Output
$\{\mathit{ONE},\mathit{TWO},\mathit{THREE},\mathit{FOUR}\}$ $\{\mathit{ONE},\mathit{TWO},\mathit{THREE},\mathit{FOUR}\}$
{ONE,TWO,THREE,FOUR} {ONE,TWO,THREE,FOUR}
%% Cell type:markdown id: tags: %% Cell type:markdown id: tags:
Preference values can be specified. Preference values can be specified.
%% Cell type:code id: tags: %% Cell type:code id: tags:
``` prob ``` prob
::load MININT=-5 MAXINT=5 ::load MININT=-5 MAXINT=5
MACHINE prefs MACHINE prefs
END END
``` ```
%% Output %% Output
Loaded machine: prefs : [] Loaded machine: prefs
%% Cell type:code id: tags: %% Cell type:code id: tags:
``` prob ``` prob
MININT..MAXINT MININT..MAXINT
``` ```
%% Output %% Output
$\{-5,-4,-3,-2,-1,0,1,2,3,4,5\}$ $\{-5,-4,-3,-2,-1,0,1,2,3,4,5\}$
{−5,−4,−3,−2,−1,0,1,2,3,4,5} {−5,−4,−3,−2,−1,0,1,2,3,4,5}
......
%% Cell type:code id: tags: %% Cell type:code id: tags:
``` prob ``` prob
:help :load :help :load
``` ```
%% Output %% Output
``` ```
:load FILENAME [PREF=VALUE ...] :load FILENAME [PREF=VALUE ...]
``` ```
Load the machine from the given path. Load the machine from the given path.
The path is relative to the kernel's current directory (i. e. the directory in which the notebook is located). The path is relative to the kernel's current directory (i. e. the directory in which the notebook is located).
Any number of preference assignments may be included after the file path. Preferences can also be changed on a loaded machine using the `:pref` command, however certain preferences do not take full effect when set using `:pref` and must be set when the machine is loaded. Any number of preference assignments may be included after the file path. Preferences can also be changed on a loaded machine using the `:pref` command, however certain preferences do not take full effect when set using `:pref` and must be set when the machine is loaded.
``` ```
:load FILENAME [PREF=VALUE ...] :load FILENAME [PREF=VALUE ...]
``` ```
Load the machine from the given path. Load the machine from the given path.
The path is relative to the kernel's current directory (i. e. the directory in which the notebook is located). The path is relative to the kernel's current directory (i. e. the directory in which the notebook is located).
Any number of preference assignments may be included after the file path. Preferences can also be changed on a loaded machine using the `:pref` command, however certain preferences do not take full effect when set using `:pref` and must be set when the machine is loaded. Any number of preference assignments may be included after the file path. Preferences can also be changed on a loaded machine using the `:pref` command, however certain preferences do not take full effect when set using `:pref` and must be set when the machine is loaded.
%% Cell type:markdown id: tags: %% Cell type:markdown id: tags:
Machines can be loaded from files in the current directory. Machines can be loaded from files in the current directory.
%% Cell type:code id: tags: %% Cell type:code id: tags:
``` prob ``` prob
:load things.mch :load things.mch
``` ```
%% Output %% Output
Loaded machine: things : [] Loaded machine: things
%% Cell type:code id: tags: %% Cell type:code id: tags:
``` prob ``` prob
THINGS THINGS
``` ```
%% Output %% Output
$\{\mathit{ONE},\mathit{TWO},\mathit{THREE},\mathit{FOUR}\}$ $\{\mathit{ONE},\mathit{TWO},\mathit{THREE},\mathit{FOUR}\}$
{ONE,TWO,THREE,FOUR} {ONE,TWO,THREE,FOUR}
%% Cell type:markdown id: tags: %% Cell type:markdown id: tags:
Preference values can be specified. Preference values can be specified.
%% Cell type:code id: tags: %% Cell type:code id: tags:
``` prob ``` prob
:load things.mch MININT=-5 MAXINT=5 :load things.mch MININT=-5 MAXINT=5
``` ```
%% Output %% Output
Loaded machine: things : [] Loaded machine: things
%% Cell type:code id: tags: %% Cell type:code id: tags:
``` prob ``` prob
MININT..MAXINT MININT..MAXINT
``` ```
%% Output %% Output
$\{-5,-4,-3,-2,-1,0,1,2,3,4,5\}$ $\{-5,-4,-3,-2,-1,0,1,2,3,4,5\}$
{−5,−4,−3,−2,−1,0,1,2,3,4,5} {−5,−4,−3,−2,−1,0,1,2,3,4,5}
......
%% Cell type:code id: tags: %% Cell type:code id: tags:
``` prob ``` prob
:help :show :help :show
``` ```
%% Output %% Output
``` ```
:show :show
``` ```
Show the machine's animation function visualisation for the current state. Show the machine's animation function visualisation for the current state.
The visualisation is static, any defined right-click options cannot be viewed or used. The visualisation is static, any defined right-click options cannot be viewed or used.
``` ```
:show :show
``` ```
Show the machine's animation function visualisation for the current state. Show the machine's animation function visualisation for the current state.
The visualisation is static, any defined right-click options cannot be viewed or used. The visualisation is static, any defined right-click options cannot be viewed or used.
%% Cell type:code id: tags: %% Cell type:code id: tags:
``` prob ``` prob
:load Hanoi.mch :load Hanoi.mch
``` ```
%% Output %% Output
Loaded machine: Hanoi : [] Loaded machine: Hanoi
%% Cell type:code id: tags: %% Cell type:code id: tags:
``` prob ``` prob
:show :show
``` ```
%% Output %% Output
:show: Machine is not initialised, cannot show animation function visualisation :show: Machine is not initialised, cannot show animation function visualisation
%% Cell type:code id: tags: %% Cell type:code id: tags:
``` prob ``` prob
:constants :constants
``` ```
%% Output %% Output
Machine constants set up using operation 0: $setup_constants() Machine constants set up using operation 0: $setup_constants()
%% Cell type:code id: tags: %% Cell type:code id: tags:
``` prob ``` prob
:show :show
``` ```
%% Output %% Output
:show: Machine is not initialised, cannot show animation function visualisation :show: Machine is not initialised, cannot show animation function visualisation
%% Cell type:code id: tags: %% Cell type:code id: tags:
``` prob ``` prob
:init :init
``` ```
%% Output %% Output
Machine initialised using operation 1: $initialise_machine() Machine initialised using operation 1: $initialise_machine()
%% Cell type:code id: tags: %% Cell type:code id: tags:
``` prob ``` prob
:show :show
``` ```
%% Output %% Output
<table style="font-family:monospace"><tbody> <table style="font-family:monospace"><tbody>
<tr> <tr>
<td style="padding:0px">![1](images/Disc1.gif)</td> <td style="padding:0px">![1](images/Disc1.gif)</td>
<td style="padding:0px">![0](images/Disc_empty.gif)</td> <td style="padding:0px">![0](images/Disc_empty.gif)</td>
<td style="padding:0px">![0](images/Disc_empty.gif)</td> <td style="padding:0px">![0](images/Disc_empty.gif)</td>
</tr> </tr>
<tr> <tr>
<td style="padding:0px">![2](images/Disc2.gif)</td> <td style="padding:0px">![2](images/Disc2.gif)</td>
<td style="padding:0px">![0](images/Disc_empty.gif)</td> <td style="padding:0px">![0](images/Disc_empty.gif)</td>
<td style="padding:0px">![0](images/Disc_empty.gif)</td> <td style="padding:0px">![0](images/Disc_empty.gif)</td>
</tr> </tr>
<tr> <tr>
<td style="padding:0px">![3](images/Disc3.gif)</td> <td style="padding:0px">![3](images/Disc3.gif)</td>
<td style="padding:0px">![0](images/Disc_empty.gif)</td> <td style="padding:0px">![0](images/Disc_empty.gif)</td>
<td style="padding:0px">![0](images/Disc_empty.gif)</td> <td style="padding:0px">![0](images/Disc_empty.gif)</td>
</tr> </tr>
<tr> <tr>
<td style="padding:0px">![4](images/Disc4.gif)</td> <td style="padding:0px">![4](images/Disc4.gif)</td>
<td style="padding:0px">![0](images/Disc_empty.gif)</td> <td style="padding:0px">![0](images/Disc_empty.gif)</td>
<td style="padding:0px">![0](images/Disc_empty.gif)</td> <td style="padding:0px">![0](images/Disc_empty.gif)</td>
</tr> </tr>
<tr> <tr>
<td style="padding:0px">![5](images/Disc5.gif)</td> <td style="padding:0px">![5](images/Disc5.gif)</td>
<td style="padding:0px">![0](images/Disc_empty.gif)</td> <td style="padding:0px">![0](images/Disc_empty.gif)</td>
<td style="padding:0px">![0](images/Disc_empty.gif)</td> <td style="padding:0px">![0](images/Disc_empty.gif)</td>
</tr> </tr>
</tbody></table> </tbody></table>
<Animation function visualisation> <Animation function visualisation>
%% Cell type:code id: tags: %% Cell type:code id: tags:
``` prob ``` prob
:exec Move :exec Move
``` ```
%% Output %% Output
Executed operation 2: Move(orig,dest,1) Executed operation 2: Move(orig,dest,1)
%% Cell type:code id: tags: %% Cell type:code id: tags:
``` prob ``` prob
:show :show
``` ```
%% Output %% Output
<table style="font-family:monospace"><tbody> <table style="font-family:monospace"><tbody>
<tr> <tr>
<td style="padding:0px">![0](images/Disc_empty.gif)</td> <td style="padding:0px">![0](images/Disc_empty.gif)</td>
<td style="padding:0px">![0](images/Disc_empty.gif)</td> <td style="padding:0px">![0](images/Disc_empty.gif)</td>
<td style="padding:0px">![0](images/Disc_empty.gif)</td> <td style="padding:0px">![0](images/Disc_empty.gif)</td>
</tr> </tr>
<tr> <tr>
<td style="padding:0px">![2](images/Disc2.gif)</td> <td style="padding:0px">![2](images/Disc2.gif)</td>
<td style="padding:0px">![0](images/Disc_empty.gif)</td> <td style="padding:0px">![0](images/Disc_empty.gif)</td>
<td style="padding:0px">![0](images/Disc_empty.gif)</td> <td style="padding:0px">![0](images/Disc_empty.gif)</td>
</tr> </tr>
<tr> <tr>
<td style="padding:0px">![3](images/Disc3.gif)</td> <td style="padding:0px">![3](images/Disc3.gif)</td>
<td style="padding:0px">![0](images/Disc_empty.gif)</td> <td style="padding:0px">![0](images/Disc_empty.gif)</td>
<td style="padding:0px">![0](images/Disc_empty.gif)</td> <td style="padding:0px">![0](images/Disc_empty.gif)</td>
</tr> </tr>
<tr> <tr>
<td style="padding:0px">![4](images/Disc4.gif)</td> <td style="padding:0px">![4](images/Disc4.gif)</td>
<td style="padding:0px">![0](images/Disc_empty.gif)</td> <td style="padding:0px">![0](images/Disc_empty.gif)</td>
<td style="padding:0px">![0](images/Disc_empty.gif)</td> <td style="padding:0px">![0](images/Disc_empty.gif)</td>
</tr> </tr>
<tr> <tr>
<td style="padding:0px">![5](images/Disc5.gif)</td> <td style="padding:0px">![5](images/Disc5.gif)</td>
<td style="padding:0px">![1](images/Disc1.gif)</td> <td style="padding:0px">![1](images/Disc1.gif)</td>
<td style="padding:0px">![0](images/Disc_empty.gif)</td> <td style="padding:0px">![0](images/Disc_empty.gif)</td>
</tr> </tr>
</tbody></table> </tbody></table>
<Animation function visualisation> <Animation function visualisation>
%% Cell type:code id: tags: %% Cell type:code id: tags:
``` prob ``` prob
:exec Move :exec Move
``` ```
%% Output %% Output
Executed operation 4: Move(orig,Stakes3,2) Executed operation 4: Move(orig,Stakes3,2)
%% Cell type:code id: tags: %% Cell type:code id: tags:
``` prob ``` prob
:show :show
``` ```
%% Output %% Output
<table style="font-family:monospace"><tbody> <table style="font-family:monospace"><tbody>
<tr> <tr>
<td style="padding:0px">![0](images/Disc_empty.gif)</td> <td style="padding:0px">![0](images/Disc_empty.gif)</td>
<td style="padding:0px">![0](images/Disc_empty.gif)</td> <td style="padding:0px">![0](images/Disc_empty.gif)</td>
<td style="padding:0px">![0](images/Disc_empty.gif)</td> <td style="padding:0px">![0](images/Disc_empty.gif)</td>
</tr> </tr>
<tr> <tr>
<td style="padding:0px">![0](images/Disc_empty.gif)</td> <td style="padding:0px">![0](images/Disc_empty.gif)</td>
<td style="padding:0px">![0](images/Disc_empty.gif)</td> <td style="padding:0px">![0](images/Disc_empty.gif)</td>
<td style="padding:0px">![0](images/Disc_empty.gif)</td> <td style="padding:0px">![0](images/Disc_empty.gif)</td>
</tr> </tr>
<tr> <tr>
<td style="padding:0px">![3](images/Disc3.gif)</td> <td style="padding:0px">![3](images/Disc3.gif)</td>
<td style="padding:0px">![0](images/Disc_empty.gif)</td> <td style="padding:0px">![0](images/Disc_empty.gif)</td>
<td style="padding:0px">![0](images/Disc_empty.gif)</td> <td style="padding:0px">![0](images/Disc_empty.gif)</td>
</tr> </tr>
<tr> <tr>
<td style="padding:0px">![4](images/Disc4.gif)</td> <td style="padding:0px">![4](images/Disc4.gif)</td>
<td style="padding:0px">![0](images/Disc_empty.gif)</td> <td style="padding:0px">![0](images/Disc_empty.gif)</td>
<td style="padding:0px">![0](images/Disc_empty.gif)</td> <td style="padding:0px">![0](images/Disc_empty.gif)</td>
</tr> </tr>
<tr> <tr>
<td style="padding:0px">![5](images/Disc5.gif)</td> <td style="padding:0px">![5](images/Disc5.gif)</td>
<td style="padding:0px">![1](images/Disc1.gif)</td> <td style="padding:0px">![1](images/Disc1.gif)</td>
<td style="padding:0px">![2](images/Disc2.gif)</td> <td style="padding:0px">![2](images/Disc2.gif)</td>
</tr> </tr>
</tbody></table> </tbody></table>
<Animation function visualisation> <Animation function visualisation>
%% Cell type:markdown id: tags: %% Cell type:markdown id: tags:
The image padding preference is respected. The image padding preference is respected.
%% Cell type:code id: tags: %% Cell type:code id: tags:
``` prob ``` prob
:pref TK_CUSTOM_STATE_VIEW_PADDING=8 :pref TK_CUSTOM_STATE_VIEW_PADDING=8
``` ```
%% Output %% Output
Preference changed: TK_CUSTOM_STATE_VIEW_PADDING = 8 Preference changed: TK_CUSTOM_STATE_VIEW_PADDING = 8
%% Cell type:code id: tags: %% Cell type:code id: tags:
``` prob ``` prob
:show :show
``` ```
%% Output %% Output
<table style="font-family:monospace"><tbody> <table style="font-family:monospace"><tbody>
<tr> <tr>
<td style="padding:8px">![0](images/Disc_empty.gif)</td> <td style="padding:8px">![0](images/Disc_empty.gif)</td>
<td style="padding:8px">![0](images/Disc_empty.gif)</td> <td style="padding:8px">![0](images/Disc_empty.gif)</td>
<td style="padding:8px">![0](images/Disc_empty.gif)</td> <td style="padding:8px">![0](images/Disc_empty.gif)</td>
</tr> </tr>
<tr> <tr>
<td style="padding:8px">![0](images/Disc_empty.gif)</td> <td style="padding:8px">![0](images/Disc_empty.gif)</td>
<td style="padding:8px">![0](images/Disc_empty.gif)</td> <td style="padding:8px">![0](images/Disc_empty.gif)</td>
<td style="padding:8px">![0](images/Disc_empty.gif)</td> <td style="padding:8px">![0](images/Disc_empty.gif)</td>
</tr> </tr>
<tr> <tr>
<td style="padding:8px">![3](images/Disc3.gif)</td> <td style="padding:8px">![3](images/Disc3.gif)</td>
<td style="padding:8px">![0](images/Disc_empty.gif)</td> <td style="padding:8px">![0](images/Disc_empty.gif)</td>
<td style="padding:8px">![0](images/Disc_empty.gif)</td> <td style="padding:8px">![0](images/Disc_empty.gif)</td>
</tr> </tr>
<tr> <tr>
<td style="padding:8px">![4](images/Disc4.gif)</td> <td style="padding:8px">![4](images/Disc4.gif)</td>
<td style="padding:8px">![0](images/Disc_empty.gif)</td> <td style="padding:8px">![0](images/Disc_empty.gif)</td>
<td style="padding:8px">![0](images/Disc_empty.gif)</td> <td style="padding:8px">![0](images/Disc_empty.gif)</td>
</tr> </tr>
<tr> <tr>
<td style="padding:8px">![5](images/Disc5.gif)</td> <td style="padding:8px">![5](images/Disc5.gif)</td>
<td style="padding:8px">![1](images/Disc1.gif)</td> <td style="padding:8px">![1](images/Disc1.gif)</td>
<td style="padding:8px">![2](images/Disc2.gif)</td> <td style="padding:8px">![2](images/Disc2.gif)</td>
</tr> </tr>
</tbody></table> </tbody></table>
<Animation function visualisation> <Animation function visualisation>
%% Cell type:markdown id: tags: %% Cell type:markdown id: tags:
Text labels are supported. Text labels are supported.
%% Cell type:code id: tags: %% Cell type:code id: tags:
``` prob ``` prob
:load CrosswordPuzzle.mch :load CrosswordPuzzle.mch
``` ```
%% Output %% Output
Loaded machine: CrosswordPuzzle : [] Loaded machine: CrosswordPuzzle
%% Cell type:code id: tags: %% Cell type:code id: tags:
``` prob ``` prob
:constants :constants
``` ```
%% Output %% Output
Machine constants set up using operation 0: $setup_constants() Machine constants set up using operation 0: $setup_constants()
%% Cell type:code id: tags: %% Cell type:code id: tags:
``` prob ``` prob
:init :init
``` ```
%% Output %% Output
Machine initialised using operation 1: $initialise_machine() Machine initialised using operation 1: $initialise_machine()
%% Cell type:code id: tags: %% Cell type:code id: tags:
``` prob ``` prob
:show :show
``` ```
%% Output %% Output
<table style="font-family:monospace"><tbody> <table style="font-family:monospace"><tbody>
<tr> <tr>
<td style="padding:10px">S</td> <td style="padding:10px">S</td>
<td style="padding:10px">T</td> <td style="padding:10px">T</td>
<td style="padding:10px">E</td> <td style="padding:10px">E</td>
<td style="padding:10px">E</td> <td style="padding:10px">E</td>
<td style="padding:10px">R</td> <td style="padding:10px">R</td>
</tr> </tr>
<tr> <tr>
<td style="padding:10px">-</td> <td style="padding:10px">-</td>
<td style="padding:10px">-</td> <td style="padding:10px">-</td>
<td style="padding:10px">A</td> <td style="padding:10px">A</td>
<td style="padding:10px">-</td> <td style="padding:10px">-</td>
<td style="padding:10px">U</td> <td style="padding:10px">U</td>
</tr> </tr>
<tr> <tr>
<td style="padding:10px">-</td> <td style="padding:10px">-</td>
<td style="padding:10px">I</td> <td style="padding:10px">I</td>
<td style="padding:10px">R</td> <td style="padding:10px">R</td>
<td style="padding:10px">O</td> <td style="padding:10px">O</td>
<td style="padding:10px">N</td> <td style="padding:10px">N</td>
</tr> </tr>
<tr> <tr>
<td style="padding:10px">-</td> <td style="padding:10px">-</td>
<td style="padding:10px">-</td> <td style="padding:10px">-</td>
<td style="padding:10px">N</td> <td style="padding:10px">N</td>
<td style="padding:10px">O</td> <td style="padding:10px">O</td>
<td style="padding:10px">-</td> <td style="padding:10px">-</td>
</tr> </tr>
</tbody></table> </tbody></table>
<Animation function visualisation> <Animation function visualisation>
%% Cell type:markdown id: tags: %% Cell type:markdown id: tags:
The text padding preference is respected. The text padding preference is respected.
%% Cell type:code id: tags: %% Cell type:code id: tags:
``` prob ``` prob
:pref TK_CUSTOM_STATE_VIEW_STRING_PADDING=2 :pref TK_CUSTOM_STATE_VIEW_STRING_PADDING=2
``` ```
%% Output %% Output
Preference changed: TK_CUSTOM_STATE_VIEW_STRING_PADDING = 2 Preference changed: TK_CUSTOM_STATE_VIEW_STRING_PADDING = 2
%% Cell type:code id: tags: %% Cell type:code id: tags:
``` prob ``` prob
:show :show
``` ```
%% Output %% Output
<table style="font-family:monospace"><tbody> <table style="font-family:monospace"><tbody>
<tr> <tr>
<td style="padding:2px">S</td> <td style="padding:2px">S</td>
<td style="padding:2px">T</td> <td style="padding:2px">T</td>
<td style="padding:2px">E</td> <td style="padding:2px">E</td>
<td style="padding:2px">E</td> <td style="padding:2px">E</td>
<td style="padding:2px">R</td> <td style="padding:2px">R</td>
</tr> </tr>
<tr> <tr>
<td style="padding:2px">-</td> <td style="padding:2px">-</td>
<td style="padding:2px">-</td> <td style="padding:2px">-</td>
<td style="padding:2px">A</td> <td style="padding:2px">A</td>
<td style="padding:2px">-</td> <td style="padding:2px">-</td>
<td style="padding:2px">U</td> <td style="padding:2px">U</td>
</tr> </tr>
<tr> <tr>
<td style="padding:2px">-</td> <td style="padding:2px">-</td>
<td style="padding:2px">I</td> <td style="padding:2px">I</td>
<td style="padding:2px">R</td> <td style="padding:2px">R</td>
<td style="padding:2px">O</td> <td style="padding:2px">O</td>
<td style="padding:2px">N</td> <td style="padding:2px">N</td>
</tr> </tr>
<tr> <tr>
<td style="padding:2px">-</td> <td style="padding:2px">-</td>
<td style="padding:2px">-</td> <td style="padding:2px">-</td>
<td style="padding:2px">N</td> <td style="padding:2px">N</td>
<td style="padding:2px">O</td> <td style="padding:2px">O</td>
<td style="padding:2px">-</td> <td style="padding:2px">-</td>
</tr> </tr>
</tbody></table> </tbody></table>
<Animation function visualisation> <Animation function visualisation>
%% Cell type:markdown id: tags: %% Cell type:markdown id: tags:
The font name and size preferences are supported. The font name and size preferences are supported.
%% Cell type:code id: tags: %% Cell type:code id: tags:
``` prob ``` prob
:pref TK_CUSTOM_STATE_VIEW_FONT_NAME=Arial TK_CUSTOM_STATE_VIEW_FONT_SIZE=18 :pref TK_CUSTOM_STATE_VIEW_FONT_NAME=Arial TK_CUSTOM_STATE_VIEW_FONT_SIZE=18
``` ```
%% Output %% Output
Preference changed: TK_CUSTOM_STATE_VIEW_FONT_SIZE = 18 Preference changed: TK_CUSTOM_STATE_VIEW_FONT_SIZE = 18
Preference changed: TK_CUSTOM_STATE_VIEW_FONT_NAME = Arial Preference changed: TK_CUSTOM_STATE_VIEW_FONT_NAME = Arial
%% Cell type:code id: tags: %% Cell type:code id: tags:
``` prob ``` prob
:show :show
``` ```
%% Output %% Output
<table style="font-family:"Arial" monospace;font-size:18px"><tbody> <table style="font-family:"Arial" monospace;font-size:18px"><tbody>
<tr> <tr>
<td style="padding:2px">S</td> <td style="padding:2px">S</td>
<td style="padding:2px">T</td> <td style="padding:2px">T</td>
<td style="padding:2px">E</td> <td style="padding:2px">E</td>
<td style="padding:2px">E</td> <td style="padding:2px">E</td>
<td style="padding:2px">R</td> <td style="padding:2px">R</td>
</tr> </tr>
<tr> <tr>
<td style="padding:2px">-</td> <td style="padding:2px">-</td>
<td style="padding:2px">-</td> <td style="padding:2px">-</td>
<td style="padding:2px">A</td> <td style="padding:2px">A</td>
<td style="padding:2px">-</td> <td style="padding:2px">-</td>
<td style="padding:2px">U</td> <td style="padding:2px">U</td>
</tr> </tr>
<tr> <tr>
<td style="padding:2px">-</td> <td style="padding:2px">-</td>
<td style="padding:2px">I</td> <td style="padding:2px">I</td>
<td style="padding:2px">R</td> <td style="padding:2px">R</td>
<td style="padding:2px">O</td> <td style="padding:2px">O</td>
<td style="padding:2px">N</td> <td style="padding:2px">N</td>
</tr> </tr>
<tr> <tr>
<td style="padding:2px">-</td> <td style="padding:2px">-</td>
<td style="padding:2px">-</td> <td style="padding:2px">-</td>
<td style="padding:2px">N</td> <td style="padding:2px">N</td>
<td style="padding:2px">O</td> <td style="padding:2px">O</td>
<td style="padding:2px">-</td> <td style="padding:2px">-</td>
</tr> </tr>
</tbody></table> </tbody></table>
<Animation function visualisation> <Animation function visualisation>
......
...@@ -57,7 +57,7 @@ public final class LoadCellCommand implements Command { ...@@ -57,7 +57,7 @@ public final class LoadCellCommand implements Command {
final Map<String, String> preferences = CommandUtils.parsePreferences(args); final Map<String, String> preferences = CommandUtils.parsePreferences(args);
this.animationSelector.changeCurrentAnimation(new Trace(this.classicalBFactory.create(body).load(preferences))); this.animationSelector.changeCurrentAnimation(new Trace(this.classicalBFactory.create(body).load(preferences)));
return new DisplayData("Loaded machine: " + this.animationSelector.getCurrentTrace().getModel()); return new DisplayData("Loaded machine: " + this.animationSelector.getCurrentTrace().getStateSpace().getMainComponent());
} }
@Override @Override
......
...@@ -73,7 +73,7 @@ public final class LoadFileCommand implements Command { ...@@ -73,7 +73,7 @@ public final class LoadFileCommand implements Command {
} catch (IOException | ModelTranslationError e) { } catch (IOException | ModelTranslationError e) {
throw new RuntimeException(e); throw new RuntimeException(e);
} }
return new DisplayData("Loaded machine: " + this.animationSelector.getCurrentTrace().getModel()); return new DisplayData("Loaded machine: " + this.animationSelector.getCurrentTrace().getStateSpace().getMainComponent());
} }
@Override @Override
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment