Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Trace #336

Open
aiman-al-masoud opened this issue Dec 6, 2022 · 1 comment
Open

Trace #336

aiman-al-masoud opened this issue Dec 6, 2022 · 1 comment

Comments

@aiman-al-masoud
Copy link

I'm new to prolog in general so sorry if this is too obvious, or if it has been asked.

I was wondering if tau-prolog had something like swi-prolog's trace, which I can't find in the list of supported predicates.

I've read this other issue, but I need to do this automatically; so obtaining some sort of stack-trace, with indicated success/failure at each procedure call, would be ideal.

What do you suggest doing as an alternative?

@triska
Copy link

triska commented Dec 6, 2022

Prolog execution is usually too complex to follow in the form of traces, even more so if you consider various execution strategies such as SLG resolution.

As an alternative, consider thinking in terms of program fragments such as generalizations and failure slices. You obtain these fragments by ignoring various parts of your programs, such as generalizing away goals.

For instance, what is the most common question from Prolog beginners? A good candidate: "Why does the query unexpectedly fail?". Well, systematically remove goals, obtaining generalizations of the program. If the resulting fragment still fails, then there must be a mistake in that fragment.

Such fragments can be found automatically, and provide explanations for why something happens. This is much more interesting than tediously following low-level execution steps.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants