27.03.2014 Views

SEKE 2012 Proceedings - Knowledge Systems Institute

SEKE 2012 Proceedings - Knowledge Systems Institute

SEKE 2012 Proceedings - Knowledge Systems Institute

SHOW MORE
SHOW LESS

Create successful ePaper yourself

Turn your PDF publications into a flip-book with our unique Google optimized e-Paper software.

Figure 1. The process for engineering DSLs for mobile robot applications<br />

II.<br />

A PROCESS FOR ENGINEERING DSLS<br />

In this section we present our process, which has five<br />

activities. We detail them below. The process overview can be<br />

seen as a SADT diagram in Fig. 1. The main focus of this paper<br />

is on the second and third activities because of space<br />

limitations.<br />

Pick or build an application. In this activity, the domain<br />

engineer shall builds a robot application or take an existi ng<br />

one. He/she must have knowledge about its requirements and<br />

the software libraries used in the implementation.<br />

Identify domain abstractions. This activity is divided in<br />

two steps which are explained below.<br />

Extract domain abstractions from requirements. In this<br />

step, the domain engineer shall analyze the application’s<br />

requirements to extract domain abstractions, which will<br />

comprise the DSL abstractions. This activity consists of<br />

structuring the application’s requirements as a tree, as can be<br />

seen in Fig. 2, where the first node represents the application’s<br />

main objective. The first level of children nodes is called<br />

“What to do” level, since they state what the robot must<br />

perform in order to achieve the main objective. The second<br />

level is called “How to do” level and its nodes describe what<br />

the robot does to perform what is stated in their parent nodes.<br />

The “How to do” nodes shall be created considering how<br />

actuators and sensors are utilized to perform such action. For<br />

example, if the main objective is following a wall, there may be<br />

a first level node stating “walk near the wall”, and it could have<br />

children nodes stating “walk” and “keep parallel to wall”. A<br />

node may also have children nodes in the same level.<br />

After creating this tree, which is the resulting artifact from<br />

this activity, the domain engineer shall choose which<br />

abstractions will comprise the intended DSL. If he/she chooses<br />

the leaf nodes, the resulting DSL will be more flexible but<br />

more verbose and less related to the application domain. But if<br />

Figure 2. Illustration of requirements structured as a tree<br />

the “What to do” nodes is chosen, the DSL will be closely<br />

related to the application domain and will be more expressive<br />

but too rigorous and limited. It’s also possible to choose<br />

abstractions from different node levels—usually, the more<br />

abstract ones results in less flexible DSL elements.<br />

Classify domain abstractions into concerns. In this step,<br />

one shall create a table categorizing the chosen abstractions<br />

into concerns. These concerns must be related to the mobile<br />

robots’ domain. The most common concerns are domainindependent,<br />

for example, Movement, Communication and<br />

Recognition. However, the domain engineer can elect domainspecific<br />

concerns as well. For example, abstractions that state<br />

the robot must move, like following a line or a path, should<br />

belong to Movement concern, yet abstractions such as finding<br />

the best path should be classified into the Planning concern,<br />

and so on. The resulting artifact of this activity is called Table<br />

of Domain Abstractions and it is the input for the next activity.<br />

Create language model. In this activity, the domain<br />

engineer shall iterate the concerns and for each of them he/she<br />

identifies common and variant parts of its abstractions. Then<br />

these parts are added to t he Language model. Here, the<br />

engineer must know the APIs used in the implementation of the<br />

application, as we mentioned earlier. It is important to know<br />

how the physical parts of the robot, such as sensors and motors,<br />

are programmatically represented, because the Language<br />

Model should be aware of implementation details, even though<br />

they will not be visible to developers. These details are<br />

important for code generation issues.<br />

As a r esult of our study, we created a generic language<br />

model that could be used as a foundation for new mobile robot<br />

DSLs. That is, the domain engineer could simply extend our<br />

generic language model to fit his/her needs.<br />

Our generic language model is shown in Fig. 3. The main<br />

entity is Robot. It contains behaviors, belief states, sensors and<br />

variables. This model is based on the Behavior model [6] and<br />

its way of programming robots consists roughly of specifying<br />

behaviors for the robot, and each of them has a condition to be<br />

executed. Just one behavior will run at a time—the one whose<br />

condition is satisfied at the moment. In our model, the<br />

conditions are specified as belief states; the expression property<br />

is intended to contain comparisons of sensors’ data and<br />

variable values. The expression may use functions of sensors<br />

and variables. For example, an ultrasonic sensor may have the<br />

“distance” function which returns a float value. The domain<br />

496

Hooray! Your file is uploaded and ready to be published.

Saved successfully!

Ooh no, something went wrong!