Implicit Parameters for Logic Programming

Magnus Madsen, Ondrej Lhoták

Research output: Contribution to book/anthology/report/proceedingArticle in proceedingsResearchpeer-review

Abstract

Implicit parameters allow programmers to omit certain arguments from function calls and have them automatically inferred by the compiler based on their types. At every call site, the compiler determines the values of the implicit parameters based on their declared types and the bindings currently in implicit scope. The programmer controls this mechanism in two ways: by adding bindings to the implicit scope, or by explicitly providing the implicit parameters for the function call.

Implicit parameters are known from functional and object-oriented languages such as Haskell and Scala. In recent years, more languages have added support for implicit parameters, including Agda, Coq, and Idris. Implicit parameters have played an impressive role as the foundation for a broad range of language features such as type classes, capability and effect systems, software transactional memory, macros, and more.

In this paper, we propose a design of implicit parameters for typed Horn clause based logic programming languages, such as Datalog and Prolog. We illustrate the usefulness of implicit parameters and show how they support logic programming in the large. We explore some of the differences that arise between implicit parameters in functional languages and in logic languages.

Original languageEnglish
Title of host publicationProceedings of the 20th International Symposium on Principles and Practice of Declarative Programming
Editors David Sabel, Peter Thiemann
Number of pages14
Place of publicationNew York, NY, USA
PublisherAssociation for Computing Machinery
Publication date3 Sept 2018
Article number14
ISBN (Print)978-1-4503-6441-6
DOIs
Publication statusPublished - 3 Sept 2018
Externally publishedYes
EventInternational Symposium on Principles and Practice of Declarative Programming - Frankfurt am Main, Germany
Duration: 3 Sept 20185 Sept 2018
Conference number: 20
http://ppdp-lopstr-18.cs.uni-frankfurt.de/ppdp18.html

Conference

ConferenceInternational Symposium on Principles and Practice of Declarative Programming
Number20
Country/TerritoryGermany
CityFrankfurt am Main
Period03/09/201805/09/2018
Internet address

Keywords

  • typed logic programming
  • implicit parameters

Fingerprint

Dive into the research topics of 'Implicit Parameters for Logic Programming'. Together they form a unique fingerprint.

Cite this