Advertisement
Guest User

List

a guest
Jun 25th, 2017
62
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.40 KB | None | 0 0
  1.  
  2. potenz_menge([], [[]]).
  3. potenz_menge([X|Xs],L):-potenz_menge(Xs,L1),
  4. mischung(X,L1,L2),
  5. append(L2,L1,L).
  6.  
  7. mischung(_,[],[]).
  8. mischung(X,[Y|Ys],[Z|Zs]):-append([X],Y,Z),
  9. mischung(X,Ys,Zs).
  10.  
  11. naive_sort(List,Sorted):-perm(List,Sorted),is_sorted(Sorted).
  12.  
  13. is_sorted([]).
  14. is_sorted([_]).
  15. is_sorted([X,Y|T]):-X=<Y,is_sorted([Y|T]).
  16.  
  17. zip([],[],[]).
  18. zip([Xs],[Ys],[L,X,Y]):-zip([X|Xs],[Y|Ys],L).
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement