Parsed program: append([],Y,Y). append([X|L],Y,[X|Z]) :- append(L,Y,Z). Parsed query: append([1,2,3],[4,5,6],W). Entering BC Current goal: append([1,2,3],[4,5,6],W). Additional goals: 0 Unified goal append([1,2,3],[4,5,6],W). and clause append([X2|L2],Y2,[X2|Z2]) :- append(L2,Y2,Z2). Substitution: 'X2' '1' 'L2' '2,3' 'Y2' '4,5,6' 'W' 'X2|Z2' Entering BC Current goal: append([2,3],[4,5,6],Z2). Additional goals: 0 Unified goal append([2,3],[4,5,6],Z2). and clause append([X4|L4],Y4,[X4|Z4]) :- append(L4,Y4,Z4). Substitution: 'X4' '2' 'L4' '3' 'Y4' '4,5,6' 'Z2' 'X4|Z4' Entering BC Current goal: append([3],[4,5,6],Z4). Additional goals: 0 Unified goal append([3],[4,5,6],Z4). and clause append([X6|L6],Y6,[X6|Z6]) :- append(L6,Y6,Z6). Substitution: 'X6' '3' 'L6' [] 'Y6' '4,5,6' 'Z4' 'X6|Z6' Entering BC Current goal: append([],[4,5,6],Z6). Additional goals: 0 Unified goal append([],[4,5,6],Z6). and clause append([],Y7,Y7). Substitution: 'Y7' '4,5,6' 'Z6' '4,5,6' Entering BC Found answer 'X2' '1' 'L2' '2,3' 'Y2' '4,5,6' 'W' 'X2|Z2' 'X4' '2' 'L4' '3' 'Y4' '4,5,6' 'Z2' 'X4|Z4' 'X6' '3' 'L6' [] 'Y6' '4,5,6' 'Z4' 'X6|Z6' 'Y7' '4,5,6' 'Z6' '4,5,6' Exiting BC Exiting BC Exiting BC Exiting BC Query: append([1,2,3],[4,5,6],W). Yes answer = 'W' '1,2,3,4,5,6'