Paper abstract

Towards Machine Learning of Grammars and Compilers of Programming Languages

Katsuhiko Nakamura - Tokyo Denki University, Japan
Keita Imada - Tokyo Denki University, Japan

Session: Learning and Mining Text and NLP
Springer Link: http://dx.doi.org/10.1007/978-3-540-87481-2_7

This paper discusses machine learning of grammars and compilers of programming languages from samples of translation from source programs into object codes. This work is an application of incremental learning of definite clause grammars (DCGs) and syntax directed translation schema (SDTS), which is implemented in the Synapse system. The main experimental result is that Synapse synthesized a set of SDTS rules for translating extended arithmetic expressions with function calls and assignment operators into object codes from positive and negative samples of the translation. The object language is a simple intermediate language based on inverse Polish notation. These rules contain an unambiguous context free grammar for the extended arithmetic expressions, which specifies the precedence and associativity of the operators. This approach can be used for designing and implementing a new programming language by giving the syntax and semantics in the form of the samples of the translation.