このディレクトリの索引

a(' bottles of beer on the wall, ').

b(' bottles of beer,
Take one down and pass it around, ').

c(' bottles of beer on the wall.

').

d('1 bottle of beer on the wall, 1 bottle of beer,
Take one down, and pass it around,
Now they are all gone.
').

'99 bottles of beer on the wall'(_99_bottles_of_beer_on_the_wall) :-
        a(A),
        b(B),
        c(C),
        d(D),
        findall_flatten_concat_2(A,B,C,D,_99_bottles_of_beer_on_the_wall).

findall_flatten_concat_2(A,B,C,D,S) :-
        findall([N,C,N,A,N,B],(
                    for(99,N,2)),
                L_1),
        flatten(L_1,[_,_|L_2]),
        append(L_2,[D],L_3),
        atomic_list_concat(L_3,S).