From 833d9579b0d407d41d33e7df0b37448ade29cba8 Mon Sep 17 00:00:00 2001 From: Michael Leuschel <leuschel@uni-duesseldorf.de> Date: Tue, 15 Nov 2022 14:26:52 +0100 Subject: [PATCH] add trace output Signed-off-by: Michael Leuschel <leuschel@uni-duesseldorf.de> --- logic_programming/5_SLD.ipynb | 22 ++++++++++++++++++++++ 1 file changed, 22 insertions(+) diff --git a/logic_programming/5_SLD.ipynb b/logic_programming/5_SLD.ipynb index a5fa19f..42e2e28 100644 --- a/logic_programming/5_SLD.ipynb +++ b/logic_programming/5_SLD.ipynb @@ -547,6 +547,28 @@ "?- program(2,_,Clauses), trace_prove(p,Clauses)." ] }, + { + "cell_type": "markdown", + "id": "b59dd776", + "metadata": {}, + "source": [ + "When you step through the corresponding Prolog program using the Prolog debugger you will get an output like this one (after declaring t/0 as dynamic to avoid error messages):\n", + "```\n", + "| ?- p.\n", + " 1 1 Call: p ? \n", + " 2 2 Call: q ? \n", + " 3 3 Call: t ? \n", + " 3 3 Fail: t ? \n", + " 4 3 Call: s ? \n", + " 4 3 Exit: s ? \n", + " 2 2 Exit: q ? \n", + " 5 2 Call: r ? \n", + " 5 2 Exit: r ? \n", + " 1 1 Exit: p ? \n", + "yes\n", + "```" + ] + }, { "cell_type": "markdown", "id": "b4b28da4", -- GitLab