# Lab 5 Exercises

The EDEN interpreter will be introduced via Web EDEN. This is a web-enabled version of EDEN that can be accessed via the webpage http://go.warwick.ac.uk/webeden. For this laboratory, you will be reviewing a series of workshops entitled *The Sudoku Experience* that was prepared in July 2008 for a group of schoolchildren on the university's 'gifted and talented' programme (though, for the record, I do not personally care for the idea that there is a special subset of schoolchildren who deserve this epithet). These workshops can be accessed from http://www.dcs.warwick.ac.uk/~wmb/sudokuExperience/workshops/. Each of the workshops has a "mini-book" that introduces the ideas and exercises presented in the workshop. Of course, you will have to make allowance for the fact that some of this material is much too elementary for university students - you will not need to study all the workshops in detail, but will find much of the conceptual and practical content you need to be able to understand and carry out Empirical Modelling using EDEN. To make it easy for you to pick out the parts of the workshops that are most relevant, we have prepared an index of the pages in the minibooks of all the workshops.

Because we shall be using machines in the MSc lab to support this lab, you will need to make minor changes to the observables that specify the sizes of fonts etc. For this purpose, when you have invoked the Web EDEN interpreter, you will need to enter the redefinitions:

%eden

DFfont = "{courier 18}";

fontWidthWebEdenFix=1.4;

fontHeightWebEdenFix=1.5;

This can be (charitably) viewed as somewhat similar to the activity of "tuning an instrument" rather than "fixing a bug".

## About the workshops

All the workshops are based on a single EDEN model that relates to construing Sudoku solving activity. (Note that the term "EDEN" refers to modelling using the Eden notation and the suite of auxiliary special-purpose notations Scout, Donald, Eddi etc that it supports.) The range of activities involved in the workshops is broader, and reflects the open-ended nature of EM. A basic knowledge of the game of cricket is useful in understanding the content of the second introductory workshop and Workshop 3B.

The two introductory workshops respectively introduce the definitive script of the Sudoku model, and the nature of the activity involved in its construction. Workshops 2A, 2B and 2C introduce some practical exercises respectively relating to the use of the Scout and Eddi notations for screen layout and relational modelling, some technical exercises in model re-use, and the use of colour to assist the manual solution of puzzles. Workshops 3A and 3B show how the Sudoku model can be used to support the solving process in a semi-automated manner. They also introduce the idea of agency, and basic examples of EDEN functions and actions that complement the use of definitive scripts.

*I**n this lab, you can review the content of the workshops in whichever way suits you best. There are specific exercises within each workshop that you may find it useful to study. A brief description of each workshop and suggested activities you might attempt is given below.*

#### General introduction to the Sudoku script

The main purpose of this introductory presentation is to enable you to review the range of observables that make up the Sudoku model. It will be useful to get familiar with the sorts of observable that are represented in the model and the ways in which these are defined. It is worth noting that the definitions of observables as shown in the 'observables' are all expressed in the Eden notation. In the case of Scout and Eddi observables, these were initially entered as Scout and Eddi definitions via the interface. You can find the Scout and Eddi definitions of these observables in the listing of the entire model at http://www.dcs.warwick.ac.uk/~wmb/sudokuExperience/workshops/code/. In surveying the definitions, you may fnd it useful to review the account of the role played by Scout and Eden observables in building the model, as described in Workshop 2A. You might also consider cutting and pasting the definitions shown in the observables display into the Dependency Modeling Tool, following the procedure described in http://www2.warwick.ac.uk/fac/sci/dcs/research/em/teaching/cs405-0607/lab5.pdf. (It is of course only appropriate to do this for the definitions that pertain to one specific square of the grid, and possibly for the generic definitions!)

**Introduction to the Web EDEN environment**

The first six pages of this workshop relate to orientation for EM with which you should by now be familiar. The illustrative vehicle is modelling simple relationships arising from a cricket scenario, The way in which the model was incrementally developed is illustrated (page 9), and the idea of modeling states-of-mind is developed. The techniques for interrogating the values of observables illustrated on page 16 are fundamentally important in model-building. An unfortunate omission in Web EDEN is the facility to make queries in Scout - this is available in the desktop version of EDEN.

**Workshop 2A**

Workshop 2A illustrates the basic use of Scout and Eddi notations and makes the analogy with devising a guided walk. Pages 3-9 set up a basic exercise in Empirical Modelling (p5-7) which illustrates some key concepts that you will probably already appreciate. They also show how open-ended the model can be, and how easy it can be to restore previous states. Pages 10-16 are a basic tutorial on the Eddi notation, showing its use in dealing with relational data associated with cells in the Sudoku grid. The ideas illustrated in this workshop are basic to understanding EM with EDEN, and are typically illustrated in best submissions to previous Web EM bulletins.

**Workshop 2B**

This workshop comprises three 'simple' exercises in making definitions. The second two exercises illustrate how the experimental environment that EDEN affords can be helpful even when you are trying to specify quite formal mathematical relationships, as it can be used to give immediate feedback. These exercises illustrate the basic arithmetic operators in EDEN.

**Workshop 2C**

This workshop was devised by Antony Harfield. It shows how he constructed an interface to the Sudoku model in which the colour of a cell is determined by the digits that can plausibly be placed in it, using the most elementary criteria. Antony was the author of the Flash version of Colour Sudoku at http://go.warwick.ac.uk/sudoku. The contrast between this Flash program and the EM version of Colour Sudoku is instructive, and relates strongly to the principal theme of CS405.

**Workshop 3A **

The emphasis in previous workshops is on modelling with definitive scripts. This workshop introduces the theme of agency. Pages 1-8 introduce the idea of manual and automated agency. Pages 9-19 explain how a manual procedure for solving the Sudoku puzzle using elementary rules can be automated, and how information about the grid that is more subtle than "knowing that cell A5 contains the digit 3" can be recorded by enriching the observational model.

**Workshop 3B**

The final workshop illustrates how actions in EDEN are used to implement automatic agency. Pages 1-12 motivate this with the theme of cricket, as introduced in the introduction. In principle, the model developed here could be integrated with Chris Pether's cricket scoreboard model though this is not currently available via Web EDEN. Pages 13-18 elaborate the idea of automating procedures for Suodku solving that can be carried out manually using the Sudoku model. Exercise 3 highlights the extreme inefficiency that can result from such automation, drawing attention to the importance attached to optimisation in conventional programming.