gpt4 book ai didi

prolog - Prolog 中的 % 符号是什么意思?

转载 作者:行者123 更新时间:2023-12-05 01:37:57 24 4
gpt4 key购买 nike

我认为这个 % 符号只是序言中的注释。我不确定。你能告诉我我是对的吗?例如,我见过这样的符号

%path(X,Y,[X,Y]):-
%next_to(X,Y).

有评论吗?

最佳答案

In Prolog, a percentage sign (%) means that the remaining characters on the line should be ignored. Source



There are two ways of commenting in a program. One method is to place the comments between the special brackets / * (open) and */ (closed). Anything placed between them is not treated by Prolog as part of the program definition. The brackets may be separated by any number of lines. Do remember, however, if using this format to include the closing bracket. The alternative is to use the percentage sign, %. In this case, everything after the sign to the end of the line is ignored.

%Prolog ignores everything after this sign
%but only up to the end of the line.

/* However, Prolog ignores everything after this
bracket until the closing bracket (which may
be some lines away). */

Excerpt from, An Introduction to Natural Language Processing Through Prolog, Clive Matthews



我认为简单的Google搜索应该适合您。

关于prolog - Prolog 中的 % 符号是什么意思?,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/50668708/

24 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com