Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- %alinea 11
- produto_arvore(Elemento,Arvore):-
- findall(X,componente(Elemento,X,_),L),
- semiArvore(L,L1),not(L1==[]),append([Elemento|[L1]],[],Arvore),!;
- append([Elemento],[],Arvore),!.
- semiArvore([],[]).
- semiArvore([H|T],Arvore):-
- findall(X,componente(H,X,_),L), semiArvore(L,L1), not(L1==[]),
- semiArvore(T,L2), append([H|[L1]],L2,Arvore); semiArvore(T,L2), append([H],L2,Arvore).
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement