Published: 17th September 2021
DOI: 10.4204/EPTCS.345
ISSN: 2075-2180


Proceedings 37th International Conference on
Logic Programming (Technical Communications)
Porto (virtual event), 20-27th September 2021

Edited by: Andrea Formisano, Yanhong Annie Liu, Bart Bogaerts, Alex Brik, Veronica Dahl, Carmine Dodaro, Paul Fodor, Gian Luca Pozzato, Joost Vennekens and Neng-Fa Zhou

Bart Bogaerts, Alex Brik, Veronica Dahl, Carmine Dodaro, Paul Fodor, Andrea Formisano, Yanhong Annie Liu, Gian Luca Pozzato, Joost Vennekens and Neng-Fa Zhou

Invited talks

Answering Questions Using Neural Knowledge Representations
William W. Cohen
Logic-Based Formulation of Ethical Principles
John Hooker
Structural Characterizations of Rule-Based Languages
Phokion G. Kolaitis
Combining Probability and First-Order Logic
Stuart Russell
Why Datalog?
Jeffrey Ullman

Datalog Perspectives (Panel Session)

Datalog Perspectives
David S. Warren
The Downs and Ups of Datalog
David Maier
Datalog++ and Datalog−−
Moshe Vardi

No Logic is an Island: Internal and External Integration of Logic Programming Paradigms (Panel Session)

No Logic is an Island: Internal and External Integration of Logic Programming Paradigms (Invited Panel)
Joost Vennekens

MentorLP: Mentoring Workshop on Logic Programming

MentorLP — Mentoring Workshop on Logic Programming
Veronica Dahl and Paul Fodor

Main Track

A Logic Program Transformation for Strongly Persistent Forgetting (Extended Abstract)
Felicidad Aguado, Pedro Cabalar, Jorge Fandinno, Gilberto Pérez and Concepción Vidal
Syntactic Requirements for Well-defined Hybrid Probabilistic Logic Programs
Damiano Azzolini and Fabrizio Riguzzi
How to Split a Logic Program
Rachel Ben-Eliyahu-Zohary
Fixpoint Semantics for Recursive SHACL
Bart Bogaerts and Maxime Jakubowski
Towards a Semantics for Hybrid ASP Systems: Extended Abstract
Pedro Cabalar, Jorge Fandinno, Torsten Schaub and Philipp Wanko
Extending High-Utility Pattern Mining with Facets and Advanced Utility Functions (Extended Abstract)
Francesco Cauteruccio and Giorgio Terracina
A Note on Occur-Check
Włodzimierz Drabent
Verification of Locally Tight Programs (Extended Abstract)
Jorge Fandinno and Vladimir Lifschitz
Weighted Conditional EL^bot Knowledge Bases with Integer Weights: an ASP Approach
Laura Giordano and Daniele Theseider Dupré
Probabilistic Defeasible Logic Programming: Towards Explainable and Tractable Query Answering (Extended Abstract)
Mario A. Leiva, Alejandro J. García, Paulo Shakarian and Gerardo I. Simari
Unifying Framework for Optimizations in CASP; SMT; ILP (Extended Abstract)
Yuliya Lierler
Towards Streams of Events with Temporally-Constrained Effects
Periklis Mantenoglou, Manolis Pitsikalis and Alexander Artikis
APIA: An Architecture for Policy-Aware Intentional Agents
John Meyer and Daniela Inclezan
DMAPF: A Decentralized and Distributed Solver for Multi-Agent Path Finding Problem with Obstacles
Poom Pianpak and Tran Cao Son
Refining the Semantics of Epistemic Specifications
Ezgi Iraz Su
Generating Explainable Rule Sets from Tree-Ensemble Learning Methods by Answer Set Programming
Akihiro Takemura and Katsumi Inoue
Natlog: a Lightweight Logic Programming Language with a Neuro-symbolic Touch
Paul Tarau
exp(ASPc) : Explaining ASP Programs with Choice Atoms and Constraint Rules
Ly Ly Trieu, Tran Cao Son and Marcello Balduccini
Towards Selective and Compact Query Abduction for Existential Rules
Zhe Wang, Peng Xiao and Kewen Wang
Modeling and Solving Graph Synthesis Problems Using SAT-Encoded Reachability Constraints in Picat
Neng-Fa Zhou

Applications Track

Combining Deep Learning and ASP-based Models for the Semantic Segmentation of Medical Images
Pierangela Bruno, Francesco Calimeri, Cinzia Marte and Marco Manna
A Logic-based Multi-agent System for Ethical Monitoring and Evaluation of Dialogues
Abeer Dyoub, Stefania Costantini, Ivan Letteri and Francesca A. Lisi
Stable Marriage Problems with Ties and Incomplete Preferences: An Empirical Study
Selin Eyupoglu, Muge Fidan, Yavuz Gulesen, Ilayda Begum Izci, Berkan Teber, Baturay Yilmaz, Ahmet Alkan and Esra Erdem
Geolog: Scalable Logic Programming on Spatial Data
Tobias Grubenmann and Jens Lehmann
DiscASP: A Graph-based ASP System for Finding Relevant Consistent Concepts with Applications to Conversational Socialbots
Fang Li, Huaduo Wang, Kinjal Basu, Elmer Salazar and Gopal Gupta
Generating Concurrent Programs From Sequential Data Structure Knowledge Using Answer Set Programming
Sarat Chandra Varanasi, Neeraj Mittal and Gopal Gupta

Recently Published Research Track

Summary of Semantics for Hybrid Probabilistic Logic Programs with Function Symbols
Damiano Azzolini, Fabrizio Riguzzi and Evelina Lamma
Towards Solving Path Planning in Keyhole Neurosurgery with Answer Set Programming
Valentina Corbetta, Alice Segato, Jessica Zangari, Simona Perri, Francesco Calimeri and Elena De Momi
Extended Abstract: Non-monotonic Logical Reasoning and Deep Learning for Transparent Decision Making in Robotics
Tiago Mota, Mohan Sridharan and Ales Leonardis

Doctoral Consortium

Flexible and Explainable Solutions for Multi-Agent Path Finding Problems
Aysu Bogatarkan
Comprehensive Multi-Agent Epistemic Planning
Francesco Fabiano
Automata Techniques for Temporal Answer Set Programming
Susana Hahn
Quantitative and Stream Extensions of Answer Set Programming
Rafael Kiesel
Graph Based Answer Set Programming Solver Systems
Fang Li
Compilation of Aggregates in ASP
Giuseppe Mazzotta
Product Configuration in Answer Set Programming
Seemran Mishra
Formalisation of Action with Durations in Answer Set Programming
Etienne Tignon


This volume contains the Technical Communications and the Doctoral Consortium papers of the 37th International Conference on Logic Programming (ICLP 2021), held online from September 20 to 27, 2021. The Association of Logic Programming (ALP) Executive Committee decided to hold ICLP 2021 as a fully virtual event because of the continuing coronavirus (COVID-19) pandemic.

Contributions were from all areas of logic programming, including but not restricted to:

Semantics, Formalisms, Nonmonotonic reasoning, Knowledge representation.
Languages issues:
Concurrency, Objects, Coordination, Mobility, Higher order, Types, Modes, Assertions, Modules, Meta-programming, Logic-based domain-specific languages, Programming techniques.
Programming support:
Program analysis, Transformation, Validation, Verification, Debugging, Profiling, Testing, Execution visualization.
Compilation, Virtual machines, Memory management, Parallel and Distributed execution, Constraint handling rules, Tabling, Foreign interfaces, User interfaces.
Related Paradigms and Synergies:
Constraint logic programming, Answer set programming, Inductive and coinductive logic programming, Interaction with SAT, SMT and CSP solvers, Theorem proving, Argumentation, Probabilistic programming, Machine learning.
Databases, Big data, Data integration and federation, Software engineering, Natural language processing, Web and semantic web, Agents, Artificial intelligence, Computational life sciences, Cyber-security, Robotics, Education.

Besides the main track, ICLP 2021 hosted two additional tracks:

Applications Track: This track invited submissions of papers on emerging and deployed applications of LP, describing all aspects of the development, deployment, and evaluation of logic programming systems to solve real-world problems, including interesting case studies and benchmarks, and discussing lessons learned.

Recently Published Research Track: This track provided a forum to discuss important results related to logic programming that appeared (from January 2019 onwards) in selective journals and conferences, but have not been previously presented at ICLP.

These tracks had their own track chairs, submission requirements, and evaluation criteria.

ICLP 2021 also hosted:

MentorLP - Mentoring Workshop on Logic Programming: The purpose of MentorLP was to support students and newcomers to pursue careers in logic programming research. This workshop held technical sessions on cutting-edge research in logic programming, and mentoring sessions on how to prepare and succeed for a research career. We had leaders in logic programming research from academia and industry to give talks on their research areas. We also had live discussions among participants on how to overcome challenges and make contributions to the research community. MentorLP was dedicated to fostering and supporting diversity, equity, and inclusion. We especially encouraged members of underrepresented groups to attend.

Autumn School on Logic and Constraint Programming: The school was designed for those interested in learning advanced topics in logic programming and constraint programming. It consisted of a series of half-day tutorials. The school hosted tutorials given by Daniela Inclezan (Miamy University), Mirek Truszczyński (University of Kentucky), Agostino Dovier (University of Udine), and Alessandra Russo & Mark Law (Imperial College).

Doctoral Consortium: The Doctoral Consortium (DC) on Logic Programming provided students with the opportunity to present and discuss their research directions, and to obtain feedback from both peers and experts in the field.

Logic and Constraint Programming Contest: The contest combined some features of Prolog programming contest, Answer Set Programming contest, and Constraint Programming contest. As in the previous edition, participants were not limited to use a single system and could also combine declarative and imperative programming languages.

ICLP 2021 program also included several invited talks and panel sessions.

The main conference invited speakers were:

The panel Datalog Perspectives was chaired by David S. Warren (Stony Brook University and XSB, Inc.). The panelists were David Maier (Portland State University), Moshe Vardi (Rice University), and Jeffrey Ullman (Stanford University). The panel was originally planned to be immediately after Ullman's invited talk, but Ullman shared his invited talk time with Maier and Vardi before the panel discussions. Maier's talk was titled The Downs and Ups of Datalogi, and Vardi's talk was titled Datalog++ and Datalog--.

The panel No Logic is an Island: Internal and External Integration of Logic Programming Paradigms was chaired by Joost Vennekens (KU Leuven). The panelists were Marc Denecker (KU Leuven), Manuel Hermenegildo (IMDEA and Universidad Politécnica de Madrid), Francesco Ricca (University of Calabria), Theresa Swift (Universidade Nova de Lisboa), and Jan Wielemaker (VU University of Amsterdam).

The organizers of ICLP 2021 were:

General Chair Program Chairs Organizing and Publicity Chair Workshops Chair Doctoral Consortium and Autumn School Chairs Programming Contest Chair Applications Track Chairs Recently Published Research Track Chairs MentorLP - Mentoring Workshop on Logic Programmin Chairs ICLP 2021 adopted a hybrid publication model with journal papers and Technical Communications (TCs), following a decision made in 2010 by the Association for Logic Programming. Papers judged by the Program Committee to be of the highest quality were selected for rapid publications in a special issue of Theory and Practice of Logic Programming (TPLP). The TCs comprise papers judged by the Program Committee to be of good quality but not yet of the standard required to be published in TPLP, or extended abstracts abridged from such papers. The TCs also include short papers, extended abstracts from the different tracks, abstracts of invited talks and panels, and dissertation project descriptions from the Doctoral Consortium. We received 74 submissions of abstracts, of which 68 resulted in full submissions, distributed as follows: ICLP main track (43 full papers and 5 short papers), Applications track (13 full papers and 2 short papers), and Recently Published Research track (5 extended abstracts). The reviewing process was undertaken by the Program Committee with the support of external reviewers. Each technical paper was reviewed by at least three reviewers. This enabled a list of papers to be short-listed as candidates for rapid publication in TPLP. The authors of these papers revised their submissions in light of the reviewers' suggestions, and all these papers were subject to a second round of reviewing, and a few of them an additional round of reviewing. Of these candidates papers, 20 were accepted for publication in TPLP. In addition, the Program Committee recommended 23 papers to be accepted as TCs, either as full papers or, in case the authors chose, as extended abstracts (one of these papers was withdrawn). Also included in this volume are 4 accepted short papers, as well as 4 extended abstracts from the Recently Published Research Track (the authors of one of them opted for not publishing the abstract).

We are deeply indebted to the Program Committee members and external reviewers. The conference would not have been possible without their dedicated, enthusiastic, and outstanding work.

The Program Committee members of ICLP 2021 were:

Salvador Abreu Giovambattista Ianni Orkunt Sabuncu
Mario Alviano Katsumi Inoue Chiaki Sakama
Marcello Balduccini Tomi Janhunen Vitor Santos Costa
Roman Barták Michael Kifer Torsten Schaub
Pedro Cabalar Ekaterina Komendantskaya Konstantin Schekotihin
Manuel Carro Nicola Leone Tom Schrijvers
Stefania Costantini Michael Leuschel Tran Cao Son
Marina De Vos Ondřej Lhoták Theresa Swift
Agostino Dovier Vladimir Lifschitz Paul Tarau
Inês Dutra Fangzhen Lin Tuncay Tekle
Thomas Eiter Francesca Alessandra Lisi Michael Thielscher
Esra Erdem Jorge Lobo Mirek Truszczyński
Wolfgang Faber Viviana Mascardi Allen van Gelder
Sarah Alice Gaggl Thomas Meyer German Vidal
Marco Gavanelli Jose F. Morales Alicia Villanueva
Martin Gebser Manuel Ojeda-Aciego Toby Walsh
Michael Gelfond Carlos Olarte Antonius Weinzierl
Laura Giordano Magdalena Ortiz Jan Wielemaker
Gopal Gupta Mauricio Osorio Stefan Woltran
Michael Hanus Enrico Pontelli Roland Yap
Manuel Hermenegildo Francesco Ricca Jia-Huai You

The Program Committee members of the Applications track were:

Mutsunori Banbara Matti Järvisalo Daniele Theseider Dupré
François Bry Nikos Katzouris Paolo Torroni
Francesco Calimeri Zeynep Kiziltan Kewen Wang
Angelos Charalambidis Marco Maratea David Warren
Ferdinando Fioretto Yunsong Meng Fangkai Yang
Gerhard Friedrich Alessandra Mileo Zhizheng Zhang
Jianmin Ji Mohan Sridharan

The external reviewers were:

Sotiris Batsakis Spencer Killen Etienne Tignon
Michael Bernreiter Bruno Pereira Huaduo Wang
Francois Bry-Hausser Jacques Robin Philipp Wanko
Jose-Luis Carballido Elmer Salazar Jessica Zangari
Carmine Dodaro Zeynep G. Saribatur Claudia Zepeda Cortes
Biqing Fang Mantas Simkus

