From Plain Prolog to Logtalk Objects: Effective Code Encapsulation and Reuse

  • Authors:
  • Paulo Moura

  • Affiliations:
  • Dep. of Computer Science, University of Beira Interior, Portugal and Center for Research in Advanced Computing Systems, INESC---Porto, Portugal

  • Venue:
  • ICLP '09 Proceedings of the 25th International Conference on Logic Programming
  • Year:
  • 2009

Quantified Score

Hi-index 0.00

Visualization

Abstract

Prolog affords concise, elegant, and clean solutions for many interesting problems, but is not immune to the software engineering challenges of large-scale application development. Code modularization, using modules or objects, is a key feature to keep projects manageable. Since most literature, instruction, and practice focus exclusively on object-oriented languages derived from imperative languages, objects are perceived as alien to logic programming while modules are considered a natural fit. Logtalk is an object-oriented logic programming language that can use most Prolog implementations as a back-end compiler. Logtalk objects are about code encapsulation and reuse, providing an alternative to Prolog module systems, and enabling natural solutions for a wide range of problems that would be awkward to solve using modules. This talk presents the Logtalk design goals, followed by a tutorial on Logtalk programming and some application examples. The talk ends with a discussion on the problems and benefits of developing Logtalk as a portable Prolog application.