From my last post, the answer of my unwinding was wrong., due to the complex of unwinding an equation that end up of having a summation from 1 to n. When having a summation from 1 to n, it has to be simplified to a certain form and replace with a certain formula. This is the most difficult step I found when unwinding.
It’s just been 2 days from term test 2 on Thursday. On the test, there was
a question about proving the correctness and termination of the function. This
topic was just taught last week. We didn’t really have a chance to practice on
tutorial or assignment, so I was not familiar with the question and spent most
of the time on it. Still, the question was a bit easier compare to what we have
done in class. In test, Pow(x, y), the arguments are just numbers, but in
class, the one of the arguments is usually a list. When given a list, we have
to keep track of this indexes of the list, (ei, e, b, m), which can easily
turned into a mess when proving the post condition, correctness and
termination. Different from csc165, pre and postcondition, and loop invariant are not given, and we have to determine them by tracing the function. Although it has covered in class, it's a big mess with all this, e+1, m+1, b+1, e+1-b, e+1-m-1, b-1+1+e, etc. It was gone through quickly in class, but it required much more time to analyst them. We didn't have tutorial this week, and same next week. I find it hard to understand with the lack of practice. But I think now is a good time to do practice questions on past exams.