Изкуствен интелект Изкуствен интелект Упражнение № 6 спец. Информатика, ФМИ 2004/2005.

Slides:



Advertisements
Similar presentations
This is a self running presentation that lasts about 4 minutes, and loops continuously until escape is pressed. The text appears one word at a time to.
Advertisements

9 x9 81 4/12/2015 Know Your Facts!. 9 x2 18 4/12/2015 Know Your Facts!
1 x0 0 4/15/2015 Know Your Facts!. 9 x1 9 4/15/2015 Know Your Facts!
1 x0 0 4/16/2015 Know Your Facts!. 1 x8 8 4/16/2015 Know Your Facts!
3 x0 0 7/18/2015 Know Your Facts!. 4 x3 12 7/18/2015 Know Your Facts!
HALAMAN 333 NO.23 Melted gold is poured into a mold to form A brick. A box- like mold with inner slanting sides is used. The “draft angle” is the degree.
Beagles By Dylan Nielson.
AB 11 22 33 44 55 66 77 88 99 10  20  19  18  17  16  15  14  13  12  11  21  22  23  24  25  26  27  28.
The Flexible Learning Centre Oasis has a selection of tools that are easily accessible to Students. Our Black and white photocopier can only be operated.
Изкуствен интелект Изкуствен интелект Упражнение № 10 спец. Информатика, ФМИ 2003/2004.
Изкуствен интелект Изкуствен интелект Упражнение № 6 спец. Информатика, ФМИ 2005/2006.
For Friday Finish chapter 10 No homework (get started on program 2)
Everyone is different! If we all looked the same or liked the same things life would be very boring! Some people are tall and thin. Some people are.
 Contrary to the beliefs of early workers in AI, experience has shown that Intelligent Systems cannot achieve anything useful unless they contain a large.
Bill Martin Jr. and Eric Carle
© red ©
Warm up Get a piece of paper, compass and straight edge. 1.Create an acute angle. Duplicate it. 2.Create and obtuse angle. Duplicate it. 3.Create another.
8.6:Perimeters and Areas of Similar Figures
For Friday Exam 1. For Monday No reading Take home portion of exam due.
4 x1 4 10/18/2015 Know Your Facts!. 5 x /18/2015 Know Your Facts!
3 x0 0 10/18/2015 Know Your Facts!. 11 x /18/2015 Know Your Facts!
WHITE YELLOW GREEN BLUE RED PINK BLACK BROWN ORANGE.
For Wednesday Read chapter 13 Homework: –Chapter 10, exercise 5 (part 1 only, don’t redo) Progress for program 2 due.
Do Now 3/10/10 Take out HW from Friday & last night. Take out HW from Friday & last night.  Text p. 309, #7-11 all, 17 & 18  Practice worksheets 6.6.
How many eggs can a kiwi lay? A female kiwi can lay up 100 eggs in its hole life time.
Areas of Polygons COURSE 3 LESSON 8-7 Find the area of each parallelogram. a.b. A = bh Use the area of a parallelogram formula. = (32) (20) = (15) (11)
Изкуствен интелект Изкуствен интелект Упражнение № 9 спец. Информатика, ФМИ 2004/2005.
Warm Up’s. Area of Trapezoids Trapezoids b1b1 b2b2 h Trapezoids have 2 bases. They are the parallel sides. The height is determined by forming a.
For Friday Read Homework: –Chapter 10, exercise 22 I strongly encourage you to tackle this together. You may work in groups of up to 4 people.
For Friday Read Chapter 11, sections 1 and 2 Homework: –Chapter 10, exercises 1 and 5.
For Wednesday Read chapter 13 No homework. Program 2 Any questions?
Reading Exercise Mathayom Suksa 6 students By KruSrinuan Boontham Sansaiwittayakom Chiang Mai.
Pang Yan Ling, Esther 6C(24). Black-faced Spoon Bill is the one of the endangered animals.
Lesson #28 - Surface Area of Prisms.
Transformations Day 2. Problem Solving Quiz 1.While walking through the snowy forest, Danielle counted 8 trees. If each tree has 43 branches, how many.
10.4 Perimeters & Areas of Similar Figures
1 Frame Theory A vague paradigm - to organize knowledge in high-level structures “A Framework for Representing Knowledge” - Minsky, 1974 Knowledge is encoded.
Animals at the Zoo Черінько Наталія Василівна вчитель англійської мови Новожиттівський навчально-виховний комплекс «Дошкільний навчальний заклад – загальноосвітня.
Brown Bear, What Do You See?. Brown Bear by Annabelle.
Brown Bear, Brown Bear, What Do You See?
Выполнила: Тадевосян А.Т. Учитель английского языка МКОУ «КПООШ » Барятинский район, Калужская область.
Игра-викторина по английскому языку для учащихся 5-х классов Автор: Хоруженко Лариса Петровна МАНОУ «Гимназия №2» г.Мариинск Кемеровская область.
CO Games Development 2 Week 20 Production Systems
Artificial Intelligence
What colour is it / are they?
Интерактивный кроссворд “Birds”
1st Grade High Frequency Words
What is it doing?.
How are you. How is your mother/father/…. Where are you from
ANIMAL RIDDLES.
11.3 – Perimeter and Area of Similar Figures
Colour Farm Dr. Jean.
Polygons with 4 sides and 4 angles
THE DOG The dog is our good friend. It is very clever. The dog knows and loves its master and the friends of his family. It likes to eat meat and drink.
Pastel Project.
Warm Up Convert! 15 inches = _____ cm 360 years = ____ hours  
Learn Your 2x Facts.
Do Now 3/17/11 Take out HW from last night. Copy HW in your planner.
The Big 6 Research Model Step 3: Location and Access
All About New Zealand Primary One.
What Color is it?.
Colour Farm Dr. Jean.
Let’s help animals together!
What colour is it / are they?
11.7 Perimeters and Areas of Similar Figures
Using the terms below, label and color the emperor penguin.
Presentation transcript:

