view Int from TRIV to INT is
sort Elt to Int .
endv
fmod STACK-INTEGERS is
including STACK{vInt} .
endfm
fmod QUEUE-INTEGERS is
protecting QUEUE{Int} .
endfm
As can be observed, the syntax is similar to the one
used in several texts of algebraic specifications of data
types (Weiss, 1998).
In order to execute the specification, the student
enters the text in the editor; then, she/he executes the
Maude system using the existing buttons in the con-
sole and enters the module. The system detects exis-
ting syntax errors and shows them on the console.
Once the module shows no more errors, the student
may reduce terms by using the equations of the modu-
le. To such end, the student may use the commands
chart placed at the top of the screen or she/he may
directly write the command in the editor and enter it
into the system. For example, in order to obtain the
first of a queue, we can reduce the term:
red first(enqueue(enqueue(empty, 5),4)).
This term must be reduced over the module of the
queues using the integer number theory INT. In our
example, this module is named: QUEUE-INTEGERS.
The possibility of reducing terms, in an automatic
way, allows the students to carry out an initial test
of their specifications by detecting many of the errors
committed when defining the operations using equa-
tions.
Another greater advantage of executing the speci-
fications is that the student comprehends the diffe-
rence between the parameterized module and the ins-
tantiated module by being able to reduce terms on
different modules. For example, a new module could
be named QUEUE-CHARACTERS on which terms of type
red first(enqueue(enqueue(empty, ’a’),’c’)).
can be easily reduced.
During the last academic courses, we have
done practical classes on the data structures
included in Vedya, which can be found at
http://www.fdi.ucm.es/profesor/rdelvado/.
Other examples of data types, such as “medieval
queues” or a “doctor’s office” were also proposed
(Weiss, 1998). In all of them, the aim was to define
parameterized or instantiated data type with different
theories. The practical classes are complemented with
different terms that the student must reduce over some
type of instantiated modules to prove the specifica-
tion, as well as proposals to make little changes in
some actions or erroneous definitions to detect them.
Taking into consideration that students from the
second year were involved, just a few of the lan-
guage facilities have been used. In superior courses
where students have more knowledge on the subject,
a richer language can be used (Clavel and et al., 2006)
(e.g., many-sorted equational specifications, order-
sorted equational specifications, equational attributes,
and membership equational logic specifications).
4 FROM SPECIFICATION TO
IMPLEMENTATION
The Vedya tool turns into a pedagogical instrument
of high practical interest since it attempts to address
the whole self-learning process of the main data struc-
tures, from the algebraic specification in Maude until
the possible implementations in Java, within such a
powerful and integrated environment as the one that
has been described in the previous section by means
of the Eclipse system.
The students have their first contact with the data
structures that they are going to study by means of
the usage of Vedya. For example, if their learning of
data structures is focused on binary search trees or li-
near data structures, they will start learning the corres-
ponding section of the tool, where they will be able to
experiment, freely and on their own, each one of the
actions offered by these structures (see Figure 1). In
order to strengthen and evaluate this intuitive know-
ledge, the student has, in addition, the possibility of
using the Vedya-Test tool.
Once the student has a clear idea of the informal
behavior of the data structure, she/he may start work-
ing on the Eclipse system. The first step would be: to
formally capture that intuitive knowledge she/he has
obtained through the usage of Vedya in a specific al-
gebraic specification written in Maude syntax. In or-
der to facilitate this difficult step in the student’s self-
learning, she/he may use, interactively, the documen-
tation that is included in the manual of the Vedya tool.
Once the specification (see Figure 2) is entered into
the Eclipse system, the student can now go on exe-
cuting little tests using Maude, in order to check
whether it coincides with the intuitive and informal
notion of data structure from which he initially de-
parted in Vedya. Such experience would allow the
student to reach the high level of abstraction that is
necessary in computer supported education for each
formal specification of a software component, always
based on the intuitive and experimental knowledge.
CSEDU 2009 - International Conference on Computer Supported Education
30