الأحد، 25 أبريل 2010

Verbs of Communications3

5.6 physical.km (intermediate communication class inherited from Communication) : Physical communication handler, verifies if the communication is feasible in the physical mediums like sound or light. Also dynamically assigns correct instruments to the communicating agents and the communication itself.


;; PHYSICAL COMMUNICATION CLASS

;;



(phys-medium has

(instance-of (a Slot))

(domain (PhysicalCom))

(range (PhysicalCom))

(superslots (medium)))



(every PhysicalCom has

;; check if both source and listening instruments are there

(valid ((if (((the number of (the source-instrument of Self)) > 0)

and ((the number of (the listening-instrument of Self)) > 0))

then *Valid

else *Invalid)))

;; List of source devices available to source

(temps ((allof (the ComInstrument parts of (the source of Self))

where ((((the type of It) includes (*Source)) = *Source)))))

;; List of listening devices available to source

(templ ((allof (the ComInstrument parts of (the listener of Self))

where ((((the type of It) includes (*Reciever)) = *Reciever)))))

;; Find the devices which are compatible with the medium availabe currently

(source-instrument ((allof (the ComInstrument temps of Self)

where (oneof2 (the medium of It)

where ((the medium of Self) includes (It2))))))

(listening-instrument ((allof (the ComInstrument templ of Self)

where (oneof2 (the medium of It)

where ((the medium of Self) includes (It2))))))

;; the medium is now reasserted based on the compatibilty computations

(phys-medium ((the medium of (the source-instrument of Self)))))



;; temporary slots used above

(temps has

(instance-of (a ComInstrument))

(domain (PhysicalCom))

(range (PhysicalCom)))

(templ has

(instance-of (a ComInstrument))

(domain (PhysicalCom))

(range (PhysicalCom)))



(PhysicalCom has

(superclasses (Communicate))

(subclasses (SoundCom Type)))



(every PhysicalSound has

(source (a PhysObj)))



(PhysicalSound has

(superclasses (SoundCom)))







5.7 sound.km One of the classes derived from PhysicalCom is Soundcom checking validity of all sound communications - majority of the verbs inherit from this class too besides LingualCom


;; Derived from PhysicalCom, also the subclasses are shown for

;; future extension too. Not all of them are used

(Sound has

(superclasses (Information))

(subclasses (VerbalSound AnimalSound PhysicalSound)))



(sound-medium has

(instance-of (a Slot))

(domain (SoundCom))

(range (SoundCom))

(cardinality (N-to-N))

(superslots (medium)))



(loudness has

(instance-of (a Slot))

(domain (Sound))

(range (Sound)))



(every SoundCom has

(source ((a Agent)))

(listener ((a Intelligence)))

(information ((a Sound)))

(sound-medium ((*Sound)))

(source-instrument

((allof (the ComInstrument parts of (the source of Self))

where ((((the type of It) includes (*Source)) = *Source)

and ((the medium of It) = *Sound)))))

(listening-instrument

((allof (the ComInstrument parts of (the listener of Self))

where ((((the type of It) includes (*Reciever)) = *Reciever)

and ((the medium of It) = *Sound)))))

(transport ((a Fluid))))



(SoundCom has

(superclasses (PhysicalCom))

;; add more subclasses as needed

(subclasses (Talk Speak Babble Croak Scream Whisper Ask Shout Narrate Preach Teach Thunder Phone)))





(AnimalSound has

;; All non-human sounds; Whales, Penguins, Chimps and other

;; intelligent animals are on the border - basically the

;; sound comes from animal source which might include humans also

(superclasses (SoundCom)))



(every AnimalSound has

(source (a HigherAnimal)))





5.8 talk.km Most of these verbs derive from SoundCom and LingualCom


;; LANGUAGE BASED/MESSAGE VERBS



;; supporting definitions

(Question has (superclasses (Text)))

(Sentence has (superclasses (Text)))



(VerbalSound has

(superclasses (Sound Text)))



;;; Verb Defintions



;;;;;;;;;;;;;;;;;;;;;;;;;;;; ASK ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;

(Ask has

(superclasses (SoundCom LingualCom)))



(every Ask has

(source ((a Intelligence)))

(bandwidth ((*High)))

(information ((a VerbalSound with

(content ((*Medium)))

(emotion ((*Inquisitive)))

(loudness ((*Average)))

(duration ((*Medium)))

))))



;;;;;;;;;;;;;;;;;;;;;;;;;;;; TALK ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;

(Talk has

(superclasses (SoundCom LingualCom)))



(every Talk has

(source ((a Intelligence)))

(bandwidth ((*High)))

(information ((a VerbalSound with

(content ((*High)))

(emotion ((*Neutral)))

(loudness ((*Average)))

(duration ((*Long)))

))))

;;;;;;;;;;;;;;;;;;;;;;;;;;;; SHOUT ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;

(Shout has

(superclasses (SoundCom LingualCom)))



(every Shout has

(source ((a Intelligence)))

(bandwidth ((*Medium)))

(information ((a VerbalSound with

(content ((*Low)))

(emotion ((*Sharp)))

(loudness ((*High)))

(duration ((*Short)))

))))



;;;;;;;;;;;;;;;;;;;;;;;;;;;; SPEAK ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;

(Speak has

(superclasses (SoundCom LingualCom)))



(every Speak has

(source ((a Intelligence)))

(bandwidth ((*High)))

(information ((a VerbalSound with

(content ((*Medium)))

(emotion ((*Neutral)))

(loudness ((*Medium)))

(duration ((*Medium)))

))))



;;;;;;;;;;;;;;;;;;;;;;;;;;;; NARRATE ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;

(Narrate has

(superclasses (SoundCom LingualCom)))



(every Narrate has

(source ((a Intelligence)))

(bandwidth ((*High)))

(information ((a VerbalSound with

(content ((*High)))

(emotion ((*Neutral)))

(loudness ((*Medium)))

(duration ((*Long)))

))))



;; Explain same as Narrate



;;;;;;;;;;;;;;;;;;;;;;;;;;;; PREACH ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;

(Preach has

(superclasses (SoundCom LingualCom)))



(every Preach has

(source ((a Intelligence)))

(bandwidth ((*High)))

(information ((a VerbalSound with

(content ((*High)))

(emotion ((*Knowing *Religious)))

(loudness ((*Medium)))

(duration ((*Long)))

))))



;;;;;;;;;;;;;;;;;;;;;;;;;;;; TEACH ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;

(Teach has

(superclasses (SoundCom LingualCom)))



(every Teach has

(source ((a Intelligence)))

(bandwidth ((*High)))

(information ((a VerbalSound with

(content ((*High)))

(emotion ((*Knowing)))

(loudness ((*Medium)))

(duration ((*Long)))

))))



;;;;;;;;;;;;;;;;;;;;;;;;;;;; WHISPER ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;

(every Whisper has

(superclasses (LanguageCom SoundCom)))



(every Whisper has

(source ((a Intelligence)))

(bandwidth ((*Medium)))

(information ((a VerbalSound with

(content ((*Medium)))

(emotion ((*Neutral *Careful)))

(loudness ((*Low)))

(duration ((*Medium)))

))))



5.9 animal.km SOUND VERBS ANIMAL/HUMAN WITHOUT LINGUAL INFO




;;;;;;;;;;;;;;;;;;;;;;;;;;;; BABBLE ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;

(Babble has

(superclasses (SoundCom)))



(every Babble has

(source ((a HigherAnimal)))

(bandwidth ((*Low)))

(information ((a AnimalSound with

(content ((*Low)))

(emotion ((*Stupid)))

(loudness ((*Average)))

(duration ((*Medium)))

))))



;;;;;;;;;;;;;;;;;;;;;;;;;;;; CROAK ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;

(Croak has

(superclasses (SoundCom)))



(every Croak has

(source ((a HigherAnimal)))

(bandwidth ((*Low)))

(information ((a AnimalSound with

(content ((*Low)))

(emotion ((*Crudesound *Neutral)))

(loudness ((*Average)))

(duration ((*Short)))

))))



;;;;;;;;;;;;;;;;;;;;;;;;;;;; DECLARE ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;

(every Scream has

(superclasses (SoundCom)))



(every Scream has

(source ((a HigherAnimal)))

(bandwidth ((*Low)))

(information ((a AnimalSound with

(content ((*Low)))

(emotion ((*Sharp *Alarming)))

(loudness ((*Average)))

(duration ((*Short)))

))))



;;;;;;;;;;;;;;;;;;;;;;;;;;;; THUNDER ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;

(every Thunder has

(superclasses (SoundCom)))



