embedding asp in mobile systems discussion and
play

Embedding ASP in mobile systems: discussion and preliminary - PowerPoint PPT Presentation

Introduction The embASP Framework An embASP Specialization DLVfit Related Work Conclusions References Embedding ASP in mobile systems: discussion and preliminary implementation Francesco Calimeri Davide Fusc` a Stefano Germano Simona Perri


  1. Introduction The embASP Framework An embASP Specialization DLVfit Related Work Conclusions References Embedding ASP in mobile systems: discussion and preliminary implementation Francesco Calimeri Davide Fusc` a Stefano Germano Simona Perri Jessica Zangari Department of Mathematics and Computer Science, University of Calabria, Italy Workshop on Answer Set Programming and Other Computing Paradigms, 2015 Calimeri, Fusc` a, Germano, Perri, Zangari DeMaCS Embedding ASP in mobile systems

  2. Introduction The embASP Framework An embASP Specialization DLVfit Related Work Conclusions References Table of Contents Introduction 1 The embASP Framework 2 An embASP Specialization 3 DLVfit 4 Related Work 5 Conclusions 6 References 7 Calimeri, Fusc` a, Germano, Perri, Zangari DeMaCS Embedding ASP in mobile systems

  3. Introduction The embASP Framework An embASP Specialization DLVfit Related Work Conclusions References Motivation Ease the use of ASP [GL91, Bar03] in industrial-level and enterprise applications [CR13, LR15] Popularity of “smart”/wearable devices is constantly increasing ICT industry is moving towards the mobile scenario Lack of works about ASP systems natively running on mobile devices Calimeri, Fusc` a, Germano, Perri, Zangari DeMaCS Embedding ASP in mobile systems

  4. Introduction The embASP Framework An embASP Specialization DLVfit Related Work Conclusions References Contribution embASP : a general framework for the integration of ASP in a mobile setting DLVfit : as a proof of concept, a first ASP-based Android application (actually, a health-app) Freely available at https://www.mat.unical.it/calimeri/projects/embasp/ Calimeri, Fusc` a, Germano, Perri, Zangari DeMaCS Embedding ASP in mobile systems

  5. Introduction The embASP Framework An embASP Specialization DLVfit Related Work Conclusions References The embASP Framework Abstract Architecture ASPHANDLER SOLVER HANDLER Android Service Java Native Interface (JNI) ASP SOLVER DLV Calimeri, Fusc` a, Germano, Perri, Zangari DeMaCS Embedding ASP in mobile systems

  6. Introduction The embASP Framework An embASP Specialization DLVfit Related Work Conclusions References The embASP Framework Framework implementation Client ASP HANDLER ASPHandler Mapper AnswerSetCallback AnswerSet AnswerSets ... ASPHandler_Solver1 ASPHandler_SolverN ... AnswerSets_Solver1 AnswerSets_SolverN SOLVER HANDLER ASPService ... ASPService_Solver1 ASPService_SolverN ASP SOLVER Solver1 SolverN Calimeri, Fusc` a, Germano, Perri, Zangari DeMaCS Embedding ASP in mobile systems

  7. Introduction The embASP Framework An embASP Specialization DLVfit Related Work Conclusions References The embASP Framework ASPHandler Provides the methods to Client manipulate input and ASP HANDLER output of the solvers ASPHandler Mapper AnswerSetCallback (simple strings, files, AnswerSet AnswerSets ... ASPHandler_Solver1 ASPHandler_SolverN Java Objects) ... AnswerSets_Solver1 AnswerSets_SolverN Manages settings of all options for the actual ASP solvers Features proper methods for making the reasoning start Calimeri, Fusc` a, Germano, Perri, Zangari DeMaCS Embedding ASP in mobile systems

  8. Introduction The embASP Framework An embASP Specialization DLVfit Related Work Conclusions References The embASP Framework ASPHandler and Solver Handler interaction The Solver Handler Client layer manages ASP HANDLER invocations to the actual ASPHandler Mapper AnswerSetCallback ASP solver(s) and AnswerSet AnswerSets ... ASPHandler_Solver1 ASPHandler_SolverN gathers the results ... AnswerSets_Solver1 AnswerSets_SolverN Asynchronous invocation SOLVER HANDLER (by implementing the ASPService AnswerSetCallback ) ... ASPService_Solver1 ASPService_SolverN Answer Sets are captured and parsed by the AnswerSets class Calimeri, Fusc` a, Germano, Perri, Zangari DeMaCS Embedding ASP in mobile systems

  9. Introduction The embASP Framework An embASP Specialization DLVfit Related Work Conclusions References The embASP Framework ASPHandler , Solver Handler and ASPSolver interaction Client ASP HANDLER ASPHandler Mapper AnswerSetCallback NOT bounded to a single AnswerSet AnswerSets ... ASPHandler_Solver1 ASPHandler_SolverN solver ... AnswerSets_Solver1 AnswerSets_SolverN Different solvers can be SOLVER HANDLER managed directly within ASPService the framework ... ASPService_Solver1 ASPService_SolverN ASP SOLVER Solver1 SolverN Calimeri, Fusc` a, Germano, Perri, Zangari DeMaCS Embedding ASP in mobile systems

  10. Introduction The embASP Framework An embASP Specialization DLVfit Related Work Conclusions References The embASP Framework ASPHandler , Solver Handler and ASPSolver interaction Client ASP HANDLER To add an other solver: ASPHandler Mapper AnswerSetCallback Extend ASPHandler AnswerSet AnswerSets ... Start a proper ASPHandler_Solver1 ASPHandler_SolverN ASPService ... AnswerSets_Solver1 AnswerSets_SolverN Specialize SOLVER HANDLER AnswerSets to deal ASPService with the specific output of the solver ... ASPService_Solver1 ASPService_SolverN ASP SOLVER Solver1 SolverN Calimeri, Fusc` a, Germano, Perri, Zangari DeMaCS Embedding ASP in mobile systems

  11. Introduction The embASP Framework An embASP Specialization DLVfit Related Work Conclusions References The embASP Framework The Mapper Intended to automatically convert the input for the solver from plain Java Objects into Strings the output of the solvers from Strings into Java Objects The process is guided by proper annotations: @Predicate(string name) @Term(integer position) @Predicate("edge") public class Edge { Edge e1 = new Edge("n1","n2"); @Term (0) Edge e2 = new Edge("n1","n3"); private String node1; @Term (1) private String node2; edge("n1","n3"). ... edge("n2","n3"). } Calimeri, Fusc` a, Germano, Perri, Zangari DeMaCS Embedding ASP in mobile systems

  12. Introduction The embASP Framework An embASP Specialization DLVfit Related Work Conclusions References An embASP Specialization for Android and DLV Client ASPHandler ASPMapper AnswerSetCallback Lstart,asCallbackP:PAnswerSetCallbackv LregisterClass,classP:PClassv Lcallback,answerSetsP:PSet<AnswerSet>v LaddOption,optionsP:PStringv LgetClass,predicateP:PStringvP:PClass LaddRawInput,programP:PStringv LgetString,objP:PObjectvP:PString LaddFileInput,filePathP:PStringv LgetObject,stringP:PStringvP:PObject LaddInput,objP:PObjectv LaddInput,objectsP:PSet<Object>vPSet<Object> AnswerSets LaddFilter,objP:PClassv -answerSetListP:PList<AnswerSet> LaddFilter,predicateP:PStringv Lparse,v AnswerSet DLVHandler -outputStringP:Pstring DLVAnswerSets Lstart,asCallbackP:PAnswerSetCallbackv -weightMapP:Pmap<IntegerVPInteger> LaddFilter,predicateP:PStringv Lparse,v LgetAnswerObjects,vP:PSet<Object> LaddFilter,objP:PClassv ASPService LhandleActionSolve,v DLVService LhandleActionSolve,v Calimeri, Fusc` a, Germano, Perri, Zangari DeMaCS Embedding ASP in mobile systems

  13. Introduction The embASP Framework An embASP Specialization DLVfit Related Work Conclusions References The embASP Specialization Technical Details Android [Anda] The most used mobile operating system worldwide, due also to its open source nature The development model is currently based on the Java programming language Calimeri, Fusc` a, Germano, Perri, Zangari DeMaCS Embedding ASP in mobile systems

  14. Introduction The embASP Framework An embASP Specialization DLVfit Related Work Conclusions References The embASP Specialization Technical Details Android [Anda] The most used mobile operating system worldwide, due also to its open source nature The development model is currently based on the Java programming language JNI (Java Native Interface) [JNI] and Android NDK (Native Development Kit) [Andb] The use of JNI grants the access to the API provided by the Android NDK, and to the exposed DLV functionalities directly from the Java code of an Android application The NDK allows developers to implement parts of an Android application as “native-code” languages, such as C and C++ These technologies represent the general and standard way to realize the porting of a C++ software in an Android context Calimeri, Fusc` a, Germano, Perri, Zangari DeMaCS Embedding ASP in mobile systems

  15. Introduction The embASP Framework An embASP Specialization DLVfit Related Work Conclusions References The embASP Specialization Technical Details Android [Anda] The most used mobile operating system worldwide, due also to its open source nature The development model is currently based on the Java programming language JNI (Java Native Interface) [JNI] and Android NDK (Native Development Kit) [Andb] The use of JNI grants the access to the API provided by the Android NDK, and to the exposed DLV functionalities directly from the Java code of an Android application The NDK allows developers to implement parts of an Android application as “native-code” languages, such as C and C++ These technologies represent the general and standard way to realize the porting of a C++ software in an Android context DLV [LPF + 06] Calimeri, Fusc` a, Germano, Perri, Zangari DeMaCS Embedding ASP in mobile systems

  16. Introduction The embASP Framework An embASP Specialization DLVfit Related Work Conclusions References DLVfit A first full native ASP -based Android App Calimeri, Fusc` a, Germano, Perri, Zangari DeMaCS Embedding ASP in mobile systems

Download Presentation
Download Policy: The content available on the website is offered to you 'AS IS' for your personal information and use only. It cannot be commercialized, licensed, or distributed on other websites without prior consent from the author. To download a presentation, simply click this link. If you encounter any difficulties during the download process, it's possible that the publisher has removed the file from their server.

Recommend


More recommend