How AI Works Bird.pro as an example. An Expert System enabled by Prolog An inferencing system...
-
Upload
brendan-houston -
Category
Documents
-
view
229 -
download
1
Transcript of How AI Works Bird.pro as an example. An Expert System enabled by Prolog An inferencing system...
![Page 1: How AI Works Bird.pro as an example. An Expert System enabled by Prolog An inferencing system enabled by Prolog, or other AI language like Lisp Information.](https://reader036.fdocuments.in/reader036/viewer/2022082411/56649e4c5503460f94b41954/html5/thumbnails/1.jpg)
How AI Works
Bird.pro as an example
![Page 2: How AI Works Bird.pro as an example. An Expert System enabled by Prolog An inferencing system enabled by Prolog, or other AI language like Lisp Information.](https://reader036.fdocuments.in/reader036/viewer/2022082411/56649e4c5503460f94b41954/html5/thumbnails/2.jpg)
An Expert System enabled by Prolog
An inferencing system enabled by Prolog, or other AI language like Lisp
Information is all stored as attribute-value pairs.
The attribute is represented as a predicate, and the value as the argument to the predicate.
For example, the attribute-value pair "color-brown" is stored "color(brown)".
![Page 3: How AI Works Bird.pro as an example. An Expert System enabled by Prolog An inferencing system enabled by Prolog, or other AI language like Lisp Information.](https://reader036.fdocuments.in/reader036/viewer/2022082411/56649e4c5503460f94b41954/html5/thumbnails/3.jpg)
What is Prolog?
Programming in LogicFrom a foundation of logical theorem
proving, originally used for research in natural language processing
Declarative programming rather than Procedural programming versus
![Page 4: How AI Works Bird.pro as an example. An Expert System enabled by Prolog An inferencing system enabled by Prolog, or other AI language like Lisp Information.](https://reader036.fdocuments.in/reader036/viewer/2022082411/56649e4c5503460f94b41954/html5/thumbnails/4.jpg)
Procedural Programming
Specify what procedures to take Follow the specified procedures to work out the
answer E.g. To find out the average of a set of numbers,
we need to: Sum up all the numbers Count the total number of entries Divide the sum by the total number Report the answer
Corresponding to procedural knowledge
![Page 5: How AI Works Bird.pro as an example. An Expert System enabled by Prolog An inferencing system enabled by Prolog, or other AI language like Lisp Information.](https://reader036.fdocuments.in/reader036/viewer/2022082411/56649e4c5503460f94b41954/html5/thumbnails/5.jpg)
Declarative Programming
A collection of small modular units, called predicates
Can be added and tested separatelyCorresponding to declarative knowledge
![Page 6: How AI Works Bird.pro as an example. An Expert System enabled by Prolog An inferencing system enabled by Prolog, or other AI language like Lisp Information.](https://reader036.fdocuments.in/reader036/viewer/2022082411/56649e4c5503460f94b41954/html5/thumbnails/6.jpg)
Simple programme
Database:person(peter).
person(jane).
person(nancy).
Query: Enter:person(peter). Reply: yes.
Query: Enter: person(X). Reply: X=peter; X=jane; X=nancy
![Page 7: How AI Works Bird.pro as an example. An Expert System enabled by Prolog An inferencing system enabled by Prolog, or other AI language like Lisp Information.](https://reader036.fdocuments.in/reader036/viewer/2022082411/56649e4c5503460f94b41954/html5/thumbnails/7.jpg)
A little more
Add:likes(peter,dog)likes(jan,cat)likes(nancy,snake)animal(dog).animal(cat).animal(snake)pet(X,Y):-person(X),animal(Y),likes(X,Y).
Test:pet(peter,dog).pet(nancy,X).pet(X,cat).
![Page 8: How AI Works Bird.pro as an example. An Expert System enabled by Prolog An inferencing system enabled by Prolog, or other AI language like Lisp Information.](https://reader036.fdocuments.in/reader036/viewer/2022082411/56649e4c5503460f94b41954/html5/thumbnails/8.jpg)
How “bird.pro” Works
main :- identify.
identify:- retractall(known(_,_,_)), % clear stored information bird(X), write('The bird is a '),write(X),nl.identify:- write('I can''t identify that bird'),nl.
To start the process, type “main.”, the system tries to verify identity
To find out what bird it is
Write the answer if found
If not found
![Page 9: How AI Works Bird.pro as an example. An Expert System enabled by Prolog An inferencing system enabled by Prolog, or other AI language like Lisp Information.](https://reader036.fdocuments.in/reader036/viewer/2022082411/56649e4c5503460f94b41954/html5/thumbnails/9.jpg)
bird(laysan_albatross):- family(albatross), color(white).bird(black_footed_albatross):- family(albatross), color(dark).bird(fulmar):- order(tubenose), size(medium), flight(flap_glide).bird(whistling_swan):- family(swan), voice(muffled_musical_whistle).bird(trumpeter_swan):- family(swan), voice(loud_trumpeting).
If the bird belongs to the albatross family and its color is white,Then the bird is laysan albatross