<!DOCTYPE article PUBLIC "-//NLM//DTD JATS (Z39.96) Journal Archiving and Interchange DTD v1.0 20120330//EN" "JATS-archivearticle1.dtd">
<article xmlns:xlink="http://www.w3.org/1999/xlink">
  <front>
    <journal-meta />
    <article-meta>
      <title-group>
        <article-title>Online Search in Behavioral Programming Models</article-title>
      </title-group>
      <contrib-group>
        <aff id="aff0">
          <label>0</label>
          <institution>Orel Moshe Weinstock Department of Computer Science, Ben-Gurion University of the Negev</institution>
        </aff>
      </contrib-group>
      <abstract>
        <p>-We present a model based approach to Search Based Software Engineering (SBSE). The approach is based on the Behavioral Programming (BP) paradigm where independent aspects of behavior are woven at run time using a simple interaction protocol. We propose to extend the behavioral programming execution mechanism with on-line heuristic search in program state space that allows programmers to develop non-deterministic programs while relying on a “smart” event selection mechanism to resolve non-determinism in a way that maximizes a specified heuristic function. The paper presents a new library that we have developed in Java and in JavaScript, using Rhino, to facilitate the proposed modeling approach and programming style. We give examples, in the context of a StarCraft game bot built with the library, that demonstrate how the proposed programming idioms can simplify the code and help build robust reactive systems.</p>
      </abstract>
    </article-meta>
  </front>
  <body>
    <sec id="sec-1">
      <title>I. MOTIVATION AND BACKGROUND</title>
      <p>
        Search Based Software Engineering (SBSE) is an emerging
field of research which aims to cope with the increased
demand for functionality, scalability, and robustness of computer
programs (and of reactive robotic systems in particular) using
heuristic search mechanisms [
        <xref ref-type="bibr" rid="ref1">1</xref>
        ]. SBSE consists of automatic
resolution (using search algorithms) of complex decisions that
programmers model as optimization problems. There are many
published papers in this area that describe various approaches
within the software engineering research community [
        <xref ref-type="bibr" rid="ref2">2</xref>
        ], [
        <xref ref-type="bibr" rid="ref3">3</xref>
        ].
There are also reports that describe how SBSE has been
successfully applied to solve problems in nearly all software
development life cycle phases [
        <xref ref-type="bibr" rid="ref4">4</xref>
        ], [
        <xref ref-type="bibr" rid="ref5">5</xref>
        ]. The main challenge in
SBSE is, of course, finding a good modeling technique that
facilitates the search [
        <xref ref-type="bibr" rid="ref6">6</xref>
        ].
      </p>
      <p>
        Despite the research activity in the area, search methods are
practically used only in specific domains. Harman [
        <xref ref-type="bibr" rid="ref2">2</xref>
        ] reports,
for example, that 54% of SBSE tools are used for testing
purposes, an additional 11% for maintenance, and another
10% for project management. It seems that the main barrier
that delays further adaptation of the technique is shortage in
models for online search [
        <xref ref-type="bibr" rid="ref6">6</xref>
        ].
      </p>
      <p>
        The goal of this this paper is to explore how SBSE can
be made accessible to modelers and programmers of reactive
systems, such as robotic applications and interactive game
bots, as idioms that integrate with standard constructs in
common modeling and programming languages. This allows for
natural, powerful derivation from modeling languages (such
as LSC [
        <xref ref-type="bibr" rid="ref7">7</xref>
        ], [
        <xref ref-type="bibr" rid="ref8">8</xref>
        ]) to code. Specifically, we aim at tools that
facilitate the following software development methodology:
1) Code and/or derive from models the high-level
specification of the system’s behavior, using non-determinism
to specify free choices in execution.
2) Run the system using an engine that resolves non
determinism heuristically or synthesize deterministic code.
3) If unsatisfied with the execution’s choices, extend the
model by formalizing more refined requirements.
4) Repeat steps 2 and 3 until the behavior is satisfactory.
      </p>
      <p>
        The behavioral programming (BP) paradigm that we focus
on in this paper is described in detail in Section II. BP
extends and generalizes scenario-based programming which
was introduced with the language of live sequence charts
(LSC) [
        <xref ref-type="bibr" rid="ref7">7</xref>
        ], [
        <xref ref-type="bibr" rid="ref8">8</xref>
        ]. In addition to the refinement idioms that already
exist in BP, which allow programmers to incrementally shape
their software by adding modules that can both widen and
narrow the set of possible behaviors of the system [
        <xref ref-type="bibr" rid="ref9">9</xref>
        ], we
propose in this paper to allow BP based models to also contain
specification of fitness criteria for the heuristic search function
that can also be refined along the above development process.
      </p>
      <p>The idea of “smart” execution of scenario based
specifications started in [10] and in [11] with proposals to apply,
respectively, model-checking and planning algorithms for
running a single super-step (the part of the run that spans between
two consecutive external events) in LSC. We apply a similar
mechanism in the context of a behavioral programming library
embedded in an imperative programming language. Beyond
running in a different setting, the main addition of our library,
when compared to these earlier contributions, is that it runs
the “smart” event selection mechanism at run-time, on real
program code rather than on a model or specification, and
that it can consider a horizon beyond a single super-step.</p>
    </sec>
    <sec id="sec-2">
      <title>II. BEHAVIORAL PROGRAMMING PRINCIPLES</title>
      <p>As presented in [12], a behavioral model consists of a set
of independent behavior threads (b-threads for short). Each
b-thread is a specification of a reactive machine that can be
modeled, e.g., as a procedure in an imperative programming
language. Together, the b-threads control the behavior of flow
of the application via a synchronization protocol, as follows.
When a b-thread reaches a point that requires synchronization,
it waits until all other b-threads reach such synchronization
points in their own flow. At synchronization points, each
bthread specifies three sets of events: (1) requested events - the
thread proposes that these events be considered for triggering,
and asks to be notified when any of them occurs; (2)
waitedfor events - the thread does not request these events, but only
asks to be notified when any of them is triggered. The platform
will not consider these events for triggering, unless given as
external input to the system; and (3) blocked events - the thread
currently forbids triggering of these events.</p>
      <p>As shown in Figure 1, when all b-threads are at a
synchronization point, a legal event (an event that is requested by
at least one b-thread and is not blocked by any b-thread) is
chosen. This chosen event is then triggered by resuming all the
b-threads that either requested or waited for it. Each of these
resumed b-threads then proceeds with its execution, all the
way to its next synchronization point, where it again presents
sets of requested, waited-for and blocked events. The other
bthreads remain at their last synchronization points, oblivious
to the triggered event, until an event is selected that they have
requested or are waiting for. When all b-threads are again at
a synchronization point, the event selection process repeats.</p>
      <p>More formally, recall that a deterministic labeled transition
system is a quadruple hS; E; !; initi, where S is a set of
states, E is a set of events, ! is a (possibly partial) function
from S E to S, and init 2 S is the initial state. The
runs of such a transition system are sequences of the form
s0 e!1 s1 e!2 e!i si , where s0 = init, and for all
i = 1; 2; , si 2 S, ei 2 E, and the function ! maps
the pair hsi 1; eii to si, written as si 1 e!i si. We say that
hS; E; !; initi is total if the transition function ! is a total
function.</p>
      <p>We will now give the semantics of a set of b-threads in
terms of runs of a transition system. For this, we model each
behavior thread as a transition system with an association of
requested and blocked events to each state:
Definition 1. behavior thread [12]: A behavior thread (abbr.
b-thread) is a tuple hS; E; !; init; R; Bi, where hS; E; !
; initi forms a deterministic total labeled transition system,
R : S ! 2E is a function that associates each state with the
set of events requested by the b-thread when in that state, and
B : S ! 2E is a function that associates each state with the
set of events blocked by the b-thread when in that state.</p>
      <p>We define a composition operator on the set of b-threads and
the resulting set of runs of the composite transition system as
follows:
Definition 2. Runs of a set of b-threads [12]: We define the
n
runs of a set of b-threads fhSi; Ei; !i; initi; Ri; Biigi=1 as
the runs of the labeled transition system hS; E; !; initi, where
S = S1 Sn, E = Sin=1 Ei, init = hinit1; : : : ; initni,
e
and ! includes a transition hs1; : : : ; sni ! hs01; : : : ; s0ni if
and only if
e 2
n
[ Ri(si)
i=1
| e is r{eqzuested }
^</p>
      <p>n
e 2= [ Bi(si) :</p>
      <p>i=1
| e is not blocked }
{z
and
n
^</p>
      <p>
        e
(e 2 Ei =) si !i s0i) ^ (e 2= Ei =) si = s0i)
i=1 | affected b-{thzreads move } u|naffected b-thr{ezads do not mo}ve
When multiple events are requested and not blocked, the
semantics of event selection may vary. The process of choosing
the next event, the focus of this research, is called Arbitration.
Various arbiters have been suggested in other works:
A na¨ıve arbiter would select a legal event at random, as
in the LSC Play Engine [
        <xref ref-type="bibr" rid="ref8">8</xref>
        ].
      </p>
      <p>Choosing a minimal event according to b-thread, event,
and request order [12], [13].
Look-ahead subject to desired properties of the resulting
event sequence, as in smart play-out [10].</p>
      <p>Planning algorithms [11], called planned play-out in LSC.
Reinforcement learning where events that have shown to
produce better expected value are selected [14].</p>
      <p>Allow concurrent events or split execution into parallel
concurrent executions, as in [15].</p>
      <p>
        Synthesizing specifications into a deterministic
automaton (e.g. [
        <xref ref-type="bibr" rid="ref10">16</xref>
        ]).
      </p>
      <p>In this research we adopt and extend the mechanism
proposed in [11] as elaborated in Section IV below.</p>
      <p>b-thread
b-thread
b-thread
b-thread</p>
    </sec>
    <sec id="sec-3">
      <title>Requested Events</title>
    </sec>
    <sec id="sec-4">
      <title>Blocking</title>
    </sec>
    <sec id="sec-5">
      <title>Selected Event (1) (2)</title>
      <p>The intent is for programmers to use the principles
introduced in the previous section in an imperative programming
language. To illustrate this coding technique, consider a
bthread that increases water flow in a hot water tap by
requesting five times the event AddHot which stands for turning
the tap anticlockwise for some small fixed amount. Another
b-thread performs a similar action, with the event AddCold,
on the cold water tap. To increase the water flow in both taps
in parallel, as may be desired for keeping the temperature
stable, one may activate the above b-threads alongside a
third one, which forces the interleaving of events in the two
scenarios. The third b-thread, for example, can be coded
as “repeatedly: block AddCold until AddHot;
block AddHot until AddCold”. This programming
style was proposed in [12] in Java and is extended to Javascript
in our work. A Javascript program for the water tap application
is shown in Figure 2.</p>
      <p>As seen in Figure 2, defining b-threads is easy and concise
- you simply register a function with the application object,
which is embedded in the Javascript interpreter from the
underlying Java. Synchronization is induced by calling a method
called bsync, passing to it three sets of events: requested,
waited-for, and blocked events (in this order). The return value
of bsync is the triggered event that resumed the b-thread. All
multi-threading and concurrency issues are handled by the
BPJavascript engine.</p>
      <p>The application object is not the only object available to the
Javascript programmer. Other objects from the Java layer, like
the predefined event set objects none and all, and addCold
and addHot can also be embedded in the interpreter and, thus,
can be accessed by the Javascript code. The ability to embed
Java operations and objects within the interpreter allows us
to create DSLs for sharing common functionality between
bthreads and a much easier way to extend the application or
even embed it in another BP-Javascript application.</p>
      <p>The b-threads can combine the full power of the Javascript
language with synchronized behavioral execution and can
also dynamically integrate with applications containing
nonbehavioral components. BP-Javascript also enjoys the
flexibility and conciseness of Javascript without sacrificing any of the
semantics of the Java BP back-end.</p>
      <p>
        A comparison to [12], which has no backtracking, and
[
        <xref ref-type="bibr" rid="ref11">17</xref>
        ], which uses external tooling for backtracking, is in
order. Our implementation adapts [
        <xref ref-type="bibr" rid="ref11">17</xref>
        ] for online search by
using Javascript backtracking over Rhino with a modified BPJ
library without exteral tooling, see V.
      </p>
    </sec>
    <sec id="sec-6">
      <title>IV. BP-JAVASCRIPT WITH SEARCH</title>
      <p>
        While BP, as presented in the preceding sections, is
useful in allowing for relatively independent code components,
the model is, by definition, a non-deterministic system that
leaves a choice when there is more than one event that is
requested and not blocked. To get a standard, deterministic,
implementation, programmers can add b-threads that refine
the specification or, as we propose in this paper, use a “smart”
execution mechanism. Specifically, we now demonstrate how
an extension of BP-Javascript with an application agnostic
search-based event selection mechanism allows for a cleaner
and more robust program. The examples from now on are
based on a library we have developed to support this
approach. We demonstrate how it can be used in the context
of a StartCraft [
        <xref ref-type="bibr" rid="ref12">18</xref>
        ] bot. The bot itself is only in an early
