Abstract: I introduce a simple but efficient method to solve one of the critical aspects of English grammar which is the relationship between active sentence and passive sentence. In fact, an active sentence and its corresponding passive sentence express the same meaning, but their structure is different. I utilized Prolog [4] along with Definite Clause Grammars (DCG) [5] for doing the conversion between active sentence and passive sentence. Some advanced techniques were also used such as Extra Arguments, Extra Goals, Lexicon, etc. I tried to solve a variety of cases of active and passive sentences such as 12 English tenses, modal verbs, negative form, etc. More details and my contributions will be presented in the following sections. The source code is available at https://github.com/tqtrunghnvn/ActiveAndPassive.

Introduction: Language plays a vital role in the human life. A language is a structured system of communication BIBREF2. There are various language systems in the world with the estimated number being between 5,000 and 7,000 BIBREF3. Natural Language Processing (NLP) which we commonly hear is a subfield of linguistics. NLP aims to provide interactions between computers and human languages. The performance of NLP is evaluated by how computers can process and analyze large amounts of natural language data BIBREF4. In terms of language processing, we cannot but mention Computational Linguistics BIBREF5. Computational Linguistics is the scientific study of language from a computational perspective, and thus an interdisciplinary field, involving linguistics, computer science, mathematics, logic, cognitive science, and cognitive psychology. One of the most useful tools for studying computational linguistics is Prolog programming language BIBREF0. Prolog is a logic programming language associated with artificial intelligence and computational linguistics. Prolog can help deal with issues related to not only logic puzzle (Cryptoarithmetic puzzles, Zebra Puzzle, etc.) but also natural language processing. In this work, I utilized Prolog along with Definite Clause Grammars (DCG) BIBREF1 to solve one of the critical aspects of English grammar, active sentence and passive sentence. DCG proves the efficiency in handling the grammar of the sentence. Basically, a sentence is built out of noun phrase and verb phrase, so the structure of sentence, noun phrase, and verb phrase will be both covered in this work. In terms of English grammar, we have lots of content to solve as shown in Figure FIGREF1. For example, there are 12 tenses in English such as the simple past tense, the simple present tense, the perfect present tense, etc. We also have more than three types of conditional clause, more than three types of comparative clause, and so on. This work covers the contents of active sentence and passive sentence. For instance, if an active sentence is “a man buys an apple in the supermarket", its corresponding passive sentence will be “an apple is bought by a man in the supermarket". The basic rules for rewriting an active sentence to passive sentence are shown clearly in Figure FIGREF2. As shown in Figure FIGREF2, basic rules are: The object of the active sentence becomes the subject of the passive sentence; The subject of the active sentence becomes the object of the passive sentence; The finite form of the verb is changed to “to be + past participle". As my best understanding so far, there are only a few works mentioning the problem of active sentence and passive sentence in terms of language processing and computational linguistics. The conversion between active sentence and passive sentence was early mentioned in BIBREF6 by using a transformation rule to express the relationship between active and passive sentences. According to this rule, a parse tree is produced to represent the deep structure and determine whether the given sentence is active or passive. Similarly, BIBREF7 also used a tree-to-tree mapping to represent the active/passive transformation rule. However, these works just stopped in introducing how to transform an active sentence to passive sentence and did not solve many cases of them. Actually, there are many cases of active and passive sentences, leading to extra rules for converting between them. It is not easy to handle all these cases, and this is the main challenge of this work. My contributions are shown as follows: As far as I know, this may be the first work utilizing Prolog and DCG to solve a variety of cases of converting between active sentence and passive sentence such as 12 English tenses, modal verbs, negative form, etc. I proposed a compact version of the representation of the sentence as shown in Figure FIGREF48 and Figure FIGREF50. In order to deal with 12 tenses in English, I proposed an auxiliary-based solution (is presented in Section SECREF67) for dividing 12 tenses into 4 groups. This is a very nice solution that reduces the workload of defining DCG rules. I also proposed a three-steps conversion (is presented in Section SECREF73) for doing the conversion between active sentence and passive sentence.

Question: What DCGs are used?
Answer: Author's own DCG rules are defined from scratch.