2021/08/14 by João Barbosa, Mário Florido, Barbosa, João +3
Computer Science · #FOS: Computer and information sciences #Logic in Computer Science (cs.LO) #Logic, Reasoning, and Knowledge #Logic, programming, and type systems #Natural Language Processing Techniques #Programming Languages (cs.PL)
paper · pdf · doi:10.48550/arxiv.2108.06562
openalex publication_date 2021/08/14 · openalex created_date 2025/10/10 · openalex updated_date 2026/07/28
In this paper we present a new static data type inference algorithm for logic programming. Without the need of declaring types for predicates, our algorithm is able to automatically assign types to predicates which, in most cases, correspond to the data types processed by their intended meaning. The algorithm is also able to infer types given data type definitions similar to data definitions in Haskell and, in this case, the inferred types are more informative in general. We present the type inference algorithm, prove some properties and finally, we evaluate our approach on example programs that deal with different data structures.