Find centralized, trusted content and collaborate around the technologies you use most.
Teams
Q&A for work
Connect and share knowledge within a single location that is structured and easy to search.
hi(g,plus(A,B),int) :- hi(g,A,int),hi(g,B,int),!.
在上面的陈述中,'!'是什么意思?在声明的末尾签名吗?
这就是cut operator,它基本上说“如果我们到了这里,就不要回溯”。
因此,如果两个递归调用都成功,hi谓词将不会重试它们。
hi