Data Type Inference for Logic Programming
Jo\~ao Barbosa, M\'ario Florido, V\'itor Santos Costa

TL;DR
This paper introduces a static data type inference algorithm for logic programming that automatically deduces predicate types without explicit declarations, improving understanding of data structures in programs.
Contribution
It presents a novel type inference algorithm for logic programming that infers types both from program usage and data definitions, enhancing type understanding without requiring explicit annotations.
Findings
Successfully infers predicate data types in logic programs
Handles data type definitions similar to Haskell
Evaluated on diverse example programs
Abstract
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.
Peer Reviews
No public reviews on file for this paper yet. If you reviewed it on a platform where reviews are public (OpenReview, ICLR, NeurIPS, ICML), you can paste yours below so the community can read it here.
Code & Models
Videos
No videos yet. Explain this paper in a talk, walkthrough, or lecture? Add one.
Taxonomy
TopicsLogic, programming, and type systems · Natural Language Processing Techniques · Logic, Reasoning, and Knowledge
