/* AIC- System */ /* consult('C:/ PATH TO THE PROLOG FILES /aicsystem.pl'). FOR EXAMPLE consult('C:/Users/annehak/Documents/aicsystem.pl').*/ /* To start the execution of the system, you write start_conversation. The system will ask you questions. Do not forget that if you like to answer with a capital letter you need to use ' ', like 'Anne'.*/ :- dynamic sight/3, perception/8, animal/3, sounds/2, taste/4, smell/2, touch/4, feeling/1, expression/1. :- retractall(sight(_,_,_), perception(_,_,_,_,_,_,_,_), animal(_,_,_), sounds(_,_), taste(_,_,_,_), smell(_,_), touch(_,_,_,_), feeling(_), expression(_). /* Communication */ start_conversation:- write('Hi ! '),nl, write('When you interact with me, if you write more than one word as an answer you need to write single citation marks in the beginning and in the end of the sentence. You also need to write period after each answer - ok? >'), read(Answer),nl, write('How are you? > '), read(Text), write('OK ! Lets go! '), nl, build_database. build_database:- nl, write(' What are you? A human, an animal, or a thing? (Stop ends the process) > '), read(Object), (Object \== stop; Object \== 'Stop'), treat_object(Object), build_database. build_database. show_db:- findall((Name, Depictures, Colorsscales, Sharpness), perception(Name, sight(Depictures, Colorsscales, Sharpness), sound(_), taste(_), smell(_), touch(_), emotion_feeling(_), expression(_)), List), write(List), nl, write(' Under development! '), nl. treat_object(Object):- (human_conversation(Object, Name); animal_conversation(Object, Name); thing_conversation(Object, Name)), ask_menu. ask_menu:- write(' Give new object or show data? (Write either new or show) > '), read(Object), ((Object = new); Object = show, show_db). human_conversation(Object, Name):- (Object = ('human'); Object = ('Human'); Object = ('Man'); Object = ('Woman')), write('What is your name ? >' ), read(Name), write('Hi '), write(Name), write(' It is nice to meet you !' ), nl, write('Are you a male or a female? > ' ), read(Type), write('How do you characterise yourself? > ' ), read(Depictures), write('What is the colour of your eyes? > ' ), read(Colorsscales), Sharpness = 1, assert(sight(Depictures, Colorsscales, Sharpness)), assert(perception(Name, sight(Depictures, Colorsscales, Sharpness), sound(_), taste(_), smell(_), touch(_), emotion_feeling(_), expression(_))), nl, write('I am happy that I finally met you! > ' ), nl, nl. animal_conversation(Object, Name):- (Object = ('animal') ; Object = ('Animal')), write('What kind of animal is it? > ' ), read(Animal), write('What does it sound like? > ' ), read(Sound), write('What does it look like? > ' ), read(Picture), write('What characterise the '), write(Animal), write(' ? > ' ), read(Character), assert(sounds(Sound, Voice)), assert(sight(Picture, SightCS, SightS)), write('Taste, smell, touch, feeling and expression are under development'),nl, assert(animal(Sound, Picture, Character)), write('It is great to finally get information about this animal! ' ), nl. thing_conversation(Object, Name):- (Object = ('thing') ; Object = ('Thing')), write('I am under development! > ' ). /** Knowledge base **/ /**Perception = {Sight, Sound, Taste, Smell, Touch, Emotion/Feeling, Expression} **/ perception(Thing):- sight(SightD, SightCS, SightS), sound(Y), taste(Z), smell(V), touch(W), emotion_feeling(E), expression(D). /** Databases **/ /** Sight = {depictures, , sharpness}, sharpness = **/ sight(SightD, SightCS, SightS):- depictures(D), colors_scales(CS), sharpness(S). depictures(Object). colors_scales(ColorsScales). sharpness(Sharp). /**Sounds = {vocalization, voice}, vocalization = , voice = **/ sounds(Vocalization, Voice). /**Taste = {Temperature (celsius), experience, texture, flavour}, Experience = , texture = < hard, soft>, flavour = < sweet, salt, sour, bitter, umami, mineral, metal, oil>**/ taste(Temperature, Experience, Texture, Flavour). /**Smell = {olfactions, pheromones}, olfactions = < presence of smell >, pheromones = < fluid-phase smells >**/ smell(Olfactions, Pheromones). /**Touch = {contact, temperature, pressure, perception }, perception = < hard, soft>**/ touch(Contact, Temperature, Pressure, Perception). /**Feeling = {emotions}, emotions = < hunger, sad, anger, full, glad, tired, confused, fear, pain, sickness > **/ feeling(Emotions). /**Expression = {expressions} expressions = **/ expression(Expressions).