resultList(UsersQuery):-
question(X,H),
write(H),
myintersection(H,UsersQuery,Match,TotalQuestionKeywords),
Percent is Match/TotalQuestionKeywords*100,
write('Question: '),
write(X),nl,write('Quality: '), write(Percent),write('%'),nl,
/* please look at this part
Percent>=50,
assert(listofQuestions(Percent,Question)),
write(Percent),write(Question),nl,
fail.
resultList(_).
我想填充一个名为“listofQuestions”的事实数据库。一切正常,但我断言的东西留在内存中。所以,如果我再次运行我的程序,我会在“问题列表”中添加相同的事实。
我只想拥有一组数据。
谢谢