<!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>Six (Im)possible Things before Breakfast?: Building-Blocks and Design-Principles for Wise Computing</article-title>
      </title-group>
      <contrib-group>
        <contrib contrib-type="author">
          <string-name>Assaf Marron</string-name>
          <xref ref-type="aff" rid="aff1">1</xref>
        </contrib>
        <contrib contrib-type="author">
          <string-name>Brit Arnon</string-name>
          <xref ref-type="aff" rid="aff1">1</xref>
        </contrib>
        <contrib contrib-type="author">
          <string-name>Achiya Elyasaf</string-name>
          <xref ref-type="aff" rid="aff1">1</xref>
        </contrib>
        <contrib contrib-type="author">
          <string-name>Michal Gordon</string-name>
        </contrib>
        <contrib contrib-type="author">
          <string-name>Guy Katz</string-name>
        </contrib>
        <contrib contrib-type="author">
          <string-name>Hadas Lapid</string-name>
          <xref ref-type="aff" rid="aff1">1</xref>
        </contrib>
        <contrib contrib-type="author">
          <string-name>Rami Marelly</string-name>
          <xref ref-type="aff" rid="aff1">1</xref>
        </contrib>
        <contrib contrib-type="author">
          <string-name>Dana Sherman</string-name>
          <xref ref-type="aff" rid="aff1">1</xref>
        </contrib>
        <contrib contrib-type="author">
          <string-name>Smadar Szekely</string-name>
          <xref ref-type="aff" rid="aff1">1</xref>
        </contrib>
        <contrib contrib-type="author">
          <string-name>Gera Weiss</string-name>
          <xref ref-type="aff" rid="aff0">0</xref>
        </contrib>
        <contrib contrib-type="author">
          <string-name>David Harel</string-name>
          <xref ref-type="aff" rid="aff1">1</xref>
        </contrib>
        <aff id="aff0">
          <label>0</label>
          <institution>Ben Gurion U.</institution>
        </aff>
        <aff id="aff1">
          <label>1</label>
          <institution>Weizmann Inst.</institution>
        </aff>
      </contrib-group>
      <abstract>
        <p>Despite many advances in automating system and software engineering, the knowledge, skills and experience of human engineers and domain experts are, and will continue to be, critical factors in the success of complex system development projects. In a new research direction we term towards wise computing we aim to make some of these abilities available to all project-team members, at any time, by adding several radically-new capabilities to the development environment. For example, the development environment will be able to, on its own, notice and suggest a required action for, an unexpected, unspeci ed, emergent system property. A report on the ultimate wise-computing vision and an initial demonstration of the desired functions have been published separately. Clearly, advanced tools, such as formal veri cation and synthesis, machine learning and automatic reasoning, which were not previously available, are now maturing and will be essential to wise computing. Yet, a comprehensive feasibility plan was not shown until now, and despite the above arsenal of tools, a challenge is often presented: is it indeed possible to automate some critically relevant abilities of humans, like free association, applying general knowledge to a wide variety of speci c cases, or \thinking outside the box" to nd a solution to a problem. In this report we outline research directions for several software capabilities and design principles that we have begun to work on, and which we believe can remove key remaining obstacles to feasibility of wise computing.</p>
      </abstract>
    </article-meta>
  </front>
  <body>
    <sec id="sec-1">
      <title>-</title>
      <p>Rich knowledge and sophisticated skills, acquired by experienced engineers over
