Grammar Writing: Difference between revisions
Nikoschenk (talk | contribs) No edit summary |
|||
Line 103: | Line 103: | ||
Recall that the upper part of the picture represents types ordered from most general (the type ''vehicle''), to more specific (all the types in the second and third rows), and finally to most specific (the maximal types ''VolvoCar, FiatCar'', and ''FordCar''. All these types stand for classes of objects, with ''vehicle'' being the biggest class and the maximal types being the smallest. | Recall that the upper part of the picture represents types ordered from most general (the type ''vehicle''), to more specific (all the types in the second and third rows), and finally to most specific (the maximal types ''VolvoCar, FiatCar'', and ''FordCar''. All these types stand for classes of objects, with ''vehicle'' being the biggest class and the maximal types being the smallest. | ||
In contrast to the <span style="color: red>types</span>in the upper half of the picture, the three items below the dashed line do not stand for classes of objects, but to <span style="color: red>individual objects.</span> That is why the creator of the picture labeled the lower part of the picture ''members''. | In contrast to the <span style="color: red>types</span> in the upper half of the picture, the three items below the dashed line do not stand for classes of objects, but to <span style="color: red>individual objects.</span> That is why the creator of the picture labeled the lower part of the picture ''members''. | ||
<span style="color: blue>Illustration</span> | <span style="color: blue>Illustration</span> |
Revision as of 11:40, 23 October 2018
In this course you are going to learn how to write formal grammars with a piece of software called DesktopTrale (https://github.com/nikoschenk/desktoptrale [1]). This software is unique in that it allows you to write grammars by simply entering information about words and phrases in forms and saving these forms. Behind the scenes, DesktopTrale then creates the formal grammar which you can test on our grammar server.
Course and Module Requirements
What is a Grammar?
The purpose of a grammar is to tell you which strings of words are well formed in the language described by the grammar and which ones are not. For example, a grammar of English should tell you that the string of words in (1) is well formed English, whereas the string of words in (2) is not:
(1) Lilly likes the cat.
(2) *the Lilly cat likes.
In order to accomplish this task, a grammar needs to have at least a lexicon which contains words and grammar rules that specify which combinations of expressions are well formed phrases.
Types
Maybe you are eager to start defining words and phrases now. But before we do that, it is useful to think about the whole project and to work systematically. After all, we want to work as efficiently as possible and avoid any unnecessary or duplicate work. The issue of efficiency comes into focus when you consider the fact that a language like English has several ten thousand words in its lexicon and each word in turn contains a lot of information, among others:
- Phonological information: how the word is pronounced
- Semantic information: the word's meaning
- Morphological information: information about case, verb form, etc.
- Syntactic information: the word's part of speech and its valence.
Each word may then contain a dozen or more pieces of information. If you multiply this by the tens of thousands of words in a natural language, that makes a huge amount of information. In fact, lexical knowledge, i.e. the knowledge of information about words, by far makes up the largest part of what speakers know about their language! This means that the lexicon will be the largest component of our grammars. Therefore, it is very important that we capture this information as effectively as possible.
This is where the notion of a type comes into play. Before explaining what a type is, I give a number of examples from which you will probably already be able to guess what types are and why they are so useful. Probably all of you have a smartphone. Even though these phones may be from different manufacturers and may be different models, they are all smartphones. So, if your parents ask you what you want for your birthday and you say that you want a new smartphone, then they know that they shouldn't get you a TV set, a tennis racket, or a bicycle. All of these, smartphones, TV sets, tennis rackets, bicycles, etc. are types of things. Even though not all smartphones have the same properties and neither do all TV sets, etc. all smartphones have things in common that distinguish all of them from TV sets or tennis rackets.
The website www.dictionary.com contains the following information:
type: a number of things or persons sharing a particular characteristic, or set of characteristics, that causes them to be regarded as a group, more or less precisely defined or designated.
Why, then, are types so useful? Because they contain information about not just one thing, but a number of things, as the definition above says. And this brings us back to efficiency: if many items in a grammar share a particular characteristic or set of characteristics, then we can define a type as having these shared properties. For all the elements that behave alike because they all have the properties of the type, we simply state that they are things of that type. In this way, we do not need to repeat in their definitions the same set of properties over and over again. It is in that sense that using as many types as possible makes a grammar very efficient!
Types and Subtypes
Look at the following picture. It contains a particularly clear and systematic classification of a type of objects, namely vehicles. We are going to use it to introduce some important concepts and technical terms which are fundamental to the grammars that we will be writing.
(Source: http://www.infowebml.ws/intro/index.htm)
The picture contains of two parts, separated by the dashed line towards the bottom. Above the dashed line, we find a systematic classification of vehicles (such a classification is also called a taxonomy, but we don't use that term in linguistics). The pieces of the classification are all types. All the way at the top, we have the type Vehicle. This means that object that falls under the hierarchy is a vehicle. Directly below Vehicle, we find the three types Truck, Car, and Bus. These are specific types of vehicles. The type Car is further divided three times, and the middle type Family car as well. The dashed line now signals that the hierarchy of types ends here. We will come to the bottom line in a moment. Before we do that, we introduce some important technical terms and illustrate them with the picture above.
Type
Every node in the hierarchy (above the dashed line) is a type. A type stands for a class of things.
Illustration:
The types in the vehicle hierarchy are the following: Vehicle, Truck, Car, Bus, LuxuryCar, FamilyCar, SportsCar, VolvoCar, FordCar, FiatCar.
Subtype
The subtypes of a type t are all the types that can be reached from t by following branches downward in the hierarchy. The subtypes of a type stand for more specific things of that type.
Illustration:
- The subtypes of type Vehicle in the vehicle hierarchy are the following: Truck, Car, Bus, LuxuryCar, FamilyCar, SportsCar, VolvoCar, FordCar, FiatCar.
- The subtypes of type Car in the vehicle hierarchy are the following: LuxuryCar, FamilyCar, SportsCar, VolvoCar, FordCar, FiatCar.
- The subtypes of type FamilyCar in the vehicle hierarchy are the following: VolvoCar, FordCar, FiatCar.
- The types of type VolvoCar, FordCar and FiatCar have no subtypes.
Immediate Subtype
An immediate subtype of a type t is every subtype that can be reached by going just one step down in the hierarchy.
Illustration:
- The immediate subtypes of type Vehicle in the vehicle hierarchy are the following: Truck, Car, Bus.
- The immediate subtypes of type Car in the vehicle hierarchy are the following: LuxuryCar, FamilyCar, SportsCar.
- The subtypes of type FamilyCar in the vehicle hierarchy are the following: VolvoCar, FordCar, FiatCar.
- Since the types VolvoCar, FordCar and FiatCar have no subtypes at all, they also have no immediate subtypes.
Maximal and Non-maximal Type
A maximal type is a type which has no subtypes. Correspondingly, the types which so have subtypes are called non-maximal.
- The maximal types in the vehicle hierarchy are the following: Truck, Bus, LuxuryCar, SportsCar, VolvoCar, FordCar, FiatCar.
- The non-maximal types in the vehicle hierarchy are the following: Vehicle, Car, FamilyCar.
The Type Hierarchy
Definition The set of types that can be used in a grammar is called the type hierarchy. In DesktopTrale, the type hierarchy is saved in a file called signature.
Objects and Types
So far we have only talked about the upper part of the picture below. Now, we are going to turn our attention to the lower part and the relationship between the two parts.
(Source: http://www.infowebml.ws/intro/index.htm)
Recall that the upper part of the picture represents types ordered from most general (the type vehicle), to more specific (all the types in the second and third rows), and finally to most specific (the maximal types VolvoCar, FiatCar, and FordCar. All these types stand for classes of objects, with vehicle being the biggest class and the maximal types being the smallest.
In contrast to the types in the upper half of the picture, the three items below the dashed line do not stand for classes of objects, but to individual objects. That is why the creator of the picture labeled the lower part of the picture members.
Illustration
Tom's car is an individual object. The downward arrow from the type VolvoCar to the object Tom's car means that Tom's car is of type VolvoCar, i.e. is a member of the class of Volvo cars. But since, VolvoCar is a subtype of the types FamilyCar, Car, and Vehicle, this means that Tom's car also belongs to the types (and the classes they stand for). In other words: Tom's car is a Volvo car, a family car, a car, and also a vehicle. As a result, Tom's car not only has all the properties of a Volvo (= its maximal type), but also all the properties of a family car, a car, and a vehicle (the non-maximal types that it belongs to)!
Objects Can Contain Other Objects
Let us now look at a second picture. Click on the link below and then on the Back button of your browser to come back here.
What you see is the illustration of a car and its components. Below the picture, the parts of the car are grouped together into functional units, for instance the cooling system and the the gas supply system. These parts of the car can be viewed as objects in their own right which each belong to a type one might call car part. The type cooling system might then be an immediate subtype of the type car part and might have the the types radiator and cooling fan as its own immediate subtypes.
All this illustrates that objects which themselves belong to certain types may contain other objects as their parts and those objects again belong to one or more types!
Summary
Here is a summary of the our discussion of objects and types:
- Every object belongs to one maximal type and all the supertypes of this maximal type.
- A type of object may contain objects of other types.
- An object has all the properties of every type it belongs to, both its maximal type and its non-maximal type.
In the next section, we will design our first grammar. We will make use of all the concepts that we have introduced in this section.
Navigation: