appends two lists to a third one.
append/3 retrieves by backtracking all lists such that
the concatenation of FirstList with SecondList results in ThirdList.
FirstList list SecondList list ThirdList list
| append(X,Y,Z). | Succeeds with substitution X <- [], Y <- _1, Z <- _1. |
| append([l,i],[s,t],X). | Succeeds with substitution X <- [l,i,s,t]. |
| append(X,Y,[a,b]). | Succeeds three times with substitution X <- [], Y <- [a,b], X <- [a], Y <- [b], X <- [a,b], Y <- []. |
| append([a,b],X,Y). | Succeeds with substitution X <- _345, Y <- [a,b|_345]. |
| append([a,b],f(y),Z). | Succeeds with substitution Z <- [a,b|f(y)]. |
This predicate is not part of the ISO-Prolog Standard.