development phase, the code here is only an outline, not part
of a full, working implementation.
1 function findAndHarvestMinerals(move) {
2 while(true){
3 var minerals = bsync(new FindMineral(this), none, none
);
var othersHarvesting = new OthersHarvesting(this,
      </p>
      <p>minerals.getLocation());
while(notFullyLoaded){
var harvest =
bsync(new Harvest(minerals.getLocation()),
none, othersHarvesting);
updateLoaded(harvest.getAmount());
}
bsync(new ReturnToBase(this), none, none);</p>
      <p>Figure 3 shows an example of using BP-Javascript with
search for optimal worker assignment to mineral fields in
the game of StarCraft. The example is accompanied by the
screenshot shown in Figure 5. The function described is
registered as a b-thread for each worker. To see how the
search mechanism works in this example, let us examine the
arbitration process for a behavioral program with these
bthreads bsync by bsync, assuming the heuristic function’s
value is the total amount of minerals harvested as in Figure 4.
Each time a bsync is executed (lines 3,8,12), BP will apply
the heuristic function to the game state.</p>
      <p>Line 3: The worker asks for orders to mine any visible
mineral field - it requested such an order for each visible field.
The worker will then start harvesting the location it was sent
to at line 8. At this point, the BP system has to choose which
mineral field harvest order to trigger. The system will search
through the different branches of the program space, each
starting with a different harvest order. A sub-optimal choice
will get a lower heuristic value than the optimal choice. Line
8: The worker harvests the field he received in the preceding
bsync. While this worker is harvesting the mineral field
(receiving Harvest events), because of the blocked event
set given to bsync, no other b-thread (worker) can receive a
Harvest event on the same field (i.e. can harvest it). While
searching through program space at this point, any branch in
which a worker will wait on an already taken mineral field
will get a lower heuristic value than one in which there are
no workers who are waiting for others to finish with the
field. Therefore, the heuristic drives the search away from
unnecessary waits by workers. Line 12: The worker asks for
orders to head back to base with the collected minerals.</p>
      <p>
        This example shows how the non-determinism created by
the existence of multiple requested yet unblocked events is
resolved by the search engine, using an appropriate heuristic
function. This can be utilized to write concise programs that
would have been longer on a regular imperative platform,
even when employing search techniques [
        <xref ref-type="bibr" rid="ref13">19</xref>
        ], [
        <xref ref-type="bibr" rid="ref14">20</xref>
        ]. As a
rough quantitative comparison, assume only 10% of the code
managing the build order (resource collection, unit training
and building construction sequence) in the bot coded in [
        <xref ref-type="bibr" rid="ref14">20</xref>
        ]
deals with harvesting minerals. That is approximately 40KB
of source code, significantly longer than the code in Figure 3.
      </p>
    </sec>
    <sec id="sec-7">
      <title>V. UNDER THE HOOD</title>
      <p>Defining the program-state correctly has great influence on
search results. At every synchronization point where the arbiter
has to choose the next event, we run the program with our
choices while controlling its inputs and outputs to determine
the heuristic value of states reached in the run and choose
the event leading to the highest scored state. The model in
this case is the actual program state - all its variables, stack
frames, memory space etc.</p>
      <p>
        The technique of running the program in a controlled
environment is called sandboxing, and is often used for
testing [
        <xref ref-type="bibr" rid="ref15">21</xref>
        ]. Although using this method requires writing an
environment simulator (to generate inputs), in addition to the
desired application itself, this is not a significant penalty to
development as a simulator is a required in order to test the
application. While running the program in a sandbox with
a simulator in its entirety may be difficult for big general
purpose applications (due to the large codebase), it is viable
for control/reactive systems - the focus of this research. This
type of systems contains higher level code that concentrates
on logical flow, which runs faster than general code. Note
that the simulation of the environment does not have to be
complete, a good search mechanism can make much use even
of an abstract description of the environment.
      </p>
      <p>We will now discuss the implementation of the
programstate object. Programs in BP are comprised of b-threads, so
their states is an aggregate of the independent state of each
bthread. Anything happening inside a b-thread between bsync
calls - that is, between synchronization points - is by definition
internal to the b-thread, and so can be considered atomic to the
program as a whole. Therefore, we can ignore these internal
workings and focus on bsyncs, as only the states at these
synchronization points define the integrated system behavior.</p>
      <p>
        The only programmatic construct that captures program
execution in an immutable, re-entrant object, as required by search
algorithms, is a continuation [
        <xref ref-type="bibr" rid="ref16">22</xref>
        ], [
        <xref ref-type="bibr" rid="ref17">23</xref>
        ]. Continuations are
representations of the program at a given point in execution,
which are available to the programmer, rather than hidden by
the runtime environment. They are used here to traverse the
state space by ordinary program execution, as they facilitate
backtracking and resuming of execution from desired points
where they were captured. We can now formally define the
state space for the search:
Definition 3. A BT-state represents the state of a specific
bthread in a bsync call during a run of the program. It is
composed of the b-thread and its captured continuation.
public BEvent bsync(RequestInterface requested,
      </p>
      <p>EventSet waited, EventSet blocked) {
_request = requested;
_wait = waited;
_block = blocked;
...</p>
      <p>Context cx = ContextFactory.getGlobal().enterContext();
_cont = cx.captureContinuation();
...
}</p>
      <p>As shown in Figure 6, a BT-state (_cont) is captured
at every call to bsync by the underlying Java b-thread
object. This ensures that once all b-threads have reached a
synchronization point, their continuation object representing
that state is updated, so that a complete state of the BP system
can be captured:
Definition 4. A BP-state represents the state of the whole
program. It is composed of the BT-states of all b-threads in
the program, captured at a bsync.</p>
      <p>
        When the BP infrastructure is required to make a choice
between multiple events to trigger, it creates a BP-state as
a root for the search. Expanding search nodes is done by
triggering legal events and capturing the new BP-states created
by the triggering. This is done by executing the code as in [
        <xref ref-type="bibr" rid="ref11">17</xref>
        ],
and not offline or by running on an abstract model of the code
as in [
        <xref ref-type="bibr" rid="ref18">24</xref>
        ]. This ensures that there are no discrepancies between
the code itself and the search results. The BT-state and
BPstate are the abstractions used by the search algorithm directly
such that all BP specific code is encapsulated within those
objects and is completely transparent to the search algorithm.
      </p>
      <p>With the state space defined, we can delve into the search
mechanism itself - how we run behavioral programs in a
sandbox. The sandbox is composed of the environment simulator
(input generator), a search algorithm and a heuristic function.</p>
      <p>An implementation of a look-ahead mechanism, beyond one
super-step, requires that the system be able to predict the
actions of the environment to some precision. For this, we
need to ask programmers to provide the search mechanism
with an abstract model of the environment (which can be
probabilistic), a simulator, to provide inputs to the behavioral
program while in the sandbox.
1 function killClosest(move) {
2 var closestEnemy = getClosestEnemy();</p>
      <p>As shown in Figure 7, we have implemented an environment 3 bsync(new AttackCommand(closestEnemy),none,none);
simulator as b-threads in the program itself. In normal oper- 54 whilbes(ycnlco(sneeswtESnheomoyt.(itshAilsi,vEen(e)m)y{),none,none);
ation, a simulator b-thread’s bsync is modified such that its 6 }}
requested event sets are added to the waited-for events set, and
its requested event set is empty. This ensures the simulation
b-thread is made aware of all events relevant to it, so that it
maintains a correct state for the next use in simulation mode.</p>
      <p>When the BP infrastructure needs to search for an event
to trigger, the simulation b-threads are switched to simulation
mode, in which they request events normally triggered by the
environment as modeled in their code. No manipulation of
their event lists is done in simulation mode. This “Eating our
own dog food” approach greatly contributes to the robustness
of the simulator and program, while also providing a clear and
unified interface for programming behavioral programs.</p>
      <p>Let us now consider another example, illustrated in Figure 8.</p>
      <p>In this example, we demonstrate usage of the environment
simulator to encode our knowledge that the
environmentdriven Marines attack the closest enemy. We therefore code
the Marine simulator function as in Figure 9 and register it
as a simulation b-thread. When in normal operation, BP will
receive the Marine’s actions from the environment. When in
simulation mode, the yellow Marine will request to attack the
top Hydralisk, and the red Marine will request to attack the
bottom Hydralisk. If we learn more about Marine behavior, we
can change the function in Figure 9, or register more b-threads
specifying their behavior as simulation b-threads. VI. CONCLUSION</p>
      <p>
        An interface for sending inputs to the behavioral program
and for examining its outputs is then required. A convenient
solution for this is defining the interface to and from the
behavioral program to be an event queue (an input queue
has been introduced in [
        <xref ref-type="bibr" rid="ref19">25</xref>
        ]). This way the environment and
the sandbox both enqueue events for triggering within the
behavioral program in the input queue and read the
behavioral program’s output from its output queue. The behavioral
program does not directly perform actions on the environment
- events from the output queue are fed as player actions back
into the environment by an adapter, thus enabling running in
sandbox without extra code analysis.
      </p>
      <p>
        Selecting the right search algorithm for a behavioral
program can have great impact on the results. The algorithms we
have used are depth-limited A* and minimax [
        <xref ref-type="bibr" rid="ref20">26</xref>
        ] textbook
implementations [
        <xref ref-type="bibr" rid="ref21">27</xref>
        ]. The architecture of our solution is such
that it is easy to introduce other search algorithms, as there is
no coupling between the algorithm itself and the BP-Javascript
engine. The specific choice of best search algorithms for
specific application domains is beyond the scope of this work.
      </p>
      <p>Writing a heuristic function is straightforward: the
BPstate object passed to the function grants access to the entire
program without compromising speed or space. This includes
the b-thread’s bsync event sets and public access methods.</p>
      <p>The programmer, then, is given full power in the evaluation of
program state, independent of the search algorithm used. The
programmer can write different heuristic functions that reward
desired events and b-thread properties.</p>
      <p>In this paper we have shown how a BP engine with
an embedded program-state space search mechanism can
facilitate development in a new, more natural way using a
standard, modern programming language. The BP architecture
was enhanced to be more flexible and real-world ready. The
game bots we programmed in this manner accomplished their
initial goals by fulfilling their function in the game while
being relatively short and easy to code. This will allow us
to further explore and advance the use of BP, in general and
in AI domains particularly, using run-time search to provide
the programmer with more freedom.</p>
    </sec>
    <sec id="sec-8">
      <title>ACKNOWLEDGEMENTS</title>
    </sec>
  </body>
  <back>
    <ref-list>
      <ref id="ref1">
        <mixed-citation>
          [1]
          <string-name>
            <given-names>M.</given-names>
            <surname>Harman</surname>
          </string-name>
          and
          <string-name>
            <given-names>B. F.</given-names>
            <surname>Jones</surname>
          </string-name>
          , “
          <article-title>Search-based software engineering”</article-title>
          ,
          <source>Information and Software Technology</source>
          , vol.
          <volume>43</volume>
          , no.
          <issue>14</issue>
          , pp.
          <fpage>833</fpage>
          -
          <lpage>839</lpage>
          ,
          <year>2001</year>
          .
        </mixed-citation>
      </ref>
      <ref id="ref2">
        <mixed-citation>
          [2]
          <string-name>
            <given-names>M.</given-names>
            <surname>Harman</surname>
          </string-name>
          ,
          <string-name>
            <given-names>S. A.</given-names>
            <surname>Mansouri</surname>
          </string-name>
          , and
          <string-name>
            <given-names>Y.</given-names>
            <surname>Zhang</surname>
          </string-name>
          , “
          <article-title>Searchbased software engineering: trends, techniques and applications”</article-title>
          ,
          <source>ACM Computing Surveys (CSUR)</source>
          , vol.
          <volume>45</volume>
          , no.
          <issue>1</issue>
          , p.
          <fpage>11</fpage>
          ,
          <year>2012</year>
          .
        </mixed-citation>
      </ref>
      <ref id="ref3">
        <mixed-citation>
          [3]
          <string-name>
            <given-names>H.</given-names>
            <surname>Jiang</surname>
          </string-name>
          ,
          <string-name>
            <given-names>Z.</given-names>
            <surname>Ren</surname>
          </string-name>
          ,
          <string-name>
            <given-names>X.</given-names>
            <surname>Li</surname>
          </string-name>
          ,
          <string-name>
            <given-names>and X.</given-names>
            <surname>Lai</surname>
          </string-name>
          , “
          <article-title>Transformed search based software engineering: a new paradigm of sbse”</article-title>
          ,
          <string-name>
            <surname>in</surname>
            <given-names>SSBSE</given-names>
          </string-name>
          ,
          <year>2015</year>
          .
        </mixed-citation>
      </ref>
      <ref id="ref4">
        <mixed-citation>
          [4]
          <string-name>
            <given-names>J.</given-names>
            <surname>Manuel</surname>
          </string-name>
          ,
          <string-name>
            <given-names>C.</given-names>
            <surname>Trilla</surname>
          </string-name>
          ,
          <string-name>
            <given-names>S.</given-names>
            <surname>Poulding</surname>
          </string-name>
          , and
          <string-name>
            <given-names>C.</given-names>
            <surname>Runciman</surname>
          </string-name>
          , “
          <article-title>Weaving parallel threads: searching for useful parallelism in functional programs”</article-title>
          ,
          <string-name>
            <surname>in</surname>
            <given-names>SSBSE</given-names>
          </string-name>
          ,
          <year>2015</year>
          .
        </mixed-citation>
      </ref>
      <ref id="ref5">
        <mixed-citation>
          [5]
          <string-name>
            <given-names>S.</given-names>
            <surname>Yoo</surname>
          </string-name>
          , “
          <article-title>Amortised optimisation of non-functional property in production environment”</article-title>
          ,
          <string-name>
            <surname>in</surname>
            <given-names>SSBSE</given-names>
          </string-name>
          ,
          <year>2015</year>
          .
        </mixed-citation>
      </ref>
      <ref id="ref6">
        <mixed-citation>
          [6]
          <string-name>
            <given-names>J.</given-names>
            <surname>Ahluwalia</surname>
          </string-name>
          ,
          <string-name>
            <given-names>I. H.</given-names>
            <surname>Kru</surname>
          </string-name>
          ¨ger, W. Phillips, and
          <string-name>
            <given-names>M.</given-names>
            <surname>Meisinger</surname>
          </string-name>
          , “
          <article-title>Model-based run-time monitoring of endto-end deadlines”</article-title>
          ,
          <source>in Proceedings of the 5th ACM international conference on Embedded software, ACM</source>
          ,
          <year>2005</year>
          , pp.
          <fpage>100</fpage>
          -
          <lpage>109</lpage>
          .
        </mixed-citation>
      </ref>
      <ref id="ref7">
        <mixed-citation>
          [7]
          <string-name>
            <given-names>W.</given-names>
            <surname>Damm</surname>
          </string-name>
          and
          <string-name>
            <given-names>D.</given-names>
            <surname>Harel</surname>
          </string-name>
          , “
          <article-title>Lscs: breathing life into message sequence charts”, Formal methods in system design</article-title>
          , vol.
          <volume>19</volume>
          , no.
          <issue>1</issue>
          , pp.
          <fpage>45</fpage>
          -
          <lpage>80</lpage>
          ,
          <year>2001</year>
          .
        </mixed-citation>
      </ref>
      <ref id="ref8">
        <mixed-citation>
          [8]
          <string-name>
            <given-names>D.</given-names>
            <surname>Harel</surname>
          </string-name>
          and
          <string-name>
            <given-names>R.</given-names>
            <surname>Marelly</surname>
          </string-name>
          ,
          <article-title>Come, let's play: scenariobased programming using LSCs and the play-engine</article-title>
          . Springer Science &amp; Business
          <string-name>
            <surname>Media</surname>
          </string-name>
          ,
          <year>2003</year>
          , vol.
          <volume>1</volume>
          .
        </mixed-citation>
      </ref>
      <ref id="ref9">
        <mixed-citation>
          [9]
          <string-name>
            <given-names>D.</given-names>
            <surname>Harel</surname>
          </string-name>
          ,
          <string-name>
            <given-names>A.</given-names>
            <surname>Marron</surname>
          </string-name>
          , and G. Weiss, “
          <article-title>Behavioral programming”</article-title>
          ,
          <source>Communications of the ACM</source>
          , vol.
          <volume>55</volume>
          , no.
          <issue>7</issue>
          , pp.
          <fpage>90</fpage>
          -
          <lpage>100</lpage>
          ,
          <year>2012</year>
          . D.
          <string-name>
            <surname>Harel</surname>
            ,
            <given-names>H.</given-names>
          </string-name>
          <string-name>
            <surname>Kugler</surname>
            ,
            <given-names>R.</given-names>
          </string-name>
          <string-name>
            <surname>Marelly</surname>
          </string-name>
          ,
          <article-title>and</article-title>
          <string-name>
            <given-names>A.</given-names>
            <surname>Pnueli</surname>
          </string-name>
          , “
          <article-title>Smart play-out of behavioral requirements”</article-title>
          ,
          <string-name>
            <surname>in</surname>
            <given-names>FMCAD</given-names>
          </string-name>
          , Springer, vol.
          <volume>2</volume>
          ,
          <issue>2002</issue>
          , pp.
          <fpage>378</fpage>
          -
          <lpage>398</lpage>
          .
          <string-name>
            <given-names>D.</given-names>
            <surname>Harel</surname>
          </string-name>
          and
          <string-name>
            <surname>I. Segall</surname>
          </string-name>
          , “
          <article-title>Planned and traversable playout: a flexible method for executing scenario-based programs”</article-title>
          ,
          <source>in Tools and Algorithms for the Construction and Analysis of Systems</source>
          , Springer,
          <year>2007</year>
          , pp.
          <fpage>485</fpage>
          -
          <lpage>499</lpage>
          . D.
          <string-name>
            <surname>Harel</surname>
            ,
            <given-names>A.</given-names>
          </string-name>
          <string-name>
            <surname>Marron</surname>
          </string-name>
          , and G. Weiss, “
          <article-title>Programming coordinated behavior in java”</article-title>
          ,
          <source>in ECOOP 2010-ObjectOriented Programming</source>
          , Springer,
          <year>2010</year>
          , pp.
          <fpage>250</fpage>
          -
          <lpage>274</lpage>
          . G. Wiener,
          <string-name>
            <surname>G.</surname>
          </string-name>
          <article-title>Weiss, and</article-title>
          <string-name>
            <given-names>A.</given-names>
            <surname>Marron</surname>
          </string-name>
          , “
          <article-title>Coordinating and visualizing independent behaviors in erlang”</article-title>
          ,
          <source>in Proceedings of the 9th ACM SIGPLAN workshop on Erlang, ACM</source>
          ,
          <year>2010</year>
          , pp.
          <fpage>13</fpage>
          -
          <lpage>22</lpage>
          .
          <string-name>
            <given-names>N.</given-names>
            <surname>Eitan</surname>
          </string-name>
          and
          <string-name>
            <given-names>D.</given-names>
            <surname>Harel</surname>
          </string-name>
          , “
          <article-title>Adaptive behavioral programming”</article-title>
          ,
          <source>in Tools with Artificial Intelligence (ICTAI)</source>
          ,
          <year>2011</year>
          23rd IEEE International Conference on, IEEE,
          <year>2011</year>
          , pp.
          <fpage>685</fpage>
          -
          <lpage>692</lpage>
          . H.
          <string-name>
            <surname>Kugler</surname>
            ,
            <given-names>C.</given-names>
          </string-name>
          <string-name>
            <surname>Plock</surname>
          </string-name>
          ,
          <article-title>and</article-title>
          <string-name>
            <given-names>A.</given-names>
            <surname>Roberts</surname>
          </string-name>
          , “
          <article-title>Synthesizing biological theories”</article-title>
          , in Computer Aided Verification - 23rd International Conference, CAV 2011,
          <article-title>Snowbird</article-title>
          ,
          <string-name>
            <surname>UT</surname>
          </string-name>
          , USA, July
          <volume>14</volume>
          -
          <issue>20</issue>
          ,
          <year>2011</year>
          . Proceedings, G. Gopalakrishnan and S. Qadeer, Eds.,
          <source>ser. Lecture Notes in Computer Science</source>
          , vol.
          <volume>6806</volume>
          , Springer,
          <year>2011</year>
          , pp.
          <fpage>579</fpage>
          -
          <lpage>584</lpage>
          , ISBN:
          <fpage>978</fpage>
          -3-
          <fpage>642</fpage>
          -22109-
          <lpage>5</lpage>
          . DOI:
          <volume>10</volume>
          .1007/978- 3-
          <fpage>642</fpage>
          - 22110- 1
          <fpage>46</fpage>
          . [Online]. Available: http://dx.doi.org/10.1007/ 978-3-
          <fpage>642</fpage>
          -22110-1
          <fpage>46</fpage>
          .
        </mixed-citation>
      </ref>
      <ref id="ref10">
        <mixed-citation>
          [16]
          <string-name>
            <given-names>D.</given-names>
            <surname>Harel</surname>
          </string-name>
          and
          <string-name>
            <surname>I. Segall</surname>
          </string-name>
          , “
          <article-title>Synthesis from live sequence chart specifications”</article-title>
          ,
          <source>Journal of Computer System Sciences</source>
          ,
          <year>2011</year>
          .
        </mixed-citation>
      </ref>
      <ref id="ref11">
        <mixed-citation>
          [17]
          <string-name>
            <given-names>D.</given-names>
            <surname>Harel</surname>
          </string-name>
          ,
          <string-name>
            <given-names>R.</given-names>
            <surname>Lampert</surname>
          </string-name>
          ,
          <string-name>
            <given-names>A.</given-names>
            <surname>Marron</surname>
          </string-name>
          , and G. Weiss, “
          <article-title>Model-checking behavioral programs”</article-title>
          ,
          <source>in Proceedings of the ninth ACM international conference on Embedded software, ACM</source>
          ,
          <year>2011</year>
          , pp.
          <fpage>279</fpage>
          -
          <lpage>288</lpage>
          .
        </mixed-citation>
      </ref>
      <ref id="ref12">
        <mixed-citation>
          [18] (
          <year>1998</year>
          ).
          <article-title>Starcraft: brood war - wikipedia, the free encyclopedia</article-title>
          , [Online]. Available: http://en.wikipedia.org/ wiki/StarCraft: Brood War (visited on 07/11/
          <year>2015</year>
          ).
        </mixed-citation>
      </ref>
      <ref id="ref13">
        <mixed-citation>
          [19]
          <string-name>
            <given-names>D.</given-names>
            <surname>Churchill</surname>
          </string-name>
          and
          <string-name>
            <given-names>M.</given-names>
            <surname>Buro</surname>
          </string-name>
          , “
          <article-title>Build order optimization in starcraft</article-title>
          .”,
          <string-name>
            <surname>in</surname>
            <given-names>AIIDE</given-names>
          </string-name>
          ,
          <year>2011</year>
          .
        </mixed-citation>
      </ref>
      <ref id="ref14">
        <mixed-citation>
          [20] --
          <fpage>,</fpage>
          (
          <year>2015</year>
          ). UAlbertaBot, Starcraft bot code, [Online]. Available: http://github.com/davechurchill/ualbertabot (visited on 07/11/
          <year>2015</year>
          ).
        </mixed-citation>
      </ref>
      <ref id="ref15">
        <mixed-citation>
          [21]
          <string-name>
            <given-names>A.</given-names>
            <surname>Fox</surname>
          </string-name>
          ,
          <string-name>
            <given-names>E.</given-names>
            <surname>Brewer</surname>
          </string-name>
          , et al.,
          <article-title>“Harvest, yield, and scalable tolerant systems”</article-title>
          ,
          <source>in Hot Topics in Operating Systems</source>
          ,
          <year>1999</year>
          . Proceedings of the Seventh Workshop on, IEEE,
          <year>1999</year>
          , pp.
          <fpage>174</fpage>
          -
          <lpage>178</lpage>
          .
        </mixed-citation>
      </ref>
      <ref id="ref16">
        <mixed-citation>
          [22]
          <string-name>
            <given-names>G. D.</given-names>
            <surname>Plotkin</surname>
          </string-name>
          , “
          <article-title>Call-by-name, call-by-value and the lcalculus”, Theoretical computer science</article-title>
          , vol.
          <volume>1</volume>
          , no.
          <issue>2</issue>
          , pp.
          <fpage>125</fpage>
          -
          <lpage>159</lpage>
          ,
          <year>1975</year>
          .
        </mixed-citation>
      </ref>
      <ref id="ref17">
        <mixed-citation>
          [23]
          <string-name>
            <given-names>J. C.</given-names>
            <surname>Reynolds</surname>
          </string-name>
          , “
          <article-title>The discoveries of continuations”, Lisp and symbolic computation</article-title>
          , vol.
          <volume>6</volume>
          , no.
          <issue>3-4</issue>
          , pp.
          <fpage>233</fpage>
          -
          <lpage>247</lpage>
          ,
          <year>1993</year>
          .
        </mixed-citation>
      </ref>
      <ref id="ref18">
        <mixed-citation>
          [24]
          <string-name>
            <given-names>G.</given-names>
            <surname>Katz</surname>
          </string-name>
          , “
          <article-title>On module-based abstraction and repair of behavioral programs”, in Logic for Programming</article-title>
          ,
          <source>Artificial Intelligence, and Reasoning</source>
          , Springer,
          <year>2013</year>
          , pp.
          <fpage>518</fpage>
          -
          <lpage>535</lpage>
          .
        </mixed-citation>
      </ref>
      <ref id="ref19">
        <mixed-citation>
          [25]
          <string-name>
            <given-names>D.</given-names>
            <surname>Harel</surname>
          </string-name>
          ,
          <string-name>
            <given-names>A.</given-names>
            <surname>Kantor</surname>
          </string-name>
          ,
          <string-name>
            <given-names>G.</given-names>
            <surname>Katz</surname>
          </string-name>
          ,
          <string-name>
            <given-names>A.</given-names>
            <surname>Marron</surname>
          </string-name>
          , G. Weiss, and G. Wiener, “
          <article-title>Towards behavioral programming in distributed architectures”</article-title>
          ,
          <source>Science of Computer Programming</source>
          , vol.
          <volume>98</volume>
          , pp.
          <fpage>233</fpage>
          -
          <lpage>267</lpage>
          ,
          <year>2015</year>
          .
        </mixed-citation>
      </ref>
      <ref id="ref20">
        <mixed-citation>
          [26]
          <string-name>
            <given-names>S.</given-names>
            <surname>Russell</surname>
          </string-name>
          and
          <string-name>
            <given-names>P.</given-names>
            <surname>Norvig</surname>
          </string-name>
          , “
          <article-title>AI a Modern Approach”</article-title>
          , Learning, vol.
          <volume>2</volume>
          , no.
          <issue>3</issue>
          , p.
          <fpage>4</fpage>
          ,
          <year>2005</year>
          .
        </mixed-citation>
      </ref>
      <ref id="ref21">
        <mixed-citation>
          [27] (
          <year>2015</year>
          ).
          <article-title>Java implementation of algorithms from Norvig and Russell's ”Artificial Intelligence - A Modern Approach”</article-title>
          , [Online]. Available: http://github.com/aimajava/aima-java
          <source>(visited on 07/11/</source>
          <year>2015</year>
          ).
        </mixed-citation>
      </ref>
    </ref-list>
  </back>
</article>