Изкуствен интелект Изкуствен интелект Упражнение № 6 спец. Информатика, ФМИ 2004/2005

Семантични мрежи и фрейми  Семантични мрежи  Фрейми

Семантични мрежи  Семантичните мрежи се състоят от обекти и релации между обектите  Обикновено се представят чрез граф, като възлите на графа съответстват на обектите, а релациите между обектите се представят чрез именувани дъги свързващи възлите на графа

Семантичнa мрежa

Основни типове връзки

Семантична мрежа animal flybirddaylight albatrosskiwibrown walk night Kim black_&_white Albert Ross isa active_atmoving_method isa moving_method active_at colour

isa(bird,animal). isa(albatross,bird). isa(kiwi,bird). isa(ross,albatross). isa(albert,albatross). isa(kim,kiwi). moving_method(bird,fly). moving_method(kiwi,walk). active_at(bird,daylight). active_at(kiwi,night). colour(albatross,black_&_white). colour(kiwi,brown). moving_method(X,Method):- isa(X,SuperX), moving_method(SuperX,Method).

(де)композиция на терм +Term =.. ?List ?Term =.. +List List е списък, чийто първи елемент е функтор на Term, а останалите елементи на List са аргументите на този терм Term, т.е. | ?- product(0, n, n-1) =.. L. L = [product,0,n,n-1] | ?- n-1 =.. L. L = [-,n,1] | ?- product =.. L. L = [product] | ?- X=..[functor,arg1,arg2,arg3,arg4]. X = functor(arg1,arg2,arg3,arg4) ? Вместо този предикат може да се използват arg/3 и functor/3.

fact(Fact):- Fact,!. fact(Fact):- Fact=..[Rel,Arg1,Arg2], isa(Arg1,SuperArg), SuperFact=..[Rel,SuperArg,Arg2], fact(SuperFact).

| ?- fact(moving_method(kim,Method)). Method = walk ? | ?- fact(moving_method(albert,Method)). Method = fly ?

Съпоставяне на семантични мрежи figure oval polygon 4-sidetriangle ellipsecircle rectangle square trapezoid

Съпоставяне на семантични мрежи % is_a hierarchy isa(square,rectangle).isa(rectangle,4-side).isa(trapezoid,4-side).isa(parallelogram,4-side).isa(circle,oval).isa(ellipse,oval).isa(triangle,polygon).isa(4-side,polygon).isa(polygon,figure).isa(oval,figure).

c Съпоставяне на семантични мрежи ab c ab c ab c ab Арка support(a,c). touch(a,b).

