"Machine constants set up using operation 0: $setup_constants()"
]
},
"execution_count": 14,
"metadata": {},
"output_type": "execute_result"
}
],
"source": [
":constants"
]
},
{
"cell_type": "markdown",
"metadata": {},
"source": [
"The above machine also contains particular instantiations of the above sets and relations, which will be used in the exercises below."
]
},
{
"cell_type": "markdown",
"metadata": {},
"source": [
"## Exercise 1\n",
"Write a B expression to compute the set of clients that have ordered article a5. Use the ```:let sol1 EXPRESSION``` in the cell below."
]
},
{
"cell_type": "code",
"execution_count": 16,
"metadata": {},
"outputs": [
{
"data": {
"text/markdown": [
"$\\{\\mathit{c1},\\mathit{c2}\\}$"
],
"text/plain": [
"{c1,c2}"
]
},
"execution_count": 16,
"metadata": {},
"output_type": "execute_result"
}
],
"source": [
":let sol1 {c| a5 : union(orders[{c}])}"
]
},
{
"cell_type": "code",
"execution_count": 20,
"metadata": {},
"outputs": [
{
"ename": "CommandExecutionException",
"evalue": ":assert: Error while evaluating assertion: Computation not completed: Could not infer type of T,Could not infer type of sol1",
"output_type": "error",
"traceback": [
"\u001b[1m\u001b[31m:assert: Error while evaluating assertion: Computation not completed: Could not infer type of T,Could not infer type of sol1\u001b[0m"