Question: Write a swi prolog definition for unecho. if parameters are marked with + your definition must always terminate if the agrument contains no variables. if
Write a swi prolog definition for unecho. if parameters are marked with + your definition must always terminate if the agrument contains no variables. if the paremters is ? you must produce results if the argument is a term or a variable.
unecho(+L1, ?L2) True if L1 and L2 are lists, and any consecutive repetitions in L1 are single elements in L2. ?- unecho([1,2,2,3], [1,2,3]). true. ?- unecho([1,2,2,3], X). X = [1,2,3].
Step by Step Solution
There are 3 Steps involved in it
1 Expert Approved Answer
Step: 1 Unlock
Question Has Been Solved by an Expert!
Get step-by-step solutions from verified subject matter experts
Step: 2 Unlock
Step: 3 Unlock
