Logic Programming with Extensible Types

πŸ“… 2026-01-07
πŸ›οΈ Electronic Proceedings in Theoretical Computer Science
πŸ“ˆ Citations: 0
✨ Influential: 0
πŸ“„ PDF

career value

140K/year
πŸ€– AI Summary
This work addresses the challenge of seamlessly integrating logic programming paradigms into existing statically typed functional languages without compromising type safety. To this end, it proposes a novel approach that combines extensible types, a generic unification algorithm, and an embedded domain-specific language (DSL), enabling host-language values to naturally incorporate logic variables while supporting polymorphism and higher-order functions. The approach is implemented in Haskell, demonstrating its technical feasibility and practical utility. This study presents the first unified framework that cohesively integrates these mechanisms, significantly enhancing the expressiveness and integration depth of logic programming within typed functional languagesβ€”all while preserving the integrity of the underlying type system.

Technology Category

Application Category

πŸ“ Abstract
Logic programming languages present clear advantages in terms of declarativeness and conciseness. However, the ideas of logic programming have been met with resistance in other programming communities, and have not generally been adopted by other paradigms and languages. This paper proposes a novel way to incorporate logic programming in an existing codebase in a typed functional programming language. Our approach integrates with the host language without sacrificing static typing, and leverages strengths of typed functional programming such as polymorphism and higher-order. We do so by combining three ideas. First, we use the extensible types technique to allow values of the host language to contain logic variables. Second, we implement a unification algorithm that works for any data structure that supports certain operations.Third, we introduce a domain-specific language to define and query predicates. We demonstrate our proposal via a series of examples, and provide aids to make the notation convenient for users, showing that the proposed approach is not just technically possible but also practical. Our ideas have been implemented in the language Haskell with very good results.
Problem

Research questions and friction points this paper is trying to address.

logic programming
extensible types
static typing
functional programming
unification
Innovation

Methods, ideas, or system contributions that make the work stand out.

extensible types
logic programming
unification
typed functional programming
domain-specific language
πŸ”Ž Similar Papers
2024-07-16arXiv.orgCitations: 8