by Tim Felgentreff,
Robert Hirschfeld, Maria Graber, Alan Borning and
Hidehiko MasuharaAbstract:
Logic puzzles such as Sudoku are described by a set of properties that a valid solution must have. Constraints are a useful technique to describe and solve for such properties. However, constraints are less suited to express imperative interactions in a user interface for logic puzzles, a domain that is more readily expressed in the object-oriented paradigm. Object constraint programming provides a design to integrate constraints with dynamic, object- oriented programming languages. It allows developers to encode multi-way constraints over objects using existing, object-oriented abstractions. These constraints are automatically maintained at run-time. In this paper we present an application of this design to logic puzzles in the Squeak/Smalltalk programming environment, as well as an extension of the design and the formal semantics of Babelsberg to allow declaring constraints using the imperative collection API provided in Squeak. We argue that our implementation facilitates creating applications that use imperative construction of user interfaces and mutable program state as well as constraint satisfaction techniques for different parts of the system. The main advantage of our approach is that it moves the burden to maintain constraints from the developer to the runtime environment, while keeping the development experience close to the purely object-oriented approach.
Reference:
Declaring Constraints on Object-Oriented Collections (Tim Felgentreff, Robert Hirschfeld, Maria Graber, Alan Borning and Hidehiko Masuhara), In Journal of Information Processing, volume 24, 2016. (A preprint is also archived as IPSJ Transaction on Programming, 9(4), September 2016)
Bibtex Entry:
@article{felgentreff2016jip,
author = {Tim Felgentreff and Robert Hirschfeld and Maria Graber and Alan Borning and Hidehiko Masuhara},
title = {Declaring Constraints on Object-Oriented Collections},
pdf = {ipsj-trans-pro-2016.pdf},
journal = {Journal of Information Processing},
year = 2016,
volume = 24,
number = 5,
opturl = {http://id.nii.ac.jp/1001/00174563/},
cacheurl = {http://prg.is.titech.ac.jp/members/masuhara/papers/ipsj-trans-pro-2016.pdf},
pages = {917--927},
month = nov,
note = {A preprint is also archived as IPSJ Transaction on Programming, 9(4), September 2016},
annote = {accepted: 2016-04-25},
keywords = {Squeak, Smalltalk},
doi = {10.2197/ipsjjip.24.917},
abstract = {Logic puzzles such as Sudoku are described by a set of properties that a valid solution must have. Constraints are a useful technique to describe and solve for such properties. However, constraints are less suited to express imperative interactions in a user interface for logic puzzles, a domain that is more readily expressed in the object-oriented paradigm. Object constraint programming provides a design to integrate constraints with dynamic, object- oriented programming languages. It allows developers to encode multi-way constraints over objects using existing, object-oriented abstractions. These constraints are automatically maintained at run-time. In this paper we present an application of this design to logic puzzles in the Squeak/Smalltalk programming environment, as well as an extension of the design and the formal semantics of Babelsberg to allow declaring constraints using the imperative collection API provided in Squeak. We argue that our implementation facilitates creating applications that use imperative construction of user interfaces and mutable program state as well as constraint satisfaction techniques for different parts of the system. The main advantage of our approach is that it moves the burden to maintain constraints from the developer to the runtime environment, while keeping the development experience close to the purely object-oriented approach.}
}