Download GitHub

Latest release version

To use the specialized library on Desktop, a JAR file, a wheel file and a DLL file have been released.
To use the specialized library on Mobile (Android), an AAR file has been released.
You can download their last stable versions in the GitHub releases.

Development Version

You can find the current development version on GitHub:


Architecture Description

The general architecture of EmbASP is depicted in the following figure: it is intended as an abstract framework to be implemented in some object-oriented programming language.
In addition, this architecture can be specialized for different platforms, logic languages and solvers.
The figure also reports general dependencies among the main modules.

Abstract Architecture
Abstract Architecture of the framework.
Blocks overshadowed in white depict the abstract components of the framework, while light-blue blocks represent the modules more closely related to the proposed specialization.

The framework architecture has been designed by means of four modules: Base, Platforms, Languages, and Specialization. In the following, we denote with "solver" a logic-based system that is meant to be used by external application with the help of EmbASP.

Base Module

The Base module defines the basic components of the Framework.

The Handler component mediates the communication between the Framework and the user that can provide it with the input program(s) via the component InputProgram, along with any desired solver's option(s) via the component OptionDescriptor. A Service component is meant for managing the chosen solver executions.

Two different execution modes can be made available: synchronous or asynchronous. While in the synchronous mode any call to the execution of the solver is blocking (i.e., the caller waits until the reasoning task is completed), in asynchronous mode the call is non-blocking: a Callback component notifies the caller once the reasoning task is completed. The result of the execution (i.e., the output of the logic system) is handled by the Output component, in both modes.

Platforms Module

The Platforms module is meant for containing what is platform-dependent; in particular, the Handler and Service components from the Base module that should be adapted according to the platform at hand, since they take care of practically launching solvers.

The DesktopHandler manages the DesktopService for the execution of the solver on a Desktop platform, and, in a similay way, the AndroidHandler manages the AndroidService on an Android platform.

Languages Module

The Languages module defines specific facilities for each supported logic language.

The generic Mapper component is conceived as an utility for managing input and output via objects, if the programming language at hand permits it.

The sub-module ASP comprises components such as ASPInputProgram that adapts InputProgram to the ASP case, while AnswerSets, composed of a set of AnswerSet, represents the Output for ASP. Moreover the ASPMapper allow the management of ASP input facts and answer sets via objects. The Datalog sub-module resembles the ASP sub-module very closely: DatalogInputProgram is the Datalog equivalent of ASPInputProgram, MinimalModels is the equivalent of AnswerSets, MinimalModel is the equivalent of AnswerSet, and DatalogMapper is the equivalent of ASPMapper. Similarly, the sub-module PDDL includes PDDLInputProgram, Action, Plan and PDDLMapper.

Specialization Module

The Specialization module defines what is system-dependent; in particular, the Service, Output and OptionDescriptor components from the Base module should be adapted in order to effectively interact with the solver at hand.

In particular, this module contains specific extensions for the different solvers of the DesktopService ( DLVDesktopService, DLV2DesktopService, IDLVDesktopService, DLVHEXDesktopService, ClingoDesktopService and SPDDesktopService) and the AndroidService (DLVAndroidService and DLV2AndroidService). There are also the extensions of the AnswerSets for ASP language (DLVAnswerSets, DLV2AnswerSets, DLVHEXAnswerSets and ClingoAnswerSets) of the Plan for PDDL language (SPDPlan), and of the MinimalModels for the Datalog language (IDLVMinimalModels).

Read The Docs

For a complete documentation regarding EmbASP, visit our page on

It provides a detailed description about EmbASP implementations and some examples of EmbASP usage.



  • Francesco Calimeri
  • Davide Fuscà
  • Stefano Germano (Coordinator)
  • Francesco Pacenza
  • Simona Perri
  • Jessica Zangari


  • Marco Anastasio
  • Marco Bellizzi
  • Michele Bencardino
  • Giuseppe Buonanno
  • Dario Campisano
  • Simone Lucia
  • Richard Taupe


For further information, contact


The framework is released under The MIT License (MIT).

The framework library for DLV on Android embeds the DLV system itself, which is free for academic and non-commercial educational use, as well as for use by non-profit organizations. For further information about DLV, please refer to the DLVSystem Ltd. home page.


  • Francesco Calimeri, Davide Fuscà, Stefano Germano, Simona Perri, and Jessica Zangari.
    Fostering the Use of Declarative Formalisms for Real-World Applications: The EmbASP Framework
    In New Generation Computing (2018).


  • Davide Fuscà, Stefano Germano, Jessica Zangari, Marco Anastasio, Francesco Calimeri and Simona Perri.
    A Framework for Easing the Development of Applications Embedding Answer Set Programming
    Presented at the 23rd International Workshop on Experimental Evaluation of Algorithms for solving problems with combinatorial explosion (RCRA 2016).


  • Francesco Calimeri, Davide Fuscà, Stefano Germano, Simona Perri and Jessica Zangari.
    Boosting the Development of ASP-based Applications in Mobile and General Scenarios
    In Proceedings of the 15th International Conference of the Italian Association for Artificial Intelligence (AI*IA 2016).

    paper  slides

  • Davide Fuscà, Stefano Germano, Jessica Zangari, Marco Anastasio, Francesco Calimeri and Simona Perri.
    A Framework for Easing the Development of Applications Embedding Answer Set Programming
    In Proceedings of the 18th International Symposium on Principles and Practice of Declarative Programming (PPDP 2016).

    paper  slides

  • Francesco Calimeri, Davide Fuscà, Stefano Germano, Simona Perri and Jessica Zangari.
    Embedding ASP in mobile systems: discussion and preliminary implementations
    In (online) Procedings of the 8th Workshop on Answer Set Programming and Other Computing Paradigms (ASPOCP 2015).

    paper  slides