(every Thunder has

(source ((a Physobj)))

(bandwidth ((*Medium)))

(information ((a PhyiscalSound with

(content ((*Low)))

(emotion ((*Neutral *Echoing)))

(loudness ((*High)))

(duration ((*Medium)))





5.10 animal.km EMOTIONAL VERBS, may or may not have language or sound, but the field emotion of the Information is important to distinguish them from other verbs.


;; supporting definitions

(Question has (superclasses (Text)))

(Sentence has (superclasses (Text)))



(VerbalSound has

(superclasses (Sound Text)))



;;; Verb Defintions



;;;;;;;;;;;;;;;;;;;;;;;;;;;; BOAST ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;

(Boast has

(superclasses (SoundCom LingualCom)))



(every Boast has

(source ((a Intelligence)))

(bandwidth ((*High)))

(information ((a VerbalSound with

(content ((*Medium)))

(emotion ((*Knowing *Exaggerating)))

(loudness ((*Average)))

(duration ((*Medium)))

))))



;;;;;;;;;;;;;;;;;;;;;;;;;;;; GRUMBLE ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;

(Grumble has

(superclasses (SoundCom LingualCom)))



(every Grumble has

(source ((a Intelligence)))

(bandwidth ((*Medium)))

(information ((a VerbalSound with

(content ((*Low)))

(emotion ((*Unhappy)))

(loudness ((*Low)))

(duration ((*Short)))

))))



;;;;;;;;;;;;;;;;;;;;;;;;;;;; DECLARE ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;

(Declare has

(superclasses (SoundCom LingualCom)))



(every Declare has

(source ((a Intelligence)))

(bandwidth ((*High)))

(information ((a VerbalSound with

(content ((*Medium)))

(emotion ((*Authoritative)))

(loudness ((*Average)))

(duration ((*Medium)))

))))







5.11 examples.km : Some example instances of the verbs defined


;; SOME EXAMPLES OF MAN-MAN and MAN-MACHINE COMMUNICATION



(*Gunjan has

(instance-of (Human))

(country (*India))

(artificial-parts (*RadioUnit)))



(*Alex has

(instance-of (Human))

(country (*Germany))

(artificial-parts (*RadioUnit)))



(*Tom has

(instance-of (Human))

(country (*USA))

(artificial-parts (*RadioUnit)))





;; The knowledgebase can answer questions like -

;; what did Gunjan use to Ask his question - his VoiceBox

;; what did Tom use to hear the question - his Ears.

;; what language was used to talk given their background - English



;; TRY OUT THE EXAMPLES BELOW



(a Speak with

(source (*Gunjan))

(listener (*Alex)))



(a Ask with

(medium (*RadioWaves))

(source (*Gunjan))

(listener (*Tom)))



(a Talk with

(source (*Gunjan))

(listener (*Tom)))



(a Type with

(source (*Gunjan))

(listener ((a PC))))





;; NOW TRY THE FOLLOWING QUERY

(the valid of (that Speak))

(the allvalid of (that Speak))

(the source-instrument of (that Speak))

(the destination-instrument of (that Speak))

(the medium of (that Speak))

(the language of (the source of (that Speak)))

(the bandwidth of (that Speak))

(the information of (that Speak))

(the content of (the information of (that Speak)))

(the emotion of (the information of (that Speak)))

(the loudness of (the information of (that Speak)))

(the duration of (the information of (that Speak)))



;; NOW TRY THE SAME QUERIES FOR THE REMAINING THREE VERBS TOO



;; some comments : As we can see there are three main classes from

;; which the verbs can be inherited - thus 8 possible ways of

;; inheritance. Since the Beth-Levin's verbs of Communication were

;; roughly 166 in number, 8 is not enough to resolve some less

;; important differences between verbs. The additional optional

;; slots bandwidth, information, content, emotion, loudness, duration

;; add up to provide hundreds of possible combinations so that they

;; the verbs can now be distinguished more. Most of these parameters

;; are subjective and need to be "measured" in an actual machine

;; reasoning system to distinguish say shout from speak (for example

;; these two verbs differ in their loudness duration, information

;; content etc.. although both might involve language and sound.









5.12 main.km : Main file, loads everything


;; the file that loads everything into memory

(load-kb "communicate.km")

(load-kb "agents.km")

(load-kb "lingual.km")

(load-kb "sound.km")

(load-kb "physical.km")

(load-kb "talk.km")

(load-kb "data.km")

(load-kb "examples.km")

ليست هناك تعليقات :

إرسال تعليق