name = 'dup/2' slug = 'duplicate the elements of a list' description = '''\
dup(L1, L2): the list L2 is obtained from L1 by duplicating every element.
dup(L1, L2)
L2
L1
?- dup([1,2], X). X = [1,1,2,2]. ?- dup([1,2,3], X). X = [1,1,2,2,3,3].