Type Inference by Coinductive Logic Programming
Type Inference by Coinductive Logic Programming
复制标题
通过共归纳逻辑编程进行类型推断
DOI:
10.1007/978-3-642-02444-3_1
复制
发表时间:
2009
影响因子:
2.6
通讯作者:
E. Zucca
中科院分区:
文献类型:
--
作者:
D. Ancona;Giovanni Lagorio;E. Zucca
We propose a novel approach to constraint-based type inference based on coinductive logic. Constraint generation corresponds to translation into a conjunction of Horn clauses P , and constraint satisfaction is defined in terms of the coinductive Herbrand model of P . We illustrate the approach by formally defining this translation for a small object-oriented language similar to Featherweight Java, where type annotations in field and method declarations can be omitted.
In this way, we obtain a very precise type inference and provide new insights into the challenging problem of type inference for object-oriented programs. Since the approach is deliberately declarative, we define in fact a formal specification for a general class of algorithms, which can be a useful road map to researchers.
Furthermore, despite we consider here a particular language, the methodology could be used in general for providing abstract specifications of type inference for different kinds of programming languages.