Computing Reviews
Today's Issue Hot Topics Search Browse Recommended My Account Log In
Review Help
Search
Implicit parameters for logic programming
Madsen M., Lhoták O.  PPDP 2018 (Proceedings of the 20th International Symposium on Principles and Practice of Declarative Programming, Frankfurt am Main, Germany, Sep 3-5, 2018)1-14.2018.Type:Proceedings
Date Reviewed: Mar 10 2021

The art of programming is all about building programs that are concise, elegant, efficient, and, most importantly, readable and understandable by others. Software engineers use a number of tools to make code readable, for example, well-designed types, expressive names, and architectural principles such as DRY and SOLID. These tools are in turn supported by language features such as strong type systems, as well as features in the programming language and integrated development environment (IDE) such as code navigation, automatic inference of types, online static analysis of code, and so on.

The current paper is an exposition of one such micro feature: simplifying argument lists for functions and procedures. In most modern programming languages, functions (or more generally relations) and procedures are the smallest unit of construction. Any practitioner would be familiar with the conundrum of how to maximize reuse of the algorithmic part of the procedure while still minimizing the interface (or arguments) of the procedure. Language features such as hierarchical name scopes and inheritance provide different design points for this aspect of language design.

Implicit parameters is one such language feature that directly tackles the problem of argument lists. In many practical situations there is a strong correlation between the parameters passed to a procedure and the context in which it is called. Implicit parameters are designed to automatically detect these correlations from the program structure and automate the inference of parameters to a procedure call. Often when a procedure is called, for example, there is only one variable of a particular type visible in the context of the procedure call--this is especially true when the program is well structured using principles such as DRY and SOLID.

The paper addresses the problem of inferring arguments to predicates in the context of logic programming languages where the notion of control and information flow is implicit. The authors provide a simple formalization of the problem of inferring arguments in the context of logic programs, along with a very attractive solution in terms of a handful of inference rules that should be quite easy to implement as a preprocessing step in a compiler/interpreter. They also formalize a set of attributes for evaluating implicit parameter schemes: type safety, consistency, determinism, and predictability, and show that their formulation has these attributes.

It will be interesting to compare the formalization provided by this paper with implicit parameter schemes in other languages--default parameters in C++, implicit parameters in Scala, and named and default parameters in OCaml all fall into this category. An even more ambitious endeavor would be to deeply explore the relation with type classes in Haskell and name resolution in C++; these language features are proven in practice to provide the infrastructure for large-scale programming, and the current paper could provide the basis of an approach for importing these features into logic programming languages.

Reviewer:  Prahladavaradan Sampath Review #: CR147210 (2106-0154)
Bookmark and Share
 
General (D.2.0 )
 
 
General (D.3.0 )
 
 
Logic Programming (D.1.6 )
 
 
General (F.0 )
 
Would you recommend this review?
yes
no
Other reviews under "General": Date
Development of distributed software
Shatz S. (ed), Macmillan Publishing Co., Inc., Indianapolis, IN, 1993. Type: Book (9780024096111)
Aug 1 1994
Fundamentals of software engineering
Ghezzi C., Jazayeri M., Mandrioli D., Prentice-Hall, Inc., Upper Saddle River, NJ, 1991. Type: Book (013820432)
Jul 1 1992
Software engineering
Sodhi J., TAB Books, Blue Ridge Summit, PA, 1991. Type: Book (9780830633425)
Feb 1 1992
more...

E-Mail This Printer-Friendly
Send Your Comments
Contact Us
Reproduction in whole or in part without permission is prohibited.   Copyright 1999-2024 ThinkLoud®
Terms of Use
| Privacy Policy