7.6. Descriptive Programming

Most programs are written in a procedural language. This means that the programmer tells the machine exactly what to do, one step at a time. Each step is executed in turn unless the previous step explicitly chooses a different order.

Descriptive programming is one of the quiet successes of the artificial intelligence community. Simply stated, in descriptive programming the programmer describes the solution sought, instead of specifying the exact steps to find it. The best examples of descriptive programming are spreadsheets, which came out of the visual programming tools developed in AI labs in the early 1970s. In a spreadsheet, the user describes the desired program by creating an example. Change the data, and the program runs painlessly. Without knowing it, millions of unsuspecting people have become programmers, using spreadsheets to write programs they couldn't begin to think of in a procedural language.

Other fancier forms of descriptive programming allow people to write programs to solve an impressive array of problems in a concise and logical manner. These include many serious and useful applications, such as fault medical diagnosis, configuring complex systems, and process control. They also include a number of less serious (but mathematically interesting) problems like how to arrange n queens on an n-by-n square chessboard so no queen attacks another, many variations of the "missionaries and cannibals" and "monkeys and bananas" problems, and ...

Get Nerds on Wall Street: Math, Machines, and Wired Markets now with the O’Reilly learning platform.

O’Reilly members experience books, live events, courses curated by job role, and more from O’Reilly and nearly 200 top publishers.