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.
クエリをリストに展開する方法は?
f(a,b). f(a,c). d(a.d). expand(f(a,X), Out) -----> Out=[b,c,d]
bagof/3 または setof/3 を使用します。例えば:
?- bagof(X, (X = 1; X = 2), L)。
L = [1,2]
はい
あなたの場合、それは
?- bagof(X, f(a,X), Out)。