Question: 1. Write a Prolog program that returns the length of a list of numbers. For example: size([1, 2, 3, 4], len). then return len=4. 2.
1. Write a Prolog program that returns the length of a list of numbers. For example: size([1, 2, 3, 4], len). then return len=4. 2.
2. Write a Prolog program that reverses the given list. For example: reverse([a, b, c, d], X). then return X=[d, c, b, a].
Please do not copy answers from other chegg turors.
Step by Step Solution
There are 3 Steps involved in it
Get step-by-step solutions from verified subject matter experts
