Don't like ads? PRO users don't see any ads ;-)
Guest

Untitled

By: a guest on Aug 30th, 2012  |  syntax: Prolog  |  size: 0.16 KB  |  hits: 29  |  expires: Never
download  |  raw  |  embed  |  report abuse  |  print
Text below is selected. Please press Ctrl+C to copy to your clipboard. (⌘+C on Mac)
  1. build_tree([X], T) :-
  2.         T = l(X).
  3. build_tree(L, T) :-
  4.         [First|Rest] = L,
  5.         build_tree(Rest, Tr),
  6.         T = b(l(First), Tr).
  7.  
  8. buildtree(T, L) :-
  9.         leaves(L, T).