Q 9. Using append/3, write a Prolog query that receives a list, a start index, and a length, and returns the sublist of
-
answerhappygod
- Site Admin
- Posts: 899604
- 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
Join a community of subject matter experts. Register for FREE to view solutions, replies, and use search function. Request answer by replying!