Analyzing and Constructing Lists

To combine two lists to form a third list, use append(+Head, +Tail, -List).

To analyze a list into its component lists in various ways, use append/3 with List instantiated to a proper list. The reference page for append/3 includes examples of its usage, including backtracking.

To check the length of a list call length(+List, -Integer).

To produce a list of a certain length, use length/2 with Integer instantiated and List uninstantiated or instantiated to a list whose tail is a variable.