Practical type checking of functions defined on context-free languages

  • Authors:
  • Hai-Ming Chen;Yun-Mei Dong

  • Affiliations:
  • Laboratory of Computer Science, Institute of Software, The Chinese Academy of Sciences, Beijing 100080, P.R. China;Laboratory of Computer Science, Institute of Software, The Chinese Academy of Sciences, Beijing 100080, P.R. China

  • Venue:
  • Journal of Computer Science and Technology
  • Year:
  • 2004

Quantified Score

Hi-index 0.00

Visualization

Abstract

A type checking method for the functional language LFC is presented. A distinct feature of LFC is that it uses Context-Free (CF) languages as data types to represent compound data structures. This makes LFC a dynamically typed language. To improve efficiency, a practical type checking method is presented, which consists of both static and dynamic type checking. Although the inclusion relation of CF languages is not decidable, a special subset of the relation is decidable, i.e., the sentential form relation, which can be statically checked. Moreover, most of the expressions in actual LFC programs appear to satisfy this relation according to the statistic data of experiments. So, despite that the static type checking is not complete, it undertakes most of the type checking task. Consequently the run-time efficiency is effectively improved. Another feature of the type checking is that it converts the expressions with implicit structures to structured representation. Structure reconstruction technique is presented.