Determine the output of the following queries.
mystery2(L, [], []).
mystery2(L, [H|T], [H|M]) :- member(H, L), mystery2(L, T, M).
mystery2(L, [H|T], M) :- \+ member(H, L), mystery2(L, T, M).
mystery2([a, b], [], L).
mystery2([a, b], [], [a,b]).
mystery2([a, b], [a, b], L).
mystery2([a, b, c], [c, e, f], L).
mystery2([], [a,b], L).
In English, what does this rule do?
Already registered? Login
Not Account? Sign up
Enter your email address to reset your password
Back to Login? Click here