"evalue": ":eval: NOT-WELL-DEFINED: \n### Exception occurred while calling external function: 'REGEX_SEARCH':regex_exception('One of *?+{ was not preceded by a valid regular expression.')\n ### File: /Users/Shared/Uni/SHK/ProB2/prob_prolog/stdlib/LibraryRegex.def\n ### Line: 28, Column: 1 until 88\n ### within: DEFINITION call of REGEX_SEARCH at Line: 1 Column: 0 until Line: 1 Column: 54\n\n",
"evalue": ":eval: UNKNOWN: \n### Exception occurred while calling external function: 'REGEX_SEARCH':regex_exception('One of *?+{ was not preceded by a valid regular expression.')\n ### File: /Users/Shared/Uni/SHK/ProB2/prob_prolog/stdlib/LibraryRegex.def\n ### Line: 34, Column: 1 until 88\n ### within: DEFINITION call of REGEX_SEARCH at Line: 1 Column: 0 until Line: 1 Column: 54\n\n",
"\u001b[1m\u001b[31m### Exception occurred while calling external function: 'REGEX_SEARCH':regex_exception('One of *?+{ was not preceded by a valid regular expression.')\u001b[0m",
"Machine constants set up using operation 0: $setup_constants()"
"Executed operation: SETUP_CONSTANTS()"
]
},
"execution_count": 2,
...
...
@@ -85,7 +85,7 @@
{
"data": {
"text/plain": [
"Machine initialised using operation 1: $initialise_machine()"
"Executed operation: INITIALISATION()"
]
},
"execution_count": 3,
...
...
@@ -1067,13 +1067,6 @@
"source": [
":show"
]
},
{
"cell_type": "code",
"execution_count": null,
"metadata": {},
"outputs": [],
"source": []
}
],
"metadata": {
...
...
%% Cell type:markdown id: tags:
## N-Queens Puzzle
The N-Queens is a famous constraint solving benchmark puzzle.
It is a generalisation of the original eight queens puzzle, where the goal is to place eight queens on a 8*8 chessboard so that no two queens attach each other.
We now write a B machine with constants
* n: the size of the chess board
* queens: a partial function from 1..n to 1..n, stating in which row the queen on any given column is placed