Search papers, labs, and topics across Lattice.
This paper introduces a novel approach to implementing polymorphism in bottom-up relational programming languages, specifically through the development of semiringKanren. By avoiding monomorphization, the authors present a method to compile polymorphic semiringKanren programs into non-polymorphic versions using equality patterns and sufficiently large instances of polymorphic relations. The correctness of this compilation method is established, paving the way for future research in this area.
Compiling polymorphic relations without monomorphization could revolutionize the efficiency of relational programming languages.
We present a new approach for implementing polymorphism for bottom-up relational languages that avoids monomorphization. We begin by introducing semiringKanren, a bottom-up weighted relational programming language. We extend this base language to support polymorphism. We describe a new method to compile polymorphic semiringKanren programs into non-polymorphic ones, based on equality patterns and large-enough instances of polymorphic relations. We explain the correctness of this method. Finally, we consider existing work and suggest directions for future research.