phaunt

NSCC

Jun 28th, 2015
264
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
  1. z(A:B:C,[D:E:F|G]):-(A=D;B>=F;E>=C),(G=[];z(A:B:C,G)).
  2. u([A|B],C):-z(A,C),(B=[];u(B,C)).
  3. y([],R,R).
  4. y([A,B,C|D],E,R):-y(D,[A:B:C|E],R).
  5. d([A:_|D]):-write(A),tab(1),(D=[];d(D)).
  6. l([H|T],R):-T=[],R=H;length(H,N),l(T,X),length(X,M),(N>M,R=H;R=X).
  7. v([],_,R,R).
  8. v([A|T],Z,B,R):-u(A,A),\+z(Z,A),v(T,Z,[A|B],R);v(T,Z,B,R).
  9. t(S,T):-length(S,L),between(0,L,M),length(T,M),s(S,T).
  10. s([E|T],[F|N]):-E=F,(N=[];s(T,N));s(T,[F|N]).
  11. x(A):-y(A,[],D),K="NSCC":_,select(K,D,E),setof(L,t(E,L),B),v(B,K,[],R),l(R,S),d(S),!.
RAW Paste Data