Difference between revisions of "Universal Prokee Language"
(→Programming in Chinese?) |
(→Is-A Relationship) |
||
| (One intermediate revision by the same user not shown) | |||
| Line 18: | Line 18: | ||
=== Has-A Relationship === | === Has-A Relationship === | ||
| − | The has-a relationship between two objects (or words) describes ownership. | + | The has-a relationship between two objects (or words) describes ownership. E.g. a '''car''' ''has-a'' '''steering wheel'''. |
The has-a relationship is the default relationship between consecutive words. The sentence "A car has a steering wheel." translates into UPL as shown below. | The has-a relationship is the default relationship between consecutive words. The sentence "A car has a steering wheel." translates into UPL as shown below. | ||
| Line 25: | Line 25: | ||
=== Is-A Relationship === | === Is-A Relationship === | ||
| − | The is-a relationship between two objects (or words) describes inheritance. | + | The is-a relationship between two objects (or words) describes inheritance. E.g. a '''car''' ''is-a'' '''vehicle'''. |
The default is-a operator is the colon ':'. The sentence "A car is a vehicle." translates into UPL a shown below. | The default is-a operator is the colon ':'. The sentence "A car is a vehicle." translates into UPL a shown below. | ||
| Line 31: | Line 31: | ||
Multiple inheritance can be established by stating all superclasses concatenated by a comma ','. | Multiple inheritance can be established by stating all superclasses concatenated by a comma ','. | ||
| − | + | E.g. | |
C:Letter,ProgrammingLanguage,RomanNumeral | C:Letter,ProgrammingLanguage,RomanNumeral | ||
would be interpreted as: 'C' is a letter, a programming language and a roman numeral. | would be interpreted as: 'C' is a letter, a programming language and a roman numeral. | ||
Latest revision as of 18:28, 13 July 2019
The Universal Prokee Language (UPL) is a programming language based on natural languages and semantic nets.
Contents
Programming in Chinese?
Some inspiration for UPL comes indeed from the Chinese language.
In most languages, written words are representations of their phonetic sequence (spoken words). The atomic symbols of a written language (the letters) therefore represent the sounds, which form the spoken words of that language. The amount of different sounds of a human language is very small, so a small alphabet is sufficient to be able to write every word of such a language. By knowing all spelling rules one can theoretically write and read German or English words without necessarily being able to understand them. In contrast, the Chinese language is completely different.
In Chinese the meanings of words are represented by Symbols (Chinese characters), without being required to know how a word is spoken. At the early beginnings of the Chinese language every symbol represented a word and every word was written by a single symbol. And also today most Chinese words consist of only very few (one or two, rarely 4 or more) characters. The consequence of this is, that a huge "alphabet" is required, and avoiding the introduction of unnecessary symbols is essential.
In German e.g. we have inflection of nouns and verbs. German words come in different forms regarding to cases (nominative, accusative, genitive and dative), genders (masculine, feminine and neuter), number (singular or plural), conjugation classes, persons (first second and third), moods (infinitive, indicative, imperative and subjunctive), voices (active and passive), tenses and so on. All those different forms are essential for German.
Trying to write German with Chinese characters would fail, because all the different forms of words in German would require to invent lots of new different Chinese characters. This would result in way to many characters for a human to be able to remember. But how does the Chinese language encode the same information with much fewer words? It does so by replacing inflection with word order.
When we look at computer languages, we normally do not have inflection of keywords, but we do have a fixed word order to build valid sentences. These similarities and the differences to other natural languages resulted in considerations to develop a new language, that is as simple as possible by focusing on word order and eliminating the overhead in complexity common to all natural languages, which includes Chinese as well. So we do not want to program in Chinese but rather take some inspirations from it, to develop a completely new language.
Semantic Nets
A semantic net is a representation of words (or objects, or classes of objects) and the relationships between those words.
Has-A Relationship
The has-a relationship between two objects (or words) describes ownership. E.g. a car has-a steering wheel.
The has-a relationship is the default relationship between consecutive words. The sentence "A car has a steering wheel." translates into UPL as shown below.
Car SteeringWheel
If we refer to the steering wheel, the statement above may also be interpreted as "the steering wheel of the car" or "a steering wheel of a car". See #Paths and Queries on how to refer explicitly to a specific item.
Is-A Relationship
The is-a relationship between two objects (or words) describes inheritance. E.g. a car is-a vehicle.
The default is-a operator is the colon ':'. The sentence "A car is a vehicle." translates into UPL a shown below.
Car:Vehicle
Multiple inheritance can be established by stating all superclasses concatenated by a comma ','.
E.g.
C:Letter,ProgrammingLanguage,RomanNumeral
would be interpreted as: 'C' is a letter, a programming language and a roman numeral.
Other Relationships
Other relationships can be established by a concatenation of has-a and is-a relationships.