This week, there's more on program correctness. But this time, we have to know how to prove program correctness involving loops (for loops, while loops and recursion). After reading through the examples, it seems like the approach is to assume precondition to prove termination and post condition. I believe I can prove a program with only one loop. However, with nested loop, it is way too confusing. It gives me a headache by just looking at the example in the end of the slides. Further reading of the textbook is required.
-Assignment 2-
This assignment wasn't too bad. I'd say question 1 was the hardest. It took me half of the total time to do it. I am just bad with finding patterns. The way that I completed question 1 was mostly due to TA's help. Again, they've been extremely helpful. Question 2 and 4 were very similar to examples in the lecture slides. For question 3, as long as you see the similarity between Fibonacci sequence and the sequence generated by G(n), proving it wasn't hard. Another reason why I think this assignment was easier is because I had a partner this time. =D
Subscribe to:
Post Comments (Atom)
No comments:
Post a Comment