i have some facts.I want to make a list of members of this facts and show these members by function.but i don't know how to do it. i try this code :
hasDiabet(mina). hasvitaminD(milk). hasvitaminD(eggs). addto(X,L,[X|L]). hasvitamin(L):-hasvitaminD(x),addto(X,L,L),hasvitamin(L). eat(Y,X):-hasvitaminD(X).
here i want to make a list of thing that hasvitaminD -> milk and egg. and show this when i write something like eat(mina,X). but when i test my code the output is milk. help please
thanks in advance