Prolog 在解释器上显示结果 [英] Prolog showing results on the interpretator

查看:43
本文介绍了Prolog 在解释器上显示结果的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我有这个 prolog 谓词,它根据输入计数计算素数的数量.

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

但是在解释器上,即使我输入了所需的素数为 10,它也只显示前 9 个素数.

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

结果如下图

  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?

推荐答案

解释器会截断太长"的答案.

The interpreter truncates answers that are "too long".

在顶部添加:

set_prolog_flag(toplevel_print_options, [quoted(true)])

参见示例:http://garysieling.com/blog/printing-all-prolog-回答文件

这篇关于Prolog 在解释器上显示结果的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