To delete a element from a list the position and the element list is passed to the predicate delete. Then the delete predicate continuously breaks the list into head (H) and Tail (T) to find that the correct position is reached. On reaching the appropriate position to delete the element the predicate slices the head off the list and finally merges the remaining art with the rest. The prolog code is given as below:
int_list = integer*
del(integer, int_list, int_list)
P1 = P - 1, del(P1,T,Z).