Published: 19th September 2020 DOI: 10.4204/EPTCS.325 ISSN: 2075-2180 |
This volume contains the Technical Communications and the Doctoral Consortium papers of the 36th International Conference on Logic Programming (ICLP 2020), held virtually in Rende (CS), Italy, from September 20th to 25th, 2020. This is the first time that ICLP is run remotely together with all co-located events due to the COVID pandemic.
Since the first conference held in Marseille in 1982, ICLP has been the premier international event for presenting research in logic programming. The scope of the conference covers all areas of logic programming including, but not restricted to:
Besides the main track, ICLP 2020 included the following additional tracks and special sessions:
Applications Track: This track invites 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.
Sister Conferences and Journal Presentation Track: This track provides a forum to discuss important results related to logic programming that appeared recently (from January 2018 onwards) in selective journals and conferences but have not been previously presented at ICLP.
Research Challenges in Logic Programming Track: This track invites submissions of papers describing research challenges that an individual researcher or a research group is currently attacking. The goal of the track is to promote discussions, exchange of ideas, and possibly stimulate new collaborations. Papers submitted to this track do not go through the usual review and will not be published in the proceedings they will be distributed at the conference as a technical report.
Special Session. Women in Logic Programming: This track aims to increase the visibility and impact of women in LP. It invites submissions of papers in all areas of logic programming co-authored by at least one woman and includes invited talks and presentations by women in logic programming.
The organizers of ICLP 2020 were:
General ChairsThree kinds of submissions were accepted:
ICLP implemented the hybrid publication model used in all recent editions of the conference, with journal papers and Technical Communications (TCs), following a decision made in 2010 by the Association for Logic Programming. Papers of the highest quality were selected to be published as rapid publications in this special issue of TPLP. The TCs comprise papers which the Program Committee (PC) judged of good quality but not yet of the standard required to be accepted and published in TPLP as well as extended abstracts from the different tracks and dissertation project descriptions stemming from the Doctoral Program (DP) held with ICLP.
We have received 88 submissions of abstracts, of which 77 resulted in paper submissions, distributed as follows: ICLP main track (53), Applications track (7 full papers and 1 short papers), Sister Conferences and Journal Presentation track (6), Women in Logic Programming session (5 full papers and 3 short papers) and Research Challenge Track (2 short papers). The Program Chairs organized the refereeing process, which was undertaken by the PC with the support of external reviewers. Each technical paper was reviewed by at least three referees who provided detailed written evaluations. This yielded submissions short-listed as candidates for rapid communication. 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. Of these candidates papers, 27 were accepted as rapid communications, to appear in the special issue. In addition, the PC recommended 40 papers to be accepted as technical communications, to appear at Electronic Proceedings in Theoretical Computer Science (EPTCS) either as full papers or extended abstracts, of which 38 were also presented at the conference (2 were withdrawn).
We are deeply indebted to the Program Committee members and external reviewers, as the conference would not have been possible without their dedicated, enthusiastic and outstanding work. The Program Committee members of ICLP 2020 were:
Mario Alviano | Michael Gelfond | Ricardo Rocha |
Nicos Angelopoulos | Laura Giordano | Chiaki Sakama |
Marcello Balduccini | Gopal Gupta | Torsten Schaub |
Mutsunori Banbara | Michael Hanus | Konstantin Schekotihin |
Chitta Baral | Manuel V. Hermenegildo | Tom Schrijvers |
Roman Barták | Katsumi Inoue | Guillermo R. Simari |
Christoph Benzmüller | Tomi Janhunen | Tran Cao Son |
Alex Brik | Jianmin Ji | Mohan Sridharan |
François Bry | Nikos Katzouris | Theresa Swift |
Pedro Cabalar | Michael Kifer | Paul Tarau |
Francesco Calimeri | Zeynep Kiziltan | Hans Tompits |
Manuel Carro | Ekaterina Komendantskaya | Francesca Toni |
Angelos Charalambidis | Evelina Lamma | Irina Trubitsyna |
Michael Codish | Michael Leuschel | Mirek Truszczynski |
Stefania Costantini | Vladimir Lifschitz | German Vidal |
Marc Denecker | Francesca Alessandra Lisi | Alicia Villanueva |
Martín Diéguez | Yanhong A. Liu | David Warren |
Carmine Dodaro | Marco Maratea | Jan Wielemaker |
Agostino Dovier | Viviana Mascardi | Stefan Woltran |
Thomas Eiter | Yunsong Meng | Jia-Huai You |
Wolfgang Faber | Emilia Oikarinen | Shiqi Zhang |
Thom Fruehwirth | Magdalena Ortiz | Neng-Fa Zhou |
Marco Gavanelli | Simona Perri | |
Martin Gebser | Enrico Pontelli |
The Program Committee members of the Applications track were:
Nicos Angelopoulos | Gopal Gupta | Mohan Sridharan |
Chitta Baral | Jianmin Ji | Paul Tarau |
Alex Brik | Nikos Katzouris | David Warren |
François Bry | Zeynep Kiziltan | Jan Wielemaker |
Francesco Calimeri | Marco Maratea | Shiqi Zhang |
Angelos Charalambidis | Yunsong Meng | Neng-Fa Zhou |
Martín Diéguez | Konstantin Schekotihin | |
Martin Gebser | Tom Schrijvers |
The external reviewers were:
Gianvincenzo Alfano | Rafael Kiesel | Francesco Parisi |
Elena Bellodi | Vladimir Komendantskiy | Sascha Rechenberger |
Pierre Carbonnelle | François Laferriere | Javier Romero |
Matthew Castellana | Pedro Lopez-Garcia | Elmer Salazar |
Wolfgang Dvořák | Julio Mariño | Mantas Simkus |
Serdar Erbatur | Elena Mastria | Takehide Soh |
Francesco Fabiano | Djordje Markovich | Fabio Tardivo |
Jorge Fandinno | Simon Marynissen | Yi Tong |
Andrea Formisano | Jose F. Morales | David Tuckey |
David Fuenmayor | Johannes Oetsch | Sarat Chandra Varanasi |
Tobias Geibinger |
The 16th Doctoral Consortium (DC) on Logic Programming was held in conjunction with ICLP 2020. It attracts Ph.D. students in the area of Logic Programming Languages from different backgrounds (e.g. theoretical, implementation, application) and encourages 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 Doctoral Consortium accepted 4 papers in the areas described above. We warmly thank all student authors, supervisors, referees, co-chairs, members of the program committee and the organizing team that made the Doctoral Consortium greatly successful.
The DC Program Committee members were:
Carmine Dodaro | Martin Gebser |
Jorge Fandinno | Jose F. Moralesr |
Fabio Fioravanti | Zeynep G. Saribatur |
Paul Fodor | Frank Valencia |
We would also like to express our gratitude to the full ICLP 2020 organization committee. Our gratitude must be extended to Torsten Schaub as current President and Thomas Eiter as incoming President of the Association of Logic Programming (ALP), to Marco Gavanelli in the role of conference-coordinator for ALP, to all the members of the ALP Executive Committee and to Mirek Truszczynski, Editor-in-Chief of TPLP. Also, 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 their prompt support. Finally, we wish to thank each author of every submitted paper, since their efforts keep the conference alive and the participants to ICLP for bringing and sharing their ideas and latest developments. This is particularly appreciated in this 36th edition of the conference which has run during the unprecedented time of the COVID pandemic.
Francesco Ricca, Alessandra Russo, Sergio Greco, Nicola Leone, Alexander Artikis, Angelika Kimmig, |
Gerhard Friedrich, Fabrizio Riguzzi, Paul Fodor, Marco Maratea, Francesca Alessandra Lisi, Alessandra Mileo (Eds.) |
We have been investigating applications of Answer Set Programming (ASP) in various domains, ranging from historical linguistics and bioinformatics to economics and robotics. In these applications, theory meets practice around challenging computational problems, and they all start a journey towards benefiting science and life. ASP plays an important role in this journey, sometimes as a declarative programming paradigm to solve hard combinatorial search problems (e.g., phylogeny reconstruction for Indo-European languages, multi-agent path finding in autonomous warehouses, matching problems in economics), and sometimes as a knowledge representation paradigm to allow deep reasoning and inferences over incomplete heterogeneous knowledge and beliefs of agents (e.g., hybrid planning for robotic manipulation, diagnostic reasoning in cognitive factories, explanation generation for biomedical queries). In this talk, we will share our experiences from such different applications of ASP, and discuss its role and usefulness from different perspectives.
Humans make moral judgements about their own actions and the actions of others. Sometimes they make these judgements by following a utilitarian approach, other times they follow simple deontological rules, and yet at other times they find (or simulate) an agreement among the relevant parties. To build machines that behave similarly to humans, or that can work effectively with humans, we must understand how humans make moral judgements. This includes when to use a specific moral approach and how to appropriately switch among the various approaches. We investigate how, why, and when humans decide to break some rules. We study a suite of hypothetical scenarios that describes a person who might break a well established norm and/or rule, and asked human participants to provide a moral judgement of this action.
In order to effectively embed moral reasoning capabilities into a machine we model the human moral judgments made in these experiments via a generalization of CP-nets, a common preference formalism in computer science. We describe what is needed to both model the scenarios and the moral decisions, which requires an extension of existing computational models. We discuss how this leads to future research directions in the areas of preference reasoning, planning, and value alignment.
The forecasted success of machine learning (ML) hinges on systems that are robust in their operation and that can be trusted. This talk overviews recent efforts on applying automated reasoning tools in explaining non-interpretable (black-box) ML models, for assessing heuristic explanations, but also for learning interpretable ML models. Concretely, the talk overviews existing approaches for producing rigorous explanations of black-box models, and assesses the quality of widely used heuristic approaches for computing explanations. In addition, the talk discusses properties of rigorous explanations. Finally, the talk briefly overviews ongoing work on learning interpretable ML models.
A central challenge to contemporary AI is to integrate learning and reasoning. The integration of learning and reasoning has been studied for decades already in the fields of statistical relational artificial intelligence and probabilistic programming. StarAI has focussed on unifying logic and probability, the two key frameworks for reasoning, and has extended this probabilistic logics machine learning principles. I will argue that StarAI and Probabilistic Logics form an ideal basis for developing neuro-symbolic artificial intelligence techniques. Thus neuro-symbolic computation = StarAI + Neural Networks. Many parallels will be drawn between these two fields and will be illustrated using the Deep Probabilistic Logic Programming language DeepProbLog.
Norms, policy and laws all focus on describing desired behaviour of actors, whether they are humans, agents or processes. The actual behaviour of the actor can then be checked against this and compliance or violation potentially respectively rewarded or penalised. This talk explores the use of answer set programming in modelling the modelling, verification and compliance of these norms, policy and laws, both at the modelling stage but also in a running system. We demonstrate how this technology can be used to detect inconsistencies between sets of norms/policies/norms and how they could possibly be resolved
Satisfiability modulo theories (SMT) solving is a powerful tool. However, any client of an SMT solver faces the challenge of using the solver efficiently. In particular, modern SMT solvers support incremental solving, so there is often an advantage to asking queries in an order that lets the solver reuse work from earlier queries when answering new ones. Thus, clients are incentivized to pose queries in a way that has good "solver locality" and is amenable to effective incremental solving.
Because they are both used for automated reasoning tasks, there is a natural appeal to augmenting logic programming systems with the capabilities of SMT solving. One such hybrid system, Formulog [3], does this by extending Datalog with terms that represent SMT formulas and an interface to an external SMT solver. However, the notion of "solver locality" raises a potential problem for Formulog and other logic programming systems that embrace Kowalski's principle [8] of separating the logic of a computation from its control: The programmer cannot easily control the order of computations, and the language runtime might perform them in an order that has low solver locality.
For example, consider using Formulog to explore simple paths in a directed graph whose edges are labeled with SMT propositions. A path is explored only if the conjunction of its edge labels is satisfiable. This computation would have clearly good solver locality if it consecutively checked the satisfiability of similar paths (e.g., paths with a large common prefix); such a result might be achieved by using a sequential depth-first search (DFS) of the graph, starting at each node in turn. However, the same is not obviously the case for Formulog: because of its parallelized bottom-up evaluation algorithm, it effectively performs a breadth-first search of the graph starting from each node of the graph in parallel. Thus, paths discovered around the same time might not share a very large common prefix; in fact, they might be completely disjoint! Given the lack of obvious solver locality, it is not clear if this Formulog program should expect any advantage from incremental SMT solving.
We show empirically that, even in this setting, incremental SMT solving can in fact speed up logic programs that make SMT queries. We do so by evaluating the effectiveness of two lightweight encoding mechanisms that mediate between Formulog and an external SMT solver. The mechanisms use different capabilities defined in the SMT-LIB standard [2]: the first explicitly manages a solver's assertion stack, while the second checks satisfiability under retractable assumptions. The latter strategy consistently leads to speedups over a non-incremental baseline across a variety of benchmarks involving different SMT solvers and SMT-LIB logics, suggesting that logic programming systems can indeed take advantage of incremental, black-box SMT solving.
A Formulog user builds complex terms representing SMT formulas and reasons
about them with built-in operators like
is_sat
and get_model
.
When an SMT operator is invoked, the Formulog runtime takes the SMT query,
serializes it into the SMT-LIB format, ships it off to an external solver, and
returns the result.
The serialization code takes a list of conjuncts as input; its
job is to assert these conjuncts to the SMT solver in a way that
leads to efficient solving.
We evaluate three different strategies for SMT clients: a baseline non-incremental
strategy and two incremental strategies.
First, some background: SMT-LIB-compatible solvers maintain a stack of
assertion frames.
Frames can be pushed on and popped off the stack using the commands push
and pop
.
When a frame is popped, the solver's state is reset to the state it had before
that frame was added, forgetting any assertions made since the corresponding
push
command along with any consequences derived from those assertions.
Our baseline, non-incremental strategy clears the solver's assertion state between every satisfiability check: When it serializes an SMT query, it generates code that pushes a fresh frame on the stack, asserts each conjunct, checks for satisfiability, and then pops the frame it added.
Our second strategy (PP) explicitly push
es and pop
s the solver's stack to enable
incremental solving.
When serializing a query, PP pop
s off frames
until the solver's assertion stack is a prefix of the current list of
conjuncts, push
es assertions for each of the remaining conjuncts of the query, and then checks for satisfiability.
PP provides incremental solving when adjacent queries share large
common prefixes.
PP works well for clients who explore a constraint space
using DFS
(since the stack disciplines match up), but
penalizes clients who use search techniques that align less well with using a
stack (breadth-first search, heuristic searches, etc.).
Our final strategy (CSA) uses the check-sat-assuming
SMT-LIB command, which checks
the satisfiability of the solver's assertion state assuming particular
truth values for some given boolean variables.
CSA uses a layer of indirection to treat the solver's assertion
state as a cache of assertions that can be enabled or
disabled for a particular query [6]:
instead of asserting a
conjunct $\phi$ directly, CSA asserts the
implication $x \implies \phi$, where $x$ is a fresh boolean variable.
To check the satisfiability of a query including $\phi$,
we include $x$ in the list of literals provided to the check-sat-assuming
command.
Formulog's CSA client maintains a map from conjuncts to
boolean variables to keep track of which variables should be enabled for a
particular query and to ensure that no conjunct is ever asserted
more than once.
SMT clients using CSA need not manage an explicit stack of assertions; there is no penalty for exploring the constraint space in a way that does not align well with using a stack. Intuitively, CSA should be a boon for logic programming systems like Formulog that do not use a DFS-based search.
We empirically evaluated two hypotheses: (H1) Formulog should be able to take advantage of incremental SMT solving; i.e., either PP or CSA should outperform the non-incremental baseline strategy on most benchmarks; (H2) CSA should deliver more consistent and more substantial speedups than PP. To evaluate these hypotheses, we tested the relative performance of the three strategies on three Formulog programs given a variety of inputs.
The first program performs symbolic execution [7] over a simple imperative language. We ran the tool on six different input programs. We tried the solvers Z3 (v4.8.8) [9], CVC4 (v1.7) [1], and Boolector (v3.2.1) [10] (all set to use the logic QF_ABV). In all 18 cases, the baseline was bested by an incremental strategy (H1); CSA achieved the best speedup in 12 of these cases (H2).
The second program type checks programs written in Dminor [4], a language with refinement types that are encoded as SMT formulas. We ran the type checker on three input programs, using the solver Z3 with the logic ALL. CSA had the best improvement over the baseline in all three cases (H1, H2).
The third program computes reachability on graphs with edges labeled by propositions; a path is feasible only if the conjunction of the propositions along that path is satisfiable. We computed reachability on 24 random graphs in various bit vector and linear integer arithmetic (LIA) logics. We used the solvers Z3, CVC4, and Yices (v2.6.2) [5], and additionally Boolector for the graphs with bit vector formulas. The incremental strategies were better than the baseline on 60 of 84 experiments (H1), and CSA had the best improvement in 59 cases (H2). Of the cases where there was no gain by using incremental solving, 14 were clustered in the experiments with logics combining LIA and arrays.
Overall, out of 105 experiments, either PP or CSA beat the non-incremental baseline in 81 cases (H1✓). CSA provided a speedup in 79 cases, compared to 39 for PP; there were only two cases where PP provided a speedup and CSA did not, and only five where both strategies led to speedups but PP was faster than CSA (H2✓). Thus, our evaluation confirms our hypotheses: CSA is an effective, lightweight mechanism for integrating a logic programming system with an incremental SMT solver.
A growing body of recent research is showing that the use of aggregates in recursive Datalog programs allows a concise declarative formulation for algorithms that support with superior performance and scalability a wide range of Big Data applications, including graph and ML applications [2, 3, 4, 5, 6,7]. Yet the full deployment of this potentially disruptive logic programming technology requires a formal semantics which is simple enough to be used with confidence by everyday programmers in writing their applications. To address this need, we propose a cardinality-based approach that; identify the class of programs that use the count aggregate in recursion; and combine (i) Stable-Model (SM)semantics with (ii) very efficient; operational semantics that is also conducive to scalability via parallelization.
On objective (i) we seek to provide criteria and techniques which allow users to; prove that their programs have a Stable Model semantics,without having to rely on the formal definition of this semantics. However, for certain programs, their SM semantics is not conducive to an efficient and scalable implementation. We provide a simple criterion to identify programs along; with some hints on how to re-express such applications by program that is free of this problem. However, for a majority of programs of practical interest, an efficient and scalable computation of their SM semantics is at hand immediately using the notions of pre-mappability of extrema [8] and stale-synchronous parallelism. In fact the programs described in the above references fall in this second category that combine formal semantics with efficient and scalable implementation.
Moreover, as we deal with the other aggregates, we realize that they can all be defined by adding to the basic definition of count simple monotonic extensions needed to express the specific aggregate. In all cases, the value of the aggregate is returned when all the members of the set have been counted, i.e., when the computation of count reaches its max value.Thus the SM and fixpoint properties of programs containing arbitrary aggregates and their combinations remain those we have derived for count. Indeed, this approach has allowed us to express with formal SM and superior performance and scalability a wide range of algorithms used in graph, ML and KDD applications [1, 2, 4, 5, 6, 7]. Furthermore, query languages, such as SQL, can greatly benefit from these advances [2,7].
$\displaystyle \textbf{$e$ if $\{p_1,\dots,p_n\}$}$ | (1) |
$\displaystyle \textbf{$a$ causes $\{e_1,\dots,e_n\}$ if $\{p_1,\dots,p_m\}$}$ | (2) |
$\displaystyle \textbf{$a$ executable_if $\{p_1,\dots,p_n\}$}$ | (3) |
$\displaystyle \textbf{$a$ determines $f$}$ | (4) |
Definition 1 Let $T = (D,\Psi_0)$ be an action theory. A history of $T$ is a sequence of pairs of actions and observations $\alpha = [(a_1, \psi_1), \ldots, (a_n,\psi_n)]$ where $a_i$ is an action and $\psi_i$ is a fluent formula. We assume that if $a_i$ is a sensing action for the fluent $f$, then either $\Psi_i\models f$ or $\Psi_i \models \neg f$. We say that the history $\alpha$ is inconsistent with $T$ if there exists some $k$, $1 \le k \le n$, such that $\widehat{\Phi}([a_1,\ldots,a_k], \{\Sigma_{\Psi_0}\}) \not\models \psi_k$.
Given an inconsistent history $\alpha$, we are interested in the problem of identifying the correct initial belief state of the agent, say $\Psi_0'$, such that for every $k$, $1 \le k \le n$, such that $\widehat{\Phi}([a_1,\ldots,a_k], \{\Sigma_{\Psi_0'}\}) \models \psi_k$.Regression by non-sensing actions. Let $a$ be a non-sensing action and $\psi$ and $\varphi$ be conjunctions of fluent literals. We say $\varphi$ is a result of the regression of $a$ from $\psi$, denoted by $\varphi \stackrel{a}{\rightarrow} \psi$, if $\forall s \in \Sigma_\varphi.(\Phi(a,s)\models\psi)$.
Regression by sensing actions. Let $a$ be a sensing action and $\psi$ and $\varphi$ be conjunctions of fluent literals. We say $\varphi$ is a result of the regression of $a$ from $\psi$, denoted by $\varphi \stackrel{a}{\rightarrow} \psi$, if there exists some $\Sigma \in \Phi(a, \Sigma_\varphi)$ such that $\Sigma \models \psi$.
We define the regression of action $a$ from $\psi$, denoted by $\mathcal{R}(a, \psi)$, as follows:$\displaystyle \mathcal{R}(a, \psi) = \bigvee_{ \varphi\stackrel{a}{\rightarrow} \psi } \varphi$ | (5) |
$\displaystyle \mathcal{R}(a, \psi) = \bigvee_{i=1}^k \mathcal{R}(a, \psi_i)$ | (6) |
Definition 2 Let $(D,\Psi_0)$ be an action theory. Let $\alpha = [(a_1, \psi_1), \ldots, (a_n,\psi_n)]$ be a history and $\widehat{\Phi}(\alpha, \{\Sigma_{\Psi_0}\}) \not\models \psi_n$.The corrected initial belief state of $(D,\Psi_0)$ is defined by $\Psi_0 \star \widehat{\mathcal{R}}(\alpha)$.
There are several proposals for the operator $\star$, and as pointed out in [1], only the operator proposed in [3] satisfies all AGM postulates. In this paper, we make use of the following two operators.Example 1 Initially, the robot is in the room $n$ and believes that all lights are on. It makes a tour, from room $n$ to $1, \ldots, n-1$. In each room, the robot looks at the light. At the end of the tour, it realizes that its initial belief is incorrect ($\neg on(n-1)$ is observed and it supposed to be $on(n-1)$).
We tested with $n=1,\ldots,10$ and the system returns the result within 30 minutes. We observe that the size of the domain, in terms of the number of fluents and the number of actions, plays a significant role in the performance of the system. For $n=10$, we have 20 fluents and the number of potential regression results for a non-sensing action (e.g., $leave(k)$) is small but checking whether or not a potential regression result is a computed regression result involves checking the number of possible states given a set of formulae, which could range from $2^1$ to $2^{19}$. We observe that the system spends most of the time doing just that.
Training a model to detect patterns of interrelated events that form situations of interest can be a complex problem: such situations tend to be uncommon, and only sparse data is available. We propose a hybrid neuro-symbolic architecture based on Event Calculus that can perform Complex Event Processing (CEP). It leverages both a neural network to interpret inputs and logical rules that express the pattern of the complex event. Our approach is capable of training with much fewer labelled data than a pure neural network approach, and to learn to classify individual events even when training in an end-to-end manner. We demonstrate this comparing our approach against a pure neural network approach on a dataset based on Urban Sounds 8K.
The autoritative version of this extended abstract is available at https://arxiv.org/abs/2009.03420v1.Imagine a scenario where we are trying to detect a shooting using microphones deployed in a city: shooting is a situation of interest that we want to identify from a high-throughput (audio) data stream. Complex Event Processing (CEP) is a type of approach aimed at detecting such situations of interest, called complex events, from a data stream using a set of rules. These rules are defined on atomic pieces of information from the data stream, which we call events – or simple events, for clarity. Complex events can be formed from multiple simple events. For instance, shooting might start when multiple instances of the simple event gunshot occur. For simplicity, we can assume that when we start to detect siren events, authorities have arrived and the situation is being dealt with, which would conclude the complex event.
Using the raw data stream implies that usually we cannot directly write declarative rules on that data, as it would imply that we need to process that raw data using symbolic rules; though theoretically possible, this is hardly recommended.
Using a machine learning algorithm such a neural network trained with back-propagation is also infeasible, as it will need to simultaneously learn to understand the simple events within the data stream, and the interrelationship between such events to compose a complex event. While possible, the sparsity of data makes this a hard problem to solve.
The architecture we propose is a hybrid neuro-symbolic approach that allows us to combine the advantages of both approaches. Our approach is capable of performing CEP on raw data after training in an end-to-end manner. Among other advantages, our approach is better at training with sparse data than pure neural network approaches, as we will demonstrate. Code is available at https://github.com/MarcRoigVilamala/DeepProbCEP
ProbEC ([5]) is an approach for complex event processing using probabilistic logic programming. ProbEC takes an input stream of simple events – each of which has a probability of happening attached. From there, it is capable of outputting how likely it is for a complex event to be happening at a given point in time based on some manually-defined rules that describe the pattern for the complex event.
In a previous paper, we built on top of ProbEC proposing a system that made use of pre-trained neural networks to detect complex events from CCTV feeds ([3]). However this approach required access to pre-trained neural networks to process the simple events, which are not always available. To solve this issue, we moved towards end-to-end training, which is able to train these neural networks from just the input data and labels on when the complex events are happening.
In order to implement an end-to-end training with a hybrid neuro-symbolic approach, we made use of DeepProbLog ([2]), which incorporates deep learning into a probabilistic programming language. This allowed us to train the neural networks as part of the system in an end-to-end manner.
DeepProbLog allows users to make use of the outputs of a neural network as part of the knowledge database in a ProbLog program. DeepProbLog also allows users to train those neural networks in an end-to-end manner by calculating the gradient required to perform the gradient descent based on the true value of the performed query and the outputs provided by the neural network. This allows us to implement a hybrid neuro-symbolic architecture that is able to learn in an end-to-end manner.
In this paper, we are proposing a hybrid neuro-symbolic architecture that performs CEP. As a proof of concept, we have implemented our architecture to perform CEP on audio data. In our implementation, each audio second is processed by a PyTorch implementation of VGGish (available at https://github.com/harritaylor/torchvggish), a feature embedding frontend for audio classification models ([1]) which outputs a feature vector for each second of the original audio file. We use these features as input of a multi-layer perceptron (MLP, AudioNN in the figure) that classifies the audio into a pre-defined set of classes.
The output of this neural network is then used in the logic layer, which contains the rules required to perform CEP. Here, the user can define which patterns of simple events constitute the starts and ends of which complex events.
DeepProbLog is used to integrate the different parts, which allows us to train the neural network within the system in an end-to-end manner, which heavily reduces the cost of labelling; it is practically infeasible to label each second of large collections of audio tracks, while it is much easier to identify the beginning and the end of complex events as situations of interest. As such the system is provided with raw audio data and, for training, labels on when the complex events start and end.
We experimentally compare our approach against a pure statistical learning approach using a neural network (Pure NN). Pure NN exchanges the logical layer for an MLP, which will learn the rules that define complex events. We engineered a synthetic dataset based on Urban Sounds 8K ([4]). We consider two repetitions of the same start event – or end event – within a certain time window as the signal of the beginning – or termination – of a fluent. Then, to test the efficacy of the approach, we varied the size of the time window for repetitions, from 2 to 5 seconds. The information on when a complex event begins or ends is used as training data. The goal of our sysntetic dataset is to be able to detect when a complex event is happening from raw data.
For all the reported results, the corresponding system has been trained on a sequence generated from randomly-ordering the files from 9 of the 10 pre-sorted folds from Urban Sounds 8K, with the remaining fold being used for testing. As recommended by the creators of the dataset, 10-fold cross validation has been used for evaluation. Before each evaluation, both systems have been trained for 10 epochs with 750 training points on each epoch. This allows for both approaches to converge according to our experiments.
Approach | Window size | |||||||
2 | 3 | 4 | 5 | |||||
Sound Accuracy | Hybrid (Our approach) | 0.6425 | 0.5957 | 0.6157 | 0.6076 | |||
Pure NN | 0.0725 | 0.1155 | 0.0845 | 0.0833 | ||||
Pattern Accuracy | Hybrid (Our approach) | 0.5180 | 0.4172 | 0.4624 | 0.4506 | |||
Pure NN | 0.1843 | 0.2034 | 0.2289 | 0.1927 |
The table above shows the results of our approach and Pure NN with different window sizes. It shows both the performance for detecting the starts and ends of complex events (Pattern Accuracy) and for classifying the simple events in the sequence (Sound Accuracy). As we can see in the table, our approach is clearly superior, as Pure NN has a performance only marginally better than a random classifier, which would archive a performance of about 10%. Therefore our approach is very efficient at learning from sparse data, and, as a byproduct, can also train the neural network to classify simple events.
In this paper we demonstrated the superiority of our approach against a feedforward neural architecture. Further investigations that consider recurrent networks (RNNs) particularly long-short term memory (LSTM) networks are ongoing; we thank an anonymous reviewer for this suggestion. Further research could also include rule learning, which could be used to remove the necessity of knowing which patterns of simple events form which complex events.
This research was sponsored by the U.S. Army Research Laboratory and the U.K. Ministry of Defence under Agreement Number W911NF-16-3-0001. The views and conclusions contained in this document are those of the authors and should not be interpreted as representing the official policies, either expressed or implied, of the U.S. Army Research Laboratory, the U.S. Government, the U.K. Ministry of Defence or the U.K. Government. The U.S. and U.K. Governments are authorized to reproduce and distribute reprints for Government purposes notwithstanding any copyright notation hereon.
Abstract. Data validation may save the day of computer programmers, whatever programming language they use. Answer Set Programming is not an exception, but the quest for better and better performance resulted in systems that essentially do not validate data in any way. VALASP is a tool to inject data validation in ordinary programs, so to promote fail-fast techniques at coding time without imposing any lag on the deployed system if data are pretended to be valid. |
Data validation is the process of ensuring that data conform to some specification, so that any process in which they are involved can safely work under all of the assumptions guaranteed by the specification. In particular, immutable objects are usually expected to be validated on creation, so that their consistency can be safely assumed anywhere in the system - this way, in fact, an invalid immutable object simply cannot exist because its construction would fail. Answer Set Programming (ASP) gained popularity thanks to efficient systems [1, 10, 11, 13] implementing optimized algorithms for solution search [2, 4, 8, 14] and query answering [3, 5]. On the other hand, ASP offers very little in terms of protection mechanisms. No static or dynamic type checking are available, and programmers can rely on a very limited set of primitive types, namely integers, strings and alphanumeric constants, with no idiomatic way to enforce that the values of an argument must be of one of these types only. More structured data types are usually represented by uninterpreted function symbols [6, 7, 9, 12, 15], but again there is no idiomatic way to really validate such structures. Even integrity constraints may be insufficient to achieve a reliable data validation, as they are cheerfully satisfied if at least one of their literals is false; in fact, this is a very convenient property to discard unwanted solutions, but not very effective in guaranteeing data integrity - invalid data in this case may lead to discard some wanted solution among thousands or more equally acceptable solutions, a very hard to spot unexpected outcome. VALASP (https://github.com/alviano/valasp) is a framework for data validation. The format of some data of interest is specified in YAML, and a fail-fast approach is achieved by injecting constraints that are guaranteed to be immediately satisfied when grounded, unless data are found to be invalid and some exception is raised. For example, if birthdays are represented by instances of bday(NAME,DATE), where NAME is an alphanumeric ID and DATE is a term of the form date(YEAR,MONTH,DAY), data validation can be specified as follows:
Lines 1-2 are used to import a Python module that can validate dates. Lines 3-8 specify how to validate terms of the form date(YEAR,MONTH,DAY): the arguments must be integers (lines 4-6) and represent a valid date (line 8). Similarly, lines 9-11 dictate the format of bday referring the specification of date given in lines 3-8. The YAML specification is mapped to Python code and ASP constraints:
An atom like bday(bigel, date(1982,123)) triggers the @-term in line 21, whose implementation in line 20 tries to construct an instance of Bday. However, an exception is raised during the construction of Date (line 19) because of a wrong number of arguments detected at line 6. VALASP produces the following error message:
Abstract. Complex reasoning problems are most clearly and easily specified using logical rules, especially recursive rules with aggregation such as counts and sums for practical applications. Unfortunately, the meaning of such rules has been a significant challenge, leading to many different conflicting semantics.
This extended abstract gives an overview of a unified semantics for recursive rules with aggregation, extending the unified founded semantics and constraint semantics for recursive rules with negation. The key idea is to support simple expression of the different assumptions underlying different semantics, and orthogonally interpret aggregation operations straightforwardly using their simple usual meaning.
Introduction. Many computation problems, including complex reasoning problems in particular, are most clearly and easily specified using logical rules. However, such reasoning problems in practical applications, especially for large applications and when faced with uncertain situations, require the use of recursive rules with aggregation such as counts and sums. Unfortunately, even the meaning of such rules has been challenging and remains a subject with significant complication and disagreement by experts.
As a simple example, consider a single rule for Tom to attend the logic seminar: Tom will attend the logic seminar if the number of people who will attend it is at least 20. What does the rule mean? If 20 or more other people will attend, then surely Tom will attend. If only 10 others will attend, then Tom clearly will not attend. What if only 19 other people will attend? Will Tom attend, or not? Although simple, this example already shows that, when aggregation is used in a recursive rule, the semantics can be subtle.
Semantics of recursive rules with aggregation has been studied continuously since about 30 years ago, and intensively in the last several years, especially as they are needed in graph analysis and machine learning applications. However, the different semantics proposed, e.g., [7, 2], are complex and tricky, including having some experts changing their own minds about the desired semantics, e.g., [1, 2]. With such complex semantics, aggregation would be too challenging for non-experts to use correctly.
This extended abstract gives an overview of a simple unified semantics for recursive rules with aggregation, as well as negation and quantification, as described in the full paper [6]. The key idea is to support simple expression of the different assumptions underlying different semantics, and orthogonally interpret aggregation operations straightforwardly using their simple usual meaning. The unified semantics is built on and extends the founded semantics and constraint semantics of logical rules with negation and quantification developed recently by Liu and Stoller [3, 4], which has been used in a new language to support the power and ease of programming with logical constraints [5].
We applied the unified semantics to a variety of different examples, as described in detail in the full paper [6], including the longest and most sophisticated ones from dozens of previously studied examples [2]. For those from previously studied examples, instead of computing answer sets using naive guesses followed by sophisticated reducts, all of the results can be computed with a simple default assumption and a simple least fixed-point computation, as is used for formal inductive definitions and for commonsense reasoning. In all cases, we show that the resulting semantics match the desired semantics.
Overview of the Unified Semantics. Our simple and unified semantics for rules with aggregation as well as negation and quantification builds on founded semantics and constraint semantics [3, 4] for rules with negation and quantification. The founded semantics gives a single 3-valued model (i.e., the possible truth values of an assertion are true, false, and undefined) from simply a least fixed-point computation, and the constraint semantics gives a set of 2-valued models (i.e., the possible truth values of an assertion are true and false) from simply constraint solving.
The key insight is that disagreeing complex semantics for rules with aggregation are because of different underlying assumptions, and these assumptions can be captured using the same simple binary declarations about predicates as in founded semantics and constraint semantics but generalized to include the meaning of aggregation.
First, if there is no aggregation or no potential non-monotonicity—that is, adding new facts used in the hypotheses of a rule may make the conclusion of a rule from true to false—in recursion, then the predicate in the conclusion can be declared "certain".
Being certain means that assertions of the predicate are given true or inferred true by simply following rules whose hypotheses are given or inferred true, and the remaining assertions of the predicate are false. This is both the founded semantics and constraint semantics.
For the example of Tom attending the logic seminar, there is no potential non-monotonicity; with this declaration, when given that only 19 others will attend, the hypothesis of the rule is not true, so the conclusion cannot be inferred. Thus Tom will not attend.
Regardless of monotonicity, a predicate can be declared "uncertain". It means that assertions of the predicate can be given or inferred true or false using what is given, and any remaining assertions of the predicate are undefined. This is the founded semantics.
If there are undefined assertions from founded semantics, all combinations of true and false values are checked against the rules as constraints, yielding a set of possible satisfying combinations. This is the constraint semantics.
An uncertain predicate can be further declared "complete" or not. Being complete means that all rules that can conclude assertions of the predicate are given. Thus a new rule, called completion rule, can be created to infer negative assertions of the predicate when none of the given rules apply.
Being not complete means that negative assertions cannot be inferred using completion rules, and thus all assertions of the predicate that were not inferred to be true are undefined.
For the example of Tom attending the logic seminar, the completion rule essentially says: Tom will not attend the logic seminar if the number of people who will attend it is less than 20.
When given that only 19 others will attend, due to the uncertainty of whether Tom will attend, neither the given rule nor the completion rule will fire. So whether one uses the declaration of complete or not, there is no way to infer that Tom will attend, or Tom will not attend. So, founded semantics says it is undefined.
Then constraint semantics tries both for it to be true, and for it to be false; both satisfy the rule, so there are two models: one that Tom will attend, and one that Tom will not attend.
Finally, an uncertain complete predicate can be further declared "closed", meaning that an assertion of the predicate is made false if inferring it to be true requires itself to be true.
For the example of Tom attending the logic seminar, with this declaration, if there are only 19 others attending, then Tom will not attend in both founded semantics and constraint semantics. This is because inferring that Tom will attend requires Tom himself to attend to make the count to be 20, so it should be made false, meaning that Tom will not attend.
Overview of Language and Formal Semantics. Formal definitions of the language and semantics, and proofs of consistency and correctness of the semantics, appear in the full paper [6]. We give a brief overview here.
Our language supports Datalog rules extended with unrestricted negation, universal and existential quantification, aggregations, and comparisons. An aggregation has the form agg S, where agg is an aggregation operator (count, min, max, or sum), and S is a set expression of the form { X_{1}, ... ,X_{a} : B }, where B is a conjunction of assertions or negated assertions. A comparison is an equality (=) or inequality (≠, ≤, <, ≥, or >), with an aggregation on the left and a variable or constant on the right. Additional aggregation and comparison functions, including summing only the first component of a set of tuples and using orders on characters and strings, can be supported in the same principled way as we support those above. A program is a set of rules, facts, and declarations.
The key idea for extending the semantics is to identify conditions under which a comparison is definitely true or false in a 3-valued interpretation for the predicates, and to leave the comparison's truth value as undefined if those conditions don't hold. For example, consider the comparison count { X : p(X) } ≤ k and its complement (i.e., its negation) count { X : p(X) } > k. The former is true in an interpretation I if the number of ground instances of p(X) that are true or undefined in I is at most k. The latter is true in I if the number of ground instances of p that are true in I is greater than k. Considering the complement eliminates the need to explicitly define when a comparison is false or undefined. Instead, we derive those conditions as follows: a comparison is false in I if its complement is true in I, and a comparison is undefined in I if neither it nor its complement is true in I.
Acknowledgments. This work was supported in part by ONR under grant N00014-20-1-2751 and NSF under grants CCF-1954837, CCF-1414078, and IIS-1447549.
Bitcoin is one of the first decentralized, peer to peer, payment systems based on the Proof-of-Work consensus algorithm. The network suffers from a scalability issue due to several limitations such as the restriction imposed on the blocks' size. For this reason, several approaches have been proposed, among which the so-called "Layer 2 solutions", where a layer of channels is built on top of a blockchain. This allows users to send transactions through these channels, without broadcasting them on the blockchain, increasing the number of transactions per second that can be managed. One of the main examples of this last approach is the Lightning Network: in this paper we propose to represent this network and to query its properties by means of Logic Programming, in order to study its evolution over time.
Bitcoin [3] is one of the most famous decentralized payment system based on a blockchain. The algorithm used to append block to the blockchain, Proof of Work (POW) for Bitcoin, ensures that blocks, once discovered, cannot be easily tampered with. However, it also represents one of the main bottlenecks since only few transactions per second can be supported in the network. Currently, one of the main approaches to increase Bitcoin capacity is represented by the so-called "Layer 2 solutions". This type of systems creates a layer of channels on top of a blockchain. With these channels, users can overcome some blockchain limitations by issuing off-chain transactions. One of the most famous systems is the Lightning Network (LN) [4]. Here, we encode the Lightning Network by means of Logic Programming, since it has been proved effective in several Bitcoin scenarios [1,2]. The use of Prolog both as the representation language of the Lightning Network and as the query language allows us to easily analyse its characteristics requiring a minimal effort in the code implementation.
The Lightning Network can be represented as a graph $G = (V,E)$ where $V$ is the set of vertices (nodes) and $E$ is the set of edges (payment channels). The degree of a node is defined as the number of edges incident to the node. A path of length $n$ between two nodes $v_a, v_b \in V$ is a sequence of payment channels $e_1,\ldots,e_n \in E$ such that $e_1 = (x_1,x_2)$, $e_2 = (x_2,x_3), \dots, e_n = (x_{n-1},x_n)$ where $x_1 = v_a$ and $x_n = v_b$. The distance between two nodes is defined as the shortest path that connects those nodes. The capacity of an edge is defined as the maximum payment that can be routed through it. One of the problem of routing in LN is that the capacity of a channel between two nodes is known but the distribution of the capacity in each direction is unknown, since it is a feature introduced to increase the security of the system: this makes routing a complicated task, since several attempts may be required to send a payment.
We represent a channel of capacity Amount
between two nodes Source
and Dest
with a Prolog
fact of the form edge(Source,Dest,Amount)
.
The channels in the network are also characterized by other values (i.e., fee base and fee rate), but we ignore them
since they are not needed in our experiments.
Theoretically, the amount locked in a channel is split between the two connected nodes, so a payment channel should be
represented by two directed edges.
However, the amount distribution is unknown, so we suppose that nodes are connected by only one undirected edge.
The Prolog representation of this situation, between a source node $a$ and a destination node $b$, is given by a single
fact edge(a,b,8)
.
The whole network is a set of ground facts edge/3
.
Starting from the dataset related to [6], we trace the LN evolution along the months of February, March and April 2020 and how its properties and connections vary over time, through a series of experiments. We analyze the structure of the network in terms of node degree distribution: the majority of the nodes of the network (more than 65% for all three datasets) has degree between 1 and 5. Then, we compute how the total network capacity varies by removing the edges with the top capacity values and the nodes with the highest associated degree. The goal of this experiment is to show how much the capacity of the network is centralized in the hands of few. By removing the edges, the network capacity substantially reduces after 50 removals. Instead, removing the top 100 nodes decreases the total network capacity approximately by 90%. We analyse the rebalancing operation (i.e., a node sends a payment to itself) and, as expected, as the node degree increases, the maximum rebalancing amount increases as well. Finally, we compute the number of paths of length 2 and 3 among equal degree nodes, with the degree varying between 1 and 10. We focus on short paths since, in practice, the average length of the shortest path is 2.8 [7]. Moreover, longer paths also imply higher fees to pay. We discover that the number of paths drops after the 3rd or 4th degree for all networks in both cases. As a future work, we plan to extend our analysis using Probabilistic Logic Programming [5].
SCIFF is a language to define formal rules and protocols in agent societies, and an abductive proof-procedure for compliance checking. However, how to identify the responsible for a violation is not always clear.
In this work, a definition of accountability for artificial societies is formalized in SCIFF. Two tools are provided for the designer of interaction protocols: a guideline, in terms of syntactic features that ensure accountability of the protocol, and an algorithm (implemented in a software tool) to investigate if, for a given protocol, non-accountability issues could arise.
The current economic world is strongly based on large corporations, that have been able to provide large economic benefits, such as cheaper prices for everyday goods and better employment rates, but that also represented large problems in case of failure. Every person can list problems in his/her own country in which a large firm misbehaved, e.g., polluting the environment, or by failing in a disastrous way causing huge losses for small investors. In many cases, the firm itself cannot be punished for its misbehavior, because a company cannot be sent to jail. One hopes that the culprit of the misbehavior (e.g., the CEO) is punished, but in many cases the complex behavior of an organization depends on the policies established by previous members (that might even be dead), by common practices, or by the fact that many individuals contributed to the disaster each for an inconceivably small amount.
In the literature of moral responsibility, there exist different notions of responsibility. Van de Poel et al. [3] distinguish five moral meanings of responsibility: accountability, blameworthiness, liability, obligation and virtue.
The ascription of responsibility-as-accountability has the following implication: i is responsible-as-accountable for φ implies that i should account for (the occurrence of) φ, in particular for i's role in doing, or bringing about φ, or for i's role in failing to prevent φ from happening, where i is some agent, and φ an action or a state-of-affairs.and
Accountability implies blameworthiness unless the accountable agent can show that a reasonable excuse applies that frees her from blameworthiness. So holding an agent i accountable shifts the burden of proof for showing that i is not blameworthy to the agent i: the agent is now to show - by giving an account - that she is not blameworthy.
In this work, we focus on the SCIFF system [1], a complete system for defining and checking the compliance of agents to interaction protocols. It includes a language to define agent interaction protocols and to relate a current state of affairs with one or more expected behaviors of the agents, formalized as a set of expectations. The language was designed to leave freedom to agents, not overconstraining them to follow statically pre-defined paths, but, instead, to assert explicitly the obligatory actions and those that are forbidden, while leaving everything not explicitly stated as a possible action that an agent can perform if it is convenient. An abductive proof-procedure accepts asynchronous events and reasons about them through the protocol definition, generates the expected behavior of the agents, and checks if the actual behavior matches with the expectations.
SCIFF lacks a concept of responsibility, because expectations, unlike commitments, are not characterized by a debtor, due to different language design objectives: while SCIFF is able to detect violations of the protocols, it is not always clear which agent is responsible for the wrong state of affairs.
In this work, we address the problem by adopting the accountability version of responsibility. Accountability in the proposed setting stands for the possibility to account for the wrong state of affairs of an agent that is the one that performed (or did not perform) the action in its expected behavior. The agent might then, by reasoning on the protocol and the state of affairs (again, using the SCIFF proof procedure), be able to account for its own behavior. The agent might be able to find an explanation in which its expected behavior is fulfilled, and in such a case it cannot be held responsible for the violation. In some cases, this might happen because another agent is actually responsible for the violation, but in other cases it might be due to a wrong design of the interaction protocol.
For this reason, we define formally a notion of accountability of the interaction protocol. The idea is that a protocol is accountable if it allows to identify the agent (or agents) responsible for each possible violation. If the interactions in an organization or society are ruled by an accountable protocol, then, for each possible undesirable state of affairs, one or more agents will be unambiguously held responsible.
The formal definition allows us to provide guidelines and tools for the developer of interaction protocols. The guidelines are syntactic conditions that ensure a-priori the accountability of a protocol. We identify a syntactic characterization of a fairly large class of protocols and prove that protocols in such class are accountable. Various protocols taken from the list of SCIFF applications belong to this class.
However, even protocols that do not belong to the identified class may be accountable. For existing protocols, the user might not want to completely re-design the protocol, and in this case a tool that checks the protocol for accountability might be more suitable. We propose a tool to detect if a protocol has non-accountability issues. If there exists such an issue, the tool also provides a counterexample, i.e., a course of events with protocol violation, but for which no agent can be held responsible. We tested, through such tool, protocols modeled in the past with SCIFF, and we were able to identify non-accountability of two protocols that were completely reasonable for the task for which they were designed. Thanks to the tool and the provided counterexample, it was then easy for the designer to fix the protocol.
^{1}The full version of this extended abstract can be found in [2].
Email: matthias.nickles@nuigalway.ie
This extended abstract reports an earlier work [8] which introduced multi-model optimization through SAT witness or answer set sampling where the sampling process is controlled by a user-provided differentiable loss function over the multiset of sampled models. Probabilistic reasoning tasks are the primary use cases, including deduction-style probabilistic inference and hypothesis weight learning. Technically, our approach enhances a CDCL-based SAT and ASP solving algorithm to differentiable satisfiability solving (respectively differentiable answer set programming), by using a form of Gradient Descent as branching literal decision approach, and optionally a cost backtracking mechanism. Sampling of models using these methods minimizes a task-specific, user-provided multi-model loss function while adhering to given logical background knowledge (background knowledge being either a Boolean formula in CNF or a logic program under stable model semantics). Features of the framework include its relative simplicity and high degree of expressiveness, since arbitrary differentiable cost functions and background knowledge can be provided.
Keywords: Boolean Satisfiability Problem, Probabilistic Logic Programming, Answer Set Programming, Differentiable Satisfiability, Weighted Sampling, PSAT, Optimization
With this extended abstract, we report and summarize an earlier publication [8] which introduced an approach to finding an optimal multiset of satisfying Boolean variable assignments or answer sets by means of loss function gradient-steered sampling. The sampling process minimizes a user-defined objective function using a new optimization method which we call Differentiable Satisfiability Solving respectively Differentiable Answer Set Programming [7] (∂SAT/∂ASP).
In contrast to existing approaches to ASP- or SAT-based optimization such as MaxWalkSAT [5], a differentiable cost function evaluates statistics over an entire multi-set of models (“worldview”). Logical knowledge is provided either as a Boolean formula in CNF or as a logic program in Answer Set Programming (ASP) syntax (which is similar to Prolog and Datalog syntax). ASP is a form of logic programming oriented primarily towards NP-hard search and combinatorial problems [4].
Use cases of our framework include basically all probabilistic reasoning tasks where the input is either a logic program or a propositional formula (in CNF) with clauses or rules optionally weighted with probabilities. With appropriate cost functions, we can also determine probabilities of logical hypotheses.
More far reaching, it allows for a new type of ASP and satisfiability solving where an optimal multi-solution (list of models, i.e., stable models in the the answer set case or witnesses in the SAT case) is specified by arbitrary differentiable cost functions.
Features of our framework are its relative conceptual simplicity and high degree of expressiveness. In contrast to most existing probabilistic logic programming frameworks, no assumption of probabilistic independence needs to be made and arbitrary differentiable cost functions can be specified. Over most probabilistic FOL frameworks (including Markov Logic Networks), our approach allows for inductive definitions and allows for non-monotonic logic programming. Experimental results [8] indicate that our approach is competitive with major probabilistic reasoning approaches for standard benchmark tasks.
Technically, multi-model optimization is implemented as an enhancement of the Conflict-Driven Nogood Learning (CDNL) [3] state-of-the-art SAT/ASP solving algorithm, a variant of Conflict-Driven Clause Learning (CDCL). We have enhanced CDNL with iterative model sampling capabilities using a Gradient Descent step in the branching literal heuristics of the partial Boolean variable assignment loop (this enhancement already suffices for performing probabilistic deductive inference), and additionally an optional cost backtracking mechanism, to cover non-deductive probabilistic inference (weight finding).
Sampled models are added to the multi-model sample until a task-specific cost function is sufficiently minimized (down to a specified error threshold) while ensuring that all sampled models adhere to the given logical background knowledge. After sampling, a counting and normalization step over the sampled models can be used to compute probabilities of queries or hypotheses.
This work is related mainly to other probabilistic answer set and SAT frameworks such as [10,2,9,6] and to weighted and constrained sampling approaches such as [1] - details can be found in [8].
An open source implementation of our framework and some examples can be found at https://github.com/MatthiasNickles/delSAT
This abstract is a summary of our OOPSLA'18 paper "Incrementalizing Lattice-Based Program Analyses in Datalog". Original download URL: https://dl.acm.org/doi/10.1145/3276509.
A static analysis is a tool that reasons about the runtime behavior of a computer program without actually running it. This way static analyses can help to catch runtime errors already at development time before the code goes to production, thereby saving significant costs on maintenance and the mitigation of potential software failures. To this end, static analyses are widely used in many areas of software development. For example, Integrated Development Environments (IDEs) use type checkers or data-flow analyses to provide continuous feedback to developers as they modify their code.
Datalog is a logic programming language that sees a resurgence in the static analysis community. There are many examples of static analyses specified in Datalog; ranging from network analysis on Amazon-scale systems to inter-procedural points-to analysis of large Java projects. The benefit of using Datalog for static analyses is that the declarative nature of the language allows quick prototyping of modular and succinct analysis implementations. Moreover, the execution details of a Datalog program is left to a solver, and solvers are free to optimize the execution in many ways. Our goal is to incrementalize the Datalog solver, in order to provide continuous feedback with analyses in IDEs.
In response to a program change, an incremental analysis reuses the previously computed results and updates them based on the changed code parts. In many applications, incrementality has been shown to bring significant performance improvements over from-scratch re-computation. There also exist incremental Datalog solvers, but they are limited in expressive power: They only support standard Datalog with powersets, and there is no support for recursive aggregation over custom lattices. This is a problem because static analyses routinely use custom lattices and aggregation (under monotonic aggregation semantics), e.g. when analyzing a subject program with a loop and computing a fixpoint over a lattice using the least upper bound operator. Incrementalizing such computations is challenging, as aggregate results may recursively depend on themselves. It is true that certain finite lattices are expressible with powersets, so incrementalization techniques for standard Datalog may seemingly apply, but Madsen et al. explain that such encodings often incur prohibitive computational cost, while infinite lattices cannot even be expressed with powersets.
In this paper, we present an incremental analysis framework called IncA that supports recursive aggregation over custom lattices. IncA uses Datalog extended with lattices for analysis specification. IncA shields analysis developers from the details of efficient execution, as it automatically incrementalizes program analyses in the face of program changes. We develop a novel incremental solver called DRed_{L}. DRed_{L} extends the well-known DRed algorithm to support the standard semantics introduced by Ross and Sagiv for recursive monotonic aggregation. Our key idea is that instead of decomposing a program change into deleted and inserted tuples, DRed_{L} works with antimonotonic and monotonic changes according to the partial order of the chosen lattice. We have formally proven that DRed_{L} is correct and yields the exact same result as running a Datalog program from scratch. Although we apply DRed_{L} to incrementalize program analyses, our contributions are generally applicable to any Datalog program using recursive aggregation over custom lattices.
We evaluate the applicability and performance of IncA with real-world static analyses. We implement a lattice-based points-to analysis that reasons about the potential target heap objects of variables, and we implement a number of static analyses that reason about the potential values of string-typed variables. We benchmark the analyses on open-source code bases with sizes up to 70 KLoC, and we synthesize program changes. We find that IncA consistently delivers good performance: After an initial analysis that takes a few tens of seconds, the incremental updates times are on the millisecond ballpark. The price of incrementalization is the extra memory use. We find that the memory consumption of IncA can grow large (up to 5GB), but it is not prohibitive for applications in IDEs.
Programming with logic has allowed many design and analysis problems to be expressed more easily and clearly at a high level. Examples include problems in program analysis, network management, security frameworks, and decision support. However, when sophisticated problems require reasoning with negation and recursion, possibly causing contradiction in cyclic reasoning, programming with logic has been a challenge. Many languages and semantics have been proposed, but they have different underlying assumptions that are conflicting and subtle, and each is suitable for only certain kinds of problems.
Liu and Stoller [3] describes a unified language, DA logic, which stands for Design and Analysis logic, for programming with logic using logical constraints. It supports logic rules with unrestricted negation in recursion, as well as unrestricted universal and existential quantification. It is based on the unifying founded semantics and constraint semantics [1, 2], which give a single three-valued model and a set of two-valued models, respectively, and it supports the power and ease of programming with different intended semantics without causing contradictions in cyclic reasoning.The language provides meta-constraints on predicates. These meta-constraints capture the different underlying assumptions of different logic language semantics. They indicate whether: (1) a predicate is certain (assertions of P are two-valued: true or false) or uncertain (assertions of P are three-valued: true, false, or undefined); (2) the set of rules specifying a predicate is complete (hence negative facts ¬P can be inferred using the negations of the hypotheses of those rules) or not; (3) a predicate is closed (specified assertions of the predicate are considered false if inferring any of them to be true requires assuming that some of them are true) or not.
The language supports the use of uncertain information in the results of different semantics, in the form of either undefined values or possible combinations of values. The assertions for which P is true, false, and undefined in founded semantics are captured using three automatically derived predicates, P.T, P.F, and P.U, respectively. The constraint semantics of a set of rules, facts, and meta-constraints is captured using an automatically derived predicate CS. For each model m in CS, the assertion CS(m) holds, and m.P captures the truth values of predicate P in m. All of these predicates can be used explicitly and directly for further reasoning, unlike with the truth values in well-founded semantics, stable model semantics, founded semantics, and constraint semantics.
The language further supports the use of knowledge units that can be instantiated by any new predicates, including predicates with additional arguments. A knowledge unit, abbreviated as kunit, is a set of rules, facts, and meta-constraints. A kunit K can be used in another kunit with an instantiation of the form use K (P_{1} = Q_{1}(Y_{1,1},...,Y_{1,bi}), ..., P_{n} = Q_{n}(Y_{n,1},...,Y_{n,bn})), which replaces each occurrence P_{i} in K with Q_{i} and passes Y_{i,1},...,Y_{i,bi} as additional arguments to Q_{i}. This powerful form of instantiation allows knowledge in a kunit to be re-used in any contexts.
Example: Unique undefined positions. In an uncertain world, among the most critical information is assertions that have a unique true or false value in all possible ways of satisfying given constraints but cannot be determined to be true by just following founded reasoning. Having both founded semantics and constraint semantics at the same time allows one to find such information.
Consider the following kunits. With default meta-constraints, win, prolog, and asp are complete, move is certain in win_unit, and unique is certain in cmp_unit. First, win_unit defines win—x is a winning position if there is a move from x to y and y is not a winning position. Then, pa_unit defines prolog, asp, and move and uses win_unit. Finally, cmp_unit uses pa_unit and defines unique(x) to be true if (1) win(x) is undefined in founded semantics, (2) a constraint model of pa_unit exists, and (3) win(x) is true in all models in the constraint semantics.
kunit win_unit: win(x) ← move(x,y) ∧ ¬ win(y) kunit pa_unit: prolog ← ¬ asp asp ← ¬ prolog move(1,0) ← prolog move(1,0) ← asp closed(move) use win_unit () kunit cmp_unit: use pa_unit () unique(x) ← win.U(x) ∧ ∃ m ∈ pa_unit.CS ∧ ∀ m ∈ pa_unit.CS | m.win(x)
In pa_unit, founded semantics gives move.U(1,0) (because prolog and asp are undefined), win.F(0) (because there is no move from 0}, and win.U(1) (because win(1) cannot be true or false). Constraint semantics pa_unit.CS has two models: {prolog, move(1,0), win(1)} and {asp, move(1,0), win(1)}. We see that win(1) is true in all two models. So win.U(1) from founded semantics is imprecise.
In cmp_unit, by definition, unique(1) is true. That is, win(1) is undefined in founded semantics, the constraint semantics is not empty, and win(1) is true in all models of the constraint semantics. ∎
Overall, DA logic is essential for general knowledge representation and reasoning, because not only rules but also different assumptions must be captured, and these rules and different inference results must be used modularly for scaled up applications.
Acknowledgments. This work was supported in part by ONR under grant N00014-20-1-2751 and NSF under grants CCF-1954837, CCF-1414078, CNS-1421893, and IIS-1447549.
The integration of low-level perception with high-level reasoning is one of the oldest problems in Artificial Intelligence. Today, the topic is revisited with the recent rise of deep neural networks. However, it is still not clear how complex and high-level reasoning, such as default reasoning, ontology reasoning, and causal reasoning, can be successfully computed by these approaches. The latter subject has been well-studied in the area of knowledge representation (KR), but many KR formalisms, including answer set programming (ASP), are logic-oriented and do not incorporate high-dimensional feature space as in deep learning, which limits the applicability of KR in many practical applications.
In ([2]), we present a simple extension of answer set programs by embracing neural networks. Following the idea of DeepProbLog ([1]), by treating the neural network output as the probability distribution over atomic facts in answer set programs, the proposed formalism called NeurASP provides a simple and effective way to integrate sub-symbolic and symbolic computation.
In NeurASP, a neural network $M$ is represented by a neural atom of the form
Each neural atom $~~~nn(m(e, t), \left[v_1, \dots, v_n \right])~~~$ introduces propositional atoms of the form $c= v$, where $c\in\{m_1(t), \dots, m_e(t)\}$ and $v\in\{v_1,\dots,v_n\}$. The output of the neural network provides the probabilities of the introduced atoms.
Example. $~~$ Let $M_{digit}$ be a neural network that classifies an MNIST digit image. The input of $M_{digit}$ is (a tensor representation of) an image and the output is a matrix in $\mathbb{R}^{1\times 10}$. This neural network can be represented by the neural atom "$ nn( digit(1,d),\ [0,1,2,3,4,5,6,7,8,9]), $" which introduces propositional atoms "$digit_1(d)= 0$, $digit_1(d)= 1$, $\dots$, $digit_1(d)= 9$."
A NeurASP program $\Pi$ is the union of $\Pi^{asp}$ and $\Pi^{nn}$, where $\Pi^{asp}$ is a set of propositional ASP rules and $\Pi^{nn}$ is a set of neural atoms. Let $\sigma^{nn}$ be the set of all atoms $m_i(t) = v_j$ that is obtained from the neural atoms in $\Pi^{nn}$ as described above. We require that, in each rule $Head \leftarrow Body$ in $\Pi^{asp}$, no atoms in $\sigma^{nn}$ appear in $Head$.
The semantics of NeurASP defines a stable model and its associated probability originating from the neural network output. For any NeurASP program $\Pi$, we first obtain its ASP counterpart $\Pi'$ where each neural atom $~~~nn(m(e, t), \left[v_1, \dots, v_n \right])~~~$ is replaced with the set of "choice" rules
The stable models of $\Pi$ are defined as the stable models of $\Pi'$.
To define the probability of a stable model, we first define the probability $P_\Pi(m_i(t)=v_j)$ of an atom $m_i(t)= v_j$ in $\sigma^{nn}$ as the probability of the $j$-th outcome of the $i$-th event outputted by the neural network $M$ upon the input tensor pointed by ${t}$.
Based on this, the probability of an interpretation $I$ is defined as follows.
The paper ([2]) illustrates how NeurASP can be useful for some tasks where both perception and reasoning are required. Reasoning can help identify perception mistakes that violate semantic constraints, which in turn can make perception more robust. For example, a neural network for object detection may return a bounding box and its classification "car," but it may not be clear whether it is a real car or a toy car. The distinction can be made by applying reasoning about the relations with the surrounding objects and using commonsense knowledge. In the case of a neural network that recognizes digits in a given Sudoku board, the neural network may get confused if a digit next to 1 in the same row is 1 or 2, but NeurASP could conclude that it cannot be 1 by applying the constraints for Sudoku.
NeurASP also alleviates the burden of neural networks when the constraints/knowledge are already given. Instead of building a large end-to-end neural network that learns to solve a Sudoku puzzle given as an image, we can let a neural network only do digit recognition and use ASP to find the solution of the recognized board. This makes the design of the neural network simpler and the required training dataset much smaller. Also, when we need to solve some variation of Sudoku, such as Anti-knight or Offset Sudoku, the modification is simpler than training another large neural network from scratch to solve the new puzzle.
Since NeurASP is a simple integration of ASP with neural networks, it retains each of ASP and neural networks in individual forms, and can directly utilize the advances in each of them. The current implementation is a prototype and not highly scalable due to a naive computation of enumerating stable models. The future work is to improve computational methods.
Acknowledgements. $~~$ This work was supported in part by NSF under grants IIS-1815337 and IIS-2006747.