<!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>Towards Logic Programming as a Service: Experiments in tuProlog</article-title>
      </title-group>
      <contrib-group>
        <contrib contrib-type="author">
          <string-name>Roberta Calegari</string-name>
        </contrib>
        <contrib contrib-type="author">
          <string-name>Enrico Denti</string-name>
        </contrib>
        <contrib contrib-type="author">
          <string-name>Stefano Mariani</string-name>
        </contrib>
        <contrib contrib-type="author">
          <string-name>Andrea Omicini Dipartimento di Informatica</string-name>
        </contrib>
        <contrib contrib-type="author">
          <string-name>Scienza e Ingegneria (DISI)</string-name>
        </contrib>
        <contrib contrib-type="author">
          <string-name>roberta.calegari</string-name>
        </contrib>
        <contrib contrib-type="author">
          <string-name>enrico.denti</string-name>
        </contrib>
        <contrib contrib-type="author">
          <string-name>s.mariani</string-name>
        </contrib>
        <contrib contrib-type="author">
          <string-name>andrea.omicini}@unibo.it</string-name>
        </contrib>
      </contrib-group>
      <fpage>79</fpage>
      <lpage>84</lpage>
      <abstract>
        <p>-In this paper we explore the perspective of Logic Programming as a Service (LPaaS), with a broad notion of “service” going beyond the mere handling of the logic engine lifecycle, knowledge base management, reasoning queries execution, etc. In particular, we present tuProlog as-a-service, a Prolog engine based on the tuProlog core made available as an encapsulated service to effectively support the spreading of intelligence in pervasive systems-mainly, Internet-of-Things (IoT) application scenarios.</p>
      </abstract>
    </article-meta>
  </front>
  <body>
    <sec id="sec-1">
      <title>I. INTRODUCTION</title>
      <p>Today applications are more and more pervasive and
intelligent, calling for situated intelligence—light-weight, effective
intelligence chunks placed where and when needed to locally
tackle the specific reasoning needs in complex distributed
systems. This is particularly true in the fast-growing field of
the Internet-of-Things (IoT), where connectivity and
interoperability are just the basic steps towards higher-level, customised,
variously-situated services.</p>
      <p>The complexity of IoT system engineering calls for
suitable, easily deployable infrastructures, meant to make the
designers’ and developers’ task easier by providing
commonlyrequired services to applications. Such infrastructures should
(i) be both statically and dynamically (easily) configurable,
so as to match the application needs; (ii) govern components
and applications interaction; (iii) encapsulate intelligence in
suitable forms for applications’ exploitation.</p>
      <p>In this scenario, where software engineering, programming
languages, and distributed artificial intelligence meet,
logicbased languages have the potential to play a prominent role
both as intelligence providers and technology integrators.</p>
      <p>For the former, typical LP features – such as programs
as logic theories, computation as deduction, and programming
with relations and inference – make logic languages a natural
choice for building intelligent components. In the context of
IoT, this also implies that logic-based technologies should be
implemented taking strongly into account specific engineering
criteria such as deployability, scalability, and interoperability.</p>
      <p>
        For the latter, logic languages already proved to be
effective as both communication and coordination languages [
        <xref ref-type="bibr" rid="ref1">1</xref>
        ],
whereas, more generally, declarative models and technologies
are known to impact on the modelling of complex,
heterogeneous systems as multi-agent systems (MAS) [
        <xref ref-type="bibr" rid="ref2">2</xref>
        ]—also
suggesting that their actual vocation should rightfully include
supporting scalable, configurable, intelligent infrastructures for
Internet-based applications.
      </p>
      <p>
        The tuProlog [
        <xref ref-type="bibr" rid="ref3">3</xref>
        ] engine, deployed as a Java JAR or
Microsoft .NET DLL, is inherently easily deployable and
exploitable by other applications as a library service—that is,
from a software engineering standpoint, a suitably
encapsulated set of related functionalities. However, this might not be
enough in complex IoT scenarios, where the mobility/cloud
ecosystem aims at delivering infrastructure, platforms, and
software as a service – according to a more Service Oriented
Architecture (SOA) interpretation of the term “service” –,
enabling people to benefit from ubiquitous information access.
Emphasis is more and more on on-demand applications, where
the enabling infrastructure – servers, storage, networks, and
client devices – moves towards cloud computing.
Serviceoriented computing also promotes the idea of assembling
application components into a network of services that can be
loosely coupled to create flexible, dynamic business processes
and agile applications spanning organisations and computing
platforms.
      </p>
      <p>In the remainder of the paper, after recalling the main
features of the tuProlog technology, we outline the general
architecture for Logic Programming as a Service (LPaaS) –
without limiting ourselves to the case where “as a service”
means “as a Web/Cloud Service” – aimed at fully managing the
Prolog engine lifecycle (either dedicated or not to a given client
application), the knowledge base management, and the query
execution. Then, we focus on the tuProlog case, taking iOS
as our experimental platform – where the actual instantiation
of the as-a-service paradigm is much closer to a
SOA-/Cloudoriented interpretation – and discuss some simple application
examples.</p>
      <p>
        II. tuPROLOG IN A NUTSHELL
