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.
如果我有以下关系:
? friend(tom, X). X = jim ; X = tom ; X = joe ; X = bob ; false.
我怎样才能把输出变成:
X = [jim, tom, joe, bob].
我想到了; 我已经用作bagof解决方案谓词的一部分,如下所示:
bagof
bagof(X, friend(tom, X), Xs).