I find the following code:
difference_append(Open_list, Hole, Open_or_closed_list) :-
Hole = Open_or_closed_list.
I learnt another difference list append, its defining fact reads:
concat(X-Y, Y-Z, X-Z).
Here is are some example runs, the last two queries demonstrate associativity:
?- A = [1, 2|X]-X, B = [3|Y]-Y, concat(A, B, C).
C = [1, 2, 3|Y]-Y.
?- A = [1|X]-X, B = [2|Y]-Y, C = [3|Z]-Z, concat(A, B, H), concat(H, C, D).
D = [1, 2, 3|Z]-Z.
?- A = [1|X]-X, B = [2|Y]-Y, C = [3|Z]-Z, concat(B, C, H), concat(A, H, D).
D = [1, 2, 3|Z]-Z.
What concat/3 cannot do, but append/3 can do, use the first argument twice:
?- A = [1], B = [2], C = [3], append(A, B, D), append(A, C, E).
D = [1, 2],
E = [1, 3].
?- A = [1|X]-X, B = [2|Y]-Y, C = [3|Z]-Z, concat(A, B, D), concat(A, C, E).
false.