Applications Showcase

DLVfit is a health and fitness app that monitors the user activity during the day and suggests some workout plans that depend on her age, weight, gender and goals. The app periodically stores some information about the user activities (running, walking, etc.) and infers the current amount of calories burned so far. When the user asks for a workout plan, DLVfit proposes a set of exercises that would allow the user to reach her daily goal, taking into account also to her preferences. The suggested workout plans are computed in the background by DLV via EmbASP.

The ASP program used within DLVfit can be found in the repository. Basically, the program guesses for possible fitness exercises to do in order to burn the remaing calories. Each answer set represent a possible workout plan, in which is ensured that the user's requirements about the calories to burn and the time to spend in the workout are respected. Moreover, also user's preferences are taken into account by means of weak constraints.


You can download the latest version of DLVfit here.

The app should work on most devices equipped with Android 4.x/5.x.
The list of compatible devices include (but it is not limited to):

  • Samsung Galaxy S2 - Android 4.3, API 16
  • HTC One - Android 4.3, API 18
  • HTC One XL - Android 4.2.2, API 17
  • HTC One XL - Android 4.1.1, API 16
  • Samsung Galaxy Note 2 - Android 4.2.2, API 17
  • Google Nexus 7 - Android 4.4.4, API 19
  • Samsung S4 - Android 4.4.4, API 19
  • Samnsung S3 - Android 4.3, API 18
  • Sony Xperia S - Android 4.1.1, API 16
  • Google Nexus 7 - Android 4.3, API 18
  • Sony Xperia Go - Android 4.0
  • Sony Xperia Z3 - Android 5.0
  • Sony Xperia Z3 - Android 5.1
  • Galaxy S6 - Android 5.0
  • Nexus 6 - Android 5.0
  • Dario Campisano
  • The EmbASP Team

GuessAndCheckers is a native mobile application that works as an helper for users that play "live" games of the (Italian) checkers (i.e., by means of physical board and pieces). The app, that runs on Android, can help a player at any time: by means of the device camera a picture of the board is taken, and the information about the current status of the game is properly inferred thanks to OpenCV, an open source computer vision and machine learning software; an ASP-based artificial intelligence module then suggests the move.

Thanks to EmbASP and the use of ASP, GuessAndCheckers features a fully-declarative approach that made easy to develop and improve several different strategies, also experimenting with many combinations thereof.
The source code of this application along with the Android Application Package (APK) are available online.


You can download the latest version of GuessAndCheckers here.

  • Vincenzo Arieta
  • The EmbASP Team

DLVEdu is an educational Android App for children, that integrates well-established mobile technologies, such as voice or drawn text recognition, with the modeling capabilities of ASP. In particular, it is able to guide the child throughout the learning tasks, by proposing a series of educational games, and developing a personalized educational path. The games are divided into four macro-areas: Logic, Numeric-Mathematical, Memory, and Verbal Language. The usage of ASP allows the application to adapt to the game experiences fulfilled by the user, her formative gap, and the obtained improvements.

The application continuously profiles the user by recording mistakes and successes, and dynamically builds and updates a customized educational path along the different games. The application features a "Parent Area", that allows parents to monitor child's achievements and to express some preferences, such as explicit filters of some games or educational areas.

  • Mattia Lanzillotta
  • Mirko Pontoriero
  • The EmbASP Team

Connect4 is an application that allows a user to play the popular Connect Four game (also known as Four-in-a-Row) against an ASP-based artificial player.
The Connect Four game is played by two opponents on a vertical 7*6 rectangular board. At each turn, the players fill the board by dropping 1 disk into one of the column so that it falls from the top to the lowest unoccupied position in the column. The winner is the first player who gets four of her disks in a line, connected either horizontally, vertically, or diagonally.

Different AIs have been implemented, ranging from the most powerful one implementing advanced techniques for the perfect play to the simplest one relying on some classical heuristic strategies. By using EmbASP, two different versions of the same app have been built: one for Android, making use of DLV, and one for Java-enabled desktop platforms, making use of clingo.

  • Marco Anastasio
  • The EmbASP Team

LoIDE is a web-based IDE for Logic Programming.
An extensive documentation can be found here.

A live beta version can be found online at
This online version uses the ASPServerExecutor to run the ASP solvers (using the EmbASP Framework).

  • Stefano Germano
  • Eliana Palermiti
  • Rocco Palermiti
  • Alexander Karaulshchikov
  • Francesco Calimeri

Pac-Man Unity-EmbASP is a version of the Pac-Man game made using Unity as Game Engine and EmbASP as AI framework

  • The EmbASP Team