"Check the machine's properties, invariant, or assertions in the current state.\n",
"\n",
"The properties/invariant/assertions are checked and displayed in table form. Each row corresponds to a part of the properties/invariant conjunction, or to an assertion."
],
"text/plain": [
":check WHAT\n",
"Check the machine's properties, invariant, or assertions in the current state.\n",
"\n",
"The properties/invariant/assertions are checked and displayed in table form. Each row corresponds to a part of the properties/invariant conjunction, or to an assertion."
]
},
"execution_count": 1,
"metadata": {},
"output_type": "execute_result"
}
],
"source": [
":help :check"
]
},
{
"cell_type": "markdown",
"id": "69f51548",
"metadata": {},
"source": [
"`:check` works for classical B machines."
]
},
{
"cell_type": "code",
"execution_count": 2,
"id": "daa741b3",
"metadata": {},
"outputs": [
{
"data": {
"text/plain": [
"Loaded machine: CheckTest"
]
},
"execution_count": 2,
"metadata": {},
"output_type": "execute_result"
}
],
"source": [
"MACHINE CheckTest\n",
"CONSTANTS x, y\n",
"PROPERTIES x : {1, 2} & y : {3, 4}\n",
"VARIABLES a, b\n",
"INVARIANT a : 0..x & b : 1..y\n",
"INITIALISATION a := x; b := y\n",
"ASSERTIONS a <= x; b <= y\n",
"END"
]
},
{
"cell_type": "code",
"execution_count": 3,
"id": "0f0f8bc9",
"metadata": {},
"outputs": [
{
"data": {
"text/plain": [
"Executed operation: SETUP_CONSTANTS()"
]
},
"execution_count": 3,
"metadata": {},
"output_type": "execute_result"
}
],
"source": [
":constants"
]
},
{
"cell_type": "code",
"execution_count": 4,
"id": "ca180263",
"metadata": {},
"outputs": [
{
"data": {
"text/plain": [
"Executed operation: INITIALISATION()"
]
},
"execution_count": 4,
"metadata": {},
"output_type": "execute_result"
}
],
"source": [
":init"
]
},
{
"cell_type": "code",
"execution_count": 5,
"id": "a4901fab",
"metadata": {},
"outputs": [
{
"data": {
"text/markdown": [
"|Predicate|Value|\n",
"|---|---|\n",
"|x∈{1,2}|TRUE|\n",
"|y∈{3,4}|TRUE|"
],
"text/plain": [
"x:{1,2} = TRUE\n",
"y:{3,4} = TRUE"
]
},
"execution_count": 5,
"metadata": {},
"output_type": "execute_result"
}
],
"source": [
":check properties"
]
},
{
"cell_type": "code",
"execution_count": 6,
"id": "62fe69ce",
"metadata": {},
"outputs": [
{
"data": {
"text/markdown": [
"|Predicate|Value|\n",
"|---|---|\n",
"|a∈0‥x|TRUE|\n",
"|b∈1‥y|TRUE|"
],
"text/plain": [
"a:0..x = TRUE\n",
"b:1..y = TRUE"
]
},
"execution_count": 6,
"metadata": {},
"output_type": "execute_result"
}
],
"source": [
":check invariant"
]
},
{
"cell_type": "code",
"execution_count": 7,
"id": "d2054303",
"metadata": {},
"outputs": [
{
"data": {
"text/markdown": [
"|Predicate|Value|\n",
"|---|---|\n",
"|a≤x|TRUE|\n",
"|b≤y|TRUE|"
],
"text/plain": [
"a<=x = TRUE\n",
"b<=y = TRUE"
]
},
"execution_count": 7,
"metadata": {},
"output_type": "execute_result"
}
],
"source": [
":check assertions"
]
},
{
"cell_type": "markdown",
"id": "72e11ab6",
"metadata": {},
"source": [
"TODO: Test for Event-B"
]
}
],
"metadata": {
"kernelspec": {
"display_name": "ProB 2",
"language": "prob",
"name": "prob2"
},
"language_info": {
"codemirror_mode": "prob2_jupyter_repl",
"file_extension": ".prob",
"mimetype": "text/x-prob2-jupyter-repl",
"name": "prob"
}
},
"nbformat": 4,
"nbformat_minor": 5
}
%% Cell type:code id:36c2fbc3 tags:
``` prob
:help :check
```
%%%% Output: execute_result
```
:check WHAT
```
Check the machine's properties, invariant, or assertions in the current state.
The properties/invariant/assertions are checked and displayed in table form. Each row corresponds to a part of the properties/invariant conjunction, or to an assertion.
:check WHAT
Check the machine's properties, invariant, or assertions in the current state.
The properties/invariant/assertions are checked and displayed in table form. Each row corresponds to a part of the properties/invariant conjunction, or to an assertion.