# Main Page/Resources/E-motions/KnownBugs

### From Atenea

## Contents |

## Errors

List of problems identified waiting to fix:

#### [1] function (rem)

- The rem function returns a double when used in eMotions. It should return an integer.

Problem reported by Javier, 26/4/2011 Status: open

#### [2] early variables declaration

Let's imagine a rule is to be executed in time 10 (i.e., in time 10 there is a match with the LHS of the rule), let's call this rule R2. Let's imagine, as well, that there is another rule whose execution is to finish in time 10, let's call it R1.

R1 modifies an object which contains a Sequence of integers (in fact, it modifies the sequence of the object). R2 needs to take the sequence of the same object in order to modify other objects.

If we assign the value of the sequence in rule R2 to a variable (let's say X : Sequence = object.sequence) and then we use this variable to modify another object in the RHS of the rule, we expect that the value of the variable is updated with the result of R1. However, it may happen that the assignment of the value of the sequence to the variable happens before R1 finishes, because, in fact, variables assignment is realized when the matching of the rule is realized. So, what happens, is that the matching of the rule (and the variables assignment) is realized in time 10, but before the rule R1 finishes, which also happens in time 10).

It has been proved that if we use the variable in R2, sometimes it takes a value that we don't expect, because it is the value of the sequence before R1 finishes. However, if we do not use the value of the variable but we use the sequence of the object (writing object.sequence instead of X), the value it takes is the value AFTER the rule R1 has been executed.

To sum up, the problem is that the variables assignment is realized too early.

Problem reported by Javier, 16/05/2011

Status: open

## Improvements

List of improvements and suggestions for tool

#### [1] Ideas to improve the debugging of the e-Motions models

- One of the points that could be interesting is to indicate a maximum number of re-writes to make in Maude, to limit somehow the time taken for simulations, and test with different values.

Suggestion given by Antonio, 9/12/2010

#### [2] List somewhere the available functions in eMotions

- When declaring a new variable in an eMotions rule or in any other place, the user may want to know all the available functions to use. A good way to solve this is to show a list with all the available functions and their arguments, as well as a small description of the functions and the value they return.

Suggestion given by Javier, 07/04/2011

#### [3] slots border

- when selecting a slot, it is not marked and this leads to confusion

Suggestion given by Atenea, 5/4/2011

## Bug Fixed

The goal is to move to this section the errors and improvements once have been corrected, with information about who has closed the issue, how it has implemented or corrected, the version from which works, etc.

#### [1] Random() calls on the same rule

- When within a rule there are several calls to the random() function, the values obtained for all calls are equal.

Problem reported by Jose Bautista, 3/12/2010 Status: closed by Jose Bautista, J.E.Rivera, Fernando López How: Version: 1.0.3

#### [2] Seed the random function()

- The initial seed is chosen does not seem right, and therefore the sequences of pseudo-random numbers produced by the function random() are always equal. This makes the simulations on the same initial model are always the same.

Problema reportado por Jose Bautista, 3/12/2010 Status: closed by Jose Bautista, J.E.Rivera, Fernando López How: Version: 1.0.3

#### [3] modCL Int + float

- An error occurs when attempting to operate integers and doubles

Problem reported by Atenea, 5/4/2011 Status: closed by Atenea How: now it is possible to have mathematical operations with integer and double numbers Version: 1.0.3

#### [4] function (^)

- The function ^ does not work

Problem reported by Javier, 5/4/2011 Status: closed by How: to use the power operator ine-Motions, we have the function "pow()". For example, to obtain 4^2, we write 4.pow(2) Version: 1.0.3