Answer to Question equation-5
Here are the equations for reference.
(isPrefix.1) isPrefix([], B) = true
(isPrefix.2) isPrefix(A, []) = false (when A is not [])
(isPrefix.3) isPrefix(h1:t1, h2:t2) = h1 == h2 and isPrefix(t1, t2)
Evaluation is as follows.
isPrefix([2,3,4], [2,4,3]) = isPrefix(2:[3,4], 2:[4,3])
= 2 == 2 and isPrefix([3,4], [4,3]) by (isPrefix.3)
= true and isPrefix([3,4], [4,3])
= isPrefix([3,4], [4,3])
= isPrefix(3:[4], 4:[3])
= 3 ==4 and isPrefix([4], [3]) by (isPrefix.3)
= false and isPrefix([4], [3])
= false