tuProlog [
        <xref ref-type="bibr" rid="ref3">3</xref>
        ] is an open-source, light-weight Prolog
framework for distributed applications and infrastructures, released
under the LGPL license [
        <xref ref-type="bibr" rid="ref4">4</xref>
        ]. Unlike most Prolog programming
environments – such as [
        <xref ref-type="bibr" rid="ref5">5</xref>
        ], [
        <xref ref-type="bibr" rid="ref6">6</xref>
        ], which are typically very
efficient but also monolithic and thought to operate as
standalone systems –, tuProlog is intentionally designed to be
minimal, dynamically configurable , easily deployable,
interoperable, but above all multi-paradigm – promoting seamless
integration of the logic/declarative paradigm, on the one side,
with the object-oriented imperative paradigm, on the other
– and multi-language—enabling Prolog to inter-operate with
Java (and viceversa) easily and directly, with no need for
special pre-declarations, static stub files, etc. [
        <xref ref-type="bibr" rid="ref7">7</xref>
        ]. Over the
years, tuProlog has grown to become also multi-platform,
from Microsoft .NET to Android and Apple iOS [
        <xref ref-type="bibr" rid="ref8">8</xref>
        ]. So,
besides Java, the object-oriented side now covers potentially
any language on the .NET platform; other languages, like the
newborn Apple Swift [
        <xref ref-type="bibr" rid="ref9">9</xref>
        ], are also being included.
      </p>
      <p>Minimality means that the tuProlog core contains only the
Prolog engine essentials – roughly speaking, the reasoning
engine and the required basic mechanisms – whereas any other
feature is implemented via libraries: users can configure their
system by dynamically loading/unloading libraries at any time.</p>
      <p>Each library provides a package of related predicates,
functors, and operators; new libraries can also be easily
developed, either in Prolog or in Java/.NET language (or a
hybrid mix of the two) as a suitable Java/.NET class, extending
the tuProlog Library class and following simple naming
conventions. Library-defined predicates, functors and operators
are indistinguishable from tuProlog built-ins—actually, most
of the perceived built-ins are actually provided by some
preloaded library.</p>
      <p>Easy deployability means that, generally speaking,
installing is just a matter of making the JAR archive/.NET
assembly available in the desired location: the only exception
is when the hosting platform imposes its install procedure, as
in the case of Android/iOS app (for which going through the
Android/iOS installer is mandatory).</p>
      <p>
        In addition, tuProlog is compatible with major
interoperability standards such as TCP/IP, RMI, and CORBA, and
is exploited as the enabling technology inside the TuCSoN
coordination infrastructure [
        <xref ref-type="bibr" rid="ref10">10</xref>
        ], [
        <xref ref-type="bibr" rid="ref11">11</xref>
        ], which provides
logicbased, programmable tuple spaces – tuple centres [
        <xref ref-type="bibr" rid="ref12">12</xref>
        ] – as
coordination media for distributed processes and agents.
      </p>
    </sec>
    <sec id="sec-2">
      <title>III. LOGIC PROGRAMMING AS A SERVICE</title>
      <p>Coherently with the view outlined above, this paper looks
forward to the idea of providing Logic Programming as a
Service (LPaaS), conceptually situated inside the Software as a
Service layer of, e.g., a typical Cloud-based environment.
Nevertheless, the first step to achieve such a goal is to carefully
design the architecture of a logic programming engine according
to the general software engineering principles of modularity,
encapsulation, and reusability. The architecture would provide
the conceptual foundation for the “as a service” paradigm in
the context of heterogeneous computational environments—
e.g., as a RESTful Web Service, as a Cloud-hosted app, etc.</p>
      <p>In the LPaaS context, according to the broad acceptation of
term “service” described in Section I, the basic functionality to
be provided is the ability to reason over logic theories, which
translates into the ability to submit queries and retrieve results;
related functionalities include the creation and configuration of
the reasoner (the logic engine) with the proper knowledge base.</p>
      <p>The interface is then supposed to define the API to provide
such functionalities, namely:
•
•
create engine: to instantiate a dedicated engine;
reset engine: to reset the engine to the initial state and
possibly the empty knowledge base;
set theory: to load the knowledge base into the engine;
query: to submit queries and retrieve (possibly
multiple) results.</p>
      <p>Further degrees of freedom include whether multiple engines
could be allowed, whether a given engine should/should not
be reserved to a given client application, etc.</p>
      <p>If the Prolog language is adopted, such functionalities have
to be tailored to the Prolog-specific behaviour, assumptions,
and syntax, and APIs have to be mapped onto suitable Prolog
predicates. In the next section we specialise our approach to
the specific case of the tuProlog system, which provides not
only a light-weight Prolog engine particularly featured for this
kind of applications, but also a multi-paradigm and
multilanguage working environment, thus paving the way towards
further forms of interaction and expressiveness.</p>
      <p>Among the different platforms supported by tuProlog, in
this paper we take the iOS platform as our reference (a)
because of its adoption in pervasive contexts, (b) for the
availability of several sorts of smart devices (phones, watches,
etc.) that constitute a challenging testbed, and (c) for its
architectural similarity with more specific SOA/Cloud-oriented
notions of “as a service”.</p>
    </sec>
    <sec id="sec-3">
      <title>IV. tuPROLOG AS A SERVICE ON IOS</title>
      <p>As a challenging application context for LPaaS, here we
focus on the development of the tuProlog service for iOS,
for both Objective-C and Swift applications. The service is
embedded in a tuProlog app, acting as the service provider
for all other applications running on the mobile device. Its API
obviously adheres to the above-presented API, tailored to the
Prolog syntax plus some convenience mechanisms—namely:
where:
•
•
•
•
•
create engine: for convenience, this functionality is
just embedded in the first call to the service;
reset engine: mapped onto the reset primitive;
set theory: mapped onto the theory primitive;
query: mapped onto a set of primitives, namely
query to issue the query, result and solution
to retrieve the query result, and nextSol to explore
further solutions.</p>
      <p>A nice peculiarity of the iOS platform, which is one of
the main reasons to choose it in our experiments, is the
built-in URL scheme functionality, which provides a simple
and effective way for applications’ inter-communication via
a user-defined, URL-based protocol. In short, all is needed
to communicate with an app is to create an
appropriatelyformatted URL and ask the system to open it; on the opposite
side, the custom scheme needs to be declared and properly
implemented—see Fig. 1.</p>
      <p>In the tuProlog case, two custom URL schemes need to
be defined—one for incoming requests, to be processed by the
tuProlog Mobile App and encoding the above API; and another
for the query results, to be processed by the client app.</p>
      <p>The tuProlog app implements the following URL scheme:
tuPrologMobile://?src=srcURL&amp;
command=argument&amp;
dst=dstURL
srcURL is the client URL scheme: as a result, a
new Prolog engine is created in tuProlog Mobile and
associated with that client;
command is one of theory, query, nextSol, reset,
with argument respectively being theory (the Prolog
theory to be set in the engine, or the link where to
donwload it1), query (the text of the query), nextSol,
reset;
dstURL is the URL scheme of the client to which the
result must be sent, possibly different from srcURL; if
null, the result is shown in tuProlog app console.
On the other hand, the query result returned by the tuProlog
service is encoded by the following URL scheme:
dstURL://command=commandresult
dstURL is the URL scheme of the client receiving the
result;
command is one of the below four (result, solution,
nextSol, reset), with the respective commandresult.
The specific syntax of commandresult varies with command,
namely:
dstURL://?result=result&amp;
engine=engineVersion&amp;
engineAge=engineAge
dstURL://?solution=solution&amp;
engine=engineVersion&amp;
engineAge=engineAge
dstURL://?nextSol=nextSolution&amp;</p>
      <p>engine=engineVersion
dstURL://?reset=OK
result is either Yes or No for success or failure,
respectively;
engineVersion is the version of the tuProlog system;
engineAge can be new or still for a dedicated or
cached engine, respectively;
solution is the solution of the query;
nextSolution is the next solution of the query;
error contains potential errors.</p>
      <p>Such a URL scheme is a first step towards a more
SOA/Cloudoriented interpretation of the LPaaS paradigm, with respect
to the more general notion envisioned for tuProlog—where,
essentially, “as a service” is interpreted according to the
general software engineering principles of modularity,
encapsulation, and reusability. In fact, making LPaaS available on
a Web Server, a Cloud infrastructure, or other communication
protocols adopted in IoT scenarios is just a matter of designing
and deploying a suitable wrapper API, translating e.g. RESTful
requests to the appropriate library method calls.</p>
    </sec>
    <sec id="sec-4">
      <title>1To be supported in the next release.</title>
      <p>Fig. 3. The multi-language toy example: Swift app using Java entities
V.</p>
    </sec>
    <sec id="sec-5">
      <title>APPLICATION SCENARIOS</title>
      <p>Fig. 2 shows one first, typical application scenario: the
client is a Swift/Objective-C application that provides a GUI
for the computation of the symbolic derivative, while the
symbolic computation is delegated to the tuProlog service.
The Apple Watch extension (WatchKit) is also supported, so
as to replicate the client GUI on the the iWatchr(which, in
principle, could also play a more active role).</p>
      <p>From the user’s side, the first step is to create a dedicated
Prolog engine, loaded with the proper logic theory:
tuPrologMobile://?src=tuPrologMobileClient&amp;
theory=dExpr(T,DT) :- dTerm(T,DT).
dExpr(E+T,[DE+DT]) :- dExpr(E,DE), dTerm(T,DT).
dExpr(E-T,[DE-DT]) :- dExpr(E,DE), dTerm(T,DT).
dTerm(F,DF) :- dFactor(F,DF).
dTerm(T*F,[[DT*F]+[T*DF]]) :- dTerm(T,DT), dFactor(F,DF).
dTerm(T/F,[[F*DT]-[T*DF]]/[F*F]) :- dTerm(T,DT),
dFactor(F,DF). dFactor(x,1).
dFactor(N,0) :- number(N).
dFactor([E],DE) :- dExpr(E,DE).
dFactor(-E,-DE) :- dExpr(E,DE).
dFactor(sin(E), [cos(E)*DE] ) :- dExpr(E,DE).</p>
      <p>dFactor(cos(E), [-sin(E)*DE] ) :- dExpr(E,DE).</p>
      <p>The engine can now be queried via the top-level predicate
dExpr(+function, ?derivative). For instance, the request to
derive the cos x · sin x function translates into the URL:
tuPrologMobile://?src=myTuPrologMobileClient&amp;</p>
      <p>query=dExpr(cos(x)*sin(x), D).&amp;dst=myTuPrologMobileClient
whose answer, − sin2 x + cos2 x, is returned (in a
nonsimplified form) as the URL:
tuPrologMobileClient://?solution=yes.</p>
      <p>D / [’+’([’*’([’*’(’-’(sin(x)),1)],sin(x))],
[’*’(cos(x),[’*’(cos(x),1)])])]
dExpr(’*’(cos(x),sin(x)),
[’+’([’*’([’*’(’-’(sin(x)),1)],sin(x))],
[’*’(cos(x),[’*’(cos(x),1)])])])
&amp;errors=&amp;engine=2p Mobile - 3.0 beta
&amp;engineAge=still
This URL encodes both the variable binding and the whole
solution: in particular, the Prolog variable D, which contains
the computed derivative, results</p>
      <p>D / [’+’([’*’([’*’(’-’(sin(x)),1)], sin(x))],
[’*’(cos(x), [’*’(cos(x),1)])]) ]</p>
      <p>Technically, the client app, written in Objective-C, triggers
the iOS service based on the provided URL, while on the
other side the server app, written in Java, parses the command,
creates the Prolog engine, performs the required activity and
returns the result.</p>
      <p>More complex scenarios in a multi-language and
multiplatform perspective could exploit tuProlog multi-paradigm
programming support (OOLibrary) in a broader sense, with
Swift or Objective-C apps interacting with Java entities. Fig. 3,
for instance, shows a toy Swift app which creates Java objects,
calls some methods, and elaborates the (Java) result back in
Swift.</p>
      <p>More precisely, as detailed in the following code, a Java
string with the “ member(X, [a,d]).” text is first bound to
the Prolog variable Q, then a Java Prolog engine is bound to
the Prolog variable P and used to solve the query Q, binding the
result to the Prolog variable S; this result is finally converted
back to a Java string via toString, binding the final result
(yes in this case) to the Prolog variable SOL.
tuprologmobile://?src=null&amp;query=
new_object(’java.lang.String’, [’member(X, [a,d]).’], Q),
new_object(’alice.tuprolog.Prolog’, [], P),
P &lt;- solve(Q) returns S,</p>
      <p>S toString returns SOL&amp;dst=null
As shown in Fig. 3, the result is exploited by the client Swift
application for its own purposes–here, trivially, just to print it
in its console.</p>
      <p>In a wider perspective, this approach fits particularly well
those pervasive application scenarios where intelligence needs
to be spread onto a broad set of heterogeneous devices, yet
the choice of where logic computation should actually take
place depends on many conditions—such as the available
computational power, the available bandwidth, the instability
of the connection, the need for situatedness.</p>
      <p>
        In the IoT context, for instance, the Home Manager project
[
        <xref ref-type="bibr" rid="ref13">13</xref>
        ] aims at supporting the construction of Socio-Technical
Smart Spaces (STSS), namely in the case of a smart home
and the surrounding environment where users live, according to
the Butlers architectural vision [
        <xref ref-type="bibr" rid="ref14">14</xref>
        ]. There, a variety of smart
devices, appliances, sensors, etc. need to be properly integrated
and coordinated so as to provide advanced services to the home
users, immersed in the smart space. To this end, the house
is seen as a multi-agent system (MAS), coordinated via the
TuCSoN middleware [
        <xref ref-type="bibr" rid="ref11">11</xref>
        ], [
        <xref ref-type="bibr" rid="ref10">10</xref>
        ]: smart appliances participate
to the agent society by means of an agent, which embeds the
device intelligence, while the social intelligence (with related
policies, global goals, etc.) is implemented on top of TuCSoN
tuple centres [
        <xref ref-type="bibr" rid="ref12">12</xref>
        ].
      </p>
      <p>While Home Manager devices are supposed to be equipped
with enough computational power to support their participation
to the MAS and to perform the required reasoning, yet, in a
more realistic scenario, some supposedly-smart devices could
be not powerful enough to actually hold the computation
locally—or, it could be impractical to do so because of the
complexity of the required configuration. On the other hand,
when enough computational power is available on the devices,
the need for situatedness (along with the software engineering
principles of locality and encapsulation) could instead suggest
to compute directly on the Home Manager devices by querying
situated Prolog engines reasoning on locally-available data.</p>
      <p>In the overall, Home Manager – and, more generally, the
