resultList(UsersQuery):- question(X,H), write(H), myintersection(H,UsersQuery,Match,TotalQuestionKeywords), Percent is Match/TotalQuestionKeywords*100,
Make a separate predicate for assertion that checks if fact is not yet asserted:
assertThisFact(Fact):- \+( Fact ),!, % \+ is a NOT operator. assert(Fact). assertThisFact(_).