SearcharxivSearch

arXiv subjects

Martin Henz

Publications and source records attributed to Martin Henz.

4 recordsLinked to original sources

Beyond SICP -- Design and Implementation of a Notional Machine for Scheme

Computer science education has been at the heart of Scheme from the beginning. The language was designed in the 1970s concurrently with the MIT course 6.001 and the textbook "Structure and Interpretation of Computer Programs" (SICP). To explain the scope of variables at run time in the presence of higher-order procedures, SICP introduces a mental model called the environment model, along with a pictorial representation of environments and data structures. Recently, the concept of notional machines has emerged in computer science education: a predictive set of abstractions that define the structure and behavior of a computational device. Proponents of notional machines argue that learners benefit when complex dynamic concepts such as the computational structure of Scheme are accompanied with concise notional machines. In this paper, we start with a sublanguage of Scheme sufficient for all programs in SICP that we call SICP Scheme. We extend the environment model to a full notional machine for SICP Scheme that is simple enough to serve as the central mental model in a CS1 course and demonstrate the machine with computer-generated visualizations. Moving beyond SICP Scheme, we show how the notional machine can be further extended to explain Scheme's call/cc and thus make this powerful concept accessible to beginners through a coherent mental model. The presented notional machine serves as the core of a web-based implementation of Scheme that is under development at our university.

cs.PL

Programmable Restoration Granularity in Constraint Programming

In most constraint programming systems, a limited number of search engines is offered while the programming of user-customized search algorithms requires low-level efforts, which complicates the deployment of such algorithms. To alleviate this limitation, concepts such as computation spaces have been developed. Computation spaces provide a coarse-grained restoration mechanism, because they store all information contained in a search tree node. Other granularities are possible, and in this paper we make the case for dynamically adapting the restoration granularity during search. In order to elucidate programmable restoration granularity, we present restoration as an aspect of a constraint programming system, using the model of aspect-oriented programming. A proof-of-concept implementation using Gecode shows promising results.

cs.PL

Recollection: an Alternative Restoration Technique for Constraint Programming Systems

Search is a key service within constraint programming systems, and it demands the restoration of previously accessed states during the exploration of a search tree. Restoration proceeds either bottom-up within the tree to roll back previously performed operations using a trail, or top-down to redo them, starting from a previously stored state and using suitable information stored along the way. In this paper, we elucidate existing restoration techniques using a pair of abstract methods and employ them to present a new technique that we call recollection. The proposed technique stores the variables that were affected by constraint propagation during fix points reasoning steps, and it conducts neither operation roll-back nor recomputation, while consuming much less memory than storing previous visited states. We implemented this idea as a prototype within the Gecode solver. An empirical evaluation reveals that constraint problems with expensive propagation and frequent failures can benefit from recollection with respect to runtime at the expense of a marginal increase in memory consumption, comparing with the most competitive variant of recomputation.

cs.PL

Logic programming in the context of multiparadigm programming: the Oz experience

Oz is a multiparadigm language that supports logic programming as one of its major paradigms. A multiparadigm language is designed to support different programming paradigms (logic, functional, constraint, object-oriented, sequential, concurrent, etc.) with equal ease. This article has two goals: to give a tutorial of logic programming in Oz and to show how logic programming fits naturally into the wider context of multiparadigm programming. Our experience shows that there are two classes of problems, which we call algorithmic and search problems, for which logic programming can help formulate practical solutions. Algorithmic problems have known efficient algorithms. Search problems do not have known efficient algorithms but can be solved with search. The Oz support for logic programming targets these two problem classes specifically, using the concepts needed for each. This is in contrast to the Prolog approach, which targets both classes with one set of concepts, which results in less than optimal support for each class. To explain the essential difference between algorithmic and search programs, we define the Oz execution model. This model subsumes both concurrent logic programming (committed-choice-style) and search-based logic programming (Prolog-style). Instead of Horn clause syntax, Oz has a simple, fully compositional, higher-order syntax that accommodates the abilities of the language. We conclude with lessons learned from this work, a brief history of Oz, and many entry points into the Oz literature.

cs.PL