Class 1: Introduction

August 30, 2004

Definition

 

AI deals with problems that appear to require “intelligence” to be solved.

 

Examples:

 

 

Other definitions:

 

AI History

 

 

Representation Example

 

Suppose we want to find out if a word exists in a text. In C++ we write:

 

bool word_exists(const string& word, const string& text)

{

      stringstream ss(text);

      string s;

      bool flag = false;

 

      while(ss)

      {

            ss >> s;

            if (s == word)

            {

                  flag = true;

                  break;

            }

      }

 

      return flag;

}

 

In Lisp we write the following.

 

(defun word_exists (word text)

      (if (null text)

            NIL

            (if (eql (first text) word)

                  T

                  (word_exists word (rest text))

            )

      )

)