Question: In PROLOG, Make a binary predicate eo, short for every other, which removes every other element from an input list, starting with the first. Eg
In PROLOG, Make a binary predicate eo, short for every other, which removes every other element from an input list, starting with the first. Eg ?- eo([a,b,c,d,e,f],L). L = [b,d,f] The empty list should of course be unchanged. This predicate should be 'shallow'.
Then, make a predicate eo2, which will be a 'deep' version of eo above.
Step by Step Solution
There are 3 Steps involved in it
Get step-by-step solutions from verified subject matter experts
