Advertisement
Guest User

Untitled

a guest
Sep 26th, 2019
106
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
Prolog 0.20 KB | None | 0 0
  1. combs([H|_],[H]). % Simple case of one element comb
  2. combs([_|T],T2) :- % Combinations of the tail w/o head
  3.     combs(T,T2).
  4. combs([H|T],[H|T2]) :- % Combinations of the tail including head
  5.     combs(T,T2).
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement