THE AUTOMATED TRANSLATION OF NATURAL LANGUAGE SENTENCES INTO INTENSIONAL LOGIC AT THE TYPE ANALYSIS AND CONSTRUCTION SYNTHESIS LEVELS

This paper describes the theoretical design and implementation of the semantic machine of transparent intensional logic. Transparent intensional logic is used for the logical-semantic analysis of natural language, which is performed in three steps type analysis, creation of construction, and type control (last step is optional). The semantic machine described in this paper allows analyzing natural language sentences in the first two of the mentioned steps. Transparent intensional logic analyzes the meaning of natural language sentences and therefore it was not essential to focus on the syntactic level of analysis. Syntactic analysis is performed using a Stanford CoreNLP parser, which was carefully selected after comparison with competing parsers. The functionality of the implemented semantic machine is demonstrated by a logical analysis of examples of natural language sentences.


INTRODUCTION
Czech logician Pavel Tichý created foundations of transparent intensional logic (TIL) in 1961 [1]. TIL uses an updated version of the object-oriented λ -calculus which has a ramified hierarchy of types. Tichý defined the TIL object base to analyze natural language expressions. Object base contains a set of individuals ι, a set of truth values o, a set of possible worlds ω and a set of time points τ [2]. {ι, o, ω, τ} objects represent a TIL intensional base. The intensions are objects of type ((ατ)ω), defined as functions from possible worlds in time points for any type α.
A meaning of expression is expressed by its construction in TIL. Constructions are abstract, algorithmically structured procedures which represent the meaning of natural language expressions. Types of constructions [3]: • variable x v-construct a construction, where v is a valuation parameter, • trivializationˆ0A cunstruct A without any change, • composition [AA] construct the application of a function to arguments, • closure λxA construct a function.
The competitive logic system for TIL is Montague intensional logic (MIL) [4]. MIL has several drawbacks that TIL had overcome [5]. TIL is an effective tool for logical analysis of natural language because of its extraordinary expressive power [6], which makes it a suitable basis for the implementation of a semantic machine.

SYNTACTIC PARSERS
Analyze of the natural language sentences has two levels -syntactic and semantic [7]. To implement a semantic machine, it is necessary to first perform parsing of a sentence and, based on its output, to examine the meaning of a sentence by using semantic analysis [8]. The TIL principles are applied at the semantic level, so there was no need to implement a custom parser. We decided to use an existing tool for the syntactic analysis. Two of the most commonly used syntactic analyzers -Link Grammar Parser and Stanford CoreNLP, were compared to select the most appropriate tool as the basis of the semantic machine.

Link Grammar Parser
Link Grammar Parser [9] represents a syntax parser of the English language. This analyzer is written in C programming language and it is entirely open-source. The size of its verbal equipment is more than 60 000 words. In Figure 1 is an output from Link Grammar Parser for the sentence ,,John is an American singer.".
The output gives the display and naming of the links between individual words within the analyzed sentence. Each word of the tree is assigned to some word class. The unpleasant drawback of Link Grammar Parser is that the output is only in plain text form. For the programmer, it is hard to get some results for future semantic analysis.

Stanford CoreNLP
Stanford CoreNLP (SCN) [10] appears as a more comprehensive and advanced open-source parser. SCN is an annotation-based natural language processing framework. In addition to English, this analyzer also supports other languages, such as German, Spanish, French, Arabic or Chinese. SCN is written in Java programming language. The great advantage that SCN offers is its interfaces. Thanks to them, it is possible to use SCN with programming languages as C#, Python or JavaScript and it is also cooperative with Docker. The parser can read a single sentence, as well as multiple sentences in a block of the text as an input. If the block of the text is used as an input, then every sentence is analyzed separately and SCN returns a package of analyzed sentences in the output.
Based on our analysis, SCN gives more possibilities to further data processing than Link Grammar parser (shown in Figure 2). SCN returns the result of sentence analysis in json, which is comfortable to parse for the programmer.  Table 1 shown the comparison of Link Grammar parser and SCN. Based on it, we decide to choose SCN as the foundation of the TIL semantic machine implementation.

TIL SEMANTIC MACHINE
The semantic analysis of sentences is the second step of the logical analysis of natural language. The output of TIL semantic analysis is a sentence represented by TIL construction.
Before our semantic machine implementation, there was one similar solution created by Czech logician Aleš Horák [13]. His semantic machine works with the Czech language and covers almost the entire conceptual equipment [14]. The semantic machines of TIL (Horák and also ours) execute natural language processing in three successive steps (shown in Figure ??): 1. type analysis -to each object of the sentence is assigned corresponding type, 2. synthesis of construction -construction describes the meaning of an analyzed sentence, 3. type control -proving if the earlier steps were precisely made (voluntary part). The left side of Figure 3 represents a formal analysis of the sentence in TIL. The right side captures input processing. The input sentence/block of sentences is at the beginning sent to SCN. SCN provides syntactic analysis and returns analyzed text in json form. In the module provide type analysis of the semantic machine, a type analysis is made. All the identified types of objects are saved into a list, which should be passed to the module create construction. Successfully generated construction is printed on the output of the semantic machine. Finally, the necessary data are provided to the module provide type analysis.

