(define (f x) (if (null? x) x (cons (car x) (cons (car x) (f (cdr x)))) ) )
<S> -> a<S> a <S> -> b<S> b <S> -> cShow that string abbcbba can be derived from <S> by showing a parse tree for it.
twist([]) = [] twist(a::b::c) = b::a::twist(c)(Twist is not defined for every list.) Show an evaluation by substitution of expression twist [2,3,4,5,6,7].
append([], X, X). append([H|T], X, [H|Y]) :- append(T, X, Y).(Recall that [H|T] is the list whose head is H and whose tail is T, and that :- is the reverse implication, <=.) Show a proof tree, with variable bindings on the branches, for goal append(X, [3,4], [1,2,3,4]). Show all branches of the computation, including failed branches. Be sure to copy variables where copying is required.