Artificial
Intelligence

Fall 2011
course
navigation

Oct 11

practice

some problems from chap 8 of AIMA 3rd

chap 9 material : inference

Main points :

theorem provers

See west.lisp attached; snark example.

prolog

"Prolog is a general purpose logic programming language ..."
$ swipl ?- assert(cat(tom)). % new fact : tom is a cat ?- assert(animal(X) :- cat(X)). % :- is "if", backwards implies ?- animal(Y). % is there an animal ? Y = tom. ?-
If we have the facts in a file (facts.pl), then assert() isn't needed. The file is loaded with
$ swipl ?- [facts]. ?- cat(Y). % Note that unbound variables must be uppercase.
The "goal" seeking becomes program execution :
factorial(0, 1). factorial(N, FactN) :- N > 0, Nminus1 is N - 1, factorial(Nminus1, FactNminus1), FactN is N * FactNminus1.
Or using the example from the text : see west.pl, attached.

ai-class.com

... kicked off this week. Hmmm. Thoughts?

asides

http://cs.marlboro.edu/ courses/ fall2011/ai/ notes/ Oct_11
last modified Tuesday October 11 2011 11:29 am EDT

attachments [paper clip]

     name last modified size
   colonel_west.lisp Oct 10 2011 10:46 pm 9.10kB [COD]west.pl Oct 10 2011 10:45 pm 361B