||
Expressing the most complicated concepts with the simplest sentences or performing the most tasks with the least words is always the aspiration of programming languages. To this purpose, natural languages are undoubtedly the best. The word “entironment” in natural language imply unlimited connotation. The instruction make the economic plan” involve tremendous work. How about program this way?
The most significant differences between natural language and traditional language appear in two aspects: the first is infotainment; the second is the openness.
Infotainment : Natural languages imply knowledge while traditional languages are just procedure description tools which contain almost no knowledge. As noun “sun” implied red color and hot. On the contrary, An integer in traditional languages represent nothing to the compiler. The interpretation of data is totally left to programmer.
Openness: Natural languages are open languages, with unlimited vocabulary and unlimited content in every word. The traditional languages are closed languages made up of limited commands or key words. Natural languages may expand both extensively, and intensively. Means the vocabulary and the content of words of natural languages may expand without rebuild the language processor. But traditional languages, the predefined statements or commands are is immutable both in format and connotation after the language processors are built.
The elements of Quasi_Natural Language are unlimited words defined in dictionaries, which are independent of language processor.
The Structure of Word
A word consists of a word name and properties, as in Fig 1. At least one property “Part of Speech” is necessary, which determine the syntactic part of word.
Knowledge representation in noun
The noun define the data structure of an object (class and instance object are indifferent in Quasi_Natural Language). As noun “sound” define all data required for processable sound object in Windows in Fig 2. Since the language is at first developed for Chinese, some data appear in Chinese chatacters.
Every properties in Fig 2 must be defined by other noun until reaching basic data type without further structure. As “wavHeader” defined in Fig 3.
Similarly, property “chunkID” is defined in Fig 4.
Word “chunkID” is a basic data type without more property to be defined further. The 2 lines in the table appeare in Chinese are property “Part of Speech” and property “data type”.
Other properties in Fig 2 and Fig 3 are defined likely. And form a hierarchy structure as in Fig 5.
Knowledge representation in verb
All operations are defined in verbs. Verb defines the operated objects, produced object and information for the executable code to perform the verb. As verb “record” is defined in Fig 6.
Another class of verb is written in Quasi_Natural Language. It’s defined similarly.
Inheritance
All the nouns may be Inherited by other nouns. As in Fig 7, noun “PureTone” inherit all properties and suitable verbs of noun “wav” by defining a property “WordClass” and set it’s value to “wav”.
The properties defined in “PureTone” overlay the homonymic properties in noun “wav”. If there is no homonymic property in “wav”, new property is added to “PureTone” at running time.
In this case, property “FileSpecification” and property “wavFormat” in “PureTone” overlay homonymic properties defined in “wav”(although it’s empty in this case) by nouns “PureToneSpecification”. And “StandardFormat”, which define some detailed information. As “PureToneSpecification” defined in Fig 8.
With knowledge in dictionary we perform tasks in simple code instead of chunk of code required in traditional languages. As the code in Fig 9 record a voice and save to a file specified in noun “PureToneSpecification”.
Sentence “ThereIs PureTone” declare an object “PureTone”.
Sentence “record PureTone” acts verb “record” upon object “PureTone” to perform operation record.
Complicated data structure may be abstracted into simple noun. Chunk of code may be abstracted into simple verb. So brief sentences may perform heavy tasks.
A prototype of Quasi_Natural Language—Kaimeng Language is implement by the author. The primary ideas of Quasi_Natural Language are all realized in Kaimeng.
Some ideas as build new knowledge upon existing knowledge are implemented in Chinese, not appear in this document.
Author: Yinpu
E-mail: yinpu@whu.edu.cn
Archiver|手机版|科学网 ( 京ICP备07017567号-12 )
GMT+8, 2024-4-26 00:44
Powered by ScienceNet.cn
Copyright © 2007- 中国科学报社