The 17th Doctoral Consortium (DC) on Logic Programming was held in conjunction with ICLP 2021. It attracted Ph.D. students in the area of Logic Programming Languages from different backgrounds (e.g., theory, implementation, application) and encouraged a constructive and fruitful advising.
Topics included: theoretical foundations of logic and constraint logic programming, sequential and parallel implementation technologies, static and dynamic analysis, abstract interpretation, compilation technology, verification, logic-based paradigms (e.g., answer set programming, concurrent logic programming, inductive logic programming), and innovative applications of logic programming.
This year the DC accepted 9 papers in the areas mentioned above (the author of one of them opted for not including an abstract in this volume). We warmly thank all student authors, supervisors, reviewers, co-chairs, and Program Committee members of the DC, as well as the organizing team for making the DC greatly successful.

The Program Committee members of the Doctoral Consortium were:

Johannes K. Fichte Daniela Inclezan Yi Wang
Fabio Fioravanti Zeynep G. Saribatur Jessica Zangari
Gregory Gelfond Frank Valencia Matthias van der Hallen
and the external reviewers were

Mario Alviano Marco Maratea Elena Mastria

We would also like to express our gratitude to everyone who helped the organization of ICLP 2021, especially our General Chair, Ricardo Rocha, and Organizing and Publicity Chair, Miguel Areias. Our gratitude must be extended to the President of ALP, Thomas Eiter, to the ALP Conference Coordinator Marco Gavanelli, and to all members of the ALP Board. A special thank goes to Mirek Truszczyński, Editor-in-Chief of TPLP and to the staff at Cambridge University Press for their assistance. We would also like to thank Rob van Glabbeek, Editor-in-Chief of EPTCS, for helping the Program Chairs with his prompt support. Finally, we thank each author of every submitted paper, because their efforts keep the conference alive, and we thank all participants of ICLP 2021 for bringing and sharing their ideas and latest developments.

Bart Bogaerts, Alex Brik, Veronica Dahl, Carmine Dodaro, Paul Fodor, Andrea Formisano,
Yanhong Annie Liu, Gian Luca Pozzato, Joost Vennekens, and Neng-Fa Zhou (Eds.)

Answering Questions Using Neural Knowledge Representations

William W. Cohen (Google AI)

Neural language models, which can be pretrained on very large corpora, turn out to "know" a lot about the world, in the sense that they can be trained to answer questions surprisingly reliably. However, "language models as knowledge graphs" have many disadvantages: for example, they cannot be easily updated when information changes. I will describe recent work in my team and elsewhere on incorporating symbolic knowledge into language models and question-answering systems, and also comment on some of the remaining challenges associated with integrating symbolic reasoning and neural NLP.

Logic-Based Formulation of Ethical Principles

John Hooker (Carnegie Mellon University)

Quantified modal logic provides a useful framework for precise formulation of ethical principles. This talk begins by briefly summarizing how generalization, utilitarian, and autonomy principles can be deontologically derived from the logical structure of action. It then shows how these principles can be expressed in a logical idiom suitable for use in a rule-based AI system. In particular, it indicates how quantified modal logic can enable value alignment in machine learning to integrate ethical reasoning with empirical observation.

Portions of the talk are based on joint work with Thomas Donaldson and Tae Wan Kim.

Structural Characterizations of Rule-Based Languages

Phokion G. Kolaitis (University of California Santa Cruz and IBM Research)

Since the early days of the relational data model, rule-based languages have been used to express semantic restrictions that the data of interest ought to obey. In the past two decades, rule-based languages have also been used as specification languages in data exchange, in data integration, and in ontology-mediated data access. Tuple-generating dependencies (tgds) form one of the most widely used and extensively studied such rule-based languages. Tgds are also known as existential rules; they include Datalog rules as a special case and possess numerous desirable structural properties. The aim of this talk is to present an overview of results, both old and new, that characterize finite sets of tgds in terms of their structural properties. These results include characterizations of finite sets of arbitrary tgds, as well as characterizations of restricted types of tgds, including full tgds, linear tgds, guarded tgds, and source-to-target tgds.

Combining Probability and First-Order Logic

Stuart Russell (University of California, Berkeley)

Probabilistic programming languages (PPLs) are expressive formal languages for writing probability models. One branch derives expressive power from traditional programming languages; the other from first-order logic. This talk covers Bayesian logic (BLOG), a language that facilitates specification of probability distributions over first-order structures. I will describe the language mainly through examples and cover its application to monitoring the Comprehensive Nuclear-Test-Ban Treaty. PPLs have many advantages over deep learning systems and may offer an alternative route to the construction of general-purpose AI systems.

Why Datalog?

Jeffrey Ullman (Stanford University)

Datalog was far from the first brand of logic to be thought of as a database query language. Other approaches were far more powerful. But its weakness was in fact its strength. Its advantage is that a logic as limited as Datalog makes optimization feasible, and for any declarative query language, the ability to select an efficient implementation from among the many possible ways to execute a query is essential.

Datalog Perspectives

David S. Warren (Stony Brook University and XSB, Inc.)

Datalog was identified as a language and named about 35 years ago now. It has gone through phases of popularity and unpopularity. It has spawned (at least) two distinct, quite different, intuitive and formal semantics. It has stimulated much research. In this session we hear from several researchers, who did early and foundational research on Datalog, to get their perspectives on Datalog: what it is, where it's been, and where it's going.

Discussion questions:

The Downs and Ups of Datalog

David Maier (Portland State University)

After a burst of interest in the late 1980s and early 1990s, activity around Datalog and other logic languages declined. However, Datalog has garnered renewed attention in the last decade, often for uses beyond database querying. I will explore possible reasons for the drop-off in interest, cover a range of current application areas for Datalog, and speculate on the reasons for resurgence.

Datalog++ and Datalog−−

Moshe Vardi (Rice University)

One argument in favor of Datalog is that it constitutes a sweet point in terms of expressiveness and feasibility of evaluation and optimization. I will argue that instead of thinking of Datalog as a single query language, we should consider it as a family of query languages. For some applications, such as universal relations and data exchange, we need to enhance Datalog's expressive power, hence Datalog++. For other applications, where we need query equivalence to be decidable, we need to limit Datalog's expressiveness, hence Datalog−−.

No Logic is an Island: Internal and External Integration of Logic Programming Paradigms (Invited Panel)

Joost Vennekens (KU Leuven)

Over the course of its rich history, the area of Logic Programming has spawned many different logics, systems and paradigms. In this panel, we ask two questions:

We ask these questions with both practical and theoretical goals in mind: In this panel, we reflect on achievements so far and useful directions for future efforts on these topics.

MentorLP — Mentoring Workshop on Logic Programming

Veronica Dahl (Simon Fraser University)
Paul Fodor (Stony Brook University)

The MentorLP Workshop is designed to broaden the exposure of students to research and career opportunities in logic programming. The workshop program included talks and sessions that cover history, mentoring sessions that cover effective habits for navigating the research landscape, current practice of logic programming, and social sessions that create opportunities for students and early researchers to interact with established researchers in the field.


A Logic Program Transformation for Strongly Persistent Forgetting (Extended Abstract)

Felicidad Aguado (University of A Coruña, Spain)
Pedro Cabalar (University of A Coruña, Spain)
Jorge Fandinno (University of Nebraska at Omaha, USA)
Gilberto Pérez (University of A Coruña, Spain)
Concepción Vidal (University of A Coruña, Spain)

A common representational technique in Answer Set Programming [3] is the use of auxiliary atoms. Their introduction in a program may be due to many different reasons, for instance, looking for a simpler reading, providing new constructions (choice rules, aggregates, transitive closure, etc) or reducing the corresponding ground program. When a program (or program fragment) $\Pi$ for signature $AT$ uses auxiliary atoms $A \subseteq AT$, they do not have a relevant meaning outside $\Pi$. Accordingly, they are usually removed from the final stable models, so the latter only use atoms in $V=AT \setminus A$, that is, the relevant or public vocabulary that encodes the solutions to our problem in mind. Thus, when seen from outside, $\Pi$ becomes a black box that hides internal atoms from $A$ and provides solutions in terms of public atoms from $V$. A reasonable question is whether we can transform these black boxes into white boxes, that is, whether we can reformulate some program $\Pi$ exclusively in terms of public atoms $V$, forgetting the auxiliary ones in $A$. A forgetting operator $f(\Pi,A)=\Pi'$ transforms a logic program $\Pi$ into a new program $\Pi'$ that does not contain atoms in $A$ but has a similar behaviour on the public atoms $V$. In the case of removal of auxiliary atoms, the reasonable way to fix that similarity is to preserve the same knowledge for public atoms in $V$, and this can be formalised as a very specific property. In particular, both programs $\Pi$ and $\Pi'=f(\Pi,A)$ should not only produce the same stable models (projected on $V$) but also keep doing so even if we add a new piece of program $\Delta$ without atoms in $A$. This property, is known as strong persistence and was introduced in [7]. Later on, [6] provided a semantic condition, called $\Omega$, on the models of $\Pi$ in the logic of Here-and-There (HT) that allows checking when atoms $A$ are forgettable in $\Pi$ when $\Omega$ does not hold. When this happens, their approach can be used to construct $f(\Pi,A)$ from the HT models. Going one step further in this model-based orientation for forgetting, [1] overcame the limitation of unforgettable sets of atoms at the price of introducing a new type of disjunction, called fork.

Semantic-based forgetting is useful when we are interested in obtaining a compact representation. However, this is done at a high computational cost (similar to Boolean function minimisation techniques). When combined with the $\Omega$-condition or, similarly, with the use of HT-denotations, this method becomes practically unfeasible without the use of a computer. This may become a problem, for instance, when we try to prove properties of some new use of auxiliary atoms in a given setting, since one would expect a human-readable proof rather than resorting to a computer-based exhaustive exploration of models. On the other hand, semantic forgetting may easily produce results that look substantially different from the original program, even when this is not necessary.

An alternative and complementary orientation for forgetting is the use of \emph{syntactic transformations}. Recently, [2] presented a general syntactic operator $f_{sp}$ for a single atom $A=\{a\}$ that can be applied to any arbitrary logic program and satisfies strong persistence when the atom is forgettable (i.e. the $\Omega$ condition does not hold). Moreover, Berthold et al. also provided three syntactic sufficient conditions (what they call $a$-forgettable) under which $\Omega$ does not hold, and so, under which $f_{sp}$ is strongly persistent. Perhaps the main difficulty of $f_{sp}$ comes from its complex definition: it involves 10 different types of rule-matching that further deal with multiple partitions of $\Pi$ (using a construction called as-dual). As a result, even though it offers full generality when the atom is forgettable, its application by hand does not seem too practical, requiring too many steps and a careful reading of the transformations. In some particular syntactic fragments, simpler transformations can do the job and are much easier to use. This is the case not only of $f_{as}$ mentioned before, but also of $f_{su}$ in [5] for stratified logic programs and used as a basis for strong persistence with respect to uniform equivalence, that is, when the context $\Delta$ is a set of facts for atoms in $V$.

In this paper, we introduce another syntactic operator for forgetting a single atom, $f_{es}$, based on the external support construction used for loop formulas in [4]. This new operator, somehow, lies in between $f_{su}$ and $f_{sp}$. On the one hand, as happens with $f_{su}$, it only guarantees strong persistence for a syntactic class of programs, and may fail to do so if we use it outside that class, even though the atom may be forgettable. On the other hand, it is more general than $f_{su}$ and closer to $f_{sp}$ in the sense that it covers some disjunctive programs under the condition that the forgotten atom $a$ is not included in its own external support (in other words, it is not used in choice rules). This is, in fact, one of the three conditions for $a$-forgettable atoms defined in [2]. As we will discuss later, the new $f_{es}$ operator is less general than $f_{sp}$ even under that condition. However, our purpose is to provide one more tool for syntactic forgetting that we claim to possess a simple definition and can be useful when the preconditions for its application are fulfilled.

In what follows, we assume some familiarity with logic programming syntax and answer set semantics. We also apply basic strongly equivalence results based on the logic of Here-and-There (HT) (see [8] for more details). Let $\Pi$ be an extended logic program for signature $AT$ and $a \in AT$. We define the subprogram $\Pi^a \subseteq \Pi$ as the set of rules: $$\Pi^a = \{ r \in \Pi \mid a \in Head(r) \setminus (Body^+(r) \cup Body^-(r))\}$$ Intuitively, these are the rules that may provide support for $a$. Note that any rule with $a \in Head(r) \cap Body^+(r)$ is tautological and, for this reason, can be disregarded. On the other hand, if $a \in Head(r) \cap Body^-(r)$, we can actually remove $a$ from the head of $r$, so the rule does not provide any real support for $a$. Moreover, all head occurrences of $a$ in $\Pi \setminus \Pi^a$ can be removed under strong equivalence as we explain next. Given any program $\Pi$, let us define the syntactic transformation $behead^a(\Pi)$ as the result of removing all rules with $a \in Head(r) \cap Body^+(r)$ and all head occurrences of $a$ from rules where $a \in Head(r) \cap Body^-(r)$.

Proposition 1. For any logic program $\Pi$: $\Pi \equiv_s behead^a(\Pi) = behead^a(\Pi \setminus \Pi^a) \cup \Pi^a$.

We define the external support of $a \in AT$ w.r.t. program $\Pi$ as the formula: \begin{eqnarray*} ES_\Pi(a) := \bigvee_{ \begin{array}{c} r \in \Pi^a \end{array}} Body(r) \wedge \neg (Head(r) \setminus\{a\})^\vee \end{eqnarray*}

Definition (Operator $f_{es}$) Let $\Pi$ be an extended logic program for alphabet $AT$ and let $a \in AT$. Then $f_{es}(\Pi,a)$ is defined as the result of:

  1. Remove atom $a$ from non-supporting heads obtaining $\Pi'=behead^a(\Pi)$;
  2. Remove every $r$ from $\Pi'$ with $Head(r)=\{a\}$;
  3. In the remaining rules, replace every body occurrence of $a$ by $ES_\Pi(a)$ and every head occurrence of $a$ by $\neg\neg ES_\Pi(a)$.
Theorem 1. Let $\Pi$ be an $\{a\}$-normal logic program for alphabet $AT$ and $a\in AT$. If $ES_\Pi(a)$ does not contain occurrences of $a$ then $f_{es}(\Pi,a)$ is a forgetting operator, and satisfies strong persistence.

Corollary 1. If $\Pi$ is a stratified program (possibly with double negation), $f_{es}$ is a strongly persistent forgetting operator.

Theorem 2. Let $\Pi$ be an extended, disjunctive logic program for alphabet $AT$ and $a\in AT$. If $ES_\Pi(a)$ does not contain occurrences of $a$, and we have no pair of edges $(a,x)^+$ and $(y,a)^+$ in the dependence graph $G_\Pi$, then $f_{es}(\Pi,a)$ is a forgetting operator, and satisfies strong persistence.


  1. Felicidad Aguado, Pedro Cabalar, Jorge Fandinno, David Pearce, Gilberto Pérez & Concepción Vidal (2019): Forgetting auxiliary atoms in forks. Artificial Intelligence 275, pp. 575-601. doi:10.1016/j.artint.2019.07.005.
  2. Matti Berthold, Ricardo Gonçcalves, Matthias Knorr & Joãao Leite (2019): A Syntactic Operator for Forgetting that Satisfies Strong Persistence. Theory and Practice of Logic Programming 19 (5-6), pp. 1038-1055. doi:10.1017/S1471068419000346.
  3. Gerhard Brewka, Thomas Eiter & Miroslaw Truszczynski (2011): Answer set programming at a glance. Communications of the ACM 54(12), pp. 92-103. doi:10.1145/2043174.2043195.
  4. Paolo Ferraris, Joohyung Lee & Vladimir Lifschitz (2006): A generalization of the Lin-Zhao theorem. Annals of Mathematics and Artificial Intelligence 47(1-2), pp. 79-101. doi:10.1007/s10472-006-9025-2.
  5. Ricardo Gonçalves, Tomi Janhunen, Matthias Knorr & João Leite (2021): On Syntactic Forgetting Under Uniform Equivalence. In Wolfgang Faber, Gerhard Friedrich, Martin Gebser & Michael Morak, editors: Proc. of the 17th European Conference on Logics in Artificial Intelligence, JELIA 2021, Klagenfurt, Austria (Virtual Event), Lecture Notes in Computer Science 12678, Springer, pp. 297-312. doi:10.1007/978-3-030-75775-5_20.
  6. Ricardo Gonçalves, Matthias Knorr & João Leite (2016): You Can't Always Forget What You Want: On the Limits of Forgetting in Answer Set Programming. In Gal A. Kaminka, Maria Fox, Paolo Bouquet, Eyke Hüllermeier, Virginia Dignum, Frank Dignum & Frank van Harmelen, editors: Proceedings of 22nd European Conference on Artificial Intelligence (ECAI'16), Frontiers in Artificial Intelligence and Applications 285, IOS Press, pp. 957-965. doi:10.3233/978-1-61499-672-9-957.
  7. Matthias Knorr & José Júlio Alferes (2014): Preserving Strong Equivalence while Forgetting. In Eduardo Fermé & João Leite, editors: Logics in Artificial Intelligence - 14th European Conference, JELIA 2014, Funchal, Madeira, Portugal, September 24-26, 2014. Proceedings, Lecture Notes in Computer Science 8761, Springer, pp. 412-425. doi:10.1007/978-3-319-11558-0_29.
  8. Vladimir Lifschitz, David Pearce & Agustín Valverde (2001): Strongly equivalent logic programs. ACM Transactions on Computational Logic 2(4), pp. 526-541. doi:10.1145/383779.383783.

Towards a Semantics for Hybrid ASP Systems: Extended Abstract

Pedro Cabalar (University of Corunna, Spain)
Jorge Fandinno (University of Nebraska at Omaha, USA; University of Potsdam, Germany)
Torsten Schaub (University of Potsdam, Germany)
Philipp Wanko (University of Potsdam, Germany)

Over the last decades the development of ASP has brought about an expressive modeling language powered by highly performant systems. At the same time, it gets more and more difficult to provide semantic underpinnings capturing the resulting constructs and inferences. This is even more severe when it comes to hybrid ASP languages and systems that are often needed to handle real-world applications. We address this challenge and introduce the concept of abstract and structured theories that allow us to formally elaborate upon their integration with ASP. We then use this concept to make precise the semantic characterization of clingo’s theory-reasoning framework and establish its correspondence to the logic of Here-and-there with constraints. This provides us with a formal framework in which we can elaborate formal properties of existing hybridizations of clingo such as clingcon, clingo[dl], and clingo[lp].

1 Overview

Answer Set Programming (ASP) is about mapping a logic program onto its so-called stable models. Over the decades, stable models have been characterized in various ways [18], somehow underpinning their appropriateness as a semantics for logic programs. However, over the same period, the syntax of logic programs has been continuously enriched, equipping ASP with a highly attractive modeling language. This development also brought about much more intricate semantics, as nicely reflected by the mathematical apparatus used in the original definition [13] and the one for capturing the input language of the ASP system clingo [11].

With the growing range of ASP applications in academia and industry [109] we also witness the emergence of more and more hybrid ASP systems [1716], similar to the raise of SMT solving from plain SAT solving [2]. From a general perspective, the resulting paradigm of ASP modulo theories (AMT) can be seen as a refinement of ASP, in which an external theory certifies some of a program’s stable models. A common approach, stemming from lazy theory solving [2], is to view a theory as an oracle that determines the truth of a designated set of (theory) atoms in the program. This idea has meanwhile been adapted to the setting of ASP in various ways, most prominently in Constraint ASP [17] extending ASP with linear equations, cf. [8126195115]. Beyond this, ASP systems like clingo or dlvhex [7] leave the choice of the specific theory largely open. For instance, clingo merely requires fixing the interaction between theories and their theory atoms. As attractive as this generality may be from an implementation point of view, it complicates the development of generic semantics that are meaningful to existing systems. Not to mention that in ASP the integration of theories takes place in a non-monotonic context.

We address this issue and show how the Logic of Here-and-There with constraints (HTc[4]) can be used as a semantics for clingo’s theory reasoning framework. Thus, just like the plain Logic of Here-and-There (HT[1420]) serves as the logic foundations of ASP, HTc extends this to AMT. In this way, we cannot only draw on the formal framework of HT but we can moreover study a heterogeneous approach such as AMT in a the uniform setting of a single logic. To this end, we introduce the concept of abstract and structured theories that allow us to formally elaborate upon their integration with ASP. With them, we make precise the semantic characterization of clingo’s theory-reasoning framework and establish its correspondence to theories in HTc. This provides us with a formal framework in which we can elaborate formal properties of existing hybridizations of clingo such as clingcon, clingo[dl], and clingo[lp]. Full details can be found in [3].

Such a formal characterization provides several valuable insights. The most obvious benefit is that we have now a roadmap to follow, not only when deciding new aspects of existing AMT systems, but also when reconsidering parts of their implementation that were originally designed with no clear hint when facing design alternatives. This will have an immediate impact on the next generation of existing AMT systems like clingcon, where head atoms will start to be considered as founded, and clingo[lp], that will also accordingly introduce an implicit separation between head atoms as founded and body atoms as external. A second important contribution is that, when proving our results, we have tried to maintain the highest possible degree of generality in the description of the abstract theories used behind. This paves the way for introducing new abstract theories: We may now start classifying them in terms of the general properties, identified in the paper (consistency, structure and denotation, closed set of external atoms, absolute complement, etc), so that we can characterize their behavior via HTc formulas.


[1]   M. Banbara, B. Kaufmann, M. Ostrowski & T. Schaub (2017): Clingcon: The Next Generation. Theory and Practice of Logic Programming 17(4), pp. 408–461, doi:10.1017/S1471068417000138.

[2]   C. Barrett, R. Sebastiani, S. Seshia & C. Tinelli (2009): Satisfiability Modulo Theories. In A. Biere, M. Heule, H. van Maaren & T. Walsh, editors: Handbook of Satisfiability, chapter 26, Frontiers in Artificial Intelligence and Applications 185, IOS Press, pp. 825–885, doi:10.3233/978-1-58603-929-5-825.

[3]   P. Cabalar, J. Fandinno, T. Schaub & P. Wanko (2021): Towards a Semantics for Hybrid ASP Systems. CoRR abs/2108.03061. Available at

[4]   P. Cabalar, R. Kaminski, M. Ostrowski & T. Schaub (2016): An ASP Semantics for Default Reasoning with Constraints. In R. Kambhampati, editor: Proceedings of the Twenty-fifth International Joint Conference on Artificial Intelligence (IJCAI’16), IJCAI/AAAI Press, pp. 1015–1021, doi:10.5555/3060621.3060762.

[5]   A. De Rosis, T. Eiter, C. Redl & F. Ricca (2015): Constraint Answer Set Programming Based on HEX-Programs. In D. Inclezan & M. Maratea, editors: Proceedings of the Eighth Workshop on Answer Set Programming and Other Computing Paradigms (ASPOCP’15).

[6]   C. Drescher & T. Walsh (2010): A Translational Approach to Constraint Answer Set Solving. Theory and Practice of Logic Programming 10(4-6), pp. 465–480, doi:10.1017/S1471068410000220.

[7]   T. Eiter, S. Germano, G. Ianni, T. Kaminski, C. Redl, P. Schüller & A. Weinzierl (2018): The DLVHEX System. Künstliche Intelligenz 32(2-3), pp. 187–189, doi:10.1007/s13218-018-0535-y.

[8]   I. Elkabani, E. Pontelli & T. Son (2004): Smodels with CLP and Its Applications: A Simple and Effective Approach to Aggregates in ASP. In B. Demoen & V. Lifschitz, editors: Proceedings of the Twentieth International Conference on Logic Programming (ICLP’04), Lecture Notes in Computer Science 3132, Springer-Verlag, pp. 73–89, doi:10.1007/978-3-540-27775-0_6.

[9]   E. Erdem, M. Gelfond & N. Leone (2016): Applications of ASP. AI Magazine 37(3), pp. 53–68, doi:10.1609/aimag.v37i3.2678.

[10]   A. Falkner, G. Friedrich, K. Schekotihin, R. Taupe & E. Teppan (2018): Industrial Applications of Answer Set Programming. Künstliche Intelligenz 32(2-3), pp. 165–176, doi:10.1007/s13218-018-0548-6.

[11]   M. Gebser, A. Harrison, R. Kaminski, V. Lifschitz & T. Schaub (2015): Abstract Gringo. Theory and Practice of Logic Programming 15(4-5), pp. 449–463, doi:10.1017/S1471068415000150.

[12]   M. Gebser, M. Ostrowski & T. Schaub (2009): Constraint Answer Set Solving. In P. Hill & D. Warren, editors: Proceedings of the Twenty-fifth International Conference on Logic Programming (ICLP’09), Lecture Notes in Computer Science 5649, Springer-Verlag, pp. 235–249, doi:10.1007/978-3-642-02846-5_22.

[13]   M. Gelfond & V. Lifschitz (1988): The Stable Model Semantics for Logic Programming. In R. Kowalski & K. Bowen, editors: Proceedings of the Fifth International Conference and Symposium of Logic Programming (ICLP’88), MIT Press, pp. 1070–1080.

[14]   A. Heyting (1930): Die formalen Regeln der intuitionistischen Logik. In: Sitzungsberichte der Preussischen Akademie der Wissenschaften, Deutsche Akademie der Wissenschaften zu Berlin, pp. 42–56. R in Logik-Texte: Kommentierte Auswahl zur Geschichte der Modernen Logik, Akademie-Verlag, 1986.

[15]   T. Janhunen, R. Kaminski, M. Ostrowski, T. Schaub, S. Schellhorn & P. Wanko (2017): Clingo goes Linear Constraints over Reals and Integers. Theory and Practice of Logic Programming 17(5-6), pp. 872–888, doi:10.1017/S1471068417000242.

[16]   R. Kaminski, T. Schaub & P. Wanko (2017): A Tutorial on Hybrid Answer Set Solving with clingo. In G. Ianni, D. Lembo, L. Bertossi, W. Faber, B. Glimm, G. Gottlob & S. Staab, editors: Proceedings of the Thirteenth International Summer School of the Reasoning Web, Lecture Notes in Computer Science 10370, Springer-Verlag, pp. 167–203, doi:10.1007/978-3-319-61033-7_6.

[17]   Y. Lierler (2014): Relating constraint answer set programming languages and algorithms. Artificial Intelligence 207, pp. 1–22, doi:10.1016/j.artint.2013.10.004.

[18]   V. Lifschitz (2010): Thirteen Definitions of a Stable Model. Lecture Notes in Computer Science 6300, Springer-Verlag, pp. 488–503, doi:10.1007/978-3-642-15025-8_24.

[19]   M. Ostrowski & T. Schaub (2012): ASP modulo CSP: The clingcon system. Theory and Practice of Logic Programming 12(4-5), pp. 485–503, doi:10.1017/S1471068412000142.

[20]   D. Pearce (1997): A New Logical Characterisation of Stable Models and Answer Sets. In J. Dix, L. Pereira & T. Przymusinski, editors: Proceedings of the Sixth International Workshop on Non-Monotonic Extensions of Logic Programming (NMELP’96), Lecture Notes in Computer Science 1216, Springer-Verlag, pp. 57–70, doi:10.1007/BFb0023801.

Extending High-Utility Pattern Mining with Facets and Advanced Utility Functions (Extended Abstract)

Francesco Cauteruccio (DEMACS, University of Calabria)
Giorgio Terracina (DEMACS, University of Calabria)


In the context of High-Utility Pattern Mining (HUPM), each item in a knowledge base is associated with one, static utility and a suitable utility function is defined over them. However, the usefulness of a pattern can be defined from very different viewpoints. To cope with this limitation, we propose the introduction of facets for items, and a more structured representation of input transactions. These extensions allow the definition of different, even complex, utility functions enabling the analysis of the underlying data at different abstraction levels. A real use case on paper reviews is also considered, in order to evaluate the potential of these ideas in the mining and extraction of new knowledge. The capabilities of Answer Set Programming and its extensions are fully exploited to cope with the wide variety of analytical scenarios that can be envisioned in this new setting.


Pattern mining is one of the data mining branches that attracted vast attention in the literature. The concept of pattern frequency is used to mine patterns from databases. Frequent patterns are useful in many domains; however, the fundamental assumption that pattern frequency is the most interesting factor may not hold in several contexts. As an example, consider a purchase transaction database; here, the pattern {flour, yeast} might be frequent but uninteresting, since it is fairly obvious that those who buy flour also buy yeast. In light of such consideration, the academic community started pointing out that a wide variety of patterns may be characterized by a low frequency but a high utility, where the utility of a pattern is given by a utility function [4,5]. The introduction of the notion of pattern utility, besides the one of pattern frequency, shifts the focus from frequent pattern mining to high-utility pattern mining (HUPM).

However, the basic assumption of all these approaches is that each item is associated with one, static, external utility. In the economics domain a utility function "represents a consumer's preference ordering over a choice set" and, consequently, it is a subjective measure [7]. Then, it is fair to assume that the utility of an item can be defined from very different points of view (we refer to them as facets in the following) depending on the preference ordering. In current approaches, switching the facet actually means to completely change the computation scenario or, at least, the dataset; moreover, different facets of item utilities cannot be combined to detect the utility of a pattern, unless a new definition of item utility is introduced as a derived measure. This also implies that the notion of utility is intended as local and computed for each pattern occurrence; having more facets at disposal, it is possible to compute transverse utilities across pattern occurrences, such as the correlation degree among (groups of) facets across pattern occurrences.