smart home scenario – clearly shows how LPaaS could be an
effective way to tackle multiple different aspects – from
deployment to maintenance, cost issues, hardware requirements,
etc. – while efficiently spreading intelligence where and when
needed in pervasive contexts.</p>
      <p>VI.</p>
    </sec>
    <sec id="sec-6">
      <title>RELATED WORK</title>
      <p>
        Many Prolog systems offer some form of support for
the HTTP protocol and for the exploitation of Prolog as a
service. The (Semantic) Web is one of the most promising
application areas for SWI-Prolog [
        <xref ref-type="bibr" rid="ref15">15</xref>
        ]. Prolog handles the
semantic web Resource Description Framework (RDF) model
naturally, where RDF provides a stable model for knowledge
representation with shared semantics. The PiLLoW library
(Programming in Logic Languages on the Web) [
        <xref ref-type="bibr" rid="ref16">16</xref>
        ],
developed in Ciao Prolog and available for Ciao [17], SWI-Prolog,
SICStus [
        <xref ref-type="bibr" rid="ref5">5</xref>
        ] Prolog, and YAP, is one of the most widely known
examples: a comparison between PiLLoW and SWI-Prolog for
HTML documents handling can be found in [
        <xref ref-type="bibr" rid="ref17">18</xref>
        ].
      </p>
      <p>
        Logic programming has also been used for the composition
of Semantic Web Services: in [
        <xref ref-type="bibr" rid="ref18">19</xref>
        ], for instance, the GOLOG
language [
        <xref ref-type="bibr" rid="ref19">20</xref>
        ] is extended for this purpose through the
provision of high-level generic procedures and customising
constraints. Finally, ProWeb [
        <xref ref-type="bibr" rid="ref20">21</xref>
        ] is an ALP-Prolog library aimed
at embedded HTTP servers for controlling appliances: there,
the notion of Request Processing Modules (RPM) supports
different protocols, including HTTP, to support remote access.
      </p>
      <p>
        While PiLLoW is an add-on library, aimed at directly
handling HTTP, CGI and other internet protocols, tuProlog
does not provide such services directly: rather, its modular
and Java-based architecture makes it easy both to embed it
in other applications, and, more generally, exploit it as a
service through its API. Other features, if necessary, could be
developed in the form of suitable tuProlog libraries and loaded
by need—for instance, as in the case of the RDF library [
        <xref ref-type="bibr" rid="ref21">22</xref>
        ].
      </p>
      <p>VII.</p>
    </sec>
    <sec id="sec-7">
      <title>CONCLUSION</title>
      <p>Pervasive and situated systems of any sort are
increasingly demanding intelligence to be scattered throughout the
computational devices populating the physical environment—
as clearly demonstrated by IoT scenarios like smart homes,
personal healthcare assistants, energy grids, etc. To meet such
a requirement, light-weight logic programming engines are a
crucial need, aimed at providing the reasoning services
ondemand to the most heterogeneous client applications. In its
turn, this requires the logic engine to be modular,
multiplatform, and multi-language—as tuProlog is.</p>
      <p>Then, making available such a logic programming
service according to the different application needs, onto
heterogeneous infrastructures, and across different interaction
paradigms is a matter of designing suitable wrapper interfaces
around the tuProlog service API—as we have done with the
iOS platform. Accordingly, future work is devoted to further
extend the reach of the LPaaS paradigm considering both
traditional SOA infrastructures – e.g., tuProlog as a RESTful
web service – and pervasive deployment scenarios from the
IoT landscape—e.g., making tuProlog available over Bluetooth
Low Energy connections.</p>
      <p>Also, building a specialised tuProlog-oriented middleware,
dealing with heterogeneous platforms, as well as with
distribution, life-cycle, interoperation, and coordination of multiple,
situated Prolog engines – possibly based onto the existing
TuCSoN middleware – is a goal for our future research, aimed
at exploring the full potential of logic-based technologies in
the context of IoT scenarios and applications.</p>
    </sec>
    <sec id="sec-8">
      <title>ACKNOWLEDGEMENTS</title>
      <p>Authors would like to thank Dipl. Eng. Alberto Sita for his
contribution to this project and his work to the new prototype
of the iOS tuProlog app. Also, we would like to thank Asia
Mariani for her help in fixing the last version of the paper.</p>
    </sec>
  </body>
  <back>
    <ref-list>
      <ref id="ref1">
        <mixed-citation>
          [1]
          <string-name>
            <given-names>E.</given-names>
            <surname>Denti</surname>
          </string-name>
          and
          <string-name>
            <given-names>A.</given-names>
            <surname>Omicini</surname>
          </string-name>
          , “
          <article-title>Engineering multi-agent systems in LuCe,”</article-title>
          <source>in ICLP'99 International Workshop on Multi-Agent Systems in Logic Programming (MAS'99)</source>
          ,
          <string-name>
            <given-names>S.</given-names>
            <surname>Rochefort</surname>
          </string-name>
          ,
          <string-name>
            <given-names>F.</given-names>
            <surname>Sadri</surname>
          </string-name>
          , and
          <string-name>
            <given-names>F.</given-names>
            <surname>Toni</surname>
          </string-name>
          , Eds.,
          <string-name>
            <surname>Las</surname>
            <given-names>Cruces</given-names>
          </string-name>
          ,
          <string-name>
            <surname>NM</surname>
          </string-name>
          , USA,
          <fpage>30</fpage>
          <lpage>Nov</lpage>
          .
          <year>1999</year>
          .
        </mixed-citation>
      </ref>
      <ref id="ref2">
        <mixed-citation>
          [2]
          <string-name>
            <given-names>A.</given-names>
            <surname>Omicini</surname>
          </string-name>
          and
          <string-name>
            <given-names>F.</given-names>
            <surname>Zambonelli</surname>
          </string-name>
          , “
          <article-title>MAS as complex systems: A view on the role of declarative approaches,” in Declarative Agent Languages and Technologies, ser</article-title>
          . Lecture Notes in Computer Science,
          <string-name>
            <given-names>J. A.</given-names>
            <surname>Leite</surname>
          </string-name>
          ,
          <string-name>
            <given-names>A.</given-names>
            <surname>Omicini</surname>
          </string-name>
          ,
          <string-name>
            <given-names>L.</given-names>
            <surname>Sterling</surname>
          </string-name>
          , and P. Torroni, Eds. Springer, May
          <year>2004</year>
          , vol.
          <volume>2990</volume>
          , pp.
          <fpage>1</fpage>
          -
          <lpage>17</lpage>
          , 1st International Workshop (DALT
          <year>2003</year>
          ), Melbourne, Australia,
          <volume>15</volume>
          Jul.
          <year>2003</year>
          .
          <article-title>Revised Selected and Invited Papers</article-title>
          . [Online]. Available: http://link.springer.
          <source>com/10.1007/978-3-540-25932-9 1</source>
        </mixed-citation>
      </ref>
      <ref id="ref3">
        <mixed-citation>
          [3]
          <string-name>
            <given-names>E.</given-names>
            <surname>Denti</surname>
          </string-name>
          ,
          <string-name>
            <given-names>A.</given-names>
            <surname>Omicini</surname>
          </string-name>
          ,
          <article-title>and</article-title>
          <string-name>
            <given-names>A.</given-names>
            <surname>Ricci</surname>
          </string-name>
          , “
          <article-title>tuProlog: A light-weight Prolog for Internet applications and infrastructures,” in Practical Aspects of Declarative Languages, ser</article-title>
          . Lecture Notes in Computer Science, I. Ramakrishnan, Ed. Springer,
          <year>2001</year>
          , vol.
          <year>1990</year>
          , pp.
          <fpage>184</fpage>
          -
          <lpage>198</lpage>
          , 3rd International Symposium (PADL
          <year>2001</year>
          ), Las Vegas,
          <string-name>
            <surname>NV</surname>
          </string-name>
          , USA,
          <fpage>11</fpage>
          -
          <lpage>12</lpage>
          Mar.
          <year>2001</year>
          . Proceedings. [Online]. Available: http://link.springer.
          <source>com/10.1007/3-540-45241-9 13</source>
        </mixed-citation>
      </ref>
      <ref id="ref4">
        <mixed-citation>
          [4] tuProlog, “Home page,” http://tuprolog.unibo.it,
          <string-name>
            <surname>A LMA MATER STUDIORUM-Universita</surname>
            <given-names>`</given-names>
          </string-name>
          di Bologna.
        </mixed-citation>
      </ref>
      <ref id="ref5">
        <mixed-citation>
          [5]
          <string-name>
            <given-names>SICStus</given-names>
            <surname>Prolog</surname>
          </string-name>
          , “Home page,” http://sicstus.sics.se, SICS Swedish ICT.
        </mixed-citation>
      </ref>
      <ref id="ref6">
        <mixed-citation>
          [6]
          <string-name>
            <given-names>GNU</given-names>
            <surname>Prolog</surname>
          </string-name>
          , “Home page,” http://www.gprolog.org.
        </mixed-citation>
      </ref>
      <ref id="ref7">
        <mixed-citation>
          [7]
          <string-name>
            <given-names>E.</given-names>
            <surname>Denti</surname>
          </string-name>
          ,
          <string-name>
            <given-names>A.</given-names>
            <surname>Omicini</surname>
          </string-name>
          ,
          <article-title>and</article-title>
          <string-name>
            <given-names>A.</given-names>
            <surname>Ricci</surname>
          </string-name>
          ,
          <article-title>“Multi-paradigm JavaProlog integration in tuProlog,”</article-title>
          <source>Science of Computer Programming</source>
          , vol.
          <volume>57</volume>
          , no.
          <issue>2</issue>
          , pp.
          <fpage>217</fpage>
          -
          <lpage>250</lpage>
          , Aug.
          <year>2005</year>
          . [Online]. Available: http://www.sciencedirect.com/science/article/pii/S0167642305000158
        </mixed-citation>
      </ref>
      <ref id="ref8">
        <mixed-citation>
          [8]
          <string-name>
            <given-names>E.</given-names>
            <surname>Denti</surname>
          </string-name>
          ,
          <string-name>
            <given-names>A.</given-names>
            <surname>Omicini</surname>
          </string-name>
          , and
          <string-name>
            <given-names>R.</given-names>
            <surname>Calegari</surname>
          </string-name>
          , “ tuProlog: Making Prolog ubiquitous,” ALP Newsletter, Oct.
          <year>2013</year>
          . [Online]. Available: http: //www.cs.nmsu.edu/ALP/
          <year>2013</year>
          /10/tuprolog-making
          <string-name>
            <surname>-</surname>
          </string-name>
          prolog-ubiquitous/
        </mixed-citation>
      </ref>
      <ref id="ref9">
        <mixed-citation>
          [9]
          <string-name>
            <given-names>Apple</given-names>
            <surname>Inc</surname>
          </string-name>
          .,
          <source>The Swift Programming Language (Swift 2.2 Edition)</source>
          ,
          <source>Jun</source>
          .
          <year>2014</year>
          .
        </mixed-citation>
      </ref>
      <ref id="ref10">
        <mixed-citation>
          [10]
          <string-name>
            <given-names>A.</given-names>
            <surname>Omicini</surname>
          </string-name>
          and
          <string-name>
            <given-names>F.</given-names>
            <surname>Zambonelli</surname>
          </string-name>
          , “
          <article-title>Coordination for Internet application development</article-title>
          ,” Autonomous Agents and
          <string-name>
            <surname>Multi-Agent</surname>
            <given-names>Systems</given-names>
          </string-name>
          , vol.
          <volume>2</volume>
          , no.
          <issue>3</issue>
          , pp.
          <fpage>251</fpage>
          -
          <lpage>269</lpage>
          , Sep.
          <year>1999</year>
          , Special Issue:
          <article-title>Coordination Mechanisms for Web Agents</article-title>
          . [Online]. Available: http://link.springer.com/10.1023/ A:1010060322135
        </mixed-citation>
      </ref>
      <ref id="ref11">
        <mixed-citation>
          [11] TuCSoN, “Home page,” http://tucson.unibo.it,
          <string-name>
            <surname>A LMA MATER STUDIORUM-Universita</surname>
            <given-names>`</given-names>
          </string-name>
          di Bologna.
        </mixed-citation>
      </ref>
      <ref id="ref12">
        <mixed-citation>
          [12]
          <string-name>
            <given-names>A.</given-names>
            <surname>Omicini</surname>
          </string-name>
          and E. Denti, “
          <article-title>From tuple spaces to tuple centres,” Science of Computer Programming</article-title>
          , vol.
          <volume>41</volume>
          , no.
          <issue>3</issue>
          , pp.
          <fpage>277</fpage>
          -
          <lpage>294</lpage>
          , Nov.
          <year>2001</year>
          . [Online]. Available: http://www.sciencedirect.com/science/ article/pii/S0167642301000119
        </mixed-citation>
      </ref>
      <ref id="ref13">
        <mixed-citation>
          [13]
          <string-name>
            <surname>Home</surname>
            <given-names>Manager</given-names>
          </string-name>
          , “Home Page,” https://apice.unibo.it/xwiki/bin/view/ Products/HomeManager, ALMA MATER STUDIORUM-Universita` di Bologna.
        </mixed-citation>
      </ref>
      <ref id="ref14">
        <mixed-citation>
          [14]
          <string-name>
            <given-names>E.</given-names>
            <surname>Denti</surname>
          </string-name>
          , “
          <article-title>Novel pervasive scenarios for home management: the butlers architecture</article-title>
          ,
          <source>” SpringerPlus</source>
          , vol.
          <volume>3</volume>
          , no.
          <issue>52</issue>
          , pp.
          <fpage>1</fpage>
          -
          <lpage>30</lpage>
          ,
          <year>January 2014</year>
          . [Online]. Available: http://www.springerplus.com/content/3/1/52/ abstract
        </mixed-citation>
      </ref>
      <ref id="ref15">
        <mixed-citation>
          [15]
          <string-name>
            <surname>SWI-Prolog</surname>
            <given-names>,</given-names>
          </string-name>
          “Home page,” http://www.swi-prolog.org.
        </mixed-citation>
      </ref>
      <ref id="ref16">
        <mixed-citation>
          [16]
          <string-name>
            <given-names>D.</given-names>
            <surname>Cabeza</surname>
          </string-name>
          and
          <string-name>
            <given-names>M. V.</given-names>
            <surname>Hermenegildo</surname>
          </string-name>
          , “
          <article-title>Distributed WWW programming using (Ciao-) Prolog and the PilloW library</article-title>
          ,
          <source>” Theory and Practice of Logic Programming</source>
          , vol.
          <volume>1</volume>
          , no.
          <issue>3</issue>
          , pp.
          <fpage>251</fpage>
          -
          <lpage>282</lpage>
          , May
          <year>2001</year>
          . [Online]. Available: http://journals.cambridge.org/action/displayAbstract?aid=
          <volume>77729</volume>
          [17]
          <string-name>
            <surname>Ciao</surname>
          </string-name>
          , “Home page,” http://ciao-lang.
          <source>org.</source>
        </mixed-citation>
      </ref>
      <ref id="ref17">
        <mixed-citation>
          [18]
          <string-name>
            <given-names>J.</given-names>
            <surname>Wielemaker</surname>
          </string-name>
          ,
          <string-name>
            <given-names>Z.</given-names>
            <surname>Huang</surname>
          </string-name>
          , and
          <string-name>
            <surname>L. Van Der Meij</surname>
          </string-name>
          , “
          <article-title>SWI-Prolog and the Web,” Theory and Practice of Logic Programming</article-title>
          , vol.
          <volume>8</volume>
          , no.
          <issue>3</issue>
          , pp.
          <fpage>363</fpage>
          -
          <lpage>392</lpage>
          , May
          <year>2008</year>
          . [Online]. Available: http://journals.cambridge.org/article S1471068407003237
        </mixed-citation>
      </ref>
      <ref id="ref18">
        <mixed-citation>
          [19]
          <string-name>
            <given-names>S.</given-names>
            <surname>Mcilraith</surname>
          </string-name>
          and
          <string-name>
            <given-names>T. C.</given-names>
            <surname>Son</surname>
          </string-name>
          , “
          <source>Adapting GOLOG for composition of Semantic Web Services,” in 8th International Conference on Principles and Knowledge Representation and Reasoning (KR-02)</source>
          ,
          <string-name>
            <given-names>D.</given-names>
            <surname>Fensel</surname>
          </string-name>
          ,
          <string-name>
            <given-names>F.</given-names>
            <surname>Giunchiglia</surname>
          </string-name>
          ,
          <string-name>
            <given-names>D. L.</given-names>
            <surname>McGuinness</surname>
          </string-name>
          ,
          <string-name>
            <given-names>and M.-A.</given-names>
            <surname>Williams</surname>
          </string-name>
          , Eds. Morgan Kaufmann,
          <fpage>22</fpage>
          -
          <lpage>25</lpage>
          Apr.
          <year>2002</year>
          , pp.
          <fpage>482</fpage>
          -
          <lpage>493</lpage>
          .
        </mixed-citation>
      </ref>
      <ref id="ref19">
        <mixed-citation>
          [20]
          <string-name>
            <given-names>H. J.</given-names>
            <surname>Levesque</surname>
          </string-name>
          ,
          <string-name>
            <given-names>R.</given-names>
            <surname>Reiter</surname>
          </string-name>
          , Y. Lespe´rance,
          <string-name>
            <given-names>F.</given-names>
            <surname>Lin</surname>
          </string-name>
          , and
          <string-name>
            <given-names>R. B.</given-names>
            <surname>Scherl</surname>
          </string-name>
          , “
          <article-title>GOLOG: A logic programming language for dynamic domains</article-title>
          ,”
          <source>The Journal of Logic Programming</source>
          , vol.
          <volume>31</volume>
          , no.
          <issue>1-3</issue>
          , pp.
          <fpage>59</fpage>
          -
          <lpage>83</lpage>
          ,
          <year>1997</year>
          , special Issue “
          <article-title>Reasoning about Action and Change”</article-title>
          . [Online]. Available: http://www.sciencedirect.com/science/article/pii/ S0743106696001215
        </mixed-citation>
      </ref>
      <ref id="ref20">
        <mixed-citation>
          [21]
          <string-name>
            <given-names>M.</given-names>
            <surname>Bathelt</surname>
          </string-name>
          ,
          <string-name>
            <given-names>U.</given-names>
            <surname>Gall</surname>
          </string-name>
          ,
          <string-name>
            <given-names>B.</given-names>
            <surname>Hindel</surname>
          </string-name>
          , and
          <string-name>
            <given-names>C.</given-names>
            <surname>Kurzke</surname>
          </string-name>
          , “
          <article-title>Accessing embedded systems via WWW: The ProWeb toolset</article-title>
          ,”
          <source>Computer Networks and ISDN Systems</source>
          , vol.
          <volume>29</volume>
          , no.
          <issue>8-13</issue>
          , pp.
          <fpage>1065</fpage>
          -
          <lpage>1073</lpage>
          , Sep.
          <year>1997</year>
          , papers from the 6th International World Wide Web Conference. [Online]. Available: http://www.sciencedirect.com/science/article/pii/S016975529700024X
        </mixed-citation>
      </ref>
      <ref id="ref21">
        <mixed-citation>[22] tuProlog, “RDF library,” http://apice.unibo.it/xwiki/bin/view/Tuprolog/ Libraries, ALMA MATER STUDIORUM-Universita` di Bologna.</mixed-citation>
      </ref>
    </ref-list>
  </back>
</article>