What is the difference between an agent function and an agent program (with respect to the percept sequence)?

In the book "Artificial Intelligence: A modern approach",

The agent function, notionally speaking, takes as input the entire percept sequence up to that point, whereas the agent program takes the current percept only.

Why does the agent program only take current percept. Isn't the agent program just an implementation of the agent function?


It looks as if 'function' is being used here in the mathematical (or functional programming) sense of 'pure function', i.e. it is without state or side-effects. Hence the function cannot store previous percepts anywhere, so the entire historical percept sequence is considered to be passed to the function each time.

In contrast, the notion of 'program' appears to allow state/side-effects, so it is assumed that earlier percepts are memoized as needed (or that they otherwise updated the variables used within the program).

The 'function' notion is the conceptually cleaner one, in that the 'program' version can always be abstracted to the functional one. Which aspects of percept history happen to be cached by the 'program' version is merely an implementation detail.


The agent function is an abstract mathematical description; the agent program is a concrete implementation, running within some physical system.

Artificial Intelligence Stuart Russell; Peter Norvig; Stuart J. Russell


Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.