1:- module(
2 dlist,
3 [
4 dappend/2, 5 dappend/3, 6 dappend_to_list/2, 7 dappend_to_list/3, 8 dlist_to_list/2, 9 is_dlist/1 10 ]
11).
17:- use_module(library(apply)).
23dappend([], []):- !.
24dappend([L], L):- !.
25dappend([L1,L2], L):- !,
26 dappend(L1, L2, L).
27dappend([L1,L2|T], L):-
28 dappend(L1, L2, L3),
29 dappend([L3|T], L).
35dappend(L1-H1, H1-H2, L1-H2).
44dappend_to_list(DLs, L) :-
45 dappend(DLs, DL),
46 dlist_to_list(DL, L).
54dappend_to_list(DL1, DL2, L):-
55 dappend(DL1, DL2, DL),
56 dlist_to_list(DL, L).
64dlist_to_list(L1, L):-
65 dappend(L1, []-[], L-[]).
73is_dlist(L1-L2):-
74 maplist(is_list, [L1,L2])
Difference lists
*/