相关疑难解决方法(0)

Einsteins Riddle Prolog

我的AI课程需要一些prolog作业的帮助.问题是要为爱因斯坦的谜题编写序言代码.我知道如何把它写下来,但是在作业中有一些限制.

 there are 5 houses
 the Englishman lives in the red house
 the Spaniard owns the dog
 coffee is drunk in the green house
 the Ukrainian drinks tea
 the green house is immediately to the right of the ivory house
 the Old Gold smoker owns snails
 Kools are smoked in the yellow house
 milk is drunk in the middle house
 the Norwegian lives in the first house
 the man who smokes Chesterelds lives in the house next to the man …
Run Code Online (Sandbox Code Playgroud)

logic artificial-intelligence prolog zebra-puzzle

14
推荐指数
2
解决办法
1万
查看次数

gprolog:在异常后获取堆栈跟踪

使用gprolog时,我经常会遇到没有任何类型的行号或上下文的异常:

uncaught exception: error(instantiation_error,(is)/2)
Run Code Online (Sandbox Code Playgroud)

没有任何背景.我知道我可以做一个trace但是调试它需要很长时间,trace因为我需要在到达发生错误的地方之前执行很多事情.

有关如何进行此堆栈跟踪的任何想法?还是一个动态trace/ notrace

编辑:或者只是自动化整个trace输出的打印.

debugging prolog gnu-prolog

9
推荐指数
2
解决办法
866
查看次数