home
***
CD-ROM
|
disk
|
FTP
|
other
***
search
/
OS/2 Shareware BBS: 10 Tools
/
10-Tools.zip
/
lifeos2.zip
/
LIFE-1.02
/
TESTS
/
LF
/
SUBS.LF
< prev
next >
Wrap
Text File
|
1996-06-04
|
523b
|
21 lines
op(500,xfy,\)?
subst(List, SubList, NewSubList, NewList) :-
app(Front, Back, List), % non-deterministically split
% the original list into Front
% and Back, such that
app(SubList, Rest, Back), % Back begins with SubList,
app(NewSubList, Rest, NewBack), % then construct the new
% list by undoing the previous
% steps with NewSubList
app(Front, NewBack, NewList). % in place of SubList
app([], L, L).
app([H|T], L, [H|R]) :- app(T, L, R).
dlist([],S\S).
dlist([H|T],[H|S]\E) :- dlist(T,S\E).