We propose the definition of a more general framework for HUPM, which extends basic notions along the following directions: (i) transaction set representation, (ii) facets, and (iii) advanced utility functions. The versatility of these extensions is represented by taking full advantage of the expressiveness of declarative programming, focusing on Answer Set Programming (ASP) and its recent extensions [2, 3, 6]. A simple ASP encoding of the problem can be set up in a modular way such that, given a pool of alternative encodings for each module, even non ASP practitioners can set up their own variant for the analysis, and the same dataset can be analyzed from different points of view by just switching the modules.

An Example of Extended High-Utility Pattern Mining

We build a real-case example of our framework upon the work presented in [1] which exploits aspect-based sentiment analysis of scientific reviews in order to be able to extract useful information and correlate them with the accept/reject decision. An important feature we exploit in our example from the results in [1] is the automatic annotation of review sentences around eight different aspects: appropriateness, clarity, originality, empirical/theoretical soundness, meaningful comparison, substance, impact of dataset/software/ideas and recommendation. For each of these aspects one out of four possible sentiments is assigned: positive, negative, neutral, absent.

In this example, we show that sentiment polarities may be exploited to find high utility patterns in reviews, i.e., sets of words that either strongly characterize acceptance/rejection of a paper or point out disagreement between reviewers sentiment and final decision. In particular, in this context, the database is composed of a set of reviews. Each review is relative to a paper and provides a rating and a confidence for it; the paper is associated with a final Accept/Reject decision. Each review contains a set of sentences; each sentence can be associate with sentiment annotations on appropriateness, clarity, originality, empirical/theoretical soundness, meaningful comparison, substance, impact of dataset/software/ideas and recommendation. Finally, each sentence is composed of a set of words.

To give an intuition regarding the potentiality of our framework, we describe the results of some experiments carried out to show if, and how much, the extensions proposed in our framework can help users in analyzing input data from different points of view and at different abstraction levels.

In a first series of experiments, we concentrate on the computation of coherence and disagreement degrees between the decision on a paper (Accept/Reject) and one of the eight aspects used to label review sentences [1]. In particular, the objective is to look for patterns (sets of words) characterizing with good accuracy the relationship of interest and to qualitatively check if they are meaningful. Coherence and disagreement degrees are an example of advanced utility functions which can be expressed by our framework; they measure the coherence (resp., disagreement) between facets and return the percentage of pattern occurrences having this measurement. We next report some interesting results obtained. In the setting Originality (positive) with the final decision Reject, we found several patterns with high utility, such as "paper interesting approach"" and "simple nice idea"". In the setting Impact of Dataset/Software/Ideas (positive) with the final decision Accept, we found patterns such as "paper write clearly present"" and "dataset significant"". Patterns extracted in the different settings are quite different, thus it indicates a good specificity of derived patterns.

In a second series of experiments, we focused on mining patterns where the advanced utility function is the Pearson correlation between the sentiment on a sentence aspect $X$ and the final decision on the corresponding paper. In particular, given a certain aspect, let say $X$=Clarity, a pattern $P$ showing a high utility should be read as follows: the set of review sentences containing $P$ are characterized by a direct correlation between the sentiment on Clarity and the final decision on the corresponding paper; consequently, a positive sentiment on Clarity in sentences containing $P$ (approximately) implies an Accept decision, whereas a negative sentiment on Clarity in sentences containing $P$ (approximately) implies a Reject decision. In a similar way, we computed also patterns where the utility function is the Multiple correlation between the sentiment on a pair of sentence aspects ($X$, $Y$) and the final decision. Recall that the Multiple correlation is a measure of how well a given variable can be predicted using a linear function of a set of other variables. It is the correlation between the variable's values and the best predictions that can be computed linearly from the predictive variables. In this case, the coefficient varies in the real interval $[0..1]$, where higher values indicate a high predictability of the dependent variable from the independent variables; in particular, a value of 1 indicates that the predictions are exactly correct. As in the previous case, observe that the studied utility relates to both the presence of a pattern $P$ in certain sentences and the corresponding sentiments on considered aspects; as a consequence, it is not a general result of predictability between a sentiment and the decision. In the following, we report few results obtained. In the context of the Pearson correlation, in the setting of Soundness$\to$Decision, some examples of patterns having strong positive correlation are "paper technical contribution" and "interesting approach pros", while examples of patterns having strong negative correlation are "understand difficult" and "paper clearly presented". As for the Multiple correlation, in the setting (Clarity, Impact)$\to$Decision we find patterns such as "think paper overall relevant"" and " good state art" presenting a high predictability, e.g., the Multiple correlation is 1.

The presented examples highlight the wide applicability of HUPM even in non classical contexts. Also, the ASP based computation method of the framework allows for a reasonable and versatile implementation, which provides a fast way to analyze the data from different perspectives and different abstraction levels. The real-case example has been employed as a "fil-rouge" to analyze the different aspects of the proposed framework. Again, thanks to the ASP implementation, it is possible to apply the framework to several different contexts in a straightforward way.


  1. S. Chakraborty, P. Goyal & A. Mukherjee (2020): Aspect-based Sentiment Analysis of Scientific Reviews. In: JCDL '20: Proceedings of the ACM/IEEE Joint Conference on Digital Libraries in 2020, Virtual Event, China, August 1-5, 2020, pp. 207-216, doi: 10.1145/3383583.3398541. ACM.
  2. C. Dodaro & F. Ricca (2020): The External Interface for Extending WASP. Theory and Practice of Logic Programming 20(2), pp. 225-248, doi: 10.1017/S1471068418000558.
  3. T. Eiter, M. Fink, G. Ianni, T. Krennwallner, C. Redl & P. Schuller (2016): A model building framework for answer set programming with external computations. Theory and Practice of Logic Programming 16(4), pp. 418-464, doi :10.1017/S1471068415000113.
  4. P. Fournier-Viger, J.C.-W. Lin, R. Nkambou, B. Vo & V.S. Tseng (2019): High-Utility Pattern Mining. Springer, doi: 10.1007/978-3-030-04921-8.
  5. W. Gan, C. Lin, P. Fournier-Viger, H. Chao, V. Tseng & P. Yu (2019): A Survey of Utility-Oriented Pattern Mining. Theory and Practice of Logic Programming, pp. 1-1, doi: 10.1109/TKDE.2019.2942594.
  6. M. Gebser, R. Kaminski, B. Kaufmann & T. Schaub (2019): Multi-shot ASP solving with clingo. Theory and Practice of Logic Programming 19(1), pp. 27-82, doi: 10.1017/S1471068418000054.
  7. H.U. Gerber & G. Pafum (1998): Utility functions: from risk theory to finance. North American Actuarial Journal 2(3), pp. 74-91, doi: 10.1080/10920277.1998.10595728. Taylor & Francis

Verification of Locally Tight Programs (Extended Abstract)

Jorge Fandinno
Vladimir Lifschitz

ANTHEM is a proof assistant that can be used for verifying the correctness of a program written in the input language of the answer set grounder GRINGO with respect to a specification expressed by first-order formulas. In addition to the rules of the program, the user of ANTHEM is expected to provide some information on the intended use of the rules: which symbols are meant to serve as placeholders, which predicates are meant to be defined in the input, and which predicates are considered part of the output. The predicates that do not belong to either category are "private" and they are not allowed in a specification. A set of rules along with this additional information is termed a "program with input and output," or an "io-program."

A specification given to ANTHEM consists of two groups of first-order sentences. One group, "assumptions," is the list of conditions on the values of placeholders and input predicates that are satisfied when the input is considered valid. The second group, "specs," is the list of conditions that characterize correct outputs.

To bridge the gap between the language of io-programs and the language of specifications, ANTHEM employs a transformation similar to program completion. The completion COMP[$\Omega$] of an io-program $\Omega$ faithfully represents the meaning of $\Omega$ whenever $\Omega$ satisfies the syntactic condition called "tightness." Tightness of io-programs is a generalization of a condition identified in early work on the relationship between stable models and completion. The operation of ANTHEM is based on the fact that the correctness of a tight io-program $\Omega$ with respect to a specification can be described by the sentence \begin{gather} A \to (\text{COMP}[\Omega] \leftrightarrow S), \label{main} \end{gather} where $A$ is the conjunction of the assumptions, and $S$ is the conjunction of the specs.

The tightness requirement eliminates practically all uses of recursion in the program. It turns out that the above-mentioned property of tight io-programs---the possibility of characterizing correctness by the above formula---holds, more generally, for "locally tight" io-programs, in which some forms of recursion are allowed. For example, the io-program with the rules \begin{flalign} &in(P,R,0) \ \texttt{:-}\ in0(P,R).&\\ &in(P,R,T+1) \ \texttt{:-}\ goto(P,R,T).&\\ &{in(P,R,T+1)} \ \texttt{:-}\ in(P,R,T), T < h.&\\ &\ \texttt{:-}\ in(P,R1,T), in(P,R2,T), R1 != R2.&\\ &in\_building(P,T) \ \texttt{:-}\ in(P,R,T).&\\ &\ \texttt{:-}\ not in\_building(P,T), person(P), T = 0..h.& \end{flalign} with the placeholder ${\tt h}$, the input predicates $\texttt{person/1}$, $\texttt{in0/2}$ and $\texttt{goto/3}$, and the output predicate $\texttt{in/3}$ is a program of this kind. We can read $\texttt{in(P,R,T)}$ as "person $P$ is in room $R$ at time $T$," and $\texttt{goto(P,R,T)}$ as "person $P$ goes to room $R$ between times $T$ and $T+1$." The symbol ${\tt h}$ represents the "horizon"---the length of the scenarios under consideration. The third rule of the program encodes the commonsense law of inertia for this domain, and this is the rule that makes the program nontight: $\texttt{in/3}$ occurs both in the head and in the body of this rule nonnegated.

In the definition of the positive dependency graph below, $[t]$ stands for the set of values of a ground term $t$; for instance, $[\tt{2+2}]=\{{\tt 4}\}$, $[{\tt 2..4}]=\{{\tt 2},{\tt 3},{\tt 4}\}$. The values of a ground term are "precomputed terms." Precise definitions, as well as a description of the syntax of io-programs, can be found in the previous publication on ANTHEM.

A valuation for an io-program $\Omega$ is a function defined on the set of placeholders of $\Omega$ such that its values are precomputed terms different from placeholders. For an io-program $\Omega$ and a valuation $v$, by $\Omega(v)$ we denote the set of rules obtained from the rules of $\Omega$ by replacing every occurrence of every placeholder $t$ by the term $v(t)$. An~input for $\Omega$ is a pair $(v,I)$, where $v$ is a valuation for $\Omega$, and $I$ is a set of precomputed atoms without placeholders, such that the predicate symbol of each atom in $I$ is an input symbol of $\Omega$.

The positive dependency graph of an io-program $\Omega$ for an input $(v,I)$} is the directed graph defined as follows. Its vertices are ground atoms $p(r_1,\dots,r_n)$ such that $p/n$ is an output symbol or a private symbol of $\Omega$, and each $r_i$ is a precomputed term different from the placeholders of $\Omega$. It has an edge from $p(r_1,\dots,r_n)$ to $p'(r'_1,\dots,r'_m)$ iff there exists a ground instance $R$ of one of the rules of $\Omega(v)$ such that

If the positive dependency graph of $\Omega$ on an input $(v,I)$ has no infinite paths then we say that $\Omega$ is locally tight on that input.

In the example above, the vertices of the positive dependency graph for an input $(v,I)$ are atoms $\texttt{in}(p,r,t)$ and $\texttt{in_buildin}g(p,t)$, where $p$, $r$, $t$ are precomputed terms different from ${\tt h}$. Its edges go from $\texttt{in_building}(p,t)$ to $\texttt{in}(p,r,t)$ and, if $v({\tt h})$ is a positive integer, from $\texttt{in}(p,r,i+1)$ to $\texttt{in}(p,r,i)$ for $i=0,\dots,v({\tt h})-1$. This graph has no infinite paths, so that the program is locally tight on all inputs.


  1. Keith Clark (1978): Negation as failure. In: Herve Gallaire & Jack Minker: Logic and Data Bases. Plenum Press, New York, pp. 293--322, doi:10.1007/978-1-4684-3384-5_11.
  2. Jorge Fandinno, Vladimir Lifschitz, Patrick Luhne & Torsten Schaub (2020): Verifying Tight Programs with Anthem and Vampire. Theory and Practice of Logic Programming 20, doi:10.1017/S1471068420000344.
  3. Martin Gebser, Roland Kaminski, Benjamin Kaufmann, Marius Lindauer, Max Ostrowski, Javier Romero, Torsten Schaub & Sven Thiele (2015): Potassco User Guide. Available at
  4. Joohyung Lee & Yunsong Meng (2011): First-order stable model semantics and first-order loop formulas. Journal of Artificial Inteligence Research (JAIR) 42, pp. 125--180, doi:10.5555/2208436.2208441.
  5. Vladimir Lifschitz (2019): Answer Set Programming. Springer, doi:10.1007/978-3-642-30743-0.

Probabilistic Defeasible Logic Programming: Towards Explainable and Tractable Query Answering (Extended Abstract)

Mario A. Leiva (Departamento de Cs. e Ing. de la Computacion, Universidad Nacional del Sur (UNS) and Inst. de Cs. e Ing. de la Computacion (UNS–CONICET), Bahia Blanca, Argentina)
Alejandro J. García (Departamento de Cs. e Ing. de la Computacion, Universidad Nacional del Sur (UNS) and Inst. de Cs. e Ing. de la Computacion (UNS–CONICET), Bahia Blanca, Argentina)
Paulo Shakarian (Cyber Reconnaissance, Inc., Tempe, Arizona, USA)
Gerardo I. Simari (Departamento de Cs. e Ing. de la Computacion, Universidad Nacional del Sur (UNS) and Inst. de Cs. e Ing. de la Computacion (UNS–CONICET), Bahia Blanca, Argentina)

