- Q 9 Using Append 3 Write A Prolog Query That Receives A List A Start Index And A Length And Returns The Sublist Of 1 (32.03 KiB) Viewed 32 times
Q 9. Using append/3, write a Prolog query that receives a list, a start index, and a length, and returns the sublist of
-
- Site Admin
- Posts: 899603
- Joined: Mon Aug 02, 2021 8:13 am
Q 9. Using append/3, write a Prolog query that receives a list, a start index, and a length, and returns the sublist of
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