Keywords

These keywords were added by machine and not by the authors. This process is experimental and the keywords may be updated as the learning algorithm improves.

1 Introduction

When studying concepts and methods for nonmonotonic reasoning, actually implemented and operational systems realizing the developed approaches can be very helpful. Besides providing a proof-of-concept, such systems may also yield the basis for practical applications. In recent years, our group at the University of Hagen has been involved in the development of several software systems implementing reasoning tasks for conditional logics. The types of conditional logics covered by these systems comprise pure qualitative logics providing default rules like “If A, then normally B” and also quantitative probabilistic logics with rules like “If A, then B with probability x”, based either on an underlying propositional language or on a first-order language. The purpose of this paper is to provide a brief overview of some of these systems and to illustrate the reasoning tasks they address.

In Sect. 2, after sketching syntax and models of several propositional conditional logics, systems dealing with these logics are presented, both for qualitative logics and for probabilistic logics. Along the same dimensions, Sect. 3 deals with first-order conditionals. In Sect. 4, we conclude and point out future work.

2 Propositional Conditional Logics

2.1 Unquantified and Quantified Conditionals

We start with a propositional language \(\mathcal L\), generated by a finite set \(\varSigma \) of atoms \(a,b,c, \ldots \). The formulas of \(\mathcal L\) will be denoted by uppercase Roman letters \(A,B,C, \ldots \). For conciseness of notation, we may omit the logical and-connective, writing AB instead of \(A \wedge B\), and overlining formulas will indicate negation, i.e. \(\overline{A}\) means \(\lnot A\). Let \(\varOmega \) denote the set of possible worlds over \(\mathcal L\); \(\varOmega \) will be taken here simply as the set of all propositional interpretations over \(\mathcal L\) and can be identified with the set of all complete conjunctions over \(\varSigma \). For \(\omega \in \varOmega \), \(\omega \,\models \, A\) means that the propositional formula \(A \in \mathcal L\) holds in the possible world \(\omega \).

By introducing a new binary operator |, we obtain the set

$$ (\mathcal L\mid \mathcal L) = \{ (B|A) \mid A,B \in \mathcal L\} $$

of unquantified conditionals over \(\mathcal L\). A conditional \((B | A)\) formalizes “if A then (normally) B” and establishes a plausible, probable, possible etc. connection between the antecedent A and the consequence B. By attaching a probability value to an unquantified conditional, we obtain the set

$$ {(\mathcal L\mid \mathcal L)}^{ prob }= \{ (B|A)[x] \mid A,B \in \mathcal L, \, x \in [0,1]\} $$

of all probabilistic conditionals (or probabilistic rules) over \(\mathcal L\). A knowledge base \(\mathcal R\) is a set of conditionals from \((\mathcal L\mid \mathcal L)\) or from \({(\mathcal L\mid \mathcal L)}^{ prob }\), respectively.

Example 1

(Qualitative conditional knowledge base). Suppose we have the propositional atoms f - flying, b - birds, p - penguins, w - winged animals, k - kiwis. Let the set

$$ {\mathcal R_{ bird }}= \{(f|b), (b|p), (\overline{f}|p), (w|b), (b|k)\} $$

consist of the following five conditionals:

figure a

Example 2

(Probabilistic conditional knowledge base). We use the well-known Léa Sombé example (see e.g. [47]) and consider the three propositional variables \(s\) - being a student, \(y\) - being young, and \(u\) - being unmarried. Students and unmarried people are mostly young. This commonsense knowledge an agent may have can be expressed by the probabilistic knowledge base

$$ {\mathcal R_{ syu }}= \{(y|s)[0.8], \, (y|u)[0.7]\} $$

containing the two conditionals:

figure b

2.2 Models of Propositional Conditional Knowledge Bases

In order to give appropriate semantics to conditionals, they are usually considered within richer structures such as epistemic states. Besides certain (logical) knowledge, epistemic states also allow the representation of preferences, beliefs, assumptions of an intelligent agent. Basically, an epistemic state allows one to compare formulas or worlds with respect to plausibility, possibility, necessity, probability, etc.

In a quantitative framework with probabilistic conditionals, obvious representations of epistemic states are provided by probability distributions \(P: \varOmega \rightarrow [0,1]\) with \(\sum _{\omega \in \varOmega } P(\omega ) = 1\). The probability of a formula \(A \in \mathcal L\) is given by \(P(A) = \sum _{\omega \models A} P(\omega )\), and the probability of a conditional \((B|A) \in (\mathcal L\mid \mathcal L)\) with \(P(A) > 0\) is defined as \(P(B|A) = \displaystyle \frac{P(AB)}{P(A)}\), the corresponding conditional probability. Thus, the satisfaction relation \( \, {\models }^{{ prob }} \, \) between probability distributions over \(\varOmega \) and conditionals from \({(\mathcal L\mid \mathcal L)}^{ prob }\) is defined by:

$$\begin{aligned} P \, {\models }^{{ prob }} \, (B|A)[x] \,\,\, \text {iff} \,\,\, P(A) > 0 \text { and } P(B|A) = \frac{P(AB)}{P(A)} = x \end{aligned}$$
(1)

As usual, this relation is extended to a set \(\mathcal R\) of conditionals by defining \( P \, {\models }^{{ prob }} \, \mathcal R\) iff \( P \, {\models }^{{ prob }} \, (B|A)[x] \) for all \((B|A)[x] \in \mathcal R\); for all satisfaction relations considered in the rest of this paper, we will tacitly assume the corresponding extension to sets of conditionals.

Example 3

For the propositional language used in Example 2, let \(P^*\) be the probability distribution given by:

figure c

It is easy to check that ; for instance since and , we have and thus .

Various types of models have been proposed to interpret qualitative conditionals \((B|A)\) adequately within a logical system (cf. e.g. [39]). One of the most prominent approaches is the system-of-spheres model of Lewis [38] which makes use of a notion of similarity between possible worlds. Other, more fine-grained semantics for conditionals use numbers to compare different degrees of “plausibility” between the verification and the falsification of a conditional. In these qualitative frameworks, a conditional (B|A) is accepted (or verified), if its confirmation, AB, is more plausible, possible etc. than its refutation, \(A\overline{B}\); a suitable degree of acceptance is calculated from the degrees associated with AB and \(A\overline{B}\). Here, two of the most popular approaches to represent epistemic states are ordinal conditional functions, OCFs, (also called ranking functions) [49, 50], and possibility distributions [11, 14], assigning degrees of plausibility, or of possibility, respectively, to formulas and possible worlds.

In the following, we will focus on OCFs [49]. An OCF \(\kappa \) is a function \( \kappa : \varOmega \rightarrow \mathbb {N}\cup \{\infty \} \) with \(\kappa ^{-1}(0) \ne \emptyset \). The smaller \(\kappa (\omega )\), the less suprising or the more plausible the world \(\omega \). For formulas \(A \in \mathcal L\), \(\kappa (A)\) is given by:

$$ \kappa (A) = {\left\{ \begin{array}{ll}\min \{\kappa (\omega ) \mid \omega \,\models \, A\} &{} \text {if } A \text { is satisfiable} \\ \infty &{} \text {otherwise} \end{array}\right. } $$

The satisfaction relation between OCFs and qualitative conditionals from \({(\mathcal L\mid \mathcal L)}\), denoted by \(\models ^{ ocf }\), is defined by:

$$ \kappa \,\models ^{ ocf }(B|A) \,\,\,\text {iff}\,\,\, \kappa (AB) < \kappa (A\overline{B}) $$

Thus, a conditional \((B|A)\) is accepted by the ordinal conditional function \(\kappa \) iff its confirmation AB is less surprising than its refutation \(A\overline{B}\).

Fig. 1.
figure 1

OCF \(\kappa \) accepting \({\mathcal R_{ bird }}\) from Example 1

Example 4

For the propositional language used in Example 1, let \(\kappa \) be the OCF given in Fig. 1. For the conditional \((\overline{f}|p) \in {\mathcal R_{ bird }}\), we have \(\kappa (p\overline{f}) = 1 < 2 = \kappa (pf)\) and thus \( \kappa \,\models ^{ ocf }(\overline{f}|p) \). Similarly, it is easy to check that \(\kappa \) also accepts the other conditionals in \({\mathcal R_{ bird }}\), implying \(\kappa \, \models ^{ ocf }{\mathcal R_{ bird }}\).

2.3 Systems for Reasoning with Propositional Conditional Knowledge Bases

Reasoning with respect to a conditional knowledge base \(\mathcal R\) means to determine what \(\mathcal R\) entails. While in classical logic, entailment is defined with respect to all models, for probabilistic conditional knowledge bases this approach is very restrictive since it may yield only uninformative answers. Therefore, entailment may be defined with respect to a set of some best or preferred models.

In probabilistic conditional logic, the principle of maximum entropy (ME principle) has been advocated [28, 30, 40, 41]. While in general, each model of a probabilistic conditional knowledge base \(\mathcal {R}\) determines a particular way of extending and completing the probabilistic knowledge expressed in \(\mathcal {R}\) to a full probability distribution, the ME principle selects the distribution that accepts \(\mathcal {R}\) and that is as unbiased as possible. Formally, given a knowledge base \(\mathcal {R} = \{(B_1|A_1)[x_1], \ldots , (B_n|A_n)[x_n]\}\), \( ME (\mathcal {R})\) is the unique probability distribution that satisfies all constraints specified by \(\mathcal {R}\) and has the highest entropy \( \mathcal {H}(P) = - \sum _{\omega \in \varOmega } P(\omega ) \log P(\omega ) \) among all models P of \(\mathcal {R}\):

$$\begin{aligned} ME (\mathcal {R}) = \text {arg} \max _{P \models \mathcal {R}} \mathcal {H}(P) \end{aligned}$$
(2)

Reasoning in probabilistic conditional logic by employing the principle of maximum entropy [28, 40] requires solving the numerical optimization problem given in Eq. (2). MEcore [19] is a software system implementing maximum entropy reasoning. While MEcore does not employ a junction-tree modelling as in the expert system shell SPIRIT [48], but a straightforward representation of the complete probability distribution, its focus is on flexibly supporting different basic knowledge and belief management functions like revising or updating probabilistic beliefs, or hypothetical reasoning in what-if mode. In addition, there is a component checking the consistency of a knowledge base \(\mathcal R\), i.e., checking whether the set of models of \(\mathcal R\) is non-empty. A query asking for the probability of \((B|A)\) in the context of \(\mathcal R\) is answered with respect to the uniquely defined maximum entropy model \( ME (\mathcal {R})\), i.e., \((B|A)[x]\) is ME-entailed from \(\mathcal R\) iff \( ME (\mathcal {R})(B|A) = x\). The distribution \(P^*\) given in Example 3 is in fact the ME distribution computed by MEcore for \({\mathcal R_{ syu }}\), i.e., we have \(P^*= ME ({\mathcal R_{ syu }})\). MEcore can be controlled by a text command interface or by script files containing command sequences. It features an expressive command language which allows, e.g., to manipulate knowledge bases, and to automate sequences of updates and revisions. Besides this, a Java software interface allows to integrate MEcore in other programs. In [3, 33], the functionalities of MEcore are illustrated in applications of ME modelling and reasoning in the medical domain.

The methodological theory of conditionals developed by Kern-Isberner [29, 30] allows to describe the aim of knowledge discovery in a very general sense: to reveal structures of knowledge which can be seen as structural relationships being represented by conditionals. In this setting, knowledge discovery is understood as a process which is inverse to inductive knowledge representation. By applying this theory, an algorithm that computes sets of propositional probabilistic conditionals from distributions was developed and implemented in the system CondorCKD [22, 23, 34] using the functional programming language Haskell.

For propositional qualitative conditional logic using OCFs, p-entailment [25] is an inference relation defined with respect to all OCF models of a knowledge base \(\mathcal R\): If AB are formulas, then A p-entails B in the context of \(\mathcal R\) iff \(\kappa \, \models \, (B|A)\) for all \(\kappa \) such that \(\kappa \,\models \,\mathcal R\). System P [1] provides a kind of gold standard for plausible, nonmonotonic inferences, and in [13] it is shown that, given a knowledge base \(\mathcal R\), system P inference is the same as p-entailment.

There are also inference relations which are defined with respect to specific OCFs obtained inductively from a knowledge base \(\mathcal R\). System Z [42] is based upon the ranking function which is the unique minimal OCF that accepts \(\mathcal R\); this ranking function is obtained from an ordered partition \((\mathcal R_0,...,\mathcal R_m)\) of \(\mathcal R\) defined by the notion of tolerance [42]. Other OCFs accepting \(\mathcal R\) that have favourable inference properties are c-representations [30, 31]. A c-representation of \(\mathcal R\) is a ranking function \(\kappa \) constructed from integer impacts \(\eta _{i}\in \mathbb {N}_0\) assigned to each conditional \((B_i|A_i) \in \mathcal R\) such that \(\kappa \) accepts \(\mathcal R\) and is given by [31]:

$$\begin{aligned} \kappa (\omega ) =\sum \limits _{\begin{array}{c} 1 \leqslant i \leqslant n\\ \omega \models A_i\overline{B}_i \end{array}}\eta _{i} \end{aligned}$$
(3)

Condor@AsmL [6] is a software system that implements automated reasoning with qualitative default rules employing c-representations. Based on a characterization theorem for c-representations and c-revisions and an approach to compute c-representations and c-revisions using the tolerance-induced partition of \(\mathcal R\) [31], inference is done with respect to the OCF thus obtained from \(\mathcal R\). Condor@AsmL provides functionalities for advanced knowledge management tasks like belief revision and update or diagnosis and hypothetical what-if-analysis for qualitative conditionals. Condor@AsmL implements the abstract Condor specification given in [4] and was developed in AsmL [26], allowing for a high-level implementation that minimizes the gap between the mathematical specification of the underlying concepts and the executable code and supports the formal verification of the implemented system [5].

While Condor@AsmL computes a c-representation for any \(\mathcal R\) that is consistent, this c-representation may not be minimal. Unlike in system Z where there is a unique minimal OCF, there may be more than one minimal c-representation. In [7], the set of all c-representations for \(\mathcal R\) is specified as the set of all solutions of a constraint satisfaction problem \( CR (\mathcal R)\), and a high-level declarative approach using constraint logic programming (CLP) techniques for solving the constraint satisfaction problem \( CR (\mathcal R)\) is presented. In particular, the approach developed in [7] supports the generation of all minimal solutions; these minimal solutions are of special interest as they provide a preferred basis for model-based inference from \(\mathcal R\). Moreover, different notions of minimality are investigated and the flexibility of the approach is demonstrated by showing how alternative minimality concepts can be taken into account by slight modifications of the CLP implementation. In [2], a skeptical inference relation taking all c-representations of \(\mathcal R\) into account is introduced, and it is demonstrated that it can be implemented as a constraint satisfaction problem that extends \( CR (\mathcal R)\).

3 First-Order Conditional Logics

As an illustration for first-order probabilistic conditionals, consider the following example, adapted from [12], modelling the relationships among elephants in a zoo and their keepers. Elephants usually like their keepers, except for keeper Fred. But elephant Clyde gets along with everyone, and therefore he also likes Fred. The knowledge base \(\mathcal {R} _{ ek }\) consists of the following conditionals:

$$ \begin{array}{l} \textit{ek}_{1}: \ ( likes (E, K)\mid elephant (E), keeper (K))[0.9]\\ \textit{ek}_{2}: \ ( likes (E, fred )\mid elephant (E), keeper ( fred ))[0.05]\\ \textit{ek}_{3}: \ ( likes ( clyde , fred )\mid elephant ( clyde ), keeper ( fred )[0.85] \end{array} $$

Conditional \(\textit{ek}_{1}\) models statistical knowledge about the general relationship between elephants and their keepers (“elephants like their keeper with probability 0.9”), whereas conditional \(\textit{ek}_{2}\) represents knowledge about the exceptional keeper Fred and his relationship to elephants in general (“elephants like keeper Fred only with probability 0.05”). Conditional \(\textit{ek}_{3}\) models subjective belief about the relationship between the elephant Clyde and keeper Fred (“elephant Clyde likes keeper Fred with probability 0.85”). From a common-sense point of view, the knowledge base \(\mathcal {R} _{ ek }\) makes perfect sense: conditional \(\textit{ek}_{2}\) is an exception of \(\textit{ek}_{1}\), and \(\textit{ek}_{3}\) is an exception of \(\textit{ek}_{2}\).

However, assigning a formal semantics to \(\mathcal {R} _{ ek }\) is not straightforward. For instance, for transforming the propositional approach employed in Eq. (1) to the relational case with free variables as in \(\mathcal {R} _{ ek }\), the exact role of the variables has to be specified. While there are various approaches dealing with a combination of probabilities with a first-order language (e.g. [24, 27, 35, 36]) here we focus on two semantics for probabilistic relational conditionals, the aggregating semantics [36] proposed by Kern-Isberner and the grounding semantics employed in the logic FO-PCL [21].

While the two approaches are related in the sense that they refer to a (finite) set of constants when interpreting the variables in the conditionals, there is also a major difference. FO-PCL requires all groundings of a conditional to have the same probability x given in the conditional, and in general, FO-PCL needs to restrict the possible instantiations for the variables occurring in a conditional by providing constraint formulas like \(U \ne V\) or \(U \ne a\) in order to avoid inconsistencies. Thus, while the aggregating semantics uses probabilistic conditionals \((B|A)[x]\) with relational formulas AB, these conditionals are extended by a constraint formula C to \(\langle (B|A)[x],C\rangle \) in FO-PCL. The models of a knowledge base \(\mathcal R\) consisting of such first-order probabilistic conditionals are again probability distributions over the possible worlds, where a possible world is a subset of the Herbrand base induced by the predicates and constants used for \(\mathcal R\).

The satisfaction relation \(\models _{\otimes }\) for FO-PCL is defined by

$$\begin{aligned} P \,\models _{\otimes }\langle (B | A) [x], C\rangle \ \text{ iff } \frac{ P\left( \theta (AB) \right) }{P\left( \theta (A) \right) } = x \\ \nonumber \text{ for } \text{ all } \theta \in \varTheta ^{ adm } (\langle (B | A) [x], C\rangle ) \end{aligned}$$
(4)

where \(\varTheta ^{ adm } (\langle (B | A) [x], C\rangle )\) is the set of all admissible ground substitutions \(\theta \) for the given conditional, i.e. where \(\theta (C)\) evaluates to true. Thus, a probability distribution P \(\otimes \)-satisfies a conditional \(\langle (B | A) [x], C\rangle \) if it satisfies each admissible individual instantiation of it. In contrast, the satisfaction relation \(\models _{\odot }\) for aggregating semantics [36] is less strict with respect to probabilities of ground instances, since it is capable of balancing the probabilities of ground instances in order to ensure the probability x given by a conditional; \(\models _{\odot }\) is defined by

$$\begin{aligned} \begin{array}{l} P\,\models _{\odot } (B | A) [x]\ \text{ iff } \displaystyle \frac{ \sum \limits _{\theta \in \varTheta ((B | A) [x])} P(\theta (AB) ) }{ \sum \limits _{\theta \in \varTheta ((B | A) [x])} P(\theta (A)) } = x\; \end{array} \end{aligned}$$
(5)

where \(\varTheta ((B | A) [x])\) is the set of all ground substitutions of \((B | A) [x]\).

The principle of maximum entropy used in the propositional setting (Equation (2)) has been extended to first-order knowledge bases for aggregating semantics and for FO-PCL [21, 36] by defining

$$\begin{aligned} ME _{\bullet }(\mathcal {R}) = \arg \max _{P\models _{\circ } \mathcal R}\mathcal {H}(P) \end{aligned}$$
(6)

where \(\bullet \in \{\otimes , \odot \}\). Since for FO-PCL grounding and for aggregating semantics the set of models is convex, the optimization problem in (6) yields a unique solution for every consistent \(\mathcal {R}\). Thus, analogously to the propositional case, reasoning can be done with respect to the maximum entropy model \( ME _{\bullet }(\mathcal {R})\).

Software components for these inference tasks have been implemented in KReator Footnote 1 [20], an integrated development environment for representing, reasoning, and learning with relational probabilistic knowledge. In particular, KReator provides specific plugins for an optimized computation of the ME model under aggregating semantics (cf. [1618]) that exploits the conditional structure of \(\mathcal R\) and its induced equivalence classes [30, 37]. The KReator plugin for FO-PCL semantics employs a simplification of the ME model computation by transforming \(\mathcal R\) into an equivalent knowledge base \(\mathcal R'\) that is parametrically uniform [810, 21]. Furthermore, algorithms for solving various reasoning problems for probabilistic conditional logics that also take inconsistent information into account have been implemented in the Log4KR libraryFootnote 2 [4346].

In [37], ranking functions for qualitative first-order conditionals are introduced, and in [32], a system Z-like approach for first-order default reasoning is developed. Unlike propositional system Z, the first-order approach of [32] may yield more than one minimal solution; an implementation of the approach in [32] using Log4KR is given in [15].

4 Conclusions and Future Work

Conditionals play a major role in logic-based knowledge representation and reasoning. In this paper, we gave a brief survey on different versions of conditional logics and illustrated corresponding reasoning tasks addressed by software systems that have been implemented within our research projects in recent years. Our current work includes the further exploitation of conditional structures for relational probabilistic inference under maximum entropy, and the investigation of the precise properties of inference with c-representations using OCFs in the propositional case and with the system Z-like approach in the relational case.