Automated type analysis
The type analysis is the first step of the semantic machine implementation. The analyzed types extend basic TIL types o, ι, ω, τ.
Individual -one of the basic types in TIL. It always starts with a capital. SCN indicates individual as NNPa proper noun (Figure 4, part a).
Truth value -one of the basic types in TIL. In the sentence ,,Sun is shining." word shining expresses truth value because it describes the state of the sun in some possible world and time point. The truth value can be also achieved as an independent element of the nominal subject nsubj (Figure 4, part b). Attribute -an extended type in TIL. It is necessary to find a dependency case, where an individual is a dependent element and the indicator 's describes an independent element. Next, the dependency nmod:poss could be foundthe dependent element is the individual and the independent element is the attribute that is owned by the individual. If there is no individual in the sentence, there is a need to find nmod:poss dependency directly (Figure 4, part c).
Property of the object -an extended type in TIL. To find out this type, there should be a dependency nsubj, where an individual is a dependent element and the truth value is an independent element. Sentence ,,Bob is student." has the property student which is assigned to the individual Bob (Figure 4, part d).
Property of the property -an extended type in TIL. To find out this type, there should be a dependency amod, where the dependent element is a property of property and the independent element represents property assigned to the object (Figure 4, part e).
Binary relation -an extended type in TIL. To find out this type, there should be a dependency nsubj or nsubjpass, where the dependent element is an individual and the independent element is a relation. Next a dependency dobj with another individual as the dependent element and relation as the independent element should be found (Figure 4, part f).
Value -an extended type in TIL. An expression has a type of value when it is a cardinal number CD or it can be expressed by the special nouns as length, weight, temperature, height ... (Figure 4, part g).
Property of the value -an extended type in TIL. It is related to all kinds of value. After identifying the value type in the sentence, the dependency nsubj should be found, where the dependent element is a value and the independent element is a property (Figure 4, part g, fourth sentence).
Each type specified in this chapter has been implemented in the provide type analysis module of the TIL semantic machine. If all the lexical objects of the natural language sentences have assigned the corresponding types, it is possible to proceed to the second phase of semantic analysis -the creation of the construction.

Automated synthesis of constructions
There is a dependency ROOT in the output from SCN ( Figure 2). The benefit of this dependency is that it is in every analyzed sentence, so in our implementation, synthesis of construction always starts from it. After the type analysis is finished, a list of all found types of objects is made, which helps us to determine a dependency ROOT in the sentence.
In the sentence ,,John is a singer.", the ROOT of sentence is the object singer which is the property type. It is necessary to discover the related types -if the object singer is related to an individual then the object singer has to be intensionalized in the output construction.

λwλt[[[ˆ0singer w]t]ˆJohn]
After all related types are identified, the object is built for every analyzed word. Each object is in specific relation to the other objects of the sentence. Sometimes more lexical units represent one type. In sentence ,,Count of apartments in Bratislava is increasing." objects count, of, apartments are originally incorrectly analyzed by SCN as independent words. In reality, they have together value type. In the final construction, our algorithm put them together as one object count of apartments.

λwλt[[[ˆ0increasing w]t] 0count of apartments in Bratislava]
If there are connectives in the sentence, it is analyzed in a specific way. For sentence ,,John's sister is a fabulous cook and skilled sportswoman." all related types are discovered and then the algorithm determines if ROOT contains conjunction by finding dependency conj. The last type of the analyzed expressions are sentences containing negation. For sentence ,,John was not raised in Bratislava.", the following output is created: The constructions described in this chapter are examples of outputs produced by the TIL semantic machine. The implementation of our semantic machine generates outputs correctly what makes it a tool suitable for automated logical analysis of natural language.

CONCLUSIONS
In the paper, a useful prototype of the TIL semantic machine (only the second in the world) is introduced. We consider the implementation of the semantic machine to be successful, but we plan to work on it in the future too -we want to improve and expand it. From Figure 3 it is evident that the voluntary step of the TIL analysis -type control has not been implemented. It would also be helpful to achieve a two-level solution that can replace SCN by a proper syntactic parser. Another extension is the creation of a universal semantic machine that can generate TIL constructions from several world languages or in other projects realized on Department of Computers and Informatics [15], [16], [17], [18].

ACKNOWLEDGEMENT
This work was supported by the following projects: