Introducing the Web-EDEN environment

Welcome to the Empirical Modelling online Web-EDEN environment. This window - which is to serve as a mini-guide to basic interaction with Web-EDEN and the EM Sudoku model - is embedded in the Web-EDEN environment. Initially, there is no model present in the environment - there is just a buttonMenu display that we shall use to load the Sudoku model stage by stage. Before we begin that loading process, it's helpful to do a little practical and mental preparation.

By way of practical preparation 1 ...

The key idea in Empirical Modelling is that of developing interactive models or environments by building up a family of interconnected definitions. Here are some simple definitions and queries that you can type into the Input Window and accept using the Accept button one by one:

- a = 199;
- b = 20;
- c = 1;
- d is b*4 + 6*c;
- e is a - d;
- f = 336;
- g is float(a)/f *100;
- writeln(e);
- writeln(g);

By way of practical preparation 2 ...

The first seven commands define the values of the variables a,b,c,d,e,f, and g. The last two then write out the values of e and g in the Output Window. Now try entering new definitions for a and f, setting these to 152 and 181 respectively. If you now write out the values of e and g again, you will see that they have changed. This very basic idea of connecting one set of values to another so that a change to one affects another ("via a dependency ") is fundamental to Empirical Modelling.

By way of practical preparation 3 ...

Unless you've guessed what's in my mind I don't suppose you found the values of a,b,c,d,e,f,g to be very interesting! Interpreting these numbers in the abstract is the sort of thing that computer programmers habitually have to do when they manipulate the variables in a complex computer program. The ability to interpret symbolic expressions of this kind is valuable in Empirical Modelling, but it is not the most crucial ingredient. What is more important is what I'm thinking of when making those definitions - something that has nothing to with computers ... before you look at the answer, you might like to see if you can guess.

Meaning in Empirical Modelling

What does the input you've entered into Web-EDEN mean? Or, more precisely (if you're speaking as an Empirical Modeller), what might the input you've entered into Web-EDEN mean? Perhaps some of you will have recognised that 199 and 152 are the scores made by Ian Bell and Kevin Pietersen in the most recent Test against South Africa, in which both hit twenty 4s and a six and that they faced 336 and 181 balls respectively. This makes e the number of runs they scored not in boundaries, and g the number of runs they scored per hundred balls. As to whether this makes the numbers any more interesting ... this is a personal matter, which is part of the motivation for the "mental preparation" that follows.

By way of mental preparation ...

In working within the Web-EDEN environment, it is essential to bear in mind that at all times there must be some sense of present state and awareness. Of course, it is entirely normal that we are each conscious of a current state. When you and I contemplate the empty model that is currently in the environment, there is unlikely to be very much connection between your consciousness of state and mine. But as a model develops, its state ("what you experience from the computer") blends in with your broader awareness of state ("what you can experience or imagining experiencing without the computer"). As a topical concrete example, you might think about what is passing through your mind and mine when we solve a Sudoku puzzle. Of course, our states of mind will never be totally taken up with the model (any more than they are by solving a puzzle), but the model can exercise more influence on what we are observing and thinking about as it grows ever richer and more subtle.

Modelling in practice

Though this mental preparation might appear to suit transcendental meditation better than software engineering, the objectives for Empirical Modelling are highly practical. Model-building is a way to improve our understanding of what is difficult to express in a formal symbolic manner. It creates objects to be experienced that can be shared in a way that would be hard to imagine without computer support. This is potentially a basis for better communication and collaboration.

Tracking states of mind ...

To emphasise how you should interpret the model as tracking a state of mind , some visual constructions and results of queries involved its development have been deliberately left open for inspection as the model is loaded. By using the buttons on the panel display in sequence from top to bottom, you can retrace the broad outline of this development. As the definitions are interpreted one by one, a blank grid is created, into which a puzzle is loaded, some invisible logic about plausible digits is added, colour is first introduced - then removed, a button interface to manage the set of definitions is added, some prototype recording and automation of solving is demonstrated and an interface for specifying plausible digits is appended to the grid screen. Though some of these steps in development have no discernible impact on the external state of the model they can be exposed through interaction with it. You can demonstrate this by entering digits into the grid and pressing the "Show history" button, or by observing how selecting a cell with the mouse is correlated with white buttons on the display beneath the grid.

More about way the model was built ...

The Sudoku model is built up of a large number of definitions - more than five thousand in total. Each definition is rather like a definition in a spreadsheet cell; when one value is changed, others change according to their definition. The partial versions of the model reflect stages in its overall ongoing conception and development. Completing these stages typically involved several days' work. As some evidence that the model assists communication and collaboration, several different modellers contributed to the model. The core model was developed by an MSc student Karl King in 2005. The colour extension was added by Dr Antony Harfield in 2007. A further extension to display the grid in text form was added by PhD student Eric Chan. The model has been revised to its current form by Meurig Beynon in preparation for this online activity.

Orientation on the EM Sudoku model

Now that we have arrived at the EM Sudoku model in its present form, you should take a look around at the various windows on display. The most conspicuous is the Sudoku grid sudokuGrid display and the panel of buttons displayed beneath it. This is the visual component of a model that will be used in an exploratory way in subsequent activities. The Input Window is the window through which the current state of the model has been built up. As you will see, you can modify the current state quite freely in an open-ended fashion at any stage. Not all aspects of the current state of the model are obvious from the display. Some have no visual representation, some only become apparent when you perform a state-changing action. To get access to this state, we need to make queries about internal state. The results of such queries are displayed in the Output Window .

A helpful analogy

Traditional computer programs represent systematic processes with a specific purpose. The model in this environment is quite different in character. Perhaps a little fancifully you should think of the model as representing something like a current situation and a state of mind. A precedent for this kind of computer application is the spreadsheet. Transitions in the model are to be viewed as similar in character to movements between one state of mind and the next. As in everyday life, such a movement may correspond to a hitherto unexplored idea, or to a revisiting of familiar states. And just as there are some things that are seemingly external and independent of our state of mind (such as the grid display might explicitly show), there are some that are internal and are more difficult to inspect, and some that can only be confirmed by a speculative action.

Interpreting interaction with the model

An unusual feature of the model that distinguishes it from a traditional computer program is that whether a new definition is seen as extending the model , or as using the model in an application , is merely a matter of interpretation. Consider redefining the content of a cell for instance. If such a definition introduced a digit into a blank cell it could be seen as a step towards solving the puzzle. By contrast, redefining one of the given digits might correspond to changing the given puzzle. Similarly, resetting the background colour of the Sudoku grid might be a way of exploring a potential redesign or a way to indicate that a mistake had been made in solving the puzzle. Suitable definitions to illustrate such redefinitions can be pasted into the input window and accepted by pressing the Accept button at the bottom right:

- b_3 = 5; ## change cell value
- b_1 = 4; ## alter the given puzzle
- background_bgcolour="green"; ## redesign the grid display

How we shall use the model

The Web Eden Sudoku model will be the focus of Workshops 2 and 3. You will interact with the model in two principal ways - by entering definitions into the Input Window and by using the mouse and keyboard. For instance, you can enter values into the Sudoku grid directly by placing the mouse over a cell and typing in the appropriate digit. You can also use buttons on the buttonDisplay panel to switch between the colour and ordinary black and white variants of the model. (Actually, these actions are themselves entering definitions into the model, but saving you the trouble of doing it manually!) When you have become familiar with simple interactions of this kind, you will appreciate the value of one or two other features of the environment to be described on the next page.

Variables and observables ...

A moderately complex traditional program may have thousands of variables that determine the state of the computer as it executes. Many of these variables are meaningful only to the programmer, and their significance could hardly be explained to a typical user. The Sudoku model script also contains thousands of definitions of 'variables', but - for the most part - the meanings of these variables will be familiar even to the naive observer of a Sudoku puzzle grid. To emphasise their different character, we call the things that appear in the definitions within our models observables . Simple examples of observables are: the value of the top left cell of the grid and the colour of the background panel in the grid . As illustrated by previous redefinitions, the names of these observables within our model are a_1 and background_bgcolour .

Useful additional features ...

Developing or understanding the Sudoku model involves thinking about a situation and state of mind which you might find yourself in when solving a Sudoku puzzle. The underlying idea in Empirical Modelling is that there should be an intimate correspondence between this external state and the state of your computer model (cf. the use of a spreadsheet). To find out about observables you can query their values and definitions through the input window, or redefine them speculatively to see how this affects other observables in the model. Useful features of Web Eden support such actions. Enter writeln(b); into the input window to find the current value of the observable b , or ?b; to display its current definition and the observables that are defined in terms of it. To access definitions that you made previously press Control up-arrow in the Input Window, or retrieve them from the Command History that is accessed via the Windows tab in the Web Eden environment. Simple example commands that you can use to exercises these features are given on the next page.

Simple commands you can try out for testing purposes

Make sure that the tab at the lower left of the Input Window displays "eden", and preface your input by %eden if not. Having entered these commands, try retrieving them by command line recall or from Command History, and editing them.

- writeln(b2);
- writeln(b_2);
- ?b2; ## returns a string consisting of a single character
- ?b_2; ## returns the integer value of a digit
- b_2 = 3;