gpt4 book ai didi

prolog - 序言中没有标题的子句是什么意思?

转载 作者:行者123 更新时间:2023-12-04 17:23:51 26 4
gpt4 key购买 nike

在 Prolog 程序的开头,我看到:

:-dynamic(path/1).

这似乎是一个没有头的子句。这是什么意思?

最佳答案

当 Prolog 解释器看到 :-在加载程序时在子句前面,该子句会立即执行,而不是成为程序“数据库”的一部分。 :-最常见的用途在程序文件的末尾定义程序的起始谓词,以便使用程序加载文件使其运行。

具体来说,dynamic/1 informs the interpreter that the definition of the specified predicate may change at runtime .在阅读程序的其余部分之前,interpeter 需要知道这一点,以便它可以为 path/1 的使用做出特殊安排。谓词。

关于prolog - 序言中没有标题的子句是什么意思?,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/14168363/

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