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.
我正在针对图形节点运行数据记录规则,clingo检查jupyter notebook共享相同直接祖先的节点,如下所示:
clingo
jupyter notebook
ancestor(A,B). ancestor(A,C). sibs(X,Y) = ancestor(Z,X), ancestor(Z,Y), X!=Y.
这给了我2个对称对,即
sibs(B,C) sibs(C,B)
如何将同胞的生成限制为只有这两个结果中的一个?
设法追踪问题。为确保您不返回两个结果,请更改此:
sibs(X,Y) = ancestor(Z,X), ancestor(Z,Y), X!=Y.
对此:
sibs(X,Y) = ancestor(Z,X), ancestor(Z,Y), X<Y.