years of training and hard-earned practical lessons, are key ingredients, and even
critical success factors, in complex software and system engineering projects. In
a new research vision that we term towards wise computing, we aim to endow
the software development environment with those engineering abilities that are
particularly considered unique to humans and make them available to the project
team at all times. Some of the relevant capabilities we are most interested in are:
{ Free association: i.e., when an event can trigger a distantly related action
{ Applying engineering and domain expertise: e.g., to new and varied situations
{ Noticing irregularities: e.g., answering \what's wrong with this picture?"
? With apologies to Lewis Carroll
{ Creative problem solving: i.e., \thinking-outside-the-box"
{ Seeing a bigger picture: e.g., considering problems, causes, work methods, etc.
{ Adapting to new demands: e.g., new work methods due to cyber risks</p>
      <p>As a speci c example, in developing an autonomous car, a wise development
environment will be able to do the following spontaneously: (1) identify the
modules participating in a communication protocol and apply model-checking to that
part of the system only, in order to verify its correctness; (2) notice, in testing
or in nal use, without it having been speci ed for the system, that the car
occasionally slows down, slightly, but still unnecessarily, and then search for causes
and solutions; and (3) use domain-speci c information, such as classical
mechanics or applicable tra c laws, in code generation, in test generation and in formal
veri cation.</p>
      <p>
        A description of the full vision of wise computing, as well as an initial
proofof-concept demonstration of the capabilities that such a wise development
environment will have, has been published separately [
        <xref ref-type="bibr" rid="ref4 ref5">4, 5</xref>
        ]. Related work is presented
later in this section.
      </p>
      <p>Wise computing will rely on advanced computationally-intensive capabilities,
such as formal veri cation using model-checking and SAT/SMT solving, program
synthesis, machine learning, pattern recognition, AI planning and reasoning,
program static analysis, and automatic test generation. These sophisticated tools,
which were not previously available, are now maturing and will play a central role
in wise computing. Yet, a comprehensive feasibility plan for wise computing was
not shown until now, and despite the availability of the above arsenal of tools,
a challenge is often presented: can the human skills described above, and others
that are required for accomplishing the wise computing vision, really be
automated? Do we know enough about the human mind to even start pursuing such
an ambitious goal?</p>
      <p>The purpose of this short paper is to describe elements of our present
research, which show that in the area of software and system engineering (\SE"
hereafter) this is indeed feasible, and that such human activity can be mimicked,
independently of the need to understand the biology and psychology behind it.</p>
      <p>In a nutshell, we believe that to harness and integrate into a development
environment (\DE" hereafter) the latest analytical tools and the not-yet-formalized
knowledge and skills of humans, will require the development of new structural
and behavioral principles. These will involve issues in system modeling, in
knowledge representation, and in the languages used by humans and machines to
converse about systems. As part of our broader research plan for wise computing,
this paper is dedicated to these enabling building blocks. In the following sections
we brie y present several of these as particular research directions, discuss their
merits and feasibility, and describe preliminary results supporting their continued
pursuit.</p>
      <p>
        Related Work. Due to space constraints we refer the reader to [
        <xref ref-type="bibr" rid="ref11">11</xref>
        ] for a
detailed discussion of related work. Automating unique human competencies has
been a goal of several research projects, most prominently, the Programmers
Apprentice and Requirements Apprentice projects at MIT (ended early 1990s) [
        <xref ref-type="bibr" rid="ref10 ref9">10,
9</xref>
        ]. There, the computer was intended to automatically generate code from
requirements where speci c text patterns (cliches) were recognized. A paper
published in 2015 by the same team shows a renewed interest in these concepts, and
demonstrates capabilities in natural language processing, domain-speci c
knowledge, and code generation [
        <xref ref-type="bibr" rid="ref2">2</xref>
        ]. Another related recent work is [
        <xref ref-type="bibr" rid="ref8">8</xref>
        ], where natural
language speci cations are used to synthesize and iteratively develop a reactive
robot controller, while predicting and discussing desired and undesired behaviors.
      </p>
      <p>The main contributions of the wise computing vision and of the feasibility plan
presented here are the breadth of target system applicability, range of human skills
addressed, and the search for fundamental game-changing engineering concepts
that would streamline this undertaking.
2</p>
    </sec>
    <sec id="sec-2">
      <title>Integrative Cross-function Models</title>
      <p>Common development practices and methodologies often rely on di erent models
and languages for requirements, speci cations, actual system code, test
scenarios, simulation results, bug reports, and system documentation. We propose to
research a method for modeling all the above artifacts in a consistent way that
connects all of them throughout the project life-cycle, in a single model or few
closely integrated ones. Combined with extended aggregation and re ection
capabilities, discussed in Sec. 3, this will help in application of knowledge in multiple
contexts, and in \seeing the bigger picture" of the system, the domain, and the
methods and tools used in development. Externally-speci ed connections between
artifacts, heuristic searches and systematic explorations of such models will be able
to exhibit behavior that may mimic the human ability for free association.</p>
      <p>
        To that end, we propose to research integration of statecharts [
        <xref ref-type="bibr" rid="ref3">3</xref>
        ] and
scenariobased programming (abbr. SBP hereafter, a.k.a behavioral programming; see
introduction of SBP in Sec. 5 and in [
        <xref ref-type="bibr" rid="ref1 ref6 ref7">1, 6, 7</xref>
        ]). Statecharts have been shown to be an
excellent modeling and coding medium from design to nal code, and SBP is
particularly geared to describing the inter-object scenarios common in requirements
speci cation, testing and the like. Our goal here is a uni ed visual and textual
modeling language (and associated semantics) that includes the capabilities of
both and any additional enhancements needed for wise computing.
      </p>
      <p>
        Speci cally, we plan to endow statecharts with the semantics unique to SBP,
including must vs. may transitions, associating statechart states with events that
should be considered for triggering and/or are forbidden in the state, and,
systemwide enforcement of event order subject to all concurrent scenarios. This work has
started and a draft speci cation of the integration is available in [
        <xref ref-type="bibr" rid="ref11">11</xref>
        ].
      </p>
      <p>
        As an interim step we integrated a statecharts development-and-simulation
tool with the PlayGo SBP tool, allowing not only exchange of events between
the two systems, but also a common, integrated user-interface, and a well-de ned
semantics for joint execution [
        <xref ref-type="bibr" rid="ref11">11</xref>
        ].
      </p>
      <p>
        Moreover, such a model immediately suggests a very useful approach to
knowledge representation: describe it in scenarios that capture the application of the
knowledge, similar to how the program itself is speci ed. This way, a particular
unit of knowledge constantly tries to apply itself wherever it is relevant, perhaps
in more than one way. An example of this approach is demonstrated in our
preliminary result of a scenario-based biological model for the intra-cellular citric-acid
cycle (a.k.a. Krebs cycle) [
        <xref ref-type="bibr" rid="ref11">11</xref>
        ]. Disparate chemical reactions are modeled as
separate scenarios, oblivious of each other, comparable to how they might be written
in a chemistry book. Yet, they all a work together, yielding a model that can
then in uence other components, such as a model of a disease or a treatment
thereof. Sec. 3 describes an example of scenario-based knowledge representation
and aggregation, in a use-case for home-assistant robot.
      </p>
      <p>This kind of knowledge representation can also help in detection of emergent
properties or missing elements, complementing machine learning methods, with
explicit, much simpler scenarios that look for behavior patterns or checklists of
elements that must be present.
3</p>
    </sec>
    <sec id="sec-3">
      <title>Enhanced Aggregation and Re ection</title>
      <p>Two of the most attractive features of statecharts are their intuitive and
powerful aggregation of states, and the ability to reference states of any object from
anywhere. We propose to extend these two capabilities to other system entities,
such as scenarios, and to also allow a single entity to be contained in multiple
containers, which themselves are rst-class citizens in the model.</p>
      <p>Flexible hierarchy and re ection will help in creating contexts for scenarios,
and then applying rules to entire contexts|e.g., day-time vs. night-time behaviors
of a home-assistant robot, or separating the robot's self-maintenance activities
from house duties. They will also simplify the application of external knowledge:
e.g., the knowledge that a baby needs a certain number of hours of sleep, can,
among others things, be re ected in a scenario that forbids the robot from doing
any of the actions previously tagged or identi ed as noisy, when the baby is asleep.
External reference to scenario states will also be valuable in re nement and repair
of existing behavior.</p>
      <p>Aggregation may also enable the DE to exhibit what may be perceived as
creative behavior, or \thinking outside the box". As is often advised in innovation
workshops, one should try to expand his or her \box", namely, by having a list
of generic solutions whose applicability should be considered. Flexible
aggregation enables the categorizing of certain system elements, as, e.g., \concurrency
related", or \safety-critical", thus enabling automated examination of generic
solutions such as a variety of locking and serialization mechanisms for the former,
or added sensors-and-alerts or human supervision for the latter.</p>
      <p>
        We have already prepared an initial speci cation for adding hierarchy and
aggregation to SBP in the context of live sequence charts (LSC) [
        <xref ref-type="bibr" rid="ref11">11</xref>
        ]. An interesting
observation is that, when SBP is nally fully integrated within statecharts, as
proposed in Sec. 2, aggregation of inter-object scenarios and the ability to externally
refer to scenario states will be readily implementable.
4
      </p>
    </sec>
    <sec id="sec-4">
      <title>An Extensible Text-based Interface</title>
      <p>In addition to any visual modeling and classical programming tools for the above,
we propose to provide an extensible textual language with precise, unambiguous
semantics for creating and discussing the models. A key feature of the language is
that its statements are aligned with how human experts would prefer to converse,
with people and with the DE, about the above systems|focusing on one fact at
a time, in arbitrary order. Each of the statements can thus be viewed as a
standalone entity, and their order or organization will not carry additional semantics.</p>
      <p>A highly relevant preliminary result is our group's work on programming
scenarios in controlled natural language with precise semantic rules|which may
thus be considered as a form of a domain-speci c language (DSL). We have also
created interfaces for displaying LSCs as English sentences. Our experience has
shown that while a picture (say, of an LSC) is \worth a thousand words", a concise
statement such as \when the driver presses the brake pedal, the brake light turns
on" is both useful and convenient. Such an approach, based on stand-alone
statements, is common also in declarative programming (e.g., Prolog), in text encoding
of UML models (e.g., UML/P), or in assertions to SAT/SMT solvers (e.g., CVC4
and Z3). As for a DSL for statement-based description of statecharts,
extending the above is straightforward, especially in the presence of existing text-based
encoding of statecharts such as SCXML.</p>
      <p>Thus, since all system entities, environment knowledge and meta information
can be described in statecharts and scenarios, we are con dent that we now have
a good basis for a natural interface for the two-way text-based interaction of a
wise DE and its users.
5</p>
    </sec>
    <sec id="sec-5">
      <title>Self-Integrating Behavior</title>
      <p>We introduce a design principle, termed self-integrating behavior (SIB), which
we believe can dramatically accelerate the endowing of DEs with new knowledge
and analytical abilities. We propose that it be adopted for speci cations, actual
system modeling and code, DEs, domain knowledge and other SE artifacts.</p>
      <p>SIB-designed components \take care of themselves". They seek out their
inputs, and make their outputs available to all other components. But, most
importantly, they are also prepared to comply with constraints speci ed by other
components. They can thus join or leave complex processes in an incremental,
selfstanding way with little or no change to existing components. The latter would be
more di cult in common OO designs, where existing modules have to be modi ed
with calls of relevant methods or for discovery of con guration changes1.</p>
      <p>
        One implementation we propose for SIB-design is that of scenario-based
programming (SBP) [
        <xref ref-type="bibr" rid="ref1 ref6 ref7">1, 6, 7</xref>
        ], which we feel is particularly apt as a basis for it. It was
rst introduced with the visual language of live sequence charts (LSC), and later
implemented in standard languages such as Java and C++. SBP calls for
specifying system behavior as inter-object scenarios, aligned with how people often
describe such behavior in, say, a requirements document or a user manual. Each
scenario speci es some facet of system behavior with the events that may, must,
or must not occur at each point. During execution, the scenarios run concurrently:
the execution environment selects the next event to be triggered, by considering
the entire speci cation according to well-de ned composition semantics, and then
advances all the scenarios accordingly. The capabilities and advantages of SBP
have been demonstrated in a variety of sample application areas, including
autonomous vehicles, industrial automation, a web server, and biological modeling.
      </p>
      <p>
        As an example of SIB, consider a game-playing program where rules and
playing strategies are each speci ed as a separate scenario, much as they would be
when described verbally, or appear, say, in paragraphs of the printed instructions
without having any program explicitly invoking all these modules in some order
1 Aspect-oriented programming (AOP) provides limited, and somewhat fragile, SIB
capabilities in standard programming languages, and indeed, some SBP implementations
use AspectJ internally. For additional discussion of SBP and AOP see [
        <xref ref-type="bibr" rid="ref7">7</xref>
        ].
      </p>
      <p>Marron et al.
(see, e.g., our group's paper in EMSOFT'13 on compositionality in SBP). Another
SIB example, focused on knowledge representation, is our preliminary-result
modeling of the Krebs cycle, described in Sec. 2.</p>
      <p>We propose to further investigate SIB. E.g., see whether any additional
semantics are required for accomplishing it, beyond the native SBP principles. One
such candidate is adding a context scope to the event-blocking idiom, limiting its
otherwise global and unilateral e ect. Another direction is to identify any special
properties SIB may have, such as its communication or module-complexity costs,
its possibly-improved succinctness under certain conditions, or its allowance of
accelerated formal veri cation using, say, assume/guarantee techniques. A most
intriguing research direction would be to measure the contribution of SIB and
aggregation to tackling state explosion.</p>
      <p>As mentioned above, wise-computing will incorporate, and appropriately
extend, a broad range of SE ideas and tools. We intend to nd ways to allow existing
tools and automated techniques to be embedded in the framework of SIB, in order
to allow DEs to harness their power smoothly and e ciently.</p>
      <p>
        Finally, as in parts of the PoC in [
        <xref ref-type="bibr" rid="ref5">5</xref>
        ] we propose to integrate the DE and
the system, using SBP and SIB, thus enabling a variety of intelligent ways to
monitor systems and proactively guide their execution. This can be done both in
development, say, in testing and simulation, and as part of the deployment and
run-time environment, for, say, diagnosis and recovery from failures.
6
      </p>
    </sec>
    <sec id="sec-6">
      <title>Conclusion</title>
      <p>Since the early days of computing, the software engineering community has been
aspiring for a development environment that can automate some of the more
sophisticated tasks carried out by human experts. We presented four research
directions: a single cross-function model for all aspects of development, exible and
extensible aggregation and re ection, a text-based interface based on stand-alone
statements, and building models, systems, and development environments from
units of self-integrating behavior. We believe that these can form important
aspects of future system and development-environment design, and help integrate
the most advanced tools and human knowledge and skills in SE and related
disciplines, thus beginning to suggest the feasibility of the wise-computing dream.</p>
    </sec>
  </body>
  <back>
    <ref-list>
      <ref id="ref1">
        <mixed-citation>
          1.
          <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</article-title>
          .
          <source>J. on Formal Methods in System Design</source>
          ,
          <year>2001</year>
          .
        </mixed-citation>
      </ref>
      <ref id="ref2">
        <mixed-citation>
          2.
          <string-name>
            <given-names>H.</given-names>
            <surname>Davis</surname>
          </string-name>
          ,
          <string-name>
            <given-names>B.</given-names>
            <surname>Shrobe</surname>
          </string-name>
          , and
          <string-name>
            <given-names>R.</given-names>
            <surname>Katz</surname>
          </string-name>
          .
          <article-title>Towards a Programmer's Apprentice (Again)</article-title>
          .
          <source>Center for Brains, Minds and Machines</source>
          ,
          <year>2015</year>
          . CBMM Memo No.
          <volume>030</volume>
          .
        </mixed-citation>
      </ref>
      <ref id="ref3">
        <mixed-citation>
          3.
          <string-name>
            <given-names>D.</given-names>
            <surname>Harel</surname>
          </string-name>
          .
          <article-title>Statecharts: A visual formalism for complex systems</article-title>
          .
          <source>Science of Computer Programming</source>
          ,
          <volume>8</volume>
          (
          <issue>3</issue>
          ):
          <volume>231</volume>
          {
          <fpage>274</fpage>
          ,
          <year>1987</year>
          .
        </mixed-citation>
      </ref>
      <ref id="ref4">
        <mixed-citation>
          4.
          <string-name>
            <given-names>D.</given-names>
            <surname>Harel</surname>
          </string-name>
          , G. Katz,
          <string-name>
            <given-names>R.</given-names>
            <surname>Marelly</surname>
          </string-name>
          ,
          <article-title>and</article-title>
          <string-name>
            <given-names>A.</given-names>
            <surname>Marron</surname>
          </string-name>
          .
          <source>Wise Computing: Towards Endowing System Development with True Wisdom</source>
          ,
          <year>2015</year>
          .
          <source>Tech Report</source>
          . http://arxiv.org/abs/1501.05924.
        </mixed-citation>
      </ref>
      <ref id="ref5">
        <mixed-citation>
          5.
          <string-name>
            <given-names>D.</given-names>
            <surname>Harel</surname>
          </string-name>
          , G. Katz,
          <string-name>
            <given-names>R.</given-names>
            <surname>Marelly</surname>
          </string-name>
          ,
          <article-title>and</article-title>
          <string-name>
            <given-names>A.</given-names>
            <surname>Marron</surname>
          </string-name>
          .
          <article-title>An Initial Wise Development Environment for Behavioral Models</article-title>
          .
          <source>In MODELSWARD</source>
          ,
          <year>2016</year>
          .
        </mixed-citation>
      </ref>
      <ref id="ref6">
        <mixed-citation>
          6.
          <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>
          . Come,
          <article-title>Let's Play: Scenario-Based Programming Using LSCs and the Play-Engine</article-title>
          . Springer,
          <year>2003</year>
          .
        </mixed-citation>
      </ref>
      <ref id="ref7">
        <mixed-citation>
          7.
          <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
          <string-name>
            <given-names>G. Weiss. Behavioral</given-names>
            <surname>Programming</surname>
          </string-name>
          .
          <source>Comm. of the ACM</source>
          ,
          <year>2012</year>
          .
        </mixed-citation>
      </ref>
      <ref id="ref8">
        <mixed-citation>
          8.
          <string-name>
            <given-names>C.</given-names>
            <surname>Lignos</surname>
          </string-name>
          ,
          <string-name>
            <given-names>V.</given-names>
            <surname>Raman</surname>
          </string-name>
          ,
          <string-name>
            <given-names>C.</given-names>
            <surname>Finucane</surname>
          </string-name>
          ,
          <string-name>
            <given-names>M.</given-names>
            <surname>Marcus</surname>
          </string-name>
          , and
          <string-name>
            <given-names>H.</given-names>
            <surname>Kress-Gazit</surname>
          </string-name>
          .
          <article-title>Provably Correct Reactive Control from Natural Language</article-title>
          . Autonomous Robots,
          <volume>38</volume>
          (
          <issue>1</issue>
          ):
          <volume>89</volume>
          {
          <fpage>105</fpage>
          ,
          <year>2015</year>
          .
        </mixed-citation>
      </ref>
      <ref id="ref9">
        <mixed-citation>
          9.
          <string-name>
            <given-names>H.</given-names>
            <surname>Reubenstein</surname>
          </string-name>
          and
          <string-name>
            <given-names>R.</given-names>
            <surname>Waters</surname>
          </string-name>
          .
          <source>The Requirements Apprentice: Automated Assistance for Requirements Acquisition. IEEE Transactions on Software Engineering</source>
          ,
          <volume>17</volume>
          (
          <issue>3</issue>
          ):
          <volume>226</volume>
          {
          <fpage>240</fpage>
          ,
          <year>1991</year>
          .
        </mixed-citation>
      </ref>
      <ref id="ref10">
        <mixed-citation>
          10. C. Rich and
          <string-name>
            <given-names>R.</given-names>
            <surname>Waters</surname>
          </string-name>
          .
          <article-title>The Programmer's Apprentice: A Res. Overview</article-title>
          . IEEE Computer,
          <year>1988</year>
          .
        </mixed-citation>
      </ref>
      <ref id="ref11">
        <mixed-citation>
          11. Supplementary Material. http://www.b-prog.
          <source>org/Models16PosterSupplemental.</source>
        </mixed-citation>
      </ref>
    </ref-list>
  </back>
</article>