Answers.Body: <p>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.</p>
  
  <p>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).</p>
  
  <p>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.</p>
  
Answers.ContentLicense: CC BY-SA 3.0
Answers.CreationDate: 2016-08-28T11:43:18.730Z
Answers.LastActivityDate: 2016-08-28T11:43:18.730Z
Answers.UserDisplayName: NietzscheanAI
Answers.Body: <p>An agent function is an abstract mathematical mapping from percept sequences to actions; an agent program is a specific implementation in a system.</p>
  
Answers.ContentLicense: CC BY-SA 4.0
Answers.CreationDate: 2024-09-30T11:41:37.460Z
Answers.LastActivityDate: 2024-09-30T11:41:37.460Z
Answers.UserDisplayName: Kristina_Poole
Body: <p>In section 2.4 (p. 46) of the book <a href="https://cs.calvin.edu/courses/cs/344/kvlinden/resources/AIMA-3rd-edition.pdf#page=65" rel="nofollow noreferrer">Artificial Intelligence: A modern approach</a> (3rd edition), Russell and Norvig write</p>
  <blockquote>
  <p>The job of AI is to design an agent program that implements the agent function — the mapping from percepts to actions.</p>
  </blockquote>
  <p>After that, in section 2.4.1, they write</p>
  <blockquote>
  <p>Notice the difference between the agent program, which takes the current percept as input, and the agent function, which takes the entire percept history.</p>
  </blockquote>
  <p>Why does the <em>agent program</em> only take current percept? Isn't the agent program just an implementation of the agent function?</p>
  <p>So, what is the difference between an <strong>agent function</strong> and an <strong>agent program</strong> (with respect to the percept sequence)?</p>
  
Tags: <terminology><comparison><norvig-russell>
Title: What is the difference between an agent function and an agent program?
UserDisplayName: Abhishek Bhatia
ThreadText: # What is the difference between an agent function and an agent program?
  
  (Asked by: username_0 on 2016-08-28)
  
  In section 2.4 (p. 46) of the book [Artificial Intelligence: A modern approach](https://cs.calvin.edu/courses/cs/344/kvlinden/resources/AIMA-3rd-edition.pdf#page=65) (3rd edition), Russell and Norvig write
  
  > The job of AI is to design an agent program that implements the agent function — the mapping from percepts to actions.
  
  After that, in section 2.4.1, they write
  
  > Notice the difference between the agent program, which takes the current percept as input, and the agent function, which takes the entire percept history.
  
  Why does the *agent program* only take current percept? Isn't the agent program just an implementation of the agent function?
  
  So, what is the difference between an **agent function** and an **agent program** (with respect to the percept sequence)?
  
  **Tags:** terminology, comparison, norvig-russell
  
  ---
  
  ## 2 answers
  
  ### Answer by username_1 on 2016-08-28. Score: 9
  
  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.
  
  
  ---
  
  ### Answer by username_2 on 2024-09-30. Score: 0
  
  An agent function is an abstract mathematical mapping from percept sequences to actions; an agent program is a specific implementation in a system.
  
  
  ---
  
  