Decision support tools face a variety of challenges, including multiplicity of information sources, heterogeneous format, constant changes, and other characteristics of the domain they model. Handling such challenges requires the ability to analyze and process inconsistent and incomplete information with varying degrees of associated uncertainty. In addition to this, some domains require the system's outputs to be explainable and interpretable---an example of this is cyber threat analysis (CTA) in cybersecurity domains. Due to the nature of these analysis processes, an automated reasoning system with human-in-the-loop capabilities would be best suited for the task. Such a system must be able to accomplish several goals, among which we distinguish the following main capabilities([1]): (i) reason about evidence in a formal, principled manner; (ii) consider evidence associated with probabilistic uncertainty; (iii) consider logical rules that allow for the system to draw conclusions based on certain pieces of evidence and iteratively apply such rules; (iv) consider pieces of information that may not be compatible with each other, deciding which are most relevant; and (v) show the actual status of the system based on the above-described features, and provide the analyst with the ability to understand why an answer is correct, and how the system arrives at that conclusion (i.e., explainability and interpretability).
Based on these capabilities, we work with the DeLP3E framework([1]), which was designed based on the requirements mentioned above. A DeLP3E knowledge base consists of two parts: an analytical model (AM) and an environmental model (EM), which represent different aspects of a domain. The former model contains all the background information and knowledge that is available for analysis: here we can have rules, facts, or presumptions to represent the knowledge of the domain. From this model we can obtain conclusions based on the creation and analysis of arguments using defeasible logic programming([2]). On the other hand, the environmental model is used to describe the background knowledge and is probabilistic in nature. Unlike the AM, this model must be consistent, which simply means that there must exist a probabilistic distribution over the possible states of the domain (worlds) that satisfies all of the constraints in the model, as well as the axioms of probability theory. In general, the EM contains knowledge such as evidence, intelligence reporting, or knowledge about actions, software, and systems. There are thus two kinds of uncertainty to be modeled: probabilistic uncertainty and that arising from defeasible knowledge. DeLP3E allows both to coexist, and combinations of the two since defeasible rules and presumptions (that is, defeasible facts) can also be annotated with probabilistic events.
In this model, to answer a query for a literal we need to compute the probability interval with which it is warranted in the DeLP3E KB---for this, we must sum the probability mass of the worlds where the queried literal is warranted (warranting scenarios, for the lower bound) and the mass worlds whose warrants the complement of the query (for the upper bound). The lower and upper bounds obtained in this manner comprise the probability interval for the query. This is one of the main sources of computational intractability, since we must answer the query either for all the worlds in the EM model or all the programs in the AM model. This computational intractability is the main problem that we address here.
This extended abstract provides an overview of a research project focused on approximate query answering in probabilistic structured argumentation based on DeLP([2]) and probabilistic models to deliver these capabilities. The ultimate goal is to develop a suite of algorithms for tackling the intractability of this task and selection criteria for choosing the best one based on the analysis of available information.

Motivation and Description of the Approach

The characteristics that DeLP3E offers to model reasoning in a specific domain based on the observations of probabilistic events makes it a good choice for developing a system that provides answers accompanied by explanations in complex domains such as those mentioned above. Our goal is to design an effective and efficient tool that allows to perform tasks such as: evaluating the state of the system under a particular set of observed events (evidence), deriving the most probable scenarios based on counterfactuals ("what if" scenarios), and approximating the probability interval associated with a query considering all possible eventualities (possible worlds). These tasks will be supplemented with the capability of understanding how the system reaches that conclusion through explanations based on the AM and EM components.

Sampling-based Approximation

Our main goal is to propose a set of algorithms that take advantage of a variety of sampling-based techniques to approximate the exact probability interval with which a query is entailed. We can consider two types of sampling: world-based and subprogram-based. In world-based sampling, a subset of the possible EM worlds are chosen and, based on the annotation function (which annotates each component of the AM with logical formulas formed by components from the EM), different subprograms of AM are obtained. Given a world, an AM program is induced, which is simply a classical DeLP program([2]) in which we can query for the status of some literal. On the other hand, subprogram-based sampling chooses from the universe of all possible AM subprograms, and each of these programs can be generated by multiple worlds through their annotations. In both cases, we also have those worlds or programs in which the status of the query can be "undecided" or "unknown". By construction, these sampling techniques yield sound results, meaning that the probability intervals obtained are guaranteed to be supersets of the exact answer---given the incomplete nature of the process, some probability mass will in general remain unexplored.

Experimental Approach

As summarized above, different sampling techniques can be proposed, and our hypothesis is that their effectiveness will be directly affected by the different settings that arise in practice. Having empirical results based on the application of different techniques in a variety of such settings would therefore be of great use in designing a query answering algorithm based on choosing the best technique given the current setting.
In order to base the selection of technique on the best available data, we analyzed the information available in each model in order to define a series of metrics that characterize the current configuration. For the input KB, two main attributes were established: size and complexity, which apply to each component: AM, EM, and annotation function. The former defines a quantitative value based on the number elements in the model, while the latter is focused on capturing the intricacy of generate and working with structures in the particular model. Developing a comprehensive set of such metrics allows us to do two things: (i) develop techniques for generating synthetic KBs that fall within specific settings (for instance, simple AM and annotation function, but complex EM); and (ii) evaluate how the possible alternatives for sampling-based approximation algorithms perform based in different settings. This is key in developing decision criteria for selecting the best algorithm for the job, contemplating the tradeoffs between running time (including the cost of calculating any approximate metrics) and precision of the result obtained.

Preliminary Results: First Steps Towards Approximation Algorithms

We carried out a preliminary experimental evaluation with a world-based sampling algorithm and a variety of settings defined according to the values of metrics, focusing for this initial evaluation only on the EM, for which we use Bayesian Networks (BNs). We characterize size via the number of variables (nodes), and in order to gauge the complexity of the underlying distribution, we measure its entropy). All KBs were randomly generated; AMs are built as balanced sets of facts and rules (rule bodies and heads are generated in such a way as to ensure overlap, in order to yield nontrivial arguments), while BNs were randomly generated with a maximum number of edges equal to the number of nodes, thus yielding graphs of low complexity (measured via treewidth). Annotation functions are literals or the constant true, which means that the associated formula always holds. BN nodes varied from 10 to 30, entropy varied from low to high, and #samples varied depending on the setting in a range from 100 to 100K.
Finally, to measure the quality of approximations $[c,d]$ of exact intervals $[a,b]$, we use function $Q([c,d]) = (1 - (b - a)) / (1 - (d-c))$.

Summary of results

As one of our main results, we found that sampling larger sets of worlds leads to higher quality approximations; even though this is of course expected, there are two interesting details here. First, for the 20 EM variable case (1M worlds, the largest instances for which exact values were computable), the quality obtained by 5K vs. 10K world samples was not statistically significant, which means that only 5K samples sufficed to obtain a good approximation. Second, the proportion of repeated samples (which must be discarded, leading to wasted effort) was quite high for both entropy levels; for higher entropy levels, on average 52% of samples were repeated, while for lower entropy an average of 87% were non-unique. For the 20 EM variable case, the quality levels were achieved with only 2,293 and 469 unique samples, respectively. Our study also yielded lower variation in quality when larger sample sizes were used.
Finally, our results showed that the entropy associated with the probability distribution over possible worlds has a large impact on expected solution quality, but in many cases even a modest number of samples suffices to achieve an approximation of relatively good quality.


  1. Paulo Shakarian and Gerardo I. Simari and Geoffrey Moores and Damon Paulo and Simon Parsons and Marcelo A. Falappa and Ashkan Aleali (2015): Belief revision in structured probabilistic argumentation. In: Annals of Mathematics and Artificial Intelligence, Springer Science and Business Media (LLC), volume 78, pp. 259–301, doi:10.1007/s10472-015-9483-5.
  2. Alejandro J. García and Guillermo R. Simari (2004): Defeasible logic programming: an argumentative approach. In: Theory and Practice of Logic Programming, Cambridge University Press (CUP), volume 4, pp. 95–138, doi:10.1017/s1471068403001674.

Unifying Framework for Optimizations in CASP; SMT; ILP (Extended Abstract)

Yuliya Lierler (University of Nebraska Omaha)

Search-optimization problems are plentiful in scientific and engineering domains. Various automated reasoning paradigms provide users with languages supporting optimization statements. Indeed, consider such popular paradigms as integer linear programming (ILP) [4], MaxSAT [5], optimization satisfiability modulo theory (OMT) [6], constraint answer set programming (CASP) [1]. These paradigms allow a user to express ``hard'' and ''soft'' constraints given a problem of interest. Hard part of an encoding for a considered problem is meant to state requirements on what constitutes a solution to this problem. Soft part of the encoding is meant to state optimization criteria based on which we compare resulting solutions and find optimal ones. These paradigms vary significantly in their languages, for example, in ways they express the ``hard constraints'', in ways they express ``soft constraints'', as well as their vocabularies. Indeed, ILP primarily objects are variables over integers, whereas in MaxSAT we are looking at binary variables. Furthermore, in formalisms such as optimizations modulo theory or constraints answer set programming both kinds of variables are allowed together with intricate interface between these.

The relations between many of the enumerated paradigms have been studied in the absence of ``soft constraints.'' Recently, Lierler provided a formal account comparing MaxSAT family and answer set programs with weak constraints (weak constraints are syntactic objects to express soft constraints in logic programs) [3]. In that work, to draw the precise parallel between these frameworks so called abstract modular weight-systems (w-systems) served the role of a primary tool. These systems abstracted away syntactic differences of the paradigms, while leaving the essential semantic ingredients sufficient to introduce a concept of a model and optimization criteria for their comparison. An abstract notion of a logic introduced by Brewka and Eiter [2] is a crucial ingredient of w-systems. This abstract logic may encapsulate languages over binary variables. Hence, w-systems may capture frameworks such as MaxSAT or logic programs with optimizations.

In this work, we extend the concepts of an abstract logic and w-systems to provide us with a framework capable to capture formalisms that utilize distinct kinds of variables in their languages. Then, we show how resulting extended w-systems encapsulate ILP, OMT (in its two common variants), and CASP with optimization statements. We trust that such birds eye view on these distinct paradigms will boost cross-fertilization between approaches used in design of algorithms supporting optimizations in distinct fields. Indeed, Lierler illustrated how MaxSAT solvers can be used to compute optimal answer sets for logic programs with weak constraints by providing theoretical basis for cross-translations between formalisms [3]. This work provides theoretical grounds for devising translations for related optimization statements in CASP and OMT. Thus, we pave the way, for example, for an extension of a constraint answer set solver EZSMT [7]. This solver relies on utilizing satisfiability modulo theory solvers for finding answer sets of a considered CASP program. In the future, this system can utilize OMT solvers to find optimal answer sets of a CASP program.

The work was partially supported by NSF grant 1707371.


  1. Mutsunori Banbara, Benjamin Kaufmann, Max Ostrowski & Torsten Schaub (2017): Clingcon: The next generation. Theory and Practice of Logic Programming 17(4), p. 408461, doi:10.1017/S1471068417000138.
  2. Gerhard Brewka & Thomas Eiter (2007): Equilibria in heterogeneous nonmonotonic multi-context systems. In: Proceedings of National Conference on Artificial Intelligence, AAAI 2007, pp. 385-390.
  3. Yuliya Lierler (2021): An Abstract View on Optimizations in SAT and ASP. In Wolfgang Faber, Gerhard Friedrich, Martin Gebser & Michael Morak, editors: Logics in Artificial Intelligence - 17th European Confer- ence, JELIA 2021, Virtual Event, May 17-20, 2021, Proceedings, Lecture Notes in Computer Science 12678, Springer, pp. 377-392.
  4. Christos Papadimitriou & Kenneth Steiglitz (1982): Combinatorial Optimization: Algorithms and Complexity. 32, doi:10.1109/TASSP.1984.1164450.
  5. Nathan Robinson, Charles Gretton, Duc-Nghia Pham & Abdul Sattar (2010): Cost-Optimal Planning using Weighted MaxSAT. In: ICAPS 2010 Workshop on Constraint Satisfaction Techniques for Planning and Scheduling (COPLAS10).
  6. Roberto Sebastiani & Silvia Tomasi (2012): Optimization in SMT with LA(Q) Cost Functions. In Bernhard Gramlich, Dale Miller & Uli Sattler, editors: Automated Reasoning, Springer Berlin Heidelberg, Berlin, Hei- delberg, pp. 484-498, doi:10.1007/978-3-642-31365-3_38.
  7. Da Shen & Yuliya Lierler (2018): SMT-based Constraint Answer Set Solver EZSMT+ for Non-tight Programs. In: Proceedings of the 16th International Conference on Principles of Knowledge Representation and Reason- ing (KR).

Towards Streams of Events with Temporally-Constrained Effects

Periklis Mantenoglou (NKUA, Greece & NCSR "Demokritos", Greece)
Manolis Pitsikalis (University of Liverpool, UK)
Alexander Artikis (University of Piraeus, Greece & NCSR "Demokritos", Greece)


In many contemporary application domains, data is being generated continuously and in large volumes, resulting in high-velocity data streams, which cannot be stored in memory and processed off-line. Therefore, there is a high demand for stream reasoning systems which perform temporal pattern matching over such data streams efficiently and with minimal latency ([1]). As an example, in the domain of maritime situational awareness, millions of signals are emitted by vessels each day, including information about, e.g., their position, heading and velocity. A stream reasoning system may process these data streams and compute the occurrences of composite activities, such illegal fishing or a rendez-vous between two vessels ([6]).

The specifications of stream reasoning applications often include events with temporally-constrained effects. In e-commerce, e.g., an agent may be suspended, but only temporarily, i.e. the suspension is lifted after a specified time. Moreover, in maritime situational awareness, certain types of fishing activities are predicted to have concluded at a specified time after multiple `change in heading' events from a vessel ([6]). Therefore, stream reasoning often requires the representation and the efficient treatment of the temporally-constrained effects of events. The goal of this work is to extend the stream reasoning system RTEC ([2]) with a mechanism which handles effectively the temporally-constrained effects of events.

The Event Calculus for Run-Time Reasoning

RTEC (or `Event Calculus for Run-Time Reasoning') is a logic programming implementation of the Event Calculus ([4]), optimised for stream reasoning. RTEC comprises events, fluents, i.e., properties which may have different values at different points in time, and a linear time model which includes integer time-points. Moreover, RTEC includes predicates which express event occurrences, as well as their effects on the values of fluents. happensAt(E, T) denotes that event E takes place at time-point T, while initiatedAt(F=V, T) (resp. terminatedAt(F=V, T)) expresses that a time period during which fluent F has the value V is initiated (terminated) at time-point T. Application-specific initiatedAt and terminatedAt rules define the changes in the values of fluents w.r.t. event occurrences, the values of other fluents and, possibly, other (a)temporal constraints. Finally, holdsAt(F=V, T) states that fluent F has the value V at time-point T. Note that a fluent F maintains its value V after the initiation of F=V and until the termination of F=V due to the common-sense law of inertia. Given a set of initiatedAt and terminatedAt rules for a fluent-value pair (FVP) F=V, and a stream of events, RTEC computes the maximal intervals for which F=V holds continuously.

In order to support stream reasoning, RTEC extends the Event Calculus with features which aid computational performance, such as caching and indexing. Processing data streams in windows, in conjunction with a mechanism which discards events prior to the current window, increases efficiency as reasoning time depends on the size of the window and not on the size of the entire stream. Moreover, RTEC employs a caching mechanism to avoid unnecessary re-computations, even in the presence of large knowledge bases. The complexity analysis of RTEC is available in ([2]) while the code is publicly available.

Supporting Events with Temporally-Constrained Effects

