Prolog 代码 - 不知道它是做什么的
我想知道这段代码的作用:
:- set_prolog_flag(toplevel_print_options,
[quoted(true), portray(true), attributes(portray), max_depth(100)]).
我在我的教授在他的网站上发布的一些示例代码中看到了它,但我不知道它的作用。提前感谢您的帮助。
I was wondering what this code does:
:- set_prolog_flag(toplevel_print_options,
[quoted(true), portray(true), attributes(portray), max_depth(100)]).
I have seen it in some of the sample codes my prof has posted on his website but I have no clue what it does. Thanks for your help in advance.
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(1)
我相信这可能与使程序输出更加格式化(从而更具可读性或可访问性)有关。
请参阅这篇文章:"帮助...Prolog 写入 [x, y, z|...],我想要整个答案"。
基本上,在代码设置的情况下......看起来代码只是设置一些输出格式。
max_depth
设置意味着任何嵌套超过(在您的情况下为 100)层的内容都将被写入...
。其余选项仅启用正常输出。I believe it might have something to do with making program output more formatted (and thus, more readable or accessible.)
See this article: "Help... Prolog writes [x, y, z|...], I want the whole answer".
Basically, in the case of your code's settings... it looks like the code is just setting some formatting for output. The
max_depth
setting means that anything that is nested more than (100, in your case,) levels will then be written as...
. The rest of the options just enable normal output.