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

Add missing :trace/:goto test notebook

parent a3c67017
Branches
Tags
No related merge requests found
%% Cell type:code id: tags:
``` prob
:help :trace
```
%% Output
```
:trace
```
Display all states and transitions in the current trace.
Each state has an index, which can be passed to the `:goto` command to go to that state.
The first state (index -1) is always the root state. All other states are reached from the root state by following (previously executed) transitions.
```
:trace
```
Display all states and transitions in the current trace.
Each state has an index, which can be passed to the `:goto` command to go to that state.
The first state (index -1) is always the root state. All other states are reached from the root state by following (previously executed) transitions.
%% Cell type:code id: tags:
``` prob
:help :goto
```
%% Output
```
:goto INDEX
```
Go to the state with the specified index in the current trace.
Use the `:trace` command to view the current trace and the indices of its states. Index -1 refers to the root state and is always available.
Going backwards in the current trace does *not* discard any parts of the trace, so it is possible to go forward again afterwards. However, executing an operation in a state *will* discard any parts of the trace after that state (and replace them with the destination state of the executed transition).
```
:goto INDEX
```
Go to the state with the specified index in the current trace.
Use the `:trace` command to view the current trace and the indices of its states. Index -1 refers to the root state and is always available.
Going backwards in the current trace does *not* discard any parts of the trace, so it is possible to go forward again afterwards. However, executing an operation in a state *will* discard any parts of the trace after that state (and replace them with the destination state of the executed transition).
%% Cell type:code id: tags:
``` prob
:trace
```
%% Output
* -1: Root state **(current)**
-1: Root state (current)
%% Cell type:code id: tags:
``` prob
:init
```
%% Output
Machine initialised using operation 0: $initialise_machine()
%% Cell type:code id: tags:
``` prob
:trace
```
%% Output
* -1: Root state
* 0: $initialise_machine **(current)**
-1: Root state
0: $initialise_machine (current)
%% Cell type:code id: tags:
``` prob
:goto -1
```
%% Output
Changed to state with index -1
%% Cell type:code id: tags:
``` prob
:trace
```
%% Output
* -1: Root state **(current)**
* 0: $initialise_machine
-1: Root state (current)
0: $initialise_machine
%% Cell type:markdown id: tags:
Indices out of bounds are not accepted.
%% Cell type:code id: tags:
``` prob
:goto -2
```
%% Output
:goto: Invalid trace index -2, must be in -1..0
%% Cell type:code id: tags:
``` prob
:goto 1
```
%% Output
:goto: Invalid trace index 1, must be in -1..0
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment