August 2026
Intermediate
138 pages
2h 57m
English

Before we can devise an algorithm for a function, we must know its purpose—the same principle at work when we prompt an artificial intelligence (AI) tool. We thus specify the function’s assumed initial state—its preconditions—and the desired end state—postconditions. This chapter explains how and where to provide this information. We first explain the type of language used to express preconditions and postconditions.
Specifications are declarative—Boolean (true-or-false) statements—that specify the desired end state. The language must be precise, so the reader (or ...
Read now
Unlock full access