Logic Programming
06-25433
Autumn 2012

 

 

 

Lecture 10: Writing and debugging programs

Programs should be designed top-down and built bottom-up. Style and presentation are aids to producing correct programs. Once written, programs should be tested analytically.

This lecture include:

  • designing programs top-down;
  • building the code for a program bottom-up;
  • using a good style to make programs more easily understood;
  • testing programs systematically and analytically so you can be as certain as possible each part works as intended.
How to prepare

  No specific preparation for this lecture.

Video

  Recording of the lecture (Vimeo)

Slides

  If you really want the slides from the lecture ... but don't forget printing the slides is not the same as understanding them.

Summary

  Summary and programs with commentary from the lecture

Programs from the lecture

 
Example 1 - classifying letters (faulty) Example 2 - classifying letters (faulty with diagnostic output) Example 3 - classifying letters
Example 4 - solving a puzzle    

Individual study suggestions and further reading

 

Program design .

Programming style and debugging are covered in:

Assessed work associated with this lecture

  Tutorial sheet 4