from the book [42] which is currently used in an introductory course to programming at the University of Saarland. The book uses functional programming and Standard ML language.

Assume such an exercise would need to be reexpressed in the exercise model of the ActiveMath environment. Requirements are clear: Example of Figure 3 tests some previously introduced ML  basic concepts like 'program', 'value', 'identifier', 'operator', etc.  (that is concepts near to the lower syntax level). We also notice that some initial notions are required proper of the ML  evaluation strategy: 8  basic operational semantics like statement sequence (composition, ordering) and definition and binding of identifiers. Those concepts and corresponding relations obviously need to be part of a formal domain model so that the student interacting with the exercise is able to consult (recall) and reinforcement them.

Let us assume such concepts are available.

The exercise implementation is a matter of design: we may decide using a MCQ in each case a) and b) and/or textboxes to gather the input of the required answers, among others interaction and presentation elements. FSA stages need to be designed correspondingly.

Thus, for instance, in case b) a state can be related to the expression val z =  x* (y-2)
asking for the value of both z and y; this can done in order to test the misconception of reading a variable 9 . As can be easily realized, many choices are possible, even if we are dealing with a relatively small exercise, in appearance. A task like this one needs to be performed and evaluated following some parameters and criteria concerning adequacy, alignment and quality. We are interested in studying some of such criteria but not directly addressing the design of the interaction/presentation level.

## 4.2.2 Static Exercise Complexity

We have seen that an exercise can be implemented as a kind of interaction system whose design and implementation is actually driven by a problem as its 'leitmotif'. Thus, before or as a part of such an implementation, but at a more abstract level, we might be interested in asking how can we analyze the inherent complexity of the problem but in terms of a general cognitive model, (i.e. independently of the UI-interaction-model). In other words, our question is:
How can we represent an exercise so that, as much as possible, it can be statically analyzed in terms of its complexity? The complexity should be derived from its problem specification and surrounding domain model.

How complex an exercise can be is something that naturally depends, in the end, on the person that will be trying to solve it as well as on some environmental conditions. From that point of view, complexity is relative and clearly a dynamic value. In fact, it is a function of the student model component to help approximate and diagnose a personal profile as a result of his/her interaction with the problem. However, exercises have to be correctly aligned with prototypical student profiles, in order to be effective ([2]). So we may want to judge complexity relative to some intentionally targeted static profile, under some ideally static conditions.