Question: Only Use Prolog syntax and semantics. (Use siwpl - SWI-Prolog) 2) Define the flatten ( X, Y ) relation that holds when Y is a
Only Use Prolog syntax and semantics. (Use siwpl - SWI-Prolog)

2) Define the flatten ( X, Y ) relation that holds when Y is a list structure that contains the same elements as X, in the same order, but as a list. For example: 2- flatten ( [a, b, [c , d]], Y). [ a, b, c, d] ?; false *?- flatten ( [a, [b],[[[c]]], X = [a,b,c,d,e] ? false [d,e]], X) . ?- flatten ([a, [b, [c] ], [a,b]). false
Step by Step Solution
There are 3 Steps involved in it
Get step-by-step solutions from verified subject matter experts
