domains
il = integer*
predicates
vd(il,integer,integer,il)
goal
vd([1,2,3,4,5,6],2,2,C),write(C).
clauses
vd([A|_],1,0,[A]):-!.
vd([A|X],1,K,[A|C]):-K1=K-1,!,vd(X,1,K1,C).