4 ms·
most people don't know how to debug prolog because they never got taught her. it has debugging facilities, even GUI debuggers. http://www.swi-prolog.org/pldoc
by segmondy 7y ago
most people don't know how to debug prolog because they never got taught her. it has debugging facilities, even GUI debuggers.
http://www.swi-prolog.org/pldoc/man?section=debugger http://www.swi-prolog.org/pldoc/man?section=debugger
here's an example of a trace from a CLI section.
[trace] ?- animal(X).
Call: (7) animal(_G1588) ? creep
Call: (8) is_true('has fur') ? creep
^ Call: (9) format("~w?\n", ['has fur']) ? creep
has fur?
^ Exit: (9) format("~w?\n", ['has fur']) ? creep
Call: (9) read(yes) ? creep
|:
Most don't understand the standard 4-port prolog (call, exit, redo, and fail.) making it hard to grok what's going on.
http://www.swi-prolog.org/pldoc/doc_for?object=section(2,%272.9%27,swi(%27/doc/Manual/debugoverview.html%27) http://www.swi-prolog.org/pldoc/doc_for?object=section(2,%27...)
- YeGoblynQueenne 7y agoThat's not the fault of the language though. If you get taught, say, C# and you 're never taught how to debug it you'd have the same problem. The four-port debugger takes some explaining, but it's not the end of the world. It's actually a very conceptually simple way to understand Prolog's execution model. It's a shame that it's not taught more often.