RTEC→ is an extension of RTEC which supports events with temporally-constrained effects by means of domain-independent reasoning. In RTEC→, some FVPs of the event description may be subject to a deadline according to which the FVP may terminate at a specified time after its initiation. Moreover, RTEC→ supports an additional form of temporally-constrained effects of events, whereby the deadline of a FVP may be extended. The representation of events with temporaly-constrained effects in RTEC→ is motivated by earlier work on the representation of events/actions with delayed effects ([3]), particularly in the context of the Event Calculus ([5]). In contrast to the literature, we place emphasis on handling efficiently events with temporally-constrained effects, thus supporting streaming applications. A description and experimental evaluation of RTEC→ will be presented in a forthcoming publication.


  1. Elias Alevizos, Alexander Artikis, Nikos Katzouris, Evangelos Michelioudakis & Georgios Paliouras (2018): The Complex Event Recognition Group. In: SIGMOD Rec. 47(2) pp. 61–66, doi:10.1145/3299887.3299899.
  2. Alexander Artikis, Marek Sergot & Georgios Paliouras (2015): An Event Calculus for Event Recognition. In: IEEE Transactions on Knowledge and Data Engineering 27(4) pp. 895–908, doi:10.1109/TKDE.2014.2356476.
  3. Lars Karlsson, Joakim Gustafsson & Patrick Doherty (1998): Delayed Effects of Actions. In: Henri Prade, editor: ECAI, John Wiley and Sons pp. 542–546,
  4. Robert Kowalski & Marek Sergot (1986): A Logic-Based Calculus of Events. In: New Generation Computing 4(1) pp. 67–96, doi:10.1007/BF03037383.
  5. Rob Miller & Murray Shanahan (2002): Some Alternative Formulations of the Event Calculus. In: Computational Logic: Logic Programming and Beyond pp. 452–490, doi:10.1007/3-540-45632-5_17.
  6. Manolis Pitsikalis, Alexander Artikis, Richard Dreo, Cyril Ray, Elena Camossi & Anne-Laure Jousselme (2019): Composite Event Recognition for Maritime Monitoring. In: DEBS, ACM, pp. 163–174, doi:10.1145/3328905.3329762.

Towards Selective and Compact Query Abduction for Existential Rules

Zhe Wang
Peng Xiao
Kewen Wang


Query abduction has been studied for ontology-mediated query answering with expressive ontology languages such as existential rules [1,3,4,2]. A query abduction problem (QAP) [1] is a tuple $\Lambda=(\mathcal{P}, \mathcal{D}, q, \Sigma)$, where $\mathcal{P}$ is a set of existential rules, $\mathcal{D}$ is a dataset, $q$ is a Boolean conjuctive query (BCQ) called the observation, and $\Sigma$ is a set of predicates called the abducibles. An explanation to $\Lambda$ is a finite set of facts $\mathcal{E}$ that may contained labelled nulls such that $\mathsf{sig}(\mathcal{E})\subseteq \Sigma$ and $\mathcal{P}\cup \mathcal{D}\cup \mathcal{E}\models q$.

Different from traditional abduction, query abduction allows place-holders (expressed as nulls) in explanations that can be substituted with constants, which often causes the total number of explanations to be significantly large or even infinite. Consider an example on contact tracing where and ontology $\mathcal{P}$ contains two rules:
\begin{align*} & \mathsf{high\_risk}(x)\leftarrow \mathsf{close\_contact}(x, y), \mathsf{high\_risk}(y). \\ & \mathsf{high\_risk}(x)\leftarrow \mathsf{visit}(x, y), \mathsf{hotspot}(y). \end{align*} And the dataset $\mathcal{D} = \{\mathsf{close\_contact}(John, person_1), \ldots, \mathsf{close\_contact}(John, person_m), \mathsf{hotspot}(area_1), \ldots, \mathsf{hotspot}(area_n)\}$. Now, if we have an observation that John is of high-risk, that is, $q: \mathsf{high\_risk}(John)$. Take $\Sigma = \{\mathsf{high\_risk}, \mathsf{close\_contact}, \mathsf{visit}, \mathsf{hotspot}\}$, and we have the following three types of obvious explanations among others: $\mathcal{E}_{p_i} = \{\mathsf{high\_risk}(person_i) \}$ ($1\le i \le m$), $\mathcal{E}_{a_j} = \{\mathsf{visit}(John, area_i) \}$ ($1\le j\le n$), and $\mathcal{E}_{ap} = \{ \mathsf{visit}(John, u), \mathsf{hotspot}(u) \}$, where $u$ is a labelled null.

We note that $\mathcal{E}_{ap}$ is different from $\mathcal{E}_{p_i}$ and $\mathcal{E}_{a_j}$ in the sense the former essentially represents an abstract pattern of explanations with substitutable values, while the latter are concrete ones referring to specific persons or locations. It is hard to tell in general which kind of explanations would be better. For some abducibles, a user may prefer concrete explanations to abstract ones; for instance, to trace high-risk individuals like in $\mathcal{E}_{p_i}$. For other abducibles, the user may have the opposite preference; for instance, to know John is of high-risk due to visiting some known hotspots expressed as $\mathcal{E}_{ap}$. Thus, in this paper, we propose a general framework of query abduction that allows such preferences over different types of explanations to be specified.

Our Approach

To define a selective notion of explanations, we need some preference relations over QAP explanations. For two sets of facts $\mathcal{E}$ and $\mathcal{E}'$, $\mathcal{E} \preceq_m \mathcal{E}'$ if there exists a renaming of nulls $\sigma$ such that $\mathcal{E} \sigma\subseteq \mathcal{E}'$. $\mathcal{E}\preceq_h\mathcal{E}'$ if there is a substitution $\sigma$ such that $\mathcal{E}\sigma \subseteq \mathcal{E}'$.

To allow fine-grained partitions of abducibles and preference on constants or nulls in each of the parts, we define a selection condition over the abducibles $\Sigma$ to be a tripartition $S=(\Sigma_C,\Sigma_A,\Sigma_M)$ of $\Sigma$, where $\Sigma_C$, $\Sigma_A$ and $\Sigma_M$ are called concrete, abstract and mixed abducibles, respectively. Intuitively, $S$ specifies that for (parts of) explanations on predicates in $\Sigma_C$, concrete constants are preferred over nulls in the explanations; whereas for those on predicates in $\Sigma_A$, it is the other way round, i.e., substitutable nulls are preferred over constants. To achieve this, we define a preference over explanations such that an explanation $\mathcal{E}$ is preferred if nulls in the atoms over $\Sigma_C$ are substituted with constants, whereas nulls are preserved in the atoms over $\Sigma_A$. And on $\Sigma_M$, there is no preference between nulls and constants, and the preference relation coincides with $\preceq_h$. Formally, given a QAP with a dataset $\mathcal{D}$, $\mathcal{E}\preceq_S \mathcal{E}'$ if there exists a substitution $\sigma$ such that (i) $\mathcal{E}|_{\Sigma_C}\subseteq \mathcal{E}'|_{\Sigma_C}\sigma$, (ii) $\mathcal{E}|_{\Sigma_A}\sigma\subseteq \mathcal{E}'|_{\Sigma_A}\cup \mathcal{D} $, and (iii) $\mathcal{E}|_{\Sigma_M}\sigma\subseteq \mathcal{E}'|_{\Sigma_M}$.

Definition 1 Given a QAP $\Lambda$ and a selection condition $S$, a selective explanation $\mathcal{E}$ to $\Lambda$ w.r.t.\ $S$ is an explanation to $\Lambda$ such that

  1. for each explanation $\mathcal{E}'$ to $\Lambda$, if $\mathcal{E}'\preceq_m\mathcal{E}$ then $\mathcal{E}\preceq_m\mathcal{E}'$;
  2. for each explanation $\mathcal{E}'$ to $\Lambda$ satisfying Condition 1, if $\mathcal{E}'\preceq_h\mathcal{E}$ then $\mathcal{E}\preceq_h\mathcal{E}'$;
  3. for each explanation $\mathcal{E}'$ to $\Lambda$ satisfying Conditions 1 and 2, if $\mathcal{E}'\preceq_S\mathcal{E}$ then $\mathcal{E}\preceq_S\mathcal{E}'$.
$\mathsf{exp}_S(\Lambda)$ denotes the set of all selective explanations to $\Lambda$ w.r.t. $S$.

The notion of preferred explanations in [3] only satisfies Conditions~1 and~2, which does not allow users to specific a preference between $\mathcal{E}_{a_j}$ and $\mathcal{E}_{ap}$ in the motivating example. Our definition coincides with that in [3] when $S = (\emptyset,\emptyset,\Sigma)$, and hence is more general. Let $S = (\{\mathsf{high\_risk}, \mathsf{close\_contact}\}, \{\mathsf{visit}, \mathsf{hotspot}\}, \emptyset)$, and $\mathcal{E}_{ap}\preceq_S \mathcal{E}_{a_j}$ based on our definition, whereas the converse does not hold.

We also propose a compact representation for selected explanations using rules. In the motivating example, explanations $\mathcal{E}_{p_i} = \{\mathsf{high\_risk}(person_i)\}$ ($1\le i\le m$) all follow a similar pattern. These explanations can be obtained from one pattern explanation $\mathcal{E}_{pp} = \{\mathsf{close\_contact}(John, u), \mathsf{high\_risk}(u)\}$. And if an instance of the form $\mathsf{close\_contact}(John, a)$ is found in $\mathcal{D}$ for some constant $a$ then $\{\mathsf{high\_risk}(a)\}$ is an explanation. Such a pattern can be captured by a rule $r: \mathsf{high\_risk}(x) \Leftarrow \mathsf{close\_contact}(John, x)$, and explanations $\mathcal{E}_{p_i}$ ($1\le i\le m$) can be derived by applying $r$ to $\mathcal{D}$. Hence, rule $r$ can be seen as a compact representation for them. Note that the compact representations must not be confused with the rules in the ontology. Unlike ontological rules, a compact representation $\mathsf{high\_risk}(x) \Leftarrow \mathsf{close\_contact}(John, x)$ may not hold in general, but is specific to a QAP. It should be understood as that if $\mathsf{close\_contact}(John, a)$ is found in the given dataset for some constant $a$ then $\{\mathsf{high\_risk}(a)\}$ is an explanation.

To compute selective explanations and their compact representations, we present a method based on query rewriting. Given an observation $q$ and an ontology $\mathcal{P}$, $q$ is first-order rewritable by $\mathcal{P}$ if there exists a finite set of BCQs, denoted as $\mathsf{rew}(q,\mathcal{P})$, such that for each dataset $\mathcal{D}$, $\mathcal{P}\cup\mathcal{D}\models q$ if and only if $\mathcal{D}\models q'$ for some BCQ $q'\in \mathsf{rew}(q,\mathcal{P})$. We assume $\mathsf{rew}(q,\mathcal{P})$ is non-redundant, that is, there do not exist two BCQs $q_1, q_2\in \mathsf{rew}(q,\mathcal{P})$ such that $q_1\preceq_h q_2$ and $q_2\not\preceq_h q_1$.

In particular, we consider facts as rules with empty bodies, and for a dataset $\mathcal{D}$, $\mathcal{R}_\mathcal{D}$ denotes the set of rules $\{P(\vec{a}) \leftarrow \;|\; P(\vec{a})\in \mathcal{D}\} $. Given a set $\mathcal{Q}$ of BCQs and a signature $\Sigma$, $\mathcal{Q}|_\Sigma = \{q\in \mathcal{Q} \;|\; \mathsf{sig}(q)\subseteq \Sigma\}$. For a set of solutions $\Xi$ to a QAP and a selection condition $S$, $\min_{\preceq_S}(\Xi)$ consists of all the solutions $\mathcal{E}\in \Xi$ such that for each solution $\mathcal{E}'\in \Xi$ satisfying $\mathcal{E}'\preceq_S \mathcal{E}$, it holds $\mathcal{E}\preceq_S \mathcal{E}'$. We assume a fixed bijective mapping $\rho$ from variables to nulls, which allows us to map a BCQ to a QAP explanation.

Proposition 1 For a QAP $\Lambda=(\mathcal{P},\mathcal{D},q,\Sigma)$, $\mathsf{exp}_S(\Lambda) \equiv \min_{\preceq_S} \big( \mathsf{rew}(q, \mathcal{P} \cup \mathcal{R}_\mathcal{D})|_\Sigma \rho \big).$

The result shows that for first-order rewritable observations and ontologies the computation of selective explanations can utilise an efficient query rewriting system, which can potential scale over large datasets. Furthermore, we show the compact representation of selective explanations (as rules) can be obtained from the BCQs in $\mathsf{rew}(q, \mathcal{P})$.


We have implemented a prototype system for computing selective explanations based on Drewer [5], a rewriting-based query answering system for existential rules, and evaluated the scalability of our system on complex QAPs with large datasets.

