Q 9. Using append/3, write a Prolog query that receives a list, a start index, and a length, and returns the sublist of
Posted: Mon Jun 06, 2022 12:11 pm
Q 9. Using append/3, write a Prolog query that receives a list, a start index, and a length, and returns the sublist of the list. Use zero-based indexing. Examples are given in the following: ?- sublist([1, 2, 3, 4], 1, 2, 0) 0 = [2, 3]. ?- sublist([1, 2, 3, 4], 0, 0, 0) 0 = [] ?- sublist([1, 2, 3, 4], 0, 10, 0) false