|
The Append program can be used to append two lists:
append(c(H,T), B, c(H,TB)) <= append(T, B, TB).
append(nil, B, B).
? append( c(1, c(2, nil)), c(3, c(4, nil)), X).
{\fB Append run Forwards. \fP}
|
The same program can also be run "backwards"
to take a list apart:
append(c(H,T), B, c(H,TB)) <= append(T, B, TB).
append(nil, B, B).
? append( X, Y, c(1, c(2, c(3, nil))) ).
{\fB Append run Backwards. \fP}
|
|
In this case there are, in general, multiple solutions.
|
|