11.9k views
5 votes
Assume that you have member/2 where member(X, Y) checks whether X is an element of a list Y. Complete the first clause of the following Prolog program subset/2 where subset(A, B) will establish a relationship of A being a subset of B. subset([X|R],S) :- ________ %% the body should be... subset([ ],_).

1 Answer

2 votes

Answer:

Refer below.

Step-by-step explanation:

Assume that you have member/2 where member(X, Y) checks whether X is an element of a list Y. Complete the first clause of the following Prolog program subset/2 where subset(A, B) will establish a relationship of A being a subset of B. subset([X|R],S) :- ________ %% the body should be... subset([ ],_).

subset([X|R],S) :-

subset([ ],_).

member(X,S), subset(R,S)

User Jim Soho
by
6.7k points