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.
我是 clgo 的初学者,我一生都无法弄清楚如何获得给定原子的最大值。 例如
x(1..9). x_max(X) :- x(X), x(Y), X>Y.
在这种情况下,我希望得到的结果是x_max(9).
x_max(9)
试试这个:
max_x(X) :- x(X), #max {XX,1:x(XX)} = X.