In Table 1, for each ontology, we used 5 BCQs as observations. For each QAP evaluated, we compare the numbers of explanations as in [3] (Explanation) and selective explanations, as well as the times (in milliseconds) used for generating them. For selective explanations, we consider two special cases where all abducibles are in $\Sigma_A$ (Abstract) and all of them are in $\Sigma_C$ (Concrete). For the numbers of explanations, we report both the numbers of fact sets (#FSets) and the numbers of rules (#Rules) as the corresponding compact representations. For Abstract, these two numbers coincide.

Table 1: Evaluation on the computed selective explanations (times in milliseconds)
Ontology Query Explanation Absract Concrete
#Rules #FSet Time #FSet Time #Rules #FSet Time
LUBM q1 4 557 323 2 9 2 555 368
q2 5 13597 699 1 51 2 2167 155
q3 12 18871 190 4 0 7 17093 240
q4 10 40158 664 2 963 2 555 712
q5 50 57546 6537 10 36 10 15086 322
Vicodi q1 5 1259 322 3 3 3 1257 91
q2 3 1257 42 1 11 2 1256 10
q3 1 1 0 1 0 1 1 0
q4 189 556596 4478 84 29 116 556060 5216
q5 247 866896 7624 118 95 150 866336 5743
STB-128 q1 9 50306 794 4 3 6 39931 1001
q2 3 9998 66 2 1 2 9997 127
q3 3 10001 114 2 0 2 10000 131
q4 15 80457 725 6 4 10 69963 1056
q5 15 69773 644 6 1 10 69484 731


  1. Diego Calvanese, Magdalena Ortiz, Mantas Simkus & Giorgio Stefanoni (2013): Reasoning about Explanations for Negative Query Answers in DL-Lite. Journal of Artificial Intelligence Research 48, pp. 635–669, doi:10.1613/jair.3870.
  2. İsmail İlkan Ceylan, Thomas Lukasiewicz, Enrico Malizia, Cristian Molinaro & Andrius Vaicenavicius (2020): Explanations for Negative Query Answers under Existential Rules. In: Proceedings of the 17th International Conference on Principles of Knowledge Representation and Reasoning, pp. 223–232, doi:10.24963/kr.2020/23.
  3. Jianfeng Du, Kewen Wang & Yi-Dong Shen (2014): A Tractable Approach to ABox Abduction over Description Logic Ontologies. In: Proceedings of the 28th AAAI Conference on Artificial Intelligence, pp. 1034–1040.
  4. Zhe Wang, Mahsa Chitsaz, Kewen Wang & Jianfeng Du (2015): Towards Scalable and Complete Query Explanation with OWL 2 EL Ontologies. In: Proceedings of the 24th ACM International Conference on Information and Knowledge Management, pp. 743–752, doi:10.1145/2806416.2806547.
  5. Zhe Wang, Peng Xiao, Kewen Wang, Zhiqiang Zhuang & Hai Wan (2020): Query Answering for Existential Rules via Efficient Datalog Rewriting. In: Proceedings of the 29th International Joint Conference on Artificial Intelligence, pp. 1933–1939, doi:10.24963/ijcai.2020/268.

Combining Deep Learning and ASP-based Models for the Semantic Segmentation of Medical Images

Pierangela Bruno (University of Calabria)
Francesco Calimeri (University of Calabria)
Cinzia Marte (University of Calabria)
Marco Manna (University of Calabria)


Automatic segmentation represents a huge breakthrough in computer aided diagnosis and medicine, thanks to its ability in extracting and providing important information useful to clinicians for interventional and diagnostic tasks. Several approaches based on Deep Learning (DL), such as Convolutional Neural Networks, have been proposed to identify anatomical and pathological structures, and to extract hidden patterns from huge amounts of data; they already proved to be suitable for learning without human supervision; however, drive the decisions of the network according to prior knowledge is still a challenging issue, as well as interpreting the choices made by the models.

In this work we propose the use of deductive rule-based approaches, such as Answer Set Programming (ASP) to drive DL approaches in performing semantic segmentation of medical images. Specifically, we encoded some available prior medical knowledge via ASP, thus defining a rule-based model for deducting all admitted combinations of classes and right locations in medical images. We make use of the inferred knowledge to: (i) define a novel loss function which includes penalty for misclassified elements identified by the network, and (ii) perform post-processing to remove small islands of noise and identified classes which do not comply with medical requirements; also, we re-assign misclassified elements to the more frequent class in the neighborhood.

We evaluated our approach using different artificial neural networks trained for automatic semantic segmentation based on Laryngeal Endoscopic Images; the resulting framework relies on ASP programs to include structural and medical properties in DL-based techniques, paving the way to an effective combination of deductive and inductive methods.


Semantic image segmentation, also defined as pixel-level classification, refers to the task of segmenting an image into regions corresponding to meaningful objects and then assigning them an object category label [5, 9]. Notably, in medical contexts, semantic segmentation of images can be extremely useful to support clinicians in providing proper diagnosis, identifying pathological conditions and highlighting image regions related to specific disease. In recent decades, Deep Learning (DL)-based approaches have shown a great ability in extracting meaningful information from different types of images (e.g., computed tomography, magnetic resonance imaging, endoscopic imaging). These approaches have showed to be suitable to perform segmentation [1, 7, 11] and semantic segmentation [4, 8, 12] of medical images and, in general, for supporting automated diagnosis, surgical scene understanding and computer-assisted interventions [10]. Among several applications, DL-based approaches are used to support clinicians in confirming the size of tumors, identifying lesion site and quantitatively evaluating the effect before and after treatments [6].

However, DL-based approaches show some limitations such as (i) provide clear interpretations and explanations of the decisions made by the network, and (ii) drive the decisions according to prior knowledge, thus affecting successful deployment in real-life experiments.

We propose the use of Answer Set Programming (ASP) [2] to steer neural networks decisions and refine the predicted output with the final aim of overcoming such limitations. Specifically, we create a rule-based model by encoding prior medical knowledge to compute all the admitted combinations of classes and, for each class, identify the wrong pixel location in medical images.

Proposed Approach

The proposed approach requires to face three main challenges: (i) the design of a model based on knowledge representation for describing domain medical knowledge, $(ii)$ the design of a standard methodology to convert network prediction into logical rules over the data model mentioned above, $(iii)$ a proper interpretation of the output of ASP and its conversion into values understandable by the network, to determine the loss function in real-time. Figure 1 shows the workflow of the proposed approach, which aims to:

Figure 1: Workflow of the proposed framework. Laryngeal endoscopic images are used to train three different neural networks. The training phase is supported by ASP-based model through loss function and the predicted output is refined by rule-based post processing.

Results and Conclusion

We implemented our deductive approach into the ASP system DLV, in particular into its grounding subsystem I-DLV [3]. We tested our approach using different artificial neural networks (i.e., DeepLab-v3, SegNet, U-Net) for performing semantic segmentation of Laryngeal Endoscopic Images [4]1. First results are promising: not only showed slight improvements (according to Intersection-over-Union metric), but proved the flexibility of the presented approach, that eases the “incorporation” of explicit additional domain knowledge into the model. As future work is concerned, we aim to investigate misclassification errors and improve the generalization capability of the model, as well as the overall performance.


  1. P. Bruno, P. Zaffino, Salvatore Scaramuzzino, S. De Rosa, C. Indolfi, F. Calimeri & M. F. Spadea (2018): Using cnns for designing and implementing an automatic vascular segmentation method of biomedical images. In: International Conference of the Italian Association for Artificial Intelligence, Springer, pp. 60-70, doi:10.1007/978-3-030-03840-3_5.
  2. F. Calimeri, W. Faber, M. Gebser, G. Ianni, R. Kaminski, T. Krennwallner, N. Leone, M. Maratea, F. Ricca & T. Schaub (2020): ASP-Core-2 Input Language Format. Theory Pract. Log. Program. 20(2), pp. 294-309, doi:10.1017/S1471068419000450.
  3. F. Calimeri, D. Fuscà, S. Perri & J. Zangari (2017): I-DLV: the new intelligent grounder of DLV. Intelligenza Artificiale 11(1), pp. 5-20, doi:10.3233/IA-170104.
  4. M.-H. Laves, J. Bicker, L. A Kahrs & T. Ortmaier (2019): A dataset of laryngeal endoscopic images with comparative study on convolution neural network-based semantic segmentation. International journal of computer assisted radiology and surgery 14(3), pp. 483-492, doi:10.1007/s11548-018-01910-0.
  5. H. Li, J. Cai, T. N. A. Nguyen & J. Zheng (2013): A benchmark for semantic image segmentation. In: 2013 IEEE International Conference on Multimedia and Expo (ICME), IEEE, pp. 1-6, doi:10.1109/ICME.2013.6607512.
  6. X. Liu, L. Song, S. Liu & Y. Zhang (2021): A Review of Deep-Learning-Based Medical Image Segmentation Methods. Sustainability 13(3), p. 1224, doi: 10.3390/su13031224.
  7. A. Paderno, C. Piazza, F. Del Bon, D. Lancini, S. Tanagli, Alberto Deganello, G. Peretti, E. De Momi, I. Patrini, M. Ruperti, L. S. Mattos & S. Moccia. (2021): Deep learning for automatic segmentation of oral and oropharyngeal cancer using Narrow Band Imaging: Preliminary experience in a clinical perspective. Frontiers in Oncology 11, p. 934, doi: 10.3389/fonc.2021.626602.
  8. M. Rezaei, H. Yang & C. Meinel (2020): Recurrent generative adversarial network for learning imbalanced medical image semantic segmentation. Multimedia Tools and Applications 79(21), pp. 15329-15348, doi:10.1007/s11042-019-7305-1.
  9. J. Shotton, P. Kohli & K. Ikeuchi (2014): Semantic Image Segmentation. In: Computer Vision, A Reference Guide, pp. 713-716, doi:10.1007/978-0-387-31439-6 251.
  10. S. A. Taghanaki, K. Abhishek, J. P. Cohen, J. Cohen-Adad & G. Hamarneh (2021): Deep semantic segmentation of natural and medical images: a review. Artificial Intelligence Review 54(1), pp. 137-178, doi:10.1007/s10462-020-09854-1.
  11. E. Tappeiner, S. Pröll, M. Hönig, P. F. Raudaschl, P. Zaffino, M. F. Spadea, G. C. Sharp, R. Schubert & K. Fritscher (2019): Multi-organ segmentation of the head and neck area: an efficient hierarchical neural networks approach. International journal of computer assisted radiology and surgery 14(5), pp. 745-754, doi:10.1007/s11548-019-01922-4.
  12. J. Xu, Z. Zhang, T. Friedman, Y. Liang & G. Broeck (2018): A semantic loss function for deep learning with symbolic knowledge. In: International conference on machine learning, PMLR, pp. 5502-5511.

Stable Marriage Problems with Ties and Incomplete Preferences: An Empirical Study

Selin Eyupoglu
Muge Fidan
Yavuz Gulesen
Ilayda Begum Izci
Berkan Teber
Baturay Yilmaz
Ahmet Alkan
Esra Erdem

We study a variation of the Stable Marriage problem, where every man and every woman express their preferences as preference lists which may be incomplete and contain ties. This problem is called the Stable Marriage problem with Ties and Incomplete preferences (SMTI). We consider three optimization variants of SMTI, Max Cardinality, Sex-Equal and Egalitarian, and empirically compare the following methods to solve them: Answer Set Programming, Constraint Programming, Integer Linear Programming. For Max Cardinality, we compare these methods with Local Search methods as well. We also empirically compare Answer Set Programming with Propositional Satisfiability, for SMTI instances.

Matching problems have been studied in economics, starting with the seminal paper of Gale and Shapley [3], which has led to a Nobel Prize in 2012, utilizing game theory methods with the goal of a mechanism design. Matching problems are about markets where individuals are matched with individuals, firms, or items, typically across two sides. In each problem, preferences of individuals, firms, or items are given, possibly along with other information [2,1].

One of the well-known matching problems is the Stable Marriage Problem (SM). In SM, for a set of $n$ men and $n$ women, we are given the preferences of individuals: for each man (resp. woman), a complete ranking of the women (resp. the men) is specified as preferred partners. The goal is to marry all men and women (i.e., to find $n$ couples) in such a way that marriages are stable: no man and woman in different couples prefer each other to their partners.

We consider a variant of SM, called SMTI, where rankings may be incomplete (i.e., some partners are not acceptable) or may include ties (i.e., some partners are preferred equally). We investigate three hard variants of SMTI [10,14], that aim to compute optimal stable matchings with respect to different measures of fairness: sex-equality (preferences of men and women are considered to be equally important), egalitarian (preferences of every individual are considered to be equally important), maximum cardinality (minimizes the number of singles).

We present a variety of methods to solve these problems, using Answer Set Programming (ASP) [15,16,12], Integer Linear Programming (ILP) [9], Constraint Programming (CP) [8], and Local Search (including Hill-Climbing [13] and Genetic Algorithms [7].

The ASP formulations of SMTI and its hard variants (Sex-Equal SMTI, Egalitarian SMTI, Max Cardinality SMTI) are novel; they are implemented for the ASP solver CLINGO [4].

We consider the ILP formulation of Max Cardinality SMTI, by Kwanashie and Manlove [11] as a basis, and introduce the ILP formulations for Sex-Equal SMTI and Egalitarian SMTI; they are implemented for Gurobi and Google-OR Tools (MIP and CP).

We consider the local search algorithms introduced by Gelain et al. [5] and Haas et al. [6] for Max Cardinality SMTI, and implement them with slight variations.

We compare these methods empirically over a large set of randomly generated instances. We believe that comparing different (but closely related) methods to solve hard problems is valuable to better understand their strengths.


  1. Ahmet Alkan & David Gale (2003): Stable schedule matching under revealed preference. Journal of Economic Theory 112(2), pp. 289–306, doi:10.1016/S0022-0531(03)00096-6.
  2. Ahmet Alkan & Herve Moulin (2003): Mathematical theories of allocation of discrete resources: equilibria, matchings, mechanisms. Elsevier.
  3. D. Gale & L. S. Shapley (1962): College Admissions and the Stability of Marriage. The American Mathematical Monthly 69(1), pp. 9–15, doi:10.1080/00029890.1962.11989827.
  4. Martin Gebser, Roland Kaminski, Benjamin Kaufmann & Torsten Schaub (2019): Multi-shot ASP solving with clingo. Theory Pract. Log. Program. 19(1), pp. 27–82, doi:10.1017/S1471068418000054.
  5. Mirco Gelain, Maria Silvia Pini, Francesca Rossi, K. Brent Venable & Toby Walsh (2013): Local Search Approaches in Stable Matching Problems. Algorithms 6(4), pp. 591–617, doi:10.3390/a6040591.
  6. Christian Haas (2020): Two-Sided Matching with Indifferences: Using Heuristics to Improve Properties of Stable Matchings. Computational Economics 57, doi:10.1007/s10614-020-10006-4.
  7. John H. Holland (1992): Adaptation in Natural and Artificial Systems: An Introductory Analysis with Applications to Biology, Control, and Artificial Intelligence. The MIT Press, doi:10.7551/mitpress/1090.001.0001.
  8. J. Jaffar & J.-L. Lassez (1987): Constraint Logic Programming. In: Proceedings of the 14th ACM SIGACT-SIGPLAN Symposium on Principles of Programming Languages, Association for Computing Machinery, New York, NY, USA, pp. 111–119, doi:10.1145/41625.41635.
  9. L. V. Kantorovich (1960): Mathematical Methods of Organizing and Planning Production. Manage. Sci. 6(4), p. 366–422, doi:10.1287/mnsc.6.4.366.
  10. Akiko Kato (1993): Complexity of the sex-equal stable marriage problem. In: Japan Journal of Industrial and Applied Mathematics 10(1), pp. 1–19, doi:10.1007/BF03167200.
  11. Augustine Kwanashie & David F. Manlove (2014): An Integer Programming Approach to the Hospitals/Residents Problem with Ties. In: Operations Research Proceedings 2013, Springer International Publishing, Cham, pp. 263–269, doi:10.1007/978-3-319-07001-8_36.
  12. Vladimir Lifschitz (2002): Answer set programming and plan generation. Artificial Intelligence 138(1), pp. 39–54 doi:10.1016/S0004-3702(02)00186-8.
  13. S. Lin & B. W. Kernighan (1973): An Effective Heuristic Algorithm for the Traveling-Salesman Problem. Oper. Res. 21(2), pp. 498–516, doi:10.1287/opre.21.2.498.
  14. David F Manlove, Robert W Irving, Kazuo Iwama, Shuichi Miyazaki & Yasufumi Morita (2002): Hard variants of stable marriage. Theoretical Computer Science 276(1), pp. 261–279, doi:10.1016/S0304-3975(01)00206-7.
  15. Victor W. Marek & Miroslaw Truszczynski (1999): Stable Models and an Alternative Logic Programming Paradigm, pp. 375–398, Springer, Berlin, Heidelberg, doi:10.1007/978-3-642-60085-2_17.
  16. Ilkka Niemelae (1999): Logic programs with stable model semantics as a constraint programming paradigm. Annals of Mathematics and Artificial Intelligence 25(3), pp. 241–273, doi:10.1023/A:1018930122475.

Summary of Semantics for Hybrid Probabilistic Logic Programs with Function Symbols

Damiano Azzolini
Fabrizio Riguzzi
Evelina Lamma


The aim of Probabilistic Logic Programming is to extend the expressiveness of Logic Programming by adding the possibility to manage uncertainty over the data with the introduction of probabilistic facts representing discrete random variables. Some years ago, to manage also continuous random variables, hybrid programs were proposed, but the semantics was imprecise. In this paper, we present a formal definition of a semantics that assigns a probability value to all queries for programs with a two-valued Well-Founded model. This paper is a summary of ([1]) .


Probabilistic Logic Programs (PLPs) usually support only discrete probabilistic facts (i.e., facts that can be true or false with a certain probability) representing Bernoulli random variables. However, many models of real world tasks also require managing continuous values. Hybrid Probabilistic Logic Programs ([1,6]) extend traditional PLPs with the introduction of continuous random variables (rvs). The resulting probability space, defined as the product of the probability spaces of discrete and continuous rvs, is usually infinite. Furthermore, even in programs with only discrete probabilistic facts, the number of variables may be infinite (for example, when there is at least one function symbol and one constant). When function symbols, continuous random variables, and constraints are combined, the definition of a well-defined semantics is crucial to assign a probability value to queries.

We consider the probability space induced by the program as the product of the spaces of discrete and continuous random variables. Then, for every sample taken from the sample space for the whole program, a ground normal program is defined, called a world. If each world has a two-valued Well-Founded model, we call the probabilistic program sound. We prove that every sound program is well-defined (each query has an assigned probability). If the program fails to have all worlds with a two-valued Well-Founded model, other semantics must be used ([2]).

During the years, several semantics for programs with both discrete and continuous random variables have been proposed, none of them managing function symbols. Hybrid ProbLog ([3]) was one of the first languages that allowed the definition of a finite set of continuous probabilistic facts. Similarly, continuous distributions are supported by Distributional Clauses (DC) ([4]) but negation in the body of rules is not allowed: this limitation is no more present in HAL-ProbLog ([8]), one of its extension. The same happens with Extended PRISM ([5]). Finally, the semantics of Probabilistic Constraint Logic Programs ([7]) constrain the sample space of the whole program to be countable, a situation that may be violated when there is at least one constant and a function symbol, as explained before.

For example, consider a game where a player needs to pick a card from a deck and spin a wheel. The card can be either blue or red and it is reinserted in the deck after every round. The game continues until the player does not pick a red card and the axis of the wheel is between 0 and $\pi$. In this simple example, there are both discrete (color of card) and continuous (position of the axis of the wheel) random variables. We may be interested in computing the probability that the player draws at least one time, or that he/she never draws a red card: to compute the probability of these two queries, we need to consider an infinite number of trials. The following program models the aforementioned scenario:
1/2 :: blue(X).
angle(_,X) : uniform_dens(X,0,6.28).
pick(0,blue) :- blue(0), angle(0,V), V > 3.14.
pick(0,red) :- \+ blue(0), angle(0,V), V > 3.14.
pick(s(X),blue):- \+ pick(X,red), angle(X,V), V > 3.14, blue(s(X)), angle(s(X),V), V > 3.14.
pick(s(X),red):- \+ pick(X,red), angle(X,V), V > 3.14, \+ blue(s(X)), angle(s(X),V), V > 3.14.

at_least_once_red :- pick(_,red).
never_red :- \+ at_least_once_red.
Both queries at_least_once_red and never_red have and infinite number of groundings, since the anonymous variable _ is unified iteratively with 0, s(0), s(s(0)), .... To compute its probability we need to consider, for example, mutually disjoint covering sets of worlds. See ([1]) for further details.


  1. Damiano Azzolini, Fabrizio Riguzzi & Evelina Lamma (2021): A Semantics for Hybrid Probabilistic Logic Programs with Function Symbols. Artificial Intelligence 294, p. 103452, doi: 10.1016/j.artint.2021.103452.
  2. Fabio Gagliardi Cozman & Denis Deratani Mauá (2020): The joy of Probabilistic Answer Set Programming: Semantics, complexity, expressivity, inference. International Journal of Approximate Reasoning 125, pp. 218-239, doi:10.1016/j.ijar.2020.07.004.
  3. Bernd Gutmann, Manfred Jaeger & Luc De Raedt (2011): Extending ProbLog with Continuous Distributions. In Paolo Frasconi & Francesca A. Lisi, editors: 20th International Conference on Inductive Logic Program-ming (ILP 2010), LNCS6489, Springer, pp. 76-91, doi:10.1007/978-3-642-21295-6_12.
  4. Bernd Gutmann, Ingo Thon, Angelika Kimmig, Maurice Bruynooghe & Luc De Raedt (2011): The magicof logical inference in probabilistic programming. Theory and Practice of Logic Programming 11(4-5), pp.663-680, doi:10.1017/S1471068411000238.
  5. Muhammad Asiful Islam, CR Ramakrishnan & IV Ramakrishnan (2012): Inference in probabilistic logic programs with continuous random variables. Theory and Practice of Logic Programming 12, pp. 505-523, doi:10.1017/S1471068412000154.
  6. S Michels (2016): Hybrid Probabilistic Logics: Theoretical Aspects, Algorithms and Experiments. Ph.D.thesis, Radboud University Nijmegen.
  7. Steffen Michels, Arjen Hommersom, Peter J. F. Lucas & Marina Velikova (2015): A new probabilistic constraint logic programming language based on a generalised distribution semantics. Artificial Intelligence 228, pp. 1-44, doi: 10.1016/j.artint.2015.06.008.
  8. Pedro Zuidberg Dos Martires, Anton Dries & Luc De Raedt (2018): Knowledge Compilation with ContinuousRandom Variables and its Application in Hybrid Probabilistic Logic Programming. CoRRabs/1807.00614

Towards Solving Path Planning in Keyhole Neurosurgery with Answer Set Programming

Valentina Corbetta (Politecnico di Milano)
Alice Segato (Politecnico di Milano)
Jessica Zangari (Università della Calabria)
Simona Perri (Università della Calabria)
Francesco Calimeri (Università della Calabria)
Elena De Momi (Politecnico di Milano)

Abstract. Keyhole neurosurgery is one of the most hazardous procedures, due to the complexity of the brain environment and the high density of vital structures. Complying with the kinematic constraints of the probe selected to perform the procedure and of the preferences dictated by surgeons' experience are essential to find the safest path to the surgical target. This work presents and optimisation and classification strategy for neurosurgical interventions. The framework relies on Answer Set Programming to translate the requirements and the expert's knowledge into the objectives of the optimisation procedure. The semantics of Answer Set Programming grants extensive flexibility, as it allows to easily change the requirements to optimise and their priority based on the specific needs of the clinical case. (This work appeared at ICRA 2021)

Introduction. Keyhole Neurosurgery (KN) has become the gold standard in brain procedures, as it allows to access the brain via a small hole on the skull, minimising trauma [6] Paramount to the success is an accurate and precise planning of the trajectory the probe has to follow to reach the Target Structure (TS) deep inside the brain. In this context, it is important to identify and comply to precise requirements, some strictly mandatory and others defined as "soft" constraints. The first ones must be fulfilled, and are strictly related to the respect of the kinematic constraints of the selected probe: for the trajectory to be feasible, it should not surpass the maximum curvature the needle can perform; moreover, the path cannot be chosen if it approaches the delicate structures at a minimum distance that is smaller than the radius of the needle. Soft constraints are instead dictated by implicit and explicit desiderata that guide the decision-making process of the neurosurgeon. These are used to express preferences, that can vary from procedure to procedure, and even from patient to patient [2] Generally, they count minimisation of the path length to minimise risks in the motion of the needle, maximisation of the distance from obstacles to mitigate the damage of possible mistakes in the motion of the needle, minimisation of the curvature performed by the needle to have a smoother path that facilitates the control of the probe.

Given these premises, the attempt of fulfilling these requirements can be seen as an optimisation problem, where soft constraints are the objectives. Classical methods, like graph- and sampling-based techniques [5,7] or learning-based approaches [8] generate a raw path that is then input of the optimisation phase; the desiderata are translated into numerical constraints via cost functions. This standard optimisation approach presents several limitations when applied to KN. Indeed, the transposition of the preferences dictated by the clinician into ad hoc cost functions requires specific mathematical and programming skills together with several hours of coding to implement them. Therefore, it is not possible to immediately implement new requirements. This lack of flexibility and the impossibility of changing them and adapting them real-time during the pre-operative phase hinders their validity as optimisation techniques for KN.

Proposal. Interestingly, deductive reasoning, and in particular Answer Set Programming (ASP), can provide a valid alternative to overcome the drawbacks of standard optimisation approaches in the scenarios herein discussed. ASP is a declerative logic formalism that encodes computational problems via logic programs [1,3]. Indeed, its semantics allows to explicitly represent domain knowledge that can be used to intuitively implement the constraints of the complex brain environment and the surgeon's preferences. We herein present an optimisation and classification strategy that exploits the flexible semantics of ASP to find the optimal curvilinear trajectory in the pre-operative phase. The strategy takes in input not only the raw trajectory, but also the priority associated to each optimisation objective that can differ from case to case. Moreover, we show how the optimisation and classification techniques have been integrated in a surgical simulator developed in Unity [4] to intuitively guide the neurosurgeon through all the steps of the decision making process and easily visualise the result of the planning. Experiments show the effectiveness and robustness of our approach.


  1. Gerhard Brewka, Thomas Eiter, Miroslaw Truszczynski (2011): Answer set programming at a glance. In: Communications of the ACM54(12), pp. 92-103, doi:10.1145/2043174.2043195.
  2. Caroline Essert, Claire Haegelen, Florent Lalys, Alexandre Abadie, Pierre Jannin (2012): Automatic computation of electrode trajectories for deep brain stimulation: a hybrid symbolic and numerical approach. In: Int. J. of Computer Assisted Radiology and Surgery7(4), pp. 517-532, doi:10.1007/s11548-011-0651-8.
  3. Michael Gelfond, Vladimir Lifschitz (1991): Classical negation in logic programs and disjunctive databases. In: New generation computing9(3-4), pp. 365-385, doi:10.1007/BF03037169.
  4. Will Goldstone (2009): Unity game development essentials. Packt Publishing Ltd.
  5. Maxim Likhachev, David I. Ferguson, Geoffrey J. Gordon, Anthony Stentz, Sebastian Thrun (2005): Anytime Dynamic A*: An Anytime, Replanning Algorithm. In: Proceedings of 15th International Conference on Automated Planning and Scheduling (ICAPS), pp. 262-271.
  6. Tao Liu, Yonghang Tai, Chengming Zhao, Lei Wei, Jun Zhang, Junjun Pan, Junsheng Shi (2020): Augmented reality in neurosurgical navigation: A survey. In: The International Journal of Medical Robotics and ComputerAssisted Surgery, p. e2160, doi:10.1002/rcs.2160.
  7. Sachin Patil, Ron Alterovitz (2010): Interactive motion planning for steerable needles in 3D environ-ments with obstacles.. In: 3rd IEEE RAS and EMBS International Conference on Biomedical Robotics and Biomechatronics, BioRob 2010, pp. 893-899, doi:10.1109/BIOROB.2010.5625965.
  8. Alice Segato, Luca Sestini, Antonella Castellano, Elena De Momi (2020): GA3C Reinforcement Learningfor Surgical Steerable Catheter Path Planning. In: IEEE International Conference on Robotics andAutomation (ICRA 2020), IEEE, pp. 2429-2435, doi:10.1109/ICRA40945.2020.9196954.

Extended Abstract: Non-monotonic Logical Reasoning and Deep Learning for Transparent Decision Making in Robotics

Tiago Mota (The University of Auckland, NZ)
Mohan Sridharan (University of Birmingham, UK)
Ales Leonardis (University of Birmingham, UK)

This abstract summarizes an architecture that enables a robot to provide on-demand explanations of its decisions and beliefs ([1]). These explanations are in the form of descriptions comprising relations between relevant domain objects, object attributes, robot attributes, and robot actions. Such ``explainability'' will improve the underlying algorithms, establish accountability, and support more effective human-robot collaboration. However, state of the art robot architectures often include knowledge-based reasoning methods (e.g., for planning) and data-driven learning methods (e.g., for recognizing objects). Providing transparency is challenging in such \emph{integrated robot systems} because the robot has to sense and interact with the physical world, reason with different descriptions of knowledge and uncertainty (e.g., logic-based descriptions of commonsense domain knowledge, probabilistic uncertainty quantification), and incrementally revise its domain knowledge (e.g., axioms governing action effects).

Towards achieving transparency in integrated robot systems, our architecture builds on cognitive systems research that indicates the benefits of formally coupling different representations, reasoning methods, and learning methods. Specifically, it supports the following key capabilities:

These capabilities are evaluated in simulation and on a robot: (i) computing and executing plans to achieve object configurations; and (ii) estimating occlusion and stability of objects.

The figure above provides an overview of the architecture. Answer Set Prolog (ASP) is used to encode incomplete commonsense domain knowledge that includes some object attributes, spatial relations between objects; domain attributes; features from images of scenes; and axioms governing domain dynamics. The robot performs non-monotonic logical reasoning with this knowledge to compute plans to achieve any given goal and/or to complete the estimation tasks, using probabilistic reasoning when necessary. If the robot is unsuccessful or achieves an incorrect outcome, this is considered to indicate missing or incorrect knowledge. The robot automatically identifies and uses regions of interest (ROIs) in the relevant images to train and use deep networks to perform these tasks. Information from the ROIs is also used to induce previously unknown axioms and revise existing axioms. The robot also parses the human input to identify the query type (e.g., descriptive, contrastive, counterfactual), and to trace relevant beliefs and axioms to construct relational descriptions that respond to these queries. Experimental results indicate the ability to: (i) make decisions reliably and efficiently despite incomplete knowledge and noisy sensor inputs; (ii) incrementally learn previously unknown constraints, and preconditions and effects of actions; and (iii) accurately explain decisions and beliefs.

Example scenario

As an example, consider the example scene shown above. The following interaction takes place after the robot has executed a plan to successfully move the red cube on the orange cube.


  1. Tiago Mota, Mohan Sridharan, and Ales Leonardis (2021): Integrated Commonsense Reasoning and Deep Learning for Transparent Decision Making in Robotics. In: Springer Nature Computer Science, 2(242), pp. 1 – 18, doi:10.1007/s42979-021-00573-0.