如何使用一系列事实限制 Prolog 中参数的值?

How to restrict values of an argument in Prolog using a series of facts?

我想将查询 property(X, use, Y) 限制为列表 [a,b,c]Y 的值。 c/1 仅适用于 Y 的那些值。 我认为下面的方法会起作用,但它不起作用。

c(a).
c(b).
c(c). 

property(X, use, Y).
c(Y).

以下语句仅产生 false

     person(1).
     property(1, use, _).

我正在使用 Problog,但我在这里没有使用任何 Problog 函数,所以我想我对统一有一些误解。

我认为 c(Y) 会生成列表,Y 会统一所有事实。

更新 这似乎是一个特定于 Problog 的问题,如下所示。

substance(methadone). 
substance(heroin).

P::property(X,use,nicotine) :-  %doesn't work
    property(X,use,Z),
    substance(Z),
    P is 0.8.

property(X,use,nicotine) :-  %works
    property(X,use,Z),
    substance(Z).

person(1).
substance(Y).
property(1, use, Y).

你可以这样写:

property(_X, use, Y) :-
    c(Y).