公告
财富商城
积分规则
提问
发文
2019-08-18 02:12发布
forever°为你锁心
How to expand a query into a list?
f(a,b). f(a,c). d(a.d). expand(f(a,X), Out) -----> Out=[b,c,d]
Use bagof/3 or setof/3. E.g.:
?- bagof(X, (X = 1; X = 2), L).
L = [1,2]
yes
In your case that would be
?- bagof(X, f(a,X), Out).
最多设置5个标签!
Use bagof/3 or setof/3. E.g.:
?- bagof(X, (X = 1; X = 2), L).
L = [1,2]
yes
In your case that would be
?- bagof(X, f(a,X), Out).