Съпоставяне на семантични мрежи % Objects represented as facts in the format: % object(Name,Parts,IsaRelations, MustRelations,MustNotRelations object(arch,[a,b,c], [isa(a,4-side),isa(b,4-side), isa(c,polygon)], [support(a,c),support(b,c)], [touch(a,b)]).

Съпоставяне на семантични мрежи % Test patterns test1([X,Y,Z], [isa(X,rectangle),isa(Y,rectangle),isa(Z,triangle)], [support(X,Z),support(Y,Z)]). test2([X,Y,Z], [isa(X,rectangle),isa(Y,rectangle),isa(Z,triangle)], [support(X,Z),support(Y,Z),touch(X,Y)]).

Съпоставяне на семантични мрежи % Sample runs ?- match([X,Y,Z], [isa(X,rectangle),isa(Y,rectangle),isa(Z,triangle)], [support(X,Z),support(Y,Z)], Name). Name=arch ?- test1(Parts,Isa,Rels),match(Parts,Isa,Rels,Name). Name=arch

Съпоставяне на семантични мрежи match(Parts,Isa1,Rels,Name) :- object(Name,Parts,Isa2,Must,MustNot), match_isa(Isa1,Isa2), subset(Must,Rels), \+ intersect(Rels,MustNot).

Съпоставяне на семантични мрежи match_isa([],[]). match_isa([isa(X,P)|T],[isa(X,Q)|V]) :- parent(P,Q), match_isa(T,V).

Съпоставяне на семантични мрежи subset([],_). subset([X|T],Y) :- member(X,Y), subset(T,Y). intersect(L1,L2) :- member(X,L1), member(X,L2).

Съпоставяне на семантични мрежи parent(X,X). parent(X,Z) :- isa(X,Y), parent(Y,Z).

Opus Opus Name: Opus Friend: Birds 2 Legs: 2 T Flies: T Mammals 4 Legs: 4 Penguins F Flies: F CatsBats Legs: 2 T Flies: T Pat Pat Name: Pat Animals T Alive: T F Flies: F Bill Bill Name: Bill Friend: Subset Member rel(alive,animals,t). rel(flies,animals,f). subset(birds,animals). subset(mammals,animals). rel(flies,birds,t). rel(legs,birds,2). rel(legs,mammals,4). Фрейми

Opus Opus Name: Opus Friend: Birds 2 Legs: 2 T Flies: T Mammals 4 Legs: 4 Penguins F Flies: F CatsBats Legs: 2 T Flies: T Pat Pat Name: Pat Animals T Alive: T F Flies: F Bill Bill Name: Bill Friend: Subset Member rel(legs,mammals,4). subset(penguins,birds). subset(cats,mammals). subset(bats,mammals). rel(flies,penguins,f). rel(legs,bats,2). rel(flies,bats,t).

Opus Opus Name: Opus Friend: Birds 2 Legs: 2 T Flies: T Mammals 4 Legs: 4 Penguins F Flies: F CatsBats Legs: 2 T Flies: T Pat Pat Name: Pat Animals T Alive: T F Flies: F Bill Bill Name: Bill Friend: Subset Member is_a(opus,penguins). is_a(bill,cats). is_a(pat,bats). name(opus,'Opus'). friend(opus,bill). name(bill,'Bill'). friend(bill,opus). name(Pat,'Pat').

Пример FRAME: bird a_kind_of: animal moving_method: fly active_at: daylight

Пример FRAME: albatross a_kind_of: bird colour: black_and_white size: 115 % 115 cm long FRAME: kiwi a_kind_of: bird moving_method: walk active_at: night colour: brown size: 40

Пример FRAME: Albert instance_of: albatross size: 120

% A frame is represented as a set of % Prolog facts: % frame_name(Slot,Value) % where Value is either a simple value or % a procedure % Frame bird: the prototypical bird bird(a_kind_of,animal).bird(movin_method,fly).bird(active_at,daylight). % Frame albatross: albatross is a typical bird % with some extra facts: it is black and white, % and it is 115 cm long albatross(a_kind_of, bird). albatross(colour,black_and_white).albatross(size,115).

% Frame kiwi: kiwi is a rather untypical % bird in that it walks instead of flies, % and it is active at night kiwi(a_kind_of,bird).kiwi(moving_method,walk).kiwi(active_at,night).kiwi(colour,brown).kiwi(size,40). % Frame albert: an instance of big albatross albert(instance_of,albatross).albert(size,120). % Frame ross: an instance of baby albatross ross(instance_ot,albatross).ross(size,40).

% Frame animal: slot relative_size % obtains its value by executing % procedure relative_size animal(relative_size, execute( execute( relative_size(Object,Value), relative_size(Object,Value), Object, Object, Value Value) ). ).

value(Frame,Slot,Value):-Query=..[Frame,Slot,Value],call(Query),!.value(Frame,Slot,Value):-parent(Frame,ParentFrame),value(ParentFrame,Slot,Value).parent(Frame,ParentFrame):-(Query=..[Frame,a_kind_of,ParentFrame] ; Query=..[Frame,instance_of,ParentFrame]), Query=..[Frame,instance_of,ParentFrame]),call(Query).

?-value(albert,active_at,AlbertTime).AlbertTime=daylight?-value(kiwi,active_at,KiwiTime).KiwiTime=night

% 40/115*100%=34.78% ?-value(ross,relative_size,R).R=34.78relative_size(Object,RelativeSize):-value(Object,size,ObjSize),value(Object,instance_of,ObjClass), value(ObjClass,size,ClassSize), value(ObjClass,size,ClassSize), RelativeSize is ObjSize/ClassSize*100. animal(relative_size, execute( relative_size(Obj,Val), Obj, Val ) ).

value(Frame,Slot,Value):-value(Frame,Frame,Slot,Value).value(Frame,SuperFrame,Slot,Value):-Query=..[SuperFrame,Slot,Information],call(Query),process(Information,Frame,Value).value(Frame,SuperFrame,Slot,Value):-parent(SuperFrame,ParentSuperFrame),value(Frame,ParentSuperFrame,Slot,Value).process(execute(Goal,Frame,Value),Frame,Value):-!,call(Goal).process(Value,_,Value).