AandP: Utilizing Prolog for converting between active sentence and passive sentence with three-steps conversion
Paper · 2020 · Trung Q. Tran
Summary
The paper addresses a classic grammar task: turning an English active-voice sentence into its passive counterpart and back. The meaning stays the same while the structure changes. The author builds a small rule-based system in Prolog with Definite Clause Grammars (DCG), using extra arguments, extra goals and a hand-written lexicon. Coverage includes all 12 English tenses, modal verbs, negation, singular/plural agreement, subject/object pronoun forms and irregular past participles. Conversion is refused when the active sentence has no object. The author introduces three design elements:
- a flattened sentence representation restricted to the transitive case;
- an auxiliary-based grouping of the 12 tenses into 4 classes, which reduces the number of DCG rules;
- a three-step pipeline: parse the sentence into a representation, rewrite that representation into the other voice, then generate the surface sentence from it.
The result is a working, open-source program demonstrated on example queries. There is no quantitative evaluation. The work matters mainly as a transparent, reversible model of voice alternation, built so that the same grammar serves both analysis and generation.
Key points
- Implementation: Prolog + DCG. Code at github.com/tqtrunghnvn/ActiveAndPassive, split into
convertible.pl(DCG rules and lexicon),convert.pl(the conversion step) andtestSuite.pl(user commands). - Coverage includes:
- 12 tenses, modals (e.g., should → should be bought) and negation with not;
- do-support in negated simple tenses, number agreement and pronoun case swapping (he ↔ him);
- irregular participles (buy → bought);
- noun phrases with adjective lists and PP modifiers.
- Passive auxiliaries are organised into three
auxTensegroups (be, being, been). Separately, the 12 tenses are grouped into 4 classes by their auxiliary pattern. - Representation:
s(NP, V, NP)for actives ands(NP, aux, auxTense, v, agent(by), NP)for passives, withpol(not)andmodal(X)as extra slots. The query interface isconvert(ActiveS, ActiveRe, PassiveS, PassiveRe). - Limitations: every word must be listed in the lexicon. Testing consists only of
activeTestSuite/passiveTestSuitecommands, with no reported accuracy figures.
Interesting ideas
- I1. Voice change is done as parse → rewrite the structure → regenerate, with one reversible grammar used for both directions, so the same rules analyse and produce text.
- I2. Instead of 12 separate tense cases, tenses are grouped by the shape of their auxiliary chain, which collapses many rules into a few.
- I3. Passivisation is gated on the presence of an object, and the passive's subject and by-phrase are mapped back to the active's object and subject.
- I4. Agreement and pronoun case are threaded through the rules as extra arguments, so swapping roles automatically re-inflects the auxiliary and pronoun forms.
- I5. Two-direction test suites exercise the converter both ways, and sentences without an object are expected to be rejected.
For Mova
How these ideas could serve Mova, our small open language model — its files, stages and tests:
- I1 (back): frame-to-text generation could choose active or passive from a single frame, reusing the analysis grammar's knowledge as generation constraints rather than separate templates.
- I2 (tokens): tense/aspect/voice features could be computed from the aux chain pattern (modal? have? be+ing? be+participle?) as a compact, explainable morphology step.
- I3 (frames): normalise
nsubj:passandobl:agentback to patient/agent roles so that "an apple is bought by him" and "he buys an apple" yield the same who-did-what-to-whom frame. - I4 (back): when generation promotes a different participant to subject, recompute verb agreement and pronoun case from the frame rather than copying surface forms.
- I5 (learn): use active↔passive round-trips as a consistency check on parsing and generation, and use intransitive sentences as a negative control that must fail to passivise.
Fields, topics and concepts
📚 Shelves 4The field of science this work belongs to (OpenAlex fields).Computer Science · 16,667 worksArtificial Intelligence · 16,194 worksArts and Humanities · 16,039 worksLanguage and Linguistics · 15,891 works
Cite
Cite as Trung Q. Tran. 2020. AandP: Utilizing Prolog for converting between active sentence and passive sentence with three-steps conversion. arXiv:2001.05672.
@misc{tran2020aandp,
title = {{AandP: Utilizing Prolog for converting between active sentence and passive sentence with three-steps conversion}},
author = {Trung Q. Tran},
year = {2020},
doi = {10.48550/arxiv.2001.05672},
eprint = {2001.05672},
archivePrefix = {arXiv},
url = {https://doi.org/10.48550/arxiv.2001.05672}
}References
- Donald Davidson and Gilbert Harman. Semantics of natural language, volume 40. Springer Science & Business Media, 2012. find
- Ralph Grishman. Computational linguistics: an introduction. Cambridge University Press, 1986. find
- Pierre M Nugues. An introduction to language processing with perl and prolog. Springer, 2006. ↗
- Fernando CN Pereira and Stuart M Shieber. Prolog and natural-language analysis. Microtome Publishing, 2002. find
- Fernando CN Pereira and David HD Warren. Definite clause grammars for language analysis—a survey of the formalism and a comparison with augmented transition networks. Artificial intelligence, 13(3):231–278, 1980. ↗
- John Stobo. Problem solving with Prolog. CRC Press, 2004. ↗
Updated
This page in Markdown → https://md.research.elamur.ai/free/en/papers/tran-2020-aandp-utilizing-prolog-converting-between/