fork(1) download
  1. flatten([X|Xs] ,Ys) :-
  2. flatten(X,Ys1), flatten(Xs,Ys2), append(Ys1,Ys2,Ys).
  3. flatten(X,[X]) :- atomic(X).
  4. flatten([],[]).
  5.  
  6. :- flatten([[1,2],[3,4],[5,[6,7]],[],[[],8]], X), write(X), nl, fail.
  7.  
Success #stdin #stdout #stderr 0.04s 7872KB
stdin
Standard input is empty
stdout
[1,2,[],3,4,[],5,6,7,[],[],[],[],8,[],[]]
[1,2,[],3,4,[],5,6,7,[],[],[],[],8,[]]
[1,2,[],3,4,[],5,6,7,[],[],[],[],8,[]]
[1,2,[],3,4,[],5,6,7,[],[],[],[],8]
[1,2,[],3,4,[],5,6,7,[],[],[],8,[],[]]
[1,2,[],3,4,[],5,6,7,[],[],[],8,[]]
[1,2,[],3,4,[],5,6,7,[],[],[],8,[]]
[1,2,[],3,4,[],5,6,7,[],[],[],8]
[1,2,[],3,4,[],5,6,7,[],[],[],8,[],[]]
[1,2,[],3,4,[],5,6,7,[],[],[],8,[]]
[1,2,[],3,4,[],5,6,7,[],[],[],8,[]]
[1,2,[],3,4,[],5,6,7,[],[],[],8]
[1,2,[],3,4,[],5,6,7,[],[],8,[],[]]
[1,2,[],3,4,[],5,6,7,[],[],8,[]]
[1,2,[],3,4,[],5,6,7,[],[],8,[]]
[1,2,[],3,4,[],5,6,7,[],[],8]
[1,2,[],3,4,[],5,6,7,[],[],[],8,[],[]]
[1,2,[],3,4,[],5,6,7,[],[],[],8,[]]
[1,2,[],3,4,[],5,6,7,[],[],[],8,[]]
[1,2,[],3,4,[],5,6,7,[],[],[],8]
[1,2,[],3,4,[],5,6,7,[],[],8,[],[]]
[1,2,[],3,4,[],5,6,7,[],[],8,[]]
[1,2,[],3,4,[],5,6,7,[],[],8,[]]
[1,2,[],3,4,[],5,6,7,[],[],8]
[1,2,[],3,4,[],5,6,7,[],[],8,[],[]]
[1,2,[],3,4,[],5,6,7,[],[],8,[]]
[1,2,[],3,4,[],5,6,7,[],[],8,[]]
[1,2,[],3,4,[],5,6,7,[],[],8]
[1,2,[],3,4,[],5,6,7,[],8,[],[]]
[1,2,[],3,4,[],5,6,7,[],8,[]]
[1,2,[],3,4,[],5,6,7,[],8,[]]
[1,2,[],3,4,[],5,6,7,[],8]
[1,2,[],3,4,[],5,6,7,[],[],[],8,[],[]]
[1,2,[],3,4,[],5,6,7,[],[],[],8,[]]
[1,2,[],3,4,[],5,6,7,[],[],[],8,[]]
[1,2,[],3,4,[],5,6,7,[],[],[],8]
[1,2,[],3,4,[],5,6,7,[],[],8,[],[]]
[1,2,[],3,4,[],5,6,7,[],[],8,[]]
[1,2,[],3,4,[],5,6,7,[],[],8,[]]
[1,2,[],3,4,[],5,6,7,[],[],8]
[1,2,[],3,4,[],5,6,7,[],[],8,[],[]]
[1,2,[],3,4,[],5,6,7,[],[],8,[]]
[1,2,[],3,4,[],5,6,7,[],[],8,[]]
[1,2,[],3,4,[],5,6,7,[],[],8]
[1,2,[],3,4,[],5,6,7,[],8,[],[]]
[1,2,[],3,4,[],5,6,7,[],8,[]]
[1,2,[],3,4,[],5,6,7,[],8,[]]
[1,2,[],3,4,[],5,6,7,[],8]
[1,2,[],3,4,[],5,6,7,[],[],8,[],[]]
[1,2,[],3,4,[],5,6,7,[],[],8,[]]
[1,2,[],3,4,[],5,6,7,[],[],8,[]]
[1,2,[],3,4,[],5,6,7,[],[],8]
[1,2,[],3,4,[],5,6,7,[],8,[],[]]
[1,2,[],3,4,[],5,6,7,[],8,[]]
[1,2,[],3,4,[],5,6,7,[],8,[]]
[1,2,[],3,4,[],5,6,7,[],8]
[1,2,[],3,4,[],5,6,7,[],8,[],[]]
[1,2,[],3,4,[],5,6,7,[],8,[]]
[1,2,[],3,4,[],5,6,7,[],8,[]]
[1,2,[],3,4,[],5,6,7,[],8]
[1,2,[],3,4,[],5,6,7,8,[],[]]
[1,2,[],3,4,[],5,6,7,8,[]]
[1,2,[],3,4,[],5,6,7,8,[]]
[1,2,[],3,4,[],5,6,7,8]
[1,2,[],3,4,5,6,7,[],[],[],[],8,[],[]]
[1,2,[],3,4,5,6,7,[],[],[],[],8,[]]
[1,2,[],3,4,5,6,7,[],[],[],[],8,[]]
[1,2,[],3,4,5,6,7,[],[],[],[],8]
[1,2,[],3,4,5,6,7,[],[],[],8,[],[]]
[1,2,[],3,4,5,6,7,[],[],[],8,[]]
[1,2,[],3,4,5,6,7,[],[],[],8,[]]
[1,2,[],3,4,5,6,7,[],[],[],8]
[1,2,[],3,4,5,6,7,[],[],[],8,[],[]]
[1,2,[],3,4,5,6,7,[],[],[],8,[]]
[1,2,[],3,4,5,6,7,[],[],[],8,[]]
[1,2,[],3,4,5,6,7,[],[],[],8]
[1,2,[],3,4,5,6,7,[],[],8,[],[]]
[1,2,[],3,4,5,6,7,[],[],8,[]]
[1,2,[],3,4,5,6,7,[],[],8,[]]
[1,2,[],3,4,5,6,7,[],[],8]
[1,2,[],3,4,5,6,7,[],[],[],8,[],[]]
[1,2,[],3,4,5,6,7,[],[],[],8,[]]
[1,2,[],3,4,5,6,7,[],[],[],8,[]]
[1,2,[],3,4,5,6,7,[],[],[],8]
[1,2,[],3,4,5,6,7,[],[],8,[],[]]
[1,2,[],3,4,5,6,7,[],[],8,[]]
[1,2,[],3,4,5,6,7,[],[],8,[]]
[1,2,[],3,4,5,6,7,[],[],8]
[1,2,[],3,4,5,6,7,[],[],8,[],[]]
[1,2,[],3,4,5,6,7,[],[],8,[]]
[1,2,[],3,4,5,6,7,[],[],8,[]]
[1,2,[],3,4,5,6,7,[],[],8]
[1,2,[],3,4,5,6,7,[],8,[],[]]
[1,2,[],3,4,5,6,7,[],8,[]]
[1,2,[],3,4,5,6,7,[],8,[]]
[1,2,[],3,4,5,6,7,[],8]
[1,2,[],3,4,5,6,7,[],[],[],8,[],[]]
[1,2,[],3,4,5,6,7,[],[],[],8,[]]
[1,2,[],3,4,5,6,7,[],[],[],8,[]]
[1,2,[],3,4,5,6,7,[],[],[],8]
[1,2,[],3,4,5,6,7,[],[],8,[],[]]
[1,2,[],3,4,5,6,7,[],[],8,[]]
[1,2,[],3,4,5,6,7,[],[],8,[]]
[1,2,[],3,4,5,6,7,[],[],8]
[1,2,[],3,4,5,6,7,[],[],8,[],[]]
[1,2,[],3,4,5,6,7,[],[],8,[]]
[1,2,[],3,4,5,6,7,[],[],8,[]]
[1,2,[],3,4,5,6,7,[],[],8]
[1,2,[],3,4,5,6,7,[],8,[],[]]
[1,2,[],3,4,5,6,7,[],8,[]]
[1,2,[],3,4,5,6,7,[],8,[]]
[1,2,[],3,4,5,6,7,[],8]
[1,2,[],3,4,5,6,7,[],[],8,[],[]]
[1,2,[],3,4,5,6,7,[],[],8,[]]
[1,2,[],3,4,5,6,7,[],[],8,[]]
[1,2,[],3,4,5,6,7,[],[],8]
[1,2,[],3,4,5,6,7,[],8,[],[]]
[1,2,[],3,4,5,6,7,[],8,[]]
[1,2,[],3,4,5,6,7,[],8,[]]
[1,2,[],3,4,5,6,7,[],8]
[1,2,[],3,4,5,6,7,[],8,[],[]]
[1,2,[],3,4,5,6,7,[],8,[]]
[1,2,[],3,4,5,6,7,[],8,[]]
[1,2,[],3,4,5,6,7,[],8]
[1,2,[],3,4,5,6,7,8,[],[]]
[1,2,[],3,4,5,6,7,8,[]]
[1,2,[],3,4,5,6,7,8,[]]
[1,2,[],3,4,5,6,7,8]
[1,2,3,4,[],5,6,7,[],[],[],[],8,[],[]]
[1,2,3,4,[],5,6,7,[],[],[],[],8,[]]
[1,2,3,4,[],5,6,7,[],[],[],[],8,[]]
[1,2,3,4,[],5,6,7,[],[],[],[],8]
[1,2,3,4,[],5,6,7,[],[],[],8,[],[]]
[1,2,3,4,[],5,6,7,[],[],[],8,[]]
[1,2,3,4,[],5,6,7,[],[],[],8,[]]
[1,2,3,4,[],5,6,7,[],[],[],8]
[1,2,3,4,[],5,6,7,[],[],[],8,[],[]]
[1,2,3,4,[],5,6,7,[],[],[],8,[]]
[1,2,3,4,[],5,6,7,[],[],[],8,[]]
[1,2,3,4,[],5,6,7,[],[],[],8]
[1,2,3,4,[],5,6,7,[],[],8,[],[]]
[1,2,3,4,[],5,6,7,[],[],8,[]]
[1,2,3,4,[],5,6,7,[],[],8,[]]
[1,2,3,4,[],5,6,7,[],[],8]
[1,2,3,4,[],5,6,7,[],[],[],8,[],[]]
[1,2,3,4,[],5,6,7,[],[],[],8,[]]
[1,2,3,4,[],5,6,7,[],[],[],8,[]]
[1,2,3,4,[],5,6,7,[],[],[],8]
[1,2,3,4,[],5,6,7,[],[],8,[],[]]
[1,2,3,4,[],5,6,7,[],[],8,[]]
[1,2,3,4,[],5,6,7,[],[],8,[]]
[1,2,3,4,[],5,6,7,[],[],8]
[1,2,3,4,[],5,6,7,[],[],8,[],[]]
[1,2,3,4,[],5,6,7,[],[],8,[]]
[1,2,3,4,[],5,6,7,[],[],8,[]]
[1,2,3,4,[],5,6,7,[],[],8]
[1,2,3,4,[],5,6,7,[],8,[],[]]
[1,2,3,4,[],5,6,7,[],8,[]]
[1,2,3,4,[],5,6,7,[],8,[]]
[1,2,3,4,[],5,6,7,[],8]
[1,2,3,4,[],5,6,7,[],[],[],8,[],[]]
[1,2,3,4,[],5,6,7,[],[],[],8,[]]
[1,2,3,4,[],5,6,7,[],[],[],8,[]]
[1,2,3,4,[],5,6,7,[],[],[],8]
[1,2,3,4,[],5,6,7,[],[],8,[],[]]
[1,2,3,4,[],5,6,7,[],[],8,[]]
[1,2,3,4,[],5,6,7,[],[],8,[]]
[1,2,3,4,[],5,6,7,[],[],8]
[1,2,3,4,[],5,6,7,[],[],8,[],[]]
[1,2,3,4,[],5,6,7,[],[],8,[]]
[1,2,3,4,[],5,6,7,[],[],8,[]]
[1,2,3,4,[],5,6,7,[],[],8]
[1,2,3,4,[],5,6,7,[],8,[],[]]
[1,2,3,4,[],5,6,7,[],8,[]]
[1,2,3,4,[],5,6,7,[],8,[]]
[1,2,3,4,[],5,6,7,[],8]
[1,2,3,4,[],5,6,7,[],[],8,[],[]]
[1,2,3,4,[],5,6,7,[],[],8,[]]
[1,2,3,4,[],5,6,7,[],[],8,[]]
[1,2,3,4,[],5,6,7,[],[],8]
[1,2,3,4,[],5,6,7,[],8,[],[]]
[1,2,3,4,[],5,6,7,[],8,[]]
[1,2,3,4,[],5,6,7,[],8,[]]
[1,2,3,4,[],5,6,7,[],8]
[1,2,3,4,[],5,6,7,[],8,[],[]]
[1,2,3,4,[],5,6,7,[],8,[]]
[1,2,3,4,[],5,6,7,[],8,[]]
[1,2,3,4,[],5,6,7,[],8]
[1,2,3,4,[],5,6,7,8,[],[]]
[1,2,3,4,[],5,6,7,8,[]]
[1,2,3,4,[],5,6,7,8,[]]
[1,2,3,4,[],5,6,7,8]
[1,2,3,4,5,6,7,[],[],[],[],8,[],[]]
[1,2,3,4,5,6,7,[],[],[],[],8,[]]
[1,2,3,4,5,6,7,[],[],[],[],8,[]]
[1,2,3,4,5,6,7,[],[],[],[],8]
[1,2,3,4,5,6,7,[],[],[],8,[],[]]
[1,2,3,4,5,6,7,[],[],[],8,[]]
[1,2,3,4,5,6,7,[],[],[],8,[]]
[1,2,3,4,5,6,7,[],[],[],8]
[1,2,3,4,5,6,7,[],[],[],8,[],[]]
[1,2,3,4,5,6,7,[],[],[],8,[]]
[1,2,3,4,5,6,7,[],[],[],8,[]]
[1,2,3,4,5,6,7,[],[],[],8]
[1,2,3,4,5,6,7,[],[],8,[],[]]
[1,2,3,4,5,6,7,[],[],8,[]]
[1,2,3,4,5,6,7,[],[],8,[]]
[1,2,3,4,5,6,7,[],[],8]
[1,2,3,4,5,6,7,[],[],[],8,[],[]]
[1,2,3,4,5,6,7,[],[],[],8,[]]
[1,2,3,4,5,6,7,[],[],[],8,[]]
[1,2,3,4,5,6,7,[],[],[],8]
[1,2,3,4,5,6,7,[],[],8,[],[]]
[1,2,3,4,5,6,7,[],[],8,[]]
[1,2,3,4,5,6,7,[],[],8,[]]
[1,2,3,4,5,6,7,[],[],8]
[1,2,3,4,5,6,7,[],[],8,[],[]]
[1,2,3,4,5,6,7,[],[],8,[]]
[1,2,3,4,5,6,7,[],[],8,[]]
[1,2,3,4,5,6,7,[],[],8]
[1,2,3,4,5,6,7,[],8,[],[]]
[1,2,3,4,5,6,7,[],8,[]]
[1,2,3,4,5,6,7,[],8,[]]
[1,2,3,4,5,6,7,[],8]
[1,2,3,4,5,6,7,[],[],[],8,[],[]]
[1,2,3,4,5,6,7,[],[],[],8,[]]
[1,2,3,4,5,6,7,[],[],[],8,[]]
[1,2,3,4,5,6,7,[],[],[],8]
[1,2,3,4,5,6,7,[],[],8,[],[]]
[1,2,3,4,5,6,7,[],[],8,[]]
[1,2,3,4,5,6,7,[],[],8,[]]
[1,2,3,4,5,6,7,[],[],8]
[1,2,3,4,5,6,7,[],[],8,[],[]]
[1,2,3,4,5,6,7,[],[],8,[]]
[1,2,3,4,5,6,7,[],[],8,[]]
[1,2,3,4,5,6,7,[],[],8]
[1,2,3,4,5,6,7,[],8,[],[]]
[1,2,3,4,5,6,7,[],8,[]]
[1,2,3,4,5,6,7,[],8,[]]
[1,2,3,4,5,6,7,[],8]
[1,2,3,4,5,6,7,[],[],8,[],[]]
[1,2,3,4,5,6,7,[],[],8,[]]
[1,2,3,4,5,6,7,[],[],8,[]]
[1,2,3,4,5,6,7,[],[],8]
[1,2,3,4,5,6,7,[],8,[],[]]
[1,2,3,4,5,6,7,[],8,[]]
[1,2,3,4,5,6,7,[],8,[]]
[1,2,3,4,5,6,7,[],8]
[1,2,3,4,5,6,7,[],8,[],[]]
[1,2,3,4,5,6,7,[],8,[]]
[1,2,3,4,5,6,7,[],8,[]]
[1,2,3,4,5,6,7,[],8]
[1,2,3,4,5,6,7,8,[],[]]
[1,2,3,4,5,6,7,8,[]]
[1,2,3,4,5,6,7,8,[]]
[1,2,3,4,5,6,7,8]
stderr
Warning: /home/SuTAba/prog:6:
	Goal (directive) failed: user: (flatten([[1,2],[3,4],[5,[6,7]],[],[[],8]],_G1545),write(_G1545),nl,fail)
ERROR: '$runtoplevel'/0: Undefined procedure: program/0
   Exception: (3) program ? EOF: exit