AIMA Artificial Intelligence a modern approch

AIMA-exercises is an open-source community of students, instructors and developers. Anyone can add an exercise, suggest answers to existing questions, or simply help us improve the platform. We accept contributions on this github repository.

Exercise 9.19

The following Prolog code defines a predicate P. (Remember that uppercase terms are variables, not constants, in Prolog.)

    P(X,[X|Y]).
    P(X,[Y|Z]) :- P(X,Z).
  1. Show proof trees and solutions for the queries P(A,[1,2,3]) and P(2,[1,A,3]).

  2. What standard list operation does P represent?

View Answer