我有一个问题,需要有人纠正我:
store(wyoming, [evan, sandra], [storybook, fiction, general]).
store(brooklyn, [haas, maria], [fiction, schoolbook, religion]).
store(oakland, [rich, walker, dina, vince], [storybook, schoolbook, fiction]).
如果我咨询?-locations(storybook).
答案必须返回真,因为故事书在不止一家商店有售。我这样写我的谓词:
locations(Book) :- store(_, [_], [Books]), member(Book, Books).
当我咨询时,无论我输入什么类型的书,我都会返回false。如何解决这个问题?