Tuesday, November 11, 2008

Week 9

The test was not extremely difficult but I was unprepared due to my lack of understanding about loop invariants. The question involving the loop was the most difficult for me only for the fact that I did not know how to include an invariant that will help me in my proof. It was easy to prove that the function terminated but my proof was definitely not in the pattern of what we were taught (and was probably wrong). The rest of the questions were easy.

Finally a change in the flavor of the material, the regular expressions are a wonderful break from induction (unless were going to use that for this too...). They seemed very confusing at first (especially the Kleene star but by the end of a lecture, they made sense.) The proof was very bizare but I am sure that with practice these things will become easy.

Week 8

I did not attend the lecture and after writing the test I wish I had. It was very difficult to figure out the proofs for functions with loops simply from the lecture notes. The concept of a loop invariant, although seemingly useful, does not differ from a postcondition in my mind?

The assignment went by very well even with my limited amount of time to work through and understand it. The partner system helped very much and I am upset I never utilized partners before. The questions were very similar to those done in the lecture and it was not difficult to extend those ideas to the assignment.

Week 7

Proving correctness of a program is an interesting concept. Rather than the way we have been taught to check our code (through test cases), we now define preconditions and postconditions to see if they work every time the program is recursively called. I wonder if this would be too complex of a proof for one of our 207 assignments in order to avoid writing test cases. The concept itself is very interesting, yet the proofs themselves don't seem to be. Oh well.

The problem set was very straightforward. Probably one of the easier ones so far but it's always the stupid silly mistakes that make me lose marks. The only difficulties I encountered are determining what is a sufficient for these (non-numerical) proofs. I find I have to define what something like
# Postcondition: revString(s) returns a string with
# the characters of s in reverse order.
What does reverse order mean? If I am the one deciding it, can I just say reverse order is defined as:
revString(s[1:]) + s[0]