Wednesday, February 21, 2024

prolog 1

 Permutation:



insert(X,L,[X|L]).


insert(X,[H|T],[H|U]) :-

  insert(X,T,U).




permute([],[]).


permute([H|T],L) :-

  permute(T,U),

  insert(H,U,L).

No comments:

Post a Comment