1 / 5

predicates nondeterm isa(symbol,symbol) nondeterm hasprop(symbol,symbol,symbol).

predicates nondeterm isa(symbol,symbol) nondeterm hasprop(symbol,symbol,symbol). nondeterm hasproperty(symbol,symbol,symbol). clauses isa(canary,bird). isa(robin,bird). isa(ostrich,bird). isa(bird,animal). isa(opus,penguin). isa(penguin,bird). isa(fish,animal). isa(tweety,canary).

tabib
Download Presentation

predicates nondeterm isa(symbol,symbol) nondeterm hasprop(symbol,symbol,symbol).

An Image/Link below is provided (as is) to download presentation Download Policy: Content on the Website is provided to you AS IS for your information and personal use and may not be sold / licensed / shared on other websites without getting consent from its author. Content is provided to you AS IS for your information and personal use only. Download presentation by click this link. While downloading, if for some reason you are not able to download a presentation, the publisher may have deleted the file from their server. During download, if you can't get a presentation, the file might be deleted by the publisher.

E N D

Presentation Transcript


  1. predicates nondeterm isa(symbol,symbol) nondeterm hasprop(symbol,symbol,symbol). nondeterm hasproperty(symbol,symbol,symbol). clauses isa(canary,bird). isa(robin,bird). isa(ostrich,bird). isa(bird,animal). isa(opus,penguin). isa(penguin,bird). isa(fish,animal). isa(tweety,canary). hasprop(tweety,color,white). hasprop(robin,color,red). hasprop(canary,color,yellow). hasprop(penguin,color,brown). hasprop(bird,travel,fly). Implementing inference using inheretance hasprop(fish,travel,swim). hasprop(ostrich,travel,walk). hasprop(penguin,travel,walk). hasprop(robin,sound,sing). hasprop(canary,sound,sing). hasprop(bird,cover,feather). hasprop(animal,cover,skin). hasproperty(Obj,Pr,Val):-hasprop(Obj,Pr,Val). hasproperty(Obj,Pr,Val):-isa(Obj,Parent),hasproperty(Parent,Pr,Val). goal hasproperty(Obj,Pr,fly).

  2. Name:bird Name:animal Isa: animal Isa: animate Prop:flies,feather Prop:eats,skin Default: Default: Name:tweety Name:canary Isa: canary Isa: bird Prop: color(yellow),sound(sing) Prop: color(yellow),sound(sing) Default:color(white) Default:size(small) Frames from a knowledge base of birds

  3. domains obj=symbol prop=travel(symbol);color(symbol);call(symbol);size(symbol);cover(symbol);action(symbol) listp=prop* name=name(obj) isa=isa(obj) predicates nondeterm frame(name,isa,listp,listp) nondeterm get(prop,obj) nondeterm member(prop,listp) nondeterm memberf(prop,listp) nondeterm uget(obj,listp) nondeterm equal(prop,prop) print(listp) clauses frame(name(bird),isa(animal),[travel(flies),cover(feathers)],[]). frame(name(penguin),isa(bird),[color(brown)],[travel(walks)]). frame(name(canary),isa(bird),[color(yellow),call(sing)],[size(small)]). frame(name(tweety),isa(canary),[],[color(white)]). equal(travel(_),travel(_)). equal(color(_),color(_)). equal(call(_),call(_)). equal(size(_),size(_)).equal(cover(_),cover(_)). equal(action(_),action(_)).

  4. memberf(P,[H|_]):-equal(P,H). memberf(Pro,[_|T]):-memberf(Pro,T). member(P,[H|_]):-P=H. member(Pro,[_|T]):-member(Pro,T). get(Pro,Obj):-frame(name(Obj),_,LP,_),member(Pro,LP). get(Pro,Obj):-frame(name(Obj),_,_,LD),member(Pro,LD). get(Pro,Obj):-frame(name(Obj),isa(Parent),_,_),get(Pro,Parent). uget(Obj,L):-get(H,Obj),NOT(memberf(H,L)),uget(Obj,[H|L]). uget(Obj,L):-write(Obj),write(":"),print(L). print([]). print([H|T]):-write(H),print(T). goal uget(tweety,[]). tweety:cover("feathers")travel("flies")size("small")call("sing")color("white")yes

More Related