15-122 Principles of Imperative Computation
Lecture 2: Contracts

  • Reading: 02-contracts.pdf
  • Code: solution3.c0, code directory
  • Concepts:
    • Function precondition (@requires)
    • Function postcondition (@ensures)
    • Loop invariant (@loop_invariant)
    • Assertion (@assert)
    • Contracts for testing (dynamic checking)
    • Contracts for reasoning (program proving)
    • Partial correctness
    • Termination
    • Total correctness
  • Previous lecture: Overview
  • Next lecture: Ints

[ Home | Schedule | Assignments | Resources ]
[ Piazza | Blackboard ]

fp@cs
Frank Pfenning