
Some parts of this message have been removed.
Learn more about Nabble's
security policy.
Are you aware of SWI's builtin graphical debugger? It does at least some of what you are working on, and is definitely less obtuse than the text mode debugger.
Alan Baljeu
From: Huayi Huang <minihuang2004@...>
To: swi-prolog@...
Sent: Sunday, September 20, 2009 10:25:14 AM
Subject: [SWIPL] Prolog Metainterpreter
(OOPS, SORRY THIS HAS THE ATTACHMENT...)
Hi Everyone,
This is my first post on this mailing-list. Nice to
meet you all! I was just wondering whether someone could point me in
the right direction for a Prolog problem I'm struggling with at the
moment.
The situation is thus. I am currently starting to
develop a Prolog metainterpreter as part of a university project to
produce a Prolog teaching aid for new learners of Prolog, somewhat in
the form of a better, more visual and user-friendly debugger (as
opposed to the rather obtuse default text-based one). I have attached
a first try at a basic interpreter. However, there is a few quite
important issues I would like to solve. Firstly, there is a big
problem with examining system-defined predicates, as it seems that we
have to declare any predicate which we use 'clause/3' on as dynamic
before we can examine it, and the interpreter refuses to call clause on
any system-defined ones. Is there a way to get round this problem (in
order to have a more general interpreter which can work with any
predicate)? Or is it just something I'll have to live with? Secondly,
the way the system is envisioned to work at the moment is very much by
first calling the Prolog proof ( via using prove(... goal ...)
predicate ) and producing some information (such as the recursive call
trace and success/fail information in the current version), and then
after the first pass examining the results and using the data to
produce further illuminating information about the predicate being
proved in a suitable form. However, this process can only be
forward-moving (though using the information I can create something
which allows stepping backwards/forwards through the proof, as a
seperate process) . I'd like to know whether it is actually possible
to step 'back-up' (ie. undo) a proof step in real time as part of the
actual Prolog system, or whether we can move only in a forward
direction?
And
thirdly, what are 'frames', and what are they used for? Is this
something I could be using to obtain hooks into the Prolog proof
process? If so could someone point me to a tutorial or something to
enable me to understand better about them (as from reading just the API
description I didn't really get what was going on with these and how to
use them).
Many Thanks in advance!
Huayi Huang |
Ask a question on any topic and get answers from real people.
Go to Yahoo! Answers.