Prolog showing results on the interpretator [duplicate]

二次信任 提交于 2019-12-13 04:25:19

问题


I have this prolog predicate that computes the number of primes depending on the input count.

However on the interpretator, it only shows the first 9 primes even though I input my required prime count as 10.

the result looks like this as below

  L = [2, 3, 5, 7, 11, 13, 17, 19, 23|...] 

However, when I trace through using the graphical debugger, the correct results are actually churned out.

So I am wondering what does the | ... means?


回答1:


The interpreter truncates answers that are "too long".

Add this at the top:

set_prolog_flag(toplevel_print_options, [quoted(true)])

See example of this: http://garysieling.com/blog/printing-all-prolog-answers-to-a-file



来源:https://stackoverflow.com/questions/12427082/prolog-showing-results-on-the-interpretator

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!