Prolog showing results on the interpretator [dupli

2019-08-30 03:00发布

This question already has an answer here:

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条回答
干净又极端
2楼-- · 2019-08-30 03:49

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

查看更多
登录 后发表回答