name = 'sins/3' slug = 'insert an element at correct position into a sorted list' description = '''\
sins(X, SortedList, NewList)
: the list NewList
is obtained by inserting X
into SortedList
at the correct position to preserve the non-decreasing order of elements.
?- sins(4, [1,2,3,5], L). L = [1,2,3,4,5]. ?- sins(3, [1,2,3,4], L). L = [1,2,3,3,4].''' hint = {}