Toggle navigation
?
users online
Logout
Open hangout
Open chat for current file
% basics([a, abc, def, aaa]). %candidate(aaaabcaaadef). % -------------------------------------- % compose( Atom, Subatoms, Composition ) % -------------------------------------- compose( '' , _ , [] ) . % the empty set composes the empty atom compose( Atom , Subatoms , [A|As] ) :- % otherwise... member(A,Subatoms) , % - fish a letter out of our alphabet sub_atom(Atom,0,L,P,A) , % - see if its a prefix of our candidate sub_atom(Atom,L,P,_,Nextatom) , % - get the next atom (the suffix) compose(Nextatom, Subatoms,As) % - and recurse down . % Easy!