Attribute Grammar by Natural Language Programming
DOI:
https://doi.org/10.26821/IJSHRE.14.08.2026.140801Keywords:
attribute grammar, natural language programmingAbstract
This paper mainly proposes that the compositional semantics of a natural language sentence can be expressed as a natural language programming function. The grammar categories in natural language sentences can be expressed as natural language programming classes. And the grammar in natural language can be expressed in the function name of the function which expresses compositional semantics. Therefore, this paper can be treated as a special implementation that realizes the idea of attribute grammar. Nonetheless, for the other realizer of attribute grammar, the Definite Clause Grammar in Prolog, its grammar specification uses the non-Prolog language, while in my paper the grammar specification uses natural language programming functions. So, this is the major difference between Definite Clause Grammar and my work. In the following of my paper, I will construct the parsing from input sentence and eventually to the update of knowledge database step by step. These steps will show how the compositional semantics of a natural language sentence can be expressed as a natural language programming function.
References
Natural Language Programming Weihan Huang, “Natural Language Programming in English”, LAP LAMBERT Academic Publishing Book, 2022-08-30
Dynamically run [1] pp151
Global Variable [1] pp142
Attribute Grammar https://en.wikipedia.org/wiki/Attribute_grammar
CYK algorithm https://en.wikipedia.org/wiki/CYK_algorithm
Chart Parser https://en.wikipedia.org/wiki/Chart_parser
Definite Clause Grammar https://en.wikipedia.org/wiki/Definite_clause_grammar