Hi, sorry for the many posts, but I have lots of programms to solve... Now I have to solve a programm with two lists, that have at least one mutual element. I tried this without using append, but it's wrong. Can anyone help me? Thanks in advance. Here's my programm:
mutual_element([Head1|_],[Head1, _]).
mutual_element(A, [Head2|B]) :- Head1\=Head2, common_list([Head1|A], B).
mutual_element([Head1|_],[Head1, _]).
mutual_element(A, [Head2|B]) :- Head1\=Head2, common_list([Head1|A], B).