A tool for non-monotonic logics - THI

Bachelor Thesis
A tool for non-monotonic logics
Nicola Gruhl
Matrikelnummer: 2843050
17. März 2015
angefertigt am
Institut für Theoretische Informatik
Gottfried Wilhelm Leibniz Universität Hannover
Erstprüfender
Prof. Dr. Heribert Vollmer
Zweitprüfender Dr. Arne Meier
Betreuer
Dr. Arne Meier
Erklärung
Hiermit versichere ich, dass ich die vorliegende Bachelorarbeit selbstständig verfasst und
keine anderen als die angegebenen Hilfsmittel und Quellen genutzt habe.
Hannover, den 17. März 2015
Nicola Gruhl
Contents
1 Introduction
7
2 Non-monotonic Logic
7
3 Default Logic
3.1 Stable Extension . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .
8
9
4 Autoepistemic Logic
10
4.1 Stable Expansion . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 10
5 Boolean Functions
12
5.1 Notations for Boolean functions . . . . . . . . . . . . . . . . . . . . . . . . 12
5.2 Boolean Clones . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 13
6 Complexity Classes
14
7 Implication Problem
15
8 Decision Problems in Default Logic
8.1 Extension Existence Problem . . . . . . . . . . . . . . . . . . . . . . . . .
8.2 Credulous Reasoning Problem . . . . . . . . . . . . . . . . . . . . . . . . .
8.3 Skeptical Reasoning Problem . . . . . . . . . . . . . . . . . . . . . . . . .
22
22
26
28
9 Decision Problems in Autoepistemic Logic
29
9.1 Expansion Existence Problem . . . . . . . . . . . . . . . . . . . . . . . . . 30
9.2 Credulous Reasoning Problem . . . . . . . . . . . . . . . . . . . . . . . . . 37
9.3 Skeptical Reasoning Problem . . . . . . . . . . . . . . . . . . . . . . . . . 41
10 Tool for non-monotonic logics
42
10.1 Program . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 42
10.2 Implementation . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 44
11 Summary
45
12 Appendix
47
12.1 Boolean clones . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 47
12.2 Post’s Lattice . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 48
1 Introduction
A logic is a formal construct that maps facts to consequences. Monotonic logics always
extend their set of consequences, whereas non-monotonic logic is a logic that allows
the reduction of the set of consequences by adding a fact. This is the case, because in
non-monotonic logics, consequences can be derived as they are the most probable or the
contrary can not be proven.
This work concentrates on two non-monotonic logics: default and autoepistemic logic.
Based on certain knowledge, both logics imply rules to find information to expand this
knowledge base. In default logic this expanded knowledge base is called stable expansion, in autoepistemic logic stable extension. As these logics are non-monotone, the same
knowledge base can have di↵erent extensions respectively expansions. This leads to the
three decision problems for those logics solved in the main part of this work. Those are
the extension respectively expansion existence problem, the credulous reasoning problem
and the skeptical reasoning problem. The first problem deals with the question whether
any extension respectively expansion exists, while the second problem outlines the issue
whether any extension respectively expansion contains a certain information. The last
problem deals with the demand to find out whether all of the extensions respectively
expansions are containing a certain information.
In the next section, a short introduction to non-monotonic logic in general is given,
before the two logics will be explained and defined individually together with a formal definition of stable extensions respectively expansions. Afterwards the considered
Boolean functions are grouped into di↵erent Boolean clones, because the decision problems can be solved with easier algorithms for some of the clones than for the other.
Subsequently the complexity classes that are relevant afterwards are shortly introduced.
Before the two main sections in which the decision problems for both logics are solved,
the implication problem is introduced which is essential for solving these problems. It is
concerned with the question whether a set of facts implies a certain statement. Followed
by a short summary of the results, the last section contains an introduction to the tool
for non-monotonic logics that was implemented.
2 Non-monotonic Logic
In contrast to monotonic logic in which only proven facts can be concluded and therefore
any further information can never disprove former conclusions, in non-monotonic logic
nonproven facts can be concluded. This means that propositions can be assumed on an
incomplete knowledge base and may be withdrawn based on further information that
gets taken into account later. For example in medical diagnosis a diagnose based on
the symptoms is proposed, but the diagnose may be revoked based on some future test
results [1].
So non-monotonic reasoning equals the human way of thinking, because people often
7
conclude things due to the fact that they are presumable, although they might be false.
Concluding things although you might have an incomplete knowledge base works for
non-monotonic logic because it is based on the closed world assumption. Regarding
this assumption, all circumstances which are not part of the model (for example your
knowledge base) are considered as wrong. On the other hand, logics based on the open
world assumption have to consider all exclusions to proof something right or wrong [13].
3 Default Logic
Default logic is the best known non-monotonic logic and was introduced by Reiter[10]
in 1980. With default logic you can operate with incomplete information. It allows to
assume things only because the opposite can not be proven [8]. Default logic has the
following syntax:
Definition 1 (B-default rule) Let a B-formula be a formula using only Boolean functions from a finite set B, then a B-default rule is a term d = ↵: :
• ↵ is the prerequisite
•
is the justification
•
is the consequence
where ↵, and are B-formula. The meaning of a default rule
¬ cannot be proven, it is assumed that is true [2].
↵:
is: If ↵ is true and
As an example, if it is known that x is a bird (prerequisite) and based on an incomplete
knowledge base it can not be proven that it can not fly (negation of the justification),
one can assume that it flies (consequence), because that is presumable since most birds
are able to fly. On the opposite in a monotonic logic one could only assume that x
can fly, if it can be proven, meaning that all other possibilities of birds that do not fly
(penguins, fledglings and so on) have to be excluded [9].
A knowledge base (containing only B-formula) and a set of B-default rules for extending
is called a B-default theory and has the following syntax:
Definition 2 (B-default theory) [2]
A B-default theory is a pair hW, Di:
• W is a set of propositional B-formulae.
• D is a finite set of B-default rules.
8
3.1 Stable Extension
In the following, for a set of formula A and a formula ' the term A |= ' is written, if
all assignments satisfying A satisfy ' as well. Furthermore the set Th(A) is defined as
the set of all consequences of A, which means Th(A) = {' | A |= '}.
For a default theory hW, Di the fragmentary set of facts W can be completed using the
default rules in D to get an extension which is defined as follows.
Definition 3 (Stable Extension) [2]
Given a default theory hW, Di and a set of formulae E, let
formulae so that:
be the smallest set of
1. W ✓ (E)
2.
(E) is closed under deduction, which means (E) = Th( (E))
3. For all defaults
↵:
2 D with ↵ 2 (E) and ¬ 2
/ E follows that
2 (E)
A (stable) extension of hW, Di is a set of formulae E such that E = (E).
The first condition guarantees that the original knowledge base W is contained in every
extension. Moreover the second condition ensures that all formulae that can be derived
from the other formulae in (E) are also contained. The last condition handles the
default rules by ensuring that their consequences are contained if the default rule is
applicable.
a:¬x
For example the default theory hW, Di with W = {a} and D = a:x
has the
x , ¬x
stable extension {a, x}, but it also has the extension {a, ¬x}. A default theory can also
have no stable extension at all. A simple example is the theory hW, Di with W = ; and
D = a:¬x
. The default rule is only applicable if the negation of ¬x which equals x is
x
not true. On the other hand, if the extension contains the consequence x of this default
rule, the default rule does not apply anymore.
Stable extensions do not have to be consistent, but only if the set of formula W is already
inconsistent. Moreover it holds for a default theory hW, Di:
• If W is consistent, then every stable extension of hW, Di is consistent.
• If W is inconsistent, then hW, Di has a stable extension [2].
9
4 Autoepistemic Logic
Autoepistemic logic is a non-monotonic logic introduced by Moore[16] as a modal logic
with a single modal operator L. L expresses the beliefs of an ideally rational agent.
For example the formula Lx ! y means that if the agent believes in x, then y can be
concluded [17].
The set of all autoepistemic formulae has the following definition.
Definition 4 (Autoepistemic Formulae) [7]
If B is a finite set of Boolean functions, then the set of autoepistemic B-formulae Lae (B)
is defined as follows:
' ::= | f ( , . . . , ) | L',
with f 2 B and a propositional B-formula .
The consequence relation |= of propositional logic is extended to Lae (B) by simply
treating L' as an atomic formula.
4.1 Stable Expansion
In default logic the stable extension was introduced. The equivalent in autoepistemic
logic is a stable expansion which describes the logical consequences of the knowledge and
beliefs of the agent. Stable expansions are defined as follows.
Definition 5 (Stable Expansion) [7]
Let B be a finite set of Boolean functions and let ⌃ ✓ Lae (B) be a set of autoepistemic
B-formulae. A set ✓ Lae is called stable expansion of ⌃ if it satisfies the condition
= Th(⌃ [ L( ) [ ¬L( )),
where L( ) := {L' | ' 2
} and ¬L( ) := {¬L' | ' 62
}.
For example the set ⌃ = {x $ Lx} has two stable expansions. The first one contains x
and Lx and the other one contains ¬x and ¬Lx. The set ⌃ can have no expansions at
all. For example consider ⌃ = {Lx} [6].
In the following a finitary characterization of the stable expansions of ⌃ is introduced
[11]. Therefore a set SFL (⌃) is defined which equals the set of all subformulae of the
form L of each formula in ⌃. If ⌃ is {L(Lx LLy)} for example, then SFL (⌃) would
be {L(Lx LLy), Lx, LLy, Ly}.
Definition 6 (⌃-full sets) For a set of autoepistemic B-formulae ⌃ a set ⇤ ✓ SFL (⌃)
[ {¬L | L 2 SFL (⌃)} is ⌃-full if the following two conditions hold for every L 2
SFL (⌃):
10
1. ⌃ [ ⇤ |=
i↵ L 2 ⇤.
2. ⌃ [ ⇤ 6|=
i↵ ¬L 2 ⇤.
Proposition 1 [11]
Let ⇤ be a ⌃-full set. Then for every L 2 SFL (⌃) exactly one of L or ¬L belongs to
⇤.
For example the set ⌃ = {x $ Lx} has two ⌃-full sets: ⇤1 = {Lx} and ⇤2 = {¬Lx}.
One may notice that there are exactly the same number of expansions as ⌃-full sets.
Indeed there is a one-to-one correspondence between the stable expansions of any set ⌃
and its ⌃-full sets [11].
For the case that ⌃ contains the formula ¬Lx for any variable x, there always exist a
⌃-full set, namely the one containing no negations, respectively ⇤ = SFL (⌃). This set
must be ⌃-full, because ⌃ [ ⇤ contains ¬Lx and Lx, which means it is inconsistent. If
⌃ [ ⇤ is inconsistent it holds for every that ⌃ [ ⇤ |= , so the first condition for ⌃-full
sets is satisfied. It remains the second condition, which is obviously satisfied, since it is
assumed that there are no negations in ⇤.
The set SFq (⌃) is defined as all quasi-subformulae of every 2 ⌃. A quasi-subformula
is a normal subformula except that a formula of the form L has no further subformulae
[6]. For the set ⌃ = {L(x $ Lx) _ y}, the set of all quasi-subformulae is SFq (⌃) =
{L(x $ Lx) _ y, L(x $ Lx), y} for example.
Furthermore the stable expansion of ⌃ ✓ Lae corresponding to ⇤ is written SE⌃ (⇤) and
⇤ is called its kernel.
To make the correspondence between SE⌃ (⇤) and ⇤ more clear, a new consequence
relation is defined.
Definition 7 (|=L ) [7]
For ⌃ ✓ Lae and ' 2 Lae the consequence relation |=L is defined as follows:
⌃ |=L ' () ⌃ [ SB⌃ (') |= ',
where SB⌃ (') := {L 2 SFq (') | ⌃ |=L } [ {¬L | L 2 SFq ('), ⌃ 6|=L }.
The connection between a ⌃-full set ⇤ and the correspondent stable expansion SE⌃ (⇤)
can now be defined by the following Lemma.
Lemma 1 [11]
Let ⌃ ✓ Lae , let ⇤ be a ⌃-full set, and let ' 2 Lae . It holds that ⌃ [ ⇤ |=L ' if and only
if ' 2 SE⌃ (⇤).
For example for the set ⌃ = {x $ Lx} the stable expansions are SE⌃ ({Lx}) = {x, Lx}
and SE⌃ ({¬Lx}) = {¬x, ¬Lx}.
Stable expansions do not have to be consistent, but only if ⌃ [ SFL (⌃) is already inconsistent.
11
5 Boolean Functions
5.1 Notations for Boolean functions
Boolean functions can have the following attributes [2]:
• f is c-reproducing if f (c, . . . , c) = c, c 2 {0, 1}.
To check whether a function is c-reproducing, you can just set the value of
all variables to c, evaluate the formula and test whether the result equals c
as well.
• f is monotone if a1  b1 , a2  b2 , . . . , an  bn implies f (a1 , . . . , an )  f (b1 , . . . , bn ).
If the truth table of the formula is used, it can be checked whether f is
monotone by going through the truth table, and for each variable which is 0,
turn it to 1. If the value of the formula is greater than or equal to before for
all entries in the truth table, the function is monotone.
• f is c-separating if there exists an i 2 {1, . . . , n} such that f (a1 , . . . , an ) = c
implies ai = c, c 2 {0, 1}.
Using the truth table again, it can be checked whether a formula is c-separating
by testing for all entries with the value c whether there exists at least one
variable with the same value.
• f is self -dual if f ⌘ dual(f ), where dual(f )(x1 , . . . , xn ) = ¬f (¬x1 , . . . , ¬xn ).
To check if a function is self-dual, one can just test whether the second half of
the values in the truth table are the same as the first half but mirror inverted.
Let the values of the first half of the truth table be c1 , . . . , cm 2 {0, 1}. To
check if a function is self-dual, it has to be tested whether the values of the
second half equal ¬cm , . . . , ¬c1 .
• f is linear if f ⌘ x1 . . . xn c for a constant c 2 {0, 1} and variables x1 , . . . , xn .
(Meaning if the value of one variable is switched, the value for f changes.)
Linearity can be proven by checking whether one of the following two cases
is true:
1. In every row of the truth table where the value of f is 1 there is an odd
number of 1s assigned to the variables and in every row where the value of f
is 0 there is an even number of 1s assigned to the variables.
2. In every row of the truth table where the value of f is 1 there is an even
number of 1s assigned to the variables and in every row where the value of f
12
is 0 there is an odd number of 1s assigned to the variables.
• f is a disjunction if it is equivalent to a formula c0 _
constant.
Wn
i=1 ci xi
where the ci s are
This can be checked by testing whether the formula is constant or all the
values in the truth table except the first one are 1.
• f is a conjunction if it is equivalent to a formula c0 ^
constant.
Vn
i=1 ci xi
where the ci s are
This is the case if the formula is constant or all the values in the truth table
except the last one are 0.
• f is a projection or a constant.
If f is constant the values in the truth table clearly must be all equal and if it is
a projection there exists one variable in the formula for which all assignments
in the truth table equal the correspondent values.
• f depends on at most one variable respectively f is essentially unary.
To check that one can test whether the formula is a projection, a constant
or a negation, meaning there exists one variable in the formula for which the
assignments in the truth table always di↵er from the correspondent values.
5.2 Boolean Clones
Definition 8 (Boolean clone) A Boolean clone is a set B of Boolean functions such
that:
• B contains all projections of form ⇡kn : {0, 1}n ! {0, 1} with ⇡kn (x1 , . . . , xn ) = xk .
• B is closed under composition, which means if f is an m-ary boolean function in B
and g1 , . . . , gm are n-ary Boolean functions in B, then the n-ary Boolean function
h(x1 , . . . , xn ) := f (g1 (x1 , . . . , xn ), . . . , gm (x1 , . . . , xn )) is in B.
For example if the functions a _ b, ¬c and d ^ e are contained in a set B, the clone must
also contain a, b, c, d, e (first condition) and (a _ b) ^ ¬c, ¬(d ^ e) and so forth (second
condition).
If B is a set of Boolean functions, [B] is called the smallest clone containing B and B a
base for [B] [7]. The set of all Boolean clones for instance has the base {^, ¬}, because
all other functions can be transformed to these two functions (e.g., a _ b ⌘ ¬(¬a ^ ¬b)).
13
In 12.1 a list of Boolean clones is depicted with all clones that are relevant later in this
thesis. Emil Post[21] developed a lattice of all clones, which is shown in 12.2. If two
nodes are connected, it means that the lower one contains a Boolean clone that is a
subset of the clone contained in the upper node.
6 Complexity Classes
In this section the complexity classes that are going to be of importance for the decision
problems examined in the next sections are introduced.
A Turing machine is an abstract computational device to help examining the abilities
and limitations of what can be computed. It is a state machine with an infinite onedimensional tape divided into cells which are able to contain a single symbol (’0’ or ’1’).
Furthermore the Turning machine has a read-write head which can move from one cell to
the next or the previous one. The machine can be programmed with a table of transition
rules which leads the machine from one state to another depending on the symbol on the
current cell and may order the read-write head to perform an action (write or move).
While a deterministic Turing machine has only one transition rule for every state and
symbol, a non-deterministic Turing machine can explore alternative computations in
parallel [14]. The following complexity classes can be defined with the help of the
concept of Turing machines:
• P: the class of problems that can be solved in polynomial time by a deterministic
Turing machine.
• NP: the class of problems that can be solved in polynomial time by a non-deterministic
Turing machine.
• coNP: the complement of NP: {L | L̄ 2 NP}
• NL: the class of problems that can be solved by a non-deterministic Turing machine
using a logarithmic amount of space.
•
L: the class of problems that can be solved by a non-deterministic Turing machine
using a logarithmic amount of space, such that the machine accepts, if the number
of accepting paths is odd [18].
An oracle is a black box which can solve a decision problem for a given language. The
decision problem can be of any complexity class [15]. In the following the complexity
classes that can be described with the help of Turning machines using di↵erent oracles
are defined:
14
•
P
2
= PNP : the class of problems that can be solved in polynomial time by a
deterministic Turing machine with an oracle solving a NP-complete problem.
coNP
• ⌃P
: the class of problems that can be solved in polynomial time by a
2 = NP
non-deterministic Turing machine with an oracle solving a coNP-complete problem.
NP
• ⇧P
: the class of problems that are solvable in coNP with an oracle
2 = coNP
solving a NP-complete problem [19].
In circuit complexity Boolean functions are classified by the Boolean circuits that compute them. The Boolean circuits can have di↵erent size, depth and fan-in, where the
size is the number of gates of the circuit, the depth is the longest path from an input to
an output terminal of the circuit and the fan-in is the maximum of inputs a gate in the
circuit can handle. The following two circuit complexity classes are relevant here:
• AC0 : the class AC0 consists of all families of circuits of polynomial size and consistent depth with unlimited fan-in AND gates and OR gates.
• AC0 [2]: the class AC0 [2] equals AC0 except for the fact that in addition mod2 -gates
can be used [12].
7 Implication Problem
In the next two sections the di↵erent decision problems for default logic as well as
for autoepistemic logic are solved, but since most of the algorithms have to solve the
implication problem, this problem is considered at first.
Given a finite set of B-formulae
and a B-formula ' the implication problem asks
whether implies ', written |= '. This is the case if all assignments satisfying all
formulae in are satisfying ' as well [2].
For the implication problem, there are five di↵erent algorithms considered for the following cases:
1. S00 ✓ [B] or S10 ✓ [B] or D2 ✓ [B]
2. L2 ✓ [B] ✓ L
3. N2 ✓ [B] ✓ N
4. [B] ✓ V
5. [B] ✓ E
15
1
2
3
4
5
6
7
8
9
10
11
12
13
Input: , '
if = ; then
if ' ⌘ 1 then
return True;
else
return False;
end
end
forall the assignments of variables in and ' do
if |= and 6|= ' then
return False;
end
end
return True;
Algorithm 1: S00 ✓ [B] or S10 ✓ [B] or D2 ✓ [B]
For the first case the algorithm (Algorithm 1) is in coNP, because it has to be checked for
all assignments to the variables of and ' whether is not satisfying all the formulae
in or is satisfying ' [3]. If is not satisfying all formulae in , it becomes irrelevant
whether ' is true or false under this assignment. On the other hand if is satisfying all
the formulae in , ' has to be satisfied as well under this assignment. Otherwise 6|= '
would apply.
It is evident that if contains no formulae ' has to be a tautology, if |= ' should
apply, because in this case is satisfied by all assignments.
For example if = {a ! b, a} and ' = a _ b the assignments of all variables in and '
are (a, b) = {(0, 0); (0, 1); (1, 0); (1, 1)}. For the first two assignments it holds that 6|= a.
For the third assignment it holds that 6|= a ! b. At least for the fourth assignment
it holds that |= a and |= a ! b, but also |= a _ b. Since for all assignments
|= ^ 6|= ' was never true, it follows that |= '.
16
Input:
1
2
3
4
5
6
7
8
,'
[ {' t, t};
n
number of variables in 0 ;
x1 , . . . , x n
variables in 0 ;
S
;;
forall the 2 0 do
c0 = (0, . . . , 0);
for 1  i  n do
if (0, . . . , 0) 6⌘ (0, . . . , 0, 1, 0, . . . , 0) then
| {z }
0
i 1
9
10
11
12
13
14
15
16
17
18
19
20
21
ci = 1;
else
ci = 0;
end
end
c 0 c 1 x1 . . . c n xn ;
S
S [ {c0 + c1 x1 + . . . + cn xn = 1 (mod 2)};
end
if the system of linear equations S has a solution then
return False;
else
return True;
end
Algorithm 2: L2 ✓ [B] ✓ L
The second case L2 ✓ [B] ✓ L can be solved with Algorithm 2. It starts with a new set
0 = [{' t, t} which must be inconsistent if
|= ', because the two new formulae can
only be true if t = 1 and ' = 0, but ' must be true if all formulae in are true and |= '.
Since all formulae 2 0 are linear they can be written as c1 x1 . . . cn xn c0 where
c0 , . . . , cn 2 {0, 1}. The value of if all variables are false must be c0 , so c0 = (0, . . . , 0).
For all other ci it holds that they are only equal to 1 if the correspondent variable is
relevant for the value of , meaning ci = 1, if (0, . . . , 0) 6⌘ (0, . . . , 0, 1, 0, . . . , 0). This
| {z }
i 1
formula can be written as an equation c0 + c1 x1 + . . . + cn xn = 1 (mod 2). This is valid,
because a formula with just XORs is true if and only if it contains an odd number of
1s. If this is done for all formula 2 0 a system of linear equations is retrieved. 0 is
consistent if all 2 can be true for the same assignment to the variables, which means
the system of linear equations must be solvable. Overall |= , if the system of linear
equations has no solution. The existence of a solution can be decided in L.
For example assume that = {a $ b} and ' = a. With Algorithm 2 the set 0 = {a $
b, a t, t} and the variables x1 = a, x2 = b, x3 = t are retrieved. The system of linear
17
equations S in this case is
1 + 1x1 + 1x2 + 0x3 = 1
(mod 2)
(1)
0 + 1x1 + 0x2 + 1x3 = 1
(mod 2)
(2)
0 + 0x1 + 0x2 + 1x3 = 1
(mod 2)
(3)
It is clear to see that S has the solution x1 = 0, x2 = 0, x3 = 1, so
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
6|= ' is valid.
Input: , '
L
{li | there exists 2 : li ⌘ };
(li is a literal or a constant)
if 0 2 L then
return True;
end
if L = ; then
if ' ⌘ 1 then
return True;
else
return False;
end
end
if 9li , lj 2 with li ⌘ ¬lj then
return True;
end
Compute li ⌘ ';
if li 2 L then
return True;
else
return False;
end
Algorithm 3: N2 ✓ [B] ✓ N
For the case N2 ✓ [B] ✓ N Algorithm 3 can be used, which is in AC0 [2]. For all 2
it holds that is equivalent to some literal or a constant since [B] ✓ N . A new set L is
constructed which contains these literals and constants. The set L is computable with
an AC0 -circuit with MOD2 -gates as for each formula the atom has to be found and
whether there is an even or an odd number of preceding negations. If one formula in L
is constant 0, L is not satisfiable, so |= ' is true for every formula '. If L is empty,
|= ' is only true if ' is constant 1. Otherwise L is not satisfiable, if it contains a literal
and its negation. These conditions can be checked in AC0 . If none of the conditions is
fulfilled, the literal or constant equivalent to ' is computed (again this is in AC0 [2]).
It now holds that |= ' if and only if this equivalent is contained in L, which can be
checked in AC0 as well.
For example if = {¬¬¬x, x} and ' = y, then L = {¬x, x}. It can be seen that 0 62 L
18
and L =
6 ;, but L contains the literal x and its negation ¬x. Therefore it is concluded
that |= '.
1
2
3
4
5
6
7
Input: , '
x1 , . . . , x n
variables in and ';
c0 = '(0, . . . , 0);
if c0 = 1 then
return True;
end
for 1  i  n do
if c0 = 0 and '(0, . . . , 0, 1, 0, . . . , 0) = 0 then
| {z }
i 1
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
ci = 0;
else
ci = 1;
end
end
'
c 0 _ c 1 x1 _ . . . _ c n xn
forall the 2 do
leq
True;
c00 = (0, . . . , 0);
if c00 > c0 then
leq
False;
end
for 1  i  n do
if c00 = 0 and (0, . . . , 0, 1, 0, . . . , 0) = 0 then
| {z }
c0i = 0;
else
c0i = 1;
end
if c0i > ci then
leq
False;
end
end
if leq then
return True;
end
end
return False;
i 1
Algorithm 4: [B] ✓ V
For the fourth case Algorithm 4 can be used, which is in AC0 . The formula ' can be
19
transformed into a formula like c0 _ c1 x1 _ . . . _ cn xn with c0 , . . . , cn 2 {0, 1}, because it
is in V . If all variables in ' are assigned false, ' is equivalent to c0 , so c0 = '(0, . . . , 0).
The constants ci for 1  i  n are 0, if c0 is 0 and '(0, . . . , 0, 1, 0, . . . , 0) = 0, because in
| {z }
i 1
this case the value of the correspondent variable xi does not a↵ect the value of formula
. Likewise all formula in
are equivalent to a formula c00 _ c01 x1 _ . . . _ c0n xn with
c00 , . . . , c0n 2 {0, 1}. The constants c00 , . . . , c0n can be determined analogously.
If c0 = 1 it holds that ' is always true, so clearly |= '. In the other case |= ', if
there exist an 2 with ⌘ c000 _ c001 x1 _ . . . _ c00n xn such that c00i  ci for all 0  i  n
and c00i 2 {0, 1}. In other words all formula in can only be true if especially is true,
which means ' must be true as well for containing at least the same variables as . The
potential other variables ' contains become irrelevant since ' is equal to a disjunction.
For example if = {¬(¬a ^ ¬b)} and ' = a, the variables in and ' are x1 = a and
x2 = b. The formula ' is transformed into 0 _ 1x1 _ 0x2 and for = ¬(¬a ^ ¬b) the
constants are c00 = 0, c01 = 1 and c02 = 1. Since it holds that c02 > c2 the boolean leq
becomes false, which means 6|= ', because there are no other formula in that have
to be considered.
20
1
2
3
4
5
6
7
8
9
10
11
Input: , '
if = ; then
if ' ⌘ 1 then
return True;
else
return False;
end
end
x1 , . . . , x n
variables in and ';
c0 = '(1, . . . , 1);
for 1  i  n do
if c0 = 1 and '(1, . . . , 1, 0, 1, . . . , 1) = 1 then
| {z }
i 1
12
13
14
15
16
17
18
19
20
21
22
23
24
25
ci = 0;
else
ci = 1;
end
end
'
c 0 ^ c 1 x1 ^ . . . ^ c n xn
forall the 2 do
geq
True;
c00 = (1, . . . , 1);
if c00 = 0 then
return True;
end
for 1  i  n do
if c00 = 1 and (1, . . . , 1, 0, 1, . . . , 1) = 1 then
| {z }
i 1
26
27
28
29
30
31
32
33
34
35
36
37
38
c0i = 0;
else
c0i = 1;
end
if c0i < ci then
geq
False;
end
end
if geq and c0 = 1 then
return True;
end
end
return False;
Algorithm 5: [B] ✓ E
21
For the fifth assumption ([B] ✓ E) the Algorithm 5 works analogously to the previous
one for [B] ✓ V [3].
Summed up the implication problem can be solved in coNP for S00 ✓ [B] or S10 ✓ [B]
or D2 ✓ [B] and in P for all other cases since L, AC0 , AC0 [2] ✓ P. As some algorithms
to solve the implication problem are established by now, the further section deals with
the decision problems in default logic.
8 Decision Problems in Default Logic
There are three decision problems in default logic that are going to be examined here:
1. Extension Existence Problem EXT(B): Given a B-default theory hW, Di the
question is, if hW, Di has a stable extension.
2. Credulous Reasoning Problem CRED(B): Given a B-default theory hW, Di
and a B-formulae ' the question is, if a stable extension of hW, Di including '
exists.
3. Skeptical Reasoning Problem SKEP(B): Given a B-default theory hW, Di
and a B-formulae ' the question is, if every stable extension of hW, Di includes '.
In the following subsections it will be shown how these problems can be solved with
di↵erent algorithms, which are within di↵erent complexity classes, depending on the
considered Boolean clone [2].
8.1 Extension Existence Problem
The extension existence problem deals with determining the existence of a stable extension as the name implies. For this problem di↵erent algorithms are given which are
within di↵erent complexity classes for the following Boolean clones.
1. In ⌃P
2 if S1 ✓ [B] ✓ BF or D ✓ [B] ✓ BF .
2. In
P
2
if S11 ✓ [B] ✓ M .
3. In NP if [B] 2 {N, N2 , L, L0 , L3 }.
4. In P if [B] 2 {E, E0 , V, V0 }.
5. In NL if [B] 2 {I, I0 }.
22
6. trivial if [B] ✓ R1 .
Before the algorithms for the six di↵erent cases are described, the following Lemma is
introduced which is relevant for the cases 2 and 6.
Lemma 2 Let B be a finite set of Boolean functions and let hW, Di be a B-default
theory. If [B] ✓ R1 then hW, Di has a unique stable extension and if [B] ✓ M it has at
most one stable extension.
For [B] ✓ R1 this is the case, because all formulae in W and all justifications and
consequences in D of the default theory hW, Di are 1-reproducing. The negation of a
1-reproducing formula is apparently not 1-reproducing, so all justifications in D can
never be disproved and therefore become irrelevant. The unique stable extension can
easily be n
computed by starting
o with E0 = W and then iteratively compute Ei+1 =
↵:
Th(Ei ) [
|
2 D, ↵ 2 Ei until Ek = Ek+1 for some k
0. The iteration stops
after finitely many steps since D is finite.
For [B] ✓ M it holds that the formulae are either 1-reproducing or equivalent to 0,
because otherwise the formulae would not be monotone. So the default theory can
possess a stable extension for the same reason as for [B] ✓ R1 . On the other hand it can
also possess no stable extension if a formula equivalent to 0 is derived while establishing
the extension. That would mean that the negations of all justifications could be proven,
so none of the default rules could have been used.
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
Input: hW, Di
forall the G ✓ D do
G0
W [ { | ↵: 2 G};
G0
W;
i
0;
repeat
Gi+1
Gi ;
forall the ↵: 2 D do
if Gi |= ↵ and G0 6|= ¬ then
Gi+1
Gi+1 [ ;
end
end
until Gi = Gi+1 ;
if G0 = Gi then
return True;
end
end
return False;
Algorithm 6: [B] ✓ BF
23
For the first and the third case you can use the same algorithm (Algorithm 6). The
algorithm uses an oracle solving the implication problem, which is in coNP for [B] ✓ BF
and in P for [B] ✓ L. The algorithm itself
it first guesses a subset G
n is in NP, because
o
↵:
0
of D to create a set of formula G = W [
|
2 G and then checks if it is a stable
extension in polynomialntime. Therefore it starts witho a G0 = W and then iteratively
computes Gi+1 = Gi [
| ↵: 2 D, Gi |= ↵, G0 6|= ¬
until Gi = Gi+1 . It is clear to
see that G0 is a stable extension, if G0 = Gi .
Altogether the algorithm for the first case is in ⌃p2 and for the second case in NP [6].
1:¬x
For example consider the the default theory h;, Di with D = 1:x
x , ¬x . The subsets
1:x 1:¬x
1:x
1:¬x
1:x 1:¬x
of D are
, x , ¬x , ; . Starting with G = x , ¬x one gets G0 =
x , ¬x
{x, ¬x}, G0 = ; and G1 = ;. Since G0 6= G1 one has to continue with the next subset
0
0
G = 1:x
x . In this case G = {x}, G0 = ;, G1 = {x} and G2 = {x}. Since G = G2 one
can conclude that h;, Di has a stable extension.
1
2
3
4
5
6
7
8
9
10
11
12
13
Input: hW, Di
Gnew
W;
repeat
Gold
Gnew ;
forall the ↵: 2 D do
if Gold |= ↵ and 6⌘ 0 then
if ⌘ 0 then
return false;
end
Gnew
Gnew [ { };
end
end
until Gnew = Gold ;
return true;
Algorithm 7: [B] ✓ M [2]
The extension existence problem for the second and fourth case can be solved with
Algorithm 7. Since [B] ✓ M applies for both, the default theory has at most one
stable extension, so it is not necessary to guess a set of generating defaults as before.
Therefore the complexity of the algorithm drops from NP to P. The justification must
be 1-reproducing or equivalent to 0, so its negation ¬ can only be equivalent to 1 or
not 1-reproducing. If ¬ is equivalent to 1, the default rule can not be exerted and if
¬ is not 1-reproducing it can only be equivalent to 0, because otherwise it would not
be monotone. In this case ¬ can not be contained in any stable extension.
Now the algorithm can compute the potential
stable extension by starting
with Gold =
n
o
↵:
W and iteratively computes Gnew =
|
2 D, Gold |= ↵, 6⌘ 0 . If during this
procedure a formula equivalent to 0 is derived, the default theory has no stable extension.
Otherwise the algorithms stops, when Gnew = Gold and the default theory possesses the
24
extension Gnew . Since the implication problem solved in this algorithm is in coNP for
[B] ✓ M and in P for [B] ✓ E or [B] ✓ V , the algorithm altogether is in p2 for the
second case and in P for the fourth
n case. o
x:y z:x^y
Let W be {x ^ y} and D be z^y
, y
for example. Then G0 = {x ^ y}, G1 =
{x ^ y, z ^ y}, G2 = {x ^ y, z ^ y, y} and G3 = G2 . So one can conclude that hW, Di has
the stable extension G2 .
1
2
3
4
5
6
7
8
9
10
11
12
13
Input: hW, Di
GhW,Di = directed graph: (V, F );
if W is consistent then
n
o
V := {0, 1} [ W [ ↵, | ↵: 2 D ;
n
F := {(1, x) | x 2 W } [ (↵, ) | ↵: 2 D,
o
6⌘ 0 ;
else
V := {0, 1};
F := ;;
end
if (GhW,Di , 1, 0) 2 GAP then
return True;
else
return False;
end
Algorithm 8: [B] 2 {I, I0 }
For the fifth case you can use Algorithm 8, which reduces the problem to the complement
of the graph accessibility problem GAP which is in NL. The graph accessibility problem
GAP examines the question whether there exists a path from a given node to another
in a given directed graph [5].
If W is inconsistent, hW, Di has a stable extension. Otherwise all stable extensions need
to be consistent. Since [B] ✓ I, the extension can only be inconsistent, if a formula
equivalent to 0 is concluded with an applicable default rule. Moreover it can be assumed that a default rule ↵: 2 D is applicable if
6⌘ 0 and if ↵ 2 W or ↵ is the
conclusion of an applicable default rule. Therefore a graph GhW,Di with the nodes V :=
n
o
n
o
{0, 1}[W [ ↵, | ↵: 2 D and edges F := {(1, x) | x 2 W }[ (↵, ) | ↵: 2 D, 6⌘ 0
can be defined. If a path from 1 to 0 exists in this graph, it means that the formula 0
can be derived with applicable default rules, since an edge between the formula 1 and
every formula in W exists and edges for all applicable default rules exist as well. This
means the default theory hW, Di has a stable extension, if there exists no path from 1
to 0, respectively (GhW,Di , 1, 0) 2 GAP.
n
o
z:y 1:y
For example let W be equal to {x} and D = x:z
,
,
. Then the following directed
z
0
z
graph is retrieved:
25
1
x
0
z
Since there exists a path from 1 to 0, the default theory hW, Di has no stable extension.
At last the sixth case is trivial. If [B] ✓ R1 there always exists a unique stable extension
[2].
After finding out how to determine whether there exists any stable extension it might also
be interesting, if there exists a particular extension, which leads to the next subsection.
8.2 Credulous Reasoning Problem
The credulous reasoning problem determines if there exists a stable extension for a
default theory hW, Di which contains a given formula '. For this problem the algorithms
of the extension existence problem are modified. The algorithms are contained in the
following complexity classes:
1. In ⌃P
2 if S1 ✓ [B] ✓ BF or D ✓ [B] ✓ BF .
2. In
P
2
if S11 ✓ [B] ✓ M .
3. In coNP if X ✓ [B] ✓ R1 for X 2 {S00 , S10 , D2 }.
4. In NP if [B] 2 {N, N2 , L, L0 , L3 }.
5. In P if V2 ✓ [B] ✓ V, E2 ✓ [B] ✓ E or [B] 2 {L1 , L2 }.
6. In NL if I2 ✓ [B] ✓ I.
1
2
3
4
Input: hW, D, 'i
Run Algorithm 6 (hW, Di) but change step 14 to:
if G0 |= ' then
return True;
end
Algorithm 9: [B] ✓ BF
The first and the fourth case can be solved with Algorithm 9. This algorithm contains
an oracle for the implication problem, which is in coNP for [B] ✓ BF and in P for
26
[B] ✓ L. It is based on the Algorithm 6 for the extension existence problem. If a stable
extension is found, one first has to look if it satisfies the formula '. If that is not the
case one has to go on searching for a stable extension including '.
Altogether the algorithm is in ⌃p2 for S1 ✓ [B] ✓ BF or D ✓ [B] ✓ BF and in NP for
[B] 2 {N, N2 , L, L0 , L3 }.
1
2
3
4
5
6
Input: hW, D, 'i
Run Algorithm 7 (hW, Di) step 1 to 12;
if Gnew |= ' then
return True;
else
return False;
end
Algorithm 10: [B] ✓ M or [B] ✓ R1
The second, third and fifth case can be solved all with the Algorithm 10, because in all
cases [B] is either subset or equal to M or to R1 , since V ✓ M , E ✓ M , L1 ✓ R1 and
L2 ✓ R1 (see Post’s lattice in 12.2). For [B] ✓ R1 and [B] ✓ M , it is known that there
exists at most one stable extension, so Algorithm 7 can be used, but if a stable extension
is found it has to be tested if it satisfies ' first. For S11 ✓ [B] ✓ M the algorithm is in
p
2 and for V2 ✓ [B] ✓ V or E2 ✓ [B] ✓ E in P, for the same reasons as in subsection
8.1.
For [B] 2 {L1 , L2 } the algorithm is in P as well, because the implication problem can
be solved in P for [B] ✓ L and it holds that L1 ✓ L and L2 ✓ L. At least for the third
case the algorithm is in coNP since the implication problem for [B] ✓ R1 can only be
solved in coNP.
1
2
3
4
5
6
Input: hW, D, 'i
Run Algorithm 8 (hW, Di) but change step 10 to:
if (GhW,Di , 1, ') 2 GAP then
return True;
else
return False;
end
Algorithm 11: [B] ✓ I
The sixth case can be solved with Algorithm 11 based on Algorithm 8, which solves the
extension existence problem with with the help of a graph GhW,Di . For the credulous
reasoning problem the algorithm has to be extended as follows: If a stable extension
exists, one also has to check if there exists a path in the graph GhW,Di from 1 to ',
because that means ' can be derived using only applicable default rules. So the problem
can be solved in NL if I2 ✓ [B] ✓ I for the same reasons as in subsection 8.1 [2].
27
8.3 Skeptical Reasoning Problem
At this point it is known how to find out if ' is contained in one stable extension. The
skeptical reasoning problem questions if ' is not just contained in one stable extension
but in all of them, which is also the case, if there is no stable extension at all. The
following five di↵erent cases in di↵erent complexity classes are considered [7]:
1. In ⇧P
2 if S1 ✓ [B] ✓ BF or D ✓ [B] ✓ BF .
2. In
P
2
if S11 ✓ [B] ✓ M .
3. In coNP if X ✓ [B] ✓ Y for X 2 {S00 , S10 , D2 , N2 , L0 } and Y 2 {R1 , L}.
4. In P if V2 ✓ [B] ✓ V , E2 ✓ [B] ✓ E or [B] 2 {L1 , L2 }.
5. In NL if I2 ✓ [B] ✓ I.
Before having a look at the algorithms to solve the skeptical reasoning problem, the
relation between this problem and the credulous reasoning problem for [B] ✓ R1 and
[B] ✓ M is examined.
For [B] ✓ R1 it is known that the default theory hW, Di has a unique stable extension,
so this unique extension has to contain ', if (hW, Di, ') 2 CRED(B) or if (hW, Di, ') 2
SKEP(B). So in this case both problems are equivalent.
For [B] ✓ M it is known that there exist either a unique stable extension or no stable
extension for the default theory hW, Di. For the first case (hW, Di, ') is in SKEP(B),
if ' is contained in the unique extension, meaning (hW, Di, ') 2 CRED(B). For the
second case it holds that ' is contained in every stable extension, since there is no
stable extension, which is only true if (hW, Di, 1) 62 CRED(B), because 1 is satisfied
by every set of formulae. So summed up (hW, Di, ') is in SKEP(B) if and only if
(hW, Di, ') 2 CRED(B) or (hW, Di, 1) 62 CRED(B).
With this information the skeptical reasoning problem can be solved with the algorithms
for the credulous reasoning problem in some cases.
1
2
3
4
5
6
Input: hW, D, 'i
Run Algorithm 6 (hW, Di) but change step 14 to:
if G 6|= ' then
return False;
end
And step 17 to:
return True;
Algorithm 12: [B] ✓ BF
For the first case and for the third case with Y = L Algorithm 12 is used, which is nearly
the same as Algorithm 6 for the extension existence problem, but if a stable extension
28
is found, one has to check if it contains ', if not it is clear that ' is not contained in
every stable extension. Otherwise one has to go on searching for stable extension. The
algorithm this time is not in NP like Algorithm 6, because a subset of D is guessed as
the set of generating defaults and with its help one may find out if the default theory is
not in SKEP(B), but one can not find out if it is in SKEP(B) in one step, so Algorithm
12 is coNP.
For [B] ⇢ L the implication problem can be solved in P, otherwise in coNP. So altogether
the algorithm is in coNP for the third case and in ⇧p2 for the first case.
1
2
3
4
5
Input: hW, D, 'i
if (hW, Di, ') 2 CRED(B) or (hW, Di, 1) 62 CRED(B) then
return True;
else
return False;
end
Algorithm 13: [B] ✓ M
For S11 ✓ [B] ✓ M , V2 ✓ [B] ✓ V , E2 ✓ [B] ✓ E or I2 ✓ [B] ✓ I it holds that [B] ✓ M ,
because V ✓ M , E ✓ M and I ✓ M . As stated before, the skeptical reasoning problem
can now be solved by checking if (hW, Di, ') 2 CRED(B) or (hW, Di, 1) 62 CRED(B).
Obviously the algorithms are in the same complexity class as for the credulous reasoning
problem, meaning in p2 for the second case, in P for V2 ✓ [B] ✓ V and E2 ✓ [B] ✓ E,
and in NL for the fifth case.
1
2
3
4
5
Input: hW, D, 'i
if (hW, Di, ') 2 CRED(B) then
return True;
else
return False;
end
Algorithm 14: [B] ✓ R1
The third case for Y = R1 and the remaining part of the fourth case [B] 2 {L1 , L2 }
can be solved by just checking if (hW, Di, ') 2 CRED(B) (see Algorithm 14), because
in both cases it holds that [B] ✓ R1 since L1 ✓ R1 and L2 ✓ R1 . So the problems can
be solved in the same complexity classes as for the credulous reasoning problem, which
was in coNP for the third and in P for the fourth case [2].
9 Decision Problems in Autoepistemic Logic
In equivalence to the decision problems in default logic there are the following three
decision problems for autoepistemic logic examined here [7]:
29
1. Expansion Existence Problem EXP(B): Given a set ⌃ ✓ Lae (B) the question
is, if ⌃ has a stable expansion.
2. Credulous Reasoning Problem CREDAE (B): Given a set ⌃ ✓ Lae (B) and
a B-formulae ' 2 Lae (B) the question is, if a stable expansion of ⌃ including '
exists.
3. Skeptical Reasoning Problem SKEPAE (B): Given a set ⌃ ✓ Lae (B) and a
B-formulae ' 2 Lae (B) the question is, if every stable expansion of ⌃ includes '.
In the next subsections di↵erent algorithms are introduced to solve these problems. Some
of the algorithms include the question if a set ⇤ ✓ SFL (⌃) [ ¬SFL (⌃) is ⌃-full. This
can be tested by the following Algorithm 15, which ensures that the two conditions for
⌃-fullness are fulfilled.
1
2
3
4
5
6
7
8
9
10
11
12
13
Input: h⌃, ⇤i
forall the L 2 SFL (⌃) do
if L 2 ⇤ then
if ⌃ [ ⇤ 6|= then
return False;
end
end
else if ¬L 2 ⇤ then
if ⌃ [ ⇤ |= then
return False;
end
end
end
return True;
Algorithm 15: Testing ⌃-fullness
9.1 Expansion Existence Problem
The first problem is the expansion existence problem, which can be solved in the following
five di↵erent complexity classes, depending on the considered Boolean clone.
1. In ⌃P
2 if D2 ✓ [B] or S00 ✓ [B] or S10 ✓ [B].
2. In NP if V2 ✓ [B] ✓ V .
3. In P if L2 ✓ [B] ✓ L.
4. In AC0 [2] if N2 ✓ [B] ✓ N .
30
5. In AC0 if [B] ✓ E.
1
2
3
4
5
6
Input: ⌃
forall the ⇤ ✓ SFL (⌃) [ ¬SFL (⌃) do
if ⇤ is ⌃-full then
return True;
end
end
return False;
Algorithm 16: [B] ✓ BF [6]
The first case can be solved with Algorithm 16, which is based on the one-to-one correspondence of stable expansions and ⌃-full sets. The algorithm non-deterministically
guesses a set ⇤ ✓ SFL (⌃) [ ¬SFL (⌃) and checks if it is ⌃-full. Therefore it works in
NP using an oracle for the implication problem. If a ⌃-full set is found, ⌃ must have a
correspondent stable expansion. Since the implication problem is in coNP for S00 ✓ [B]
or S10 ✓ [B] or D2 ✓ [B] the algorithm altogether is in ⌃P
2.
31
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
Input: ⌃
x1 , . . . , x n
variables in ⌃;
forall the 2 ⌃ do
Eliminate all variables, which are not relevant for the outcome of ;
while contains LL do
Replace LL with L;
end
end
forall the ⇤ ✓ SFL (⌃) [ ¬SFL (⌃) do
forall the Lx contained in ⌃ do
if Lx 2 ⇤ then
Replace Lx with 1;
end
else if ¬Lx 2 ⇤ then
Replace Lx with 0;
end
end
isSigmaF ull
T rue;
forall the L 2 SFL (⌃) do
if L 2 ⇤ then
if ⌃ 6|= then
isSigmaF ull
F alse;
end
end
else if ¬L 2 ⇤ then
if ⌃ |= then
isSigmaF ull
F alse;
end
end
end
if isSigmaF ull then
return True;
end
end
return False;
Algorithm 17: [B] ✓ V
For the second case it is known that all formulae in ⌃ are equivalent to a disjunction.
Algorithm 17 can be used, which starts with transforming all formulae in ⌃ into equivalent formulae without unnecessary variables and doubled L operators. As in the last
algorithm a subset ⇤ ✓ SFL (⌃) [ ¬SFL (⌃) is guessed and checked whether it is ⌃-full,
which can be done non-deterministically in polynomial time. Therefore all Lx contained
in ⌃ are replaced with the correspondent value assigned to by ⇤. Checking if ⇤ is ⌃-full
32
is now simplified to the conditions ⌃ |= ' i↵ L' 2 ⇤ and ⌃ 6|= ' i↵ ¬L' 2 ⇤. Since the
implication problem is in P for [B] ✓ V the algorithm is in NP.
For example let ⌃ be {Lx _ Ly, y}. First ⇤ = {Lx, ¬Ly} is guessed, then ⌃ is transformed into {1 _ 0, y}. It is easy to see that ⇤ is not ⌃-full since Lx 2 ⇤, but ⌃ 6|= x.
Next ⇤ = {¬Lx, Ly} is guessed. ⌃ now turns to {0 _ 1, y}, which means that ⇤ is ⌃-full
since ¬Lx 2 ⇤, ⌃ 6|= x, Ly 2 ⇤ and ⌃ |= y. It can be concluded that ⌃ has a stable
expansion.
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
Input: ⌃
⌃0
;;
x1 , . . . , x n
quasi-atomic subformulae in ⌃;
forall the 2 ⌃ do
Calculate 0 = c0 c1 x1 . . . cn xn ⌘ with c0 , . . . , cn 2 {0, 1};
⌃0
⌃0 [ 0 ;
end
while there exist non-atomic formulae ' with L' in ⌃ do
⌃0
⌃0 [ {y' ' 1} where y' is a new variable;
forall the L' 2SFL (⌃) do
Replace L' with Ly' ;
end
end
Rewrite ⌃0 as a equation system Ax = By C with x = (x1 , . . . , xn )T and
y = (Lx1 , . . . , Lxn )T ;
Apply Gaussian elimination to A to get an equation system A0 x = B 0 y C 0 ;
D
{xi | xi is free variable in A0 x, 1  i  n};
Eliminate the variables {x1 , . . . , xn } \ D subsequently to get an equation system
T = {xi = fi (xj | xj 2 D) gi (Lx1 , . . . , Lxn ) ci | 8xi 2
{x1 , . . . , xn } \ D} [ {0 = gi (Lx1 , . . . , Lxn ) ci | n  i  |⌃0 | + |D|} ;
if T [Lx1 /1, . . . , Lxn /1] has no solution then
return True;
end
E
{xi | xi 62 D, fi is not a constant function, 1  i  n};
0
T
{xi = ✏i gi (Lx1 , . . . , Lxn ) ci | 8xi 2 {x1 , . . . , xn } \ (D [ E)} [ {0 =
gi (Lx1 , . . . , Lxn ) ci | n < i  |⌃0 | + |D|} with ✏i = fi and Lxi = 0 for all
xi 2 D [ E;
if T 0 [xi /Lxi | xi 2 {x1 , . . . , xn } \ (D [ E)] has at least one solution then
return True;
end
return False;
Algorithm 18: [B] ✓ L
Algorithm 18 can be used for the third case. Since [B] ✓ L every formula in ⌃ can be
written in polynomial time as formula of the form c0 c1 x1 . . . cn xn with c0 , . . . , cn 2
{0, 1} like it was done in Algorithm 2. To get only atomic formula or formula of the form
33
L' where ' is atomic formula itself, a new variable y' is introduced for every formula
not satisfying this condition. All L' are replaced with Ly' and the formula y' $ '
is added to ⌃. Now ⌃ can be written as a system of linear equations Ax = By C
with x = (x1 , . . . , xn )T and y = (Lx1 , . . . , Lxn )T . If Gaussian elimination is applied to
A, an equivalent equation system A0 x = B 0 y C 0 is retrieved. A new set D of all free
variables in A0 x is defined. Since all other variables are not free the equation system
can be rewritten such that the bounded variables are on the left side of each equation
depending only on free variables. The equation system is now of the form
T = {xi = fi (xj | xj 2 D)
gi (Lx1 , . . . , Lxn )
ci | 8xi 2 {x1 , . . . , xn } \ D}[
{0 = gi (Lx1 , . . . , Lxn )
ci | n  i  |⌃0 | + |D|}
where for each i the functions gi and fi are linear. Since Lae is only a stable expansion
if ⌃ [ SFL (⌃) is inconsistent, which is only the case if T [Lx1 /1, . . . , Lxn /1] has no
solution, this is going to be checked first. If Lae is not a stable expansion, one has to
go on searching for a consistent stable expansion by first creating another set E with
all bounded variables xi , where the correspondent fi of the equation system is not a
constant function. The set D [ E now contains all xi , which can not be derived from
⌃ [ ⇤ for every possible ⇤. This means that every consistent stable expansion has to
contain ¬Lxi for every xi 2 D [ E. For all other variables fi is congruent to a constant
✏i . Again the equation system is rewritten to get the form
T0
{xi = ✏i
gi (Lx1 , . . . , Lxn )
ci | 8xi 2 {x1 , . . . , xn } \ (D [ E)}[
{0 = gi (Lx1 , . . . , Lxn )
ci | n < i  |⌃0 | + |D|}
and replace all occurrences of Lxi with 0 for all xi 2 D [ E. It now holds for every
⇤ ✓ SFL (⌃) [ ¬SFL (⌃) and ¬Lxi 2 ⇤ for every xi 2 D [ E, that ⌃ [ ⇤ |= xi if and only
if T 0 [ ⇤ |= xi . It can be proven that T 0 [xi /Lxi | xi 2 {x1 , . . . , xn } \ (D [ E)] has the
same number of solution as ⌃ has stable expansions. So it remains to check if it has at
least one solution [20].
The algorithm altogether is in P, since the existence of a solution of a linear equation
system can be decided in L [3].
As example for the algorithm consider ⌃ = {L(x y) z La y, z $ a, a Ly}. Then
⌃ is changed into ⌃0 = {Lyx y z La y, yx y x y 1, z a 1, a Ly}. The
following equation system is retrieved:
0
1
0
1
0
1
0
1
0 1
a
La
0 0 1 1 0 B
1 0 0 0 1 B
1
C
C
B0 1 1 0 1C B x C B0 0 0 0 0C B Lx C B0C
C B
B
CB
CB
C B C
@1 0 0 1 0A B y C = @0 0 0 0 0A B Ly C @0A
@ z A
@ Lz A
1 0 0 0 0
0 0 1 0 0
1
yx y
Lyx y
34
After applying Gaussian elimination to A the equation system is:
0
1
0
1
0
1
0
1
a
La
1 0 0 1 0 B
0 0 0 0 0 B
C
C
B0 1 1 0 1C B x C B0 0 0 0 0C B Lx C
B
CB y C = B
C B Ly C
C @1 0 0 0 1A B
C
@0 0 1 1 0A B
@ z A
@ Lz A
0 0 0 1 0
0 0 1 0 0
yx y
Lyx y
In this equation system yx
T =
y
0 1
0
B0C
B C
@1A
1
is a free variable, while a, x, y and z are bounded. Therefore
{a = Ly
1,
x = yx
y
La
y = La
Ly
z = Ly
1}
Ly
Lyx
Lyx
y
y
0
0
Since T [La/1, Lx/1, Ly/1, Lz/1, Lyx y /1] has a solution Lae is not a expansion of ⌃. x
is the only variable where fx is not a constant function, so T 0 =
{a = Ly
1,
y = La
Ly
z = Ly
1}
0
T [a/La, y/Ly, z/Lz] has exact one solution, namely La = 0, Ly = 1, Lz = 0. It can be
concluded that ⌃ has a stable expansion.
35
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
Input: ⌃
forall the 2 ⌃ do
Eliminate all variables, which are not relevant for the outcome of ;
while contains ¬¬ or LL or L¬L do
Eliminate ¬¬, replace LL with L, replace L¬L with ¬L;
end
end
if ⌃[SFL (⌃) is inconsistent then
return True;
end
forall the L' 2 ⌃ do
if ' 62 ⌃ then
return False;
end
end
forall the ¬L' 2 ⌃ do
if ' 2 ⌃ then
return False;
end
end
return True;
Algorithm 19: [B] ✓ N
The fourth case can be solved with Algorithm 19. Every formula in ⌃ is equivalent to a
literal, a formula Ll or a formula ¬Ll, where l is a literal as well, because [B] ✓ N holds.
⌃ can be transformed into a set ⌃0 of those equivalents by simply eliminating every
unnecessary variable, eliminating every occurrence of ¬¬, replacing every occurrence of
LL with L and every occurrence of L¬L with ¬L. This transformation can be done
using an AC0 -circuit with oracle gates for B-formula evaluation. ⌃ can only have an
inconsistent stable expansion if ⌃0 [ SFL (⌃) is inconsistent, which can be tested using an
AC0 -circuit with oracle gates for B-formula evaluation as well. So after an inconsistent
stable expansion was excluded it remains to check if there exists a consistent stable
expansion. This is the case if and only if ' 2 ⌃0 for all L' 2 ⌃0 and ' 62 ⌃0 for all
¬L' 2 ⌃0 , which can be tested using an AC0 -circuit.
Since the evaluation of B-formula is in AC0 [2] the complexity class of the algorithm
altogether is AC0 [2].
For example let ⌃ be equal to {¬L¬Lx, LLy, x, }. First it is going to be transformed
into an equal set ⌃0 = {Lx, Ly, x}. It is easy to see that ⌃0 [SFL (⌃0 ) = {Lx, Ly, x} is
not inconsistent. First it is checked that for Lx 2 ⌃0 , x is in ⌃ as well. This is the case,
so one has to continue with Ly 2 ⌃0 , but y 62 ⌃0 . It can be concluded that ⌃ has no
stable expansion.
36
1
2
3
4
5
6
7
Input: ⌃
⌃0
;;
x1 , . . . , x n
variables in ⌃;
forall the 2 ⌃ do
Calculate c0 ^ c1 x1 ^ . . . ^ cn xn ^ cn+1 Lx1 ^ . . . ^ c2n Lxn ⌘
c0 , . . . , c2n 2 {0, 1};
⌃0
⌃0 [ {c0 , c1 x1 , . . . , cn xn , cn+1 Lx1 , . . . , c2n Lxn };
end
Run algorithm 19 with ⌃0 ;
Algorithm 20: [B] ✓ E
with
The last case can be solved with Algorithm 20. Since [B] ✓ E every formula in ⌃ can
be transformed into a conjunction like it was done in Algorithm 5 for the implication
problem. A set ⌃0 is created by splitting all formula in ⌃ by the AND-operator. ⌃0 still
is equivalent to ⌃ and contains only propositions, which means that one can just run
Algorithm 19 for [B] ✓ N with ⌃0 to get the result for ⌃.
Since in this case B-formula evaluation can be performed in AC0 , the algorithm altogether is in AC0 .
If it has to be checked not only if there exist any stable expansion, but if there is a
consistent stable expansion, the problem is called EXP’. It can be solved with only little
modifications of the algorithms for EXP. In some of them one only has to left out the
test for an inconsistent stable expansion. If no such test exists one has to check, when
a ⌃-full set ⇤ is found, if ⌃ [ ⇤ 6|= 0 before returning True [7].
9.2 Credulous Reasoning Problem
Now the credulous reasoning problem is considered to check if a stable expansion ⌃
contains a specific formula '. It can be solved in the following five complexity classes
for di↵erent Boolean clones.
1. In ⌃P
2 if D2 ✓ [B] or S00 ✓ [B] or S10 ✓ [B].
2. In NP if V2 ✓ [B] ✓ V .
3. In P if L2 ✓ [B] ✓ L.
4. In AC0 [2] if N2 ✓ [B] ✓ N .
5. In AC0 if [B] ✓ E.
37
1
2
3
4
5
6
7
8
Input: h⌃, 'i
forall the ⇤ ✓ SFL (⌃) [ ¬SFL (⌃) do
if ⇤ is ⌃-full then
if ⌃ [ ⇤ |=L ' then
return True;
end
end
end
return False;
Algorithm 21: [B] ✓ BF [6]
Again [B] ✓ BF is considered first, which can be solved with Algorithm 21. The algorithm extends the Algorithm 16 by an additional check if the stable expansion SB⌃ (⇤)
corresponding to the ⌃-full set ⇤ contains '. It is known that this test is equal to
checking whether ⌃ [ ⇤ |=L '. Since the implication problem is in coNP in this case,
the algorithm is in ⌃P
2 for the same reason as Algorithm 16.
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
Input: h⌃, 'i
Run Algorithm 17, but instead of returning True in step 31 do:
Eliminate all variables, which are not relevant for the outcome of ';
while ' contains LL do
Replace LL with L;
end
forall the T ✓ SFq (') \ SFL (') do
if ⌃ [ ⇤ [ T [ {¬L | L 2 (SFq (') \ SFL (')) \ T } |= ' then
modelsphi
True;
forall the L 2 T do
if ⌃ [ ⇤ 6|=L then
modelsphi
False;
end
end
forall the L 2 (SFq (') \ SFL (')) \ T do
if ⌃ [ ⇤ |=L then
modelsphi
False;
end
end
if modelsphi then
return True;
end
end
end
return False;
Algorithm 22: [B] ✓ V
38
For the case [B] ✓ V Algorithm 22 is used. Since it is already known how to find a ⌃-full
set in NP, it remains to check if ' is contained in the corresponding stable expansion.
For this reason a subset T ✓ SFq (') \ SFL (') is guessed non-deterministically, meaning
a subset containing only quasi-subformulae of ' starting with L. First it has to be
verified that ⌦ := ⌃ [ ⇤ [ T [ {¬L | L 2 (SFq (') \ SFL (')) \ T } |= '.
Obviously the set ⌦ can contain negations, which means not all of the formulae are
in V . But since the negations can only be at the beginning of a quasi-atomic formula
starting with L, one can replace all negated formulae ¬L in ⌦ with constant 1 and
all correspondent not negated formula L in ⌦ and ' with constant 0. An equivalent
implication problem with all formulae in V is retrieved, which means it can be solved in
P.
It remains to check if ⌃ [ ⇤ |=L
for all L 2 T and ⌃ [ ⇤ 6|=L
for all L 2
(SFq (') \ SFL (')) \ T . As it was done in Algorithm 17 it can be checked whether
⌃ [ ⇤ |=L by just checking if ⌃0 |=L , where ⌃0 is equal to ⌃ but with all Lx replaced
by 1 if Lx 2 ⇤ and Lx replaced by 0 if ¬Lx 2 ⇤. Since ⌃0 is in V this test can also be
done in P.
If a set T for which these conditions hold is found, ' is contained in the stable expansion
corresponding to the ⌃-full set. Altogether the Algorithm 22 is in NP.
In the example of Algorithm 17 it was found out that ⇤ = {¬Lx, Ly} is a ⌃-full set
for ⌃ = {Lx _ Ly, y}. Now let ' be Lx for example, then T can only be either {Lx}
or ;. If T = {Lx} then ⌦ := ⌃ [ ⇤ [ T [ {¬L | L 2 (SFq (') \ SFL (')) \ T } =
{Lx _ Ly, y, ¬Lx, Ly, Lx}. Obviously ⌦ |= ', because it is inconsistent. It remains to
check if ⌃ [ ⇤ |=L x respectively ⌃0 = {0 _ 1, y} |=L x, which clearly is false. For T = ;
it holds that ⌦ = {Lx _ Ly, y, ¬Lx, Ly}. In this case ⌦ 6|= ', so it can be concluded that
the stable expansion corresponding to this ⌃-full set not contains ' and one would have
to go on with all other ⌃-full sets, if any exists.
1
2
3
4
5
6
Input: h⌃, 'i
⌃0
⌃ [ {L' p 1, Lp} where p is a new variable;
if ⌃0 2 EXP(B) then
return True;
else
return False;
end
Algorithm 23: [B] ✓ L
If [B] ✓ L Algorithm 23 can be used. The algorithm is based on the fact that CREDAE (B)
is reducible to EXP(B [ {$}). To this end two new formulae are added to ⌃, namely
Lp and L' $ p respectively L' p 1, where p is a new variable. It now holds that
(⌃, ') 2 CREDAE (B) if and only if ⌃0 2 EXP(B [ {$}), where B [ {$} is equivalent to
B for B = L. Clearly the algorithm is in the same complexity class as for the expansion
existence problem, which was in P for [B] ✓ L [7].
39
1
2
3
4
5
6
7
8
9
10
Input: h⌃, 'i
Run Algorithm 19, but instead of returning True in the end do:
Eliminate all variables, which are not relevant for the outcome of ';
while ' contains ¬¬ or LL or L¬L do
Eliminate ¬¬, replace LL with L, replace L¬L with ¬L;
end
if ⌃ |=L ' then
return True;
else
return False;
end
Algorithm 24: [B] ✓ N
The case [B] ✓ N is solved with Algorithm 24, which simply extends the Algorithm 19
for the expansion existence problem, which was in AC0 [2]. For the credulous reasoning
problem it remains to check if ⌃ |=L '. If all occurrences of ¬¬ in ' are repeatedly
eliminiated, all LL replaced with L and all L¬L with ¬L, then ' is equivalent to Ll
or ¬Ll where l is a literal. ⌃ |=L ' is now equivalent to ⌃ [ Ll |= ' for ⌃ |= l and
⌃ [ ¬Ll |= ' for ⌃ 6|= l. Since the implication problem is in AC0 [2] for [B] ✓ N , the
algorithm altogether is in AC0 [2] as well.
1
2
3
4
5
6
7
8
9
Input: h⌃, 'i
Run Algorithm 20, but instead of returning True in the end do:
Calculate c0 ^ c1 x1 ^ . . . ^ cn xn ^ cn+1 Lx1 ^ . . . ^ c2n Lxn ⌘ ' with
c0 , . . . , c2n 2 {0, 1};
'0 = {c0 , c1 x1 , . . . , cn xn , cn+1 Lx1 , . . . , c2n Lxn };
forall the 2 '0 do
if ⌃0 6|=L then
return False;
end
end
return True;
Algorithm 25: [B] ✓ E
The last case [B] ✓ E can be solved with Algorithm 25. Like in the case before, the
algorithm just extends the algorithm for the expansion existence problem. It remains
to check if ' is contained in the expansion, if an expansion was found. To this end '
is rewritten as a equivalent conjunction and the formula is split by the AND-operator.
Now it just has to be checked if ⌃0 |=L for all of the form Lx or x contained in
'. This problem can be reduced to ⌃0 |= x for = Lx respectively = x. Since the
implication problem is in AC0 for [B] ✓ E, the algorithm altogether is in AC0 as well
[20].
40
9.3 Skeptical Reasoning Problem
The last problem to be examined is the skeptical reasoning problem, which is concerned
with the question if all of the stable expansions are containing a given formula '. The
following complexity classes for the di↵erent Boolean clones are retrieved.
1. In ⇧P
2 if D2 ✓ [B] or S00 ✓ [B] or S10 ✓ [B].
2. In coNP if V2 ✓ [B] ✓ V .
3. In P if L2 ✓ [B] ✓ L.
4. In AC0 [2] if N2 ✓ [B] ✓ N .
5. In AC0 if [B] ✓ E.
1
2
3
4
5
6
7
8
Input: h⌃, 'i
forall the ⇤ ✓ SFL (⌃) [ ¬SFL (⌃) do
if ⇤ is ⌃-full then
if ⌃ [ ⇤ 6|=L ' then
return False;
end
end
end
return True;
Algorithm 26: [B] ✓ BF [6]
For the first case Algorithm 26 can be used, which resembles the Algorithm 21 for the
credulous reasoning problem. If a ⌃-full set is found it is checked if the corresponding
stable expansion contains '. But instead of returning true if it does, false is returned if
it does not. The algorithm can only return true if all ⌃-full sets are found and checked.
P
For this reason the complexity increases from ⌃P
2 to ⇧2 .
The solution for the second case V2 ✓ [B] ✓ V is nearly the same as for the credulous
reasoning problem, which was solved with Algorithm 22. The only di↵erence is that, like
in the case before, all ⌃-full sets have to be found and checked if the corresponding stable
expansion contains '. Since the complexity class for the credulous reasoning problem
was NP, the complexity class of the skeptical reasoning problem must be coNP.
41
1
2
3
4
5
6
Input: h⌃, 'i
⌃0
⌃ [ {L' p, Lp} where p is a new variable;
if ⌃0 2 EXP0 (B) then
return False;
else
return True;
end
Algorithm 27: [B] ✓ L
The third case can be solved with Algorithm 27, which is based on the fact that the
skeptical reasoning problem can be reduced to EXP’(B [ { }). To this end a new
set ⌃0 is defined by adding the formulae L' p and Lp to ⌃. It now holds that
(⌃, ') 2 SKEPAE (B) if and only if ⌃0 62 EXP0 (B). Obviously the algorithm is in P,
since the algorithm for the expansion existence problem is in P for [B] ✓ L [7].
For the last two cases N2 ✓ [B] ✓ N and [B] ✓ E it holds that there exists at most one
stable expansion. For this reason SKEPAE (B) ⌘ CREDAE (B) and the algorithm is in
AC0 [2] for N2 ✓ [B] ✓ N and in AC0 for [B] ✓ E [7].
At this point it is known how to solve the three decision problems of autoepistemic logic
named at the beginning of this section and in which complexity class they are.
10 Tool for non-monotonic logics
In this section an introduction to the tool for non-monotonic logics that was implemented
in the course of this work is given. This tool contains an implementation of all algorithms
that were shown in the last sections. First the program itself is introduced, as the user
can see it and then the implementation.
10.1 Program
The program starts with a small window, where the user can chose between default and
autoepistemic logic. Depending on the decision a new window opens for the input of
either a default or autoepistemic theory. This window contains:
• A text field for the input of formulae, together with buttons for the following
Boolean functions:
^ (And), _ (Or), ¬ (Not), ! (Implication), $ (Biconditional), 9 (negated Implication), (Xor), ⌘ (Implication).
• Three text fields (only for default logic) for the input of a default-rule (prerequi-
42
site, justification and consequence), together with the same buttons for Boolean
functions as above.
• Enter-buttons to add the formula or default rule to the current default theory
respectively add the formula to the current autoepistemic theory. An error message
occurs if the input is wrong.
• Text areas to show the current formulae and default rules respectively show only
the formula for autoepistemic logic.
• A Load-button to load a default respectively autoepistemic theory that was saved
before.
• A Save-button to save the current default respectively autoepistemic theory.
• A Clear-button to clear the current input.
• An Edit-button to edit the text areas.
• A Done-button, which replaces the Edit-button if the user has clicked on it. When
the Done-button is clicked the changes apply, if the input is correct. Otherwise an
error message occurs.
• A Calculate-button to get to the next window.
After the user has typed in the default or autoepistemic theory, he can press the
Calculate-button and a smaller window opens to chose between the problems (EXP/
EXT, CRED, SKEP) and the di↵erent algorithms. The buttons for the algorithms are
only enabled if the current theory holds the correspondent condition. For example the
Algorithm 7 for the extension existence problem can only be executed if all formulae in
the current default theory are contained in M.
For the credulous and the skeptical reasoning problem a text field and buttons for the
Boolean functions are enabled to type in the formula '. For the expansion existence
problem there also exist a check box for EXP’ to search only for consistent stable expansions. Another check box can be selected only for the first two algorithms of the
expansion existence problem, if the user wants to find more than one ⌃-full set.
Again there exist a Calculate-button to finally run the selected algorithm. A new tab is
opened in the main window, which only contains a text field to show the steps and the
result of the algorithm.
43
10.2 Implementation
The implementation was written in Java and the elements of the GUI were created with
Java Swing. The program is subdivided into the following packages:
• ActionListen: Containing all ActionListeners. This package is subdivided again
into the packages ActionListen.Default and ActionListen.Autoepistemic.
• AutoepistemicLogic: Containing the main classes for an autoepistemic theory.
• DefaultLogic: Containing the main classes for a default theory.
• GUI: Containing all classes concerning the GUI, which are not already contained
in the ActionListen package.
• other: Package for all other classes. Mainly the class representing formulae and
the class for the implication problem.
In the following the most important classes and data structures are described in more
detail.
The class Formula (package other) represents one formula. It contains a boolean to
see if the formula is contained in an autoepistemic or a default theory. The formula is
represented as a String and its truth table as a doubly linked list containing integer.
There also exist a vector of Strings containing all variables of the formula. The main
methods in this class are:
• checkForErrors(String formulaString, boolean autoepistemic): A static method to
check if a formula is correct before it is added to the default respectively autoepistmic theory.
• evaluateFormula(Vector<Integer> values): The method to evaluate the formula
for the given values.
• isinR0(), isinR1(), isinR2(), isinM(),... : Methods to check if the formula is in
R0 , R1 , R2 , M . . . . For every Boolean clone listed in the appendix(12.1) exists one
method.
The class Imp (package other) is a static class solving the implication problem. It
contains the implementations of all algorithms introduced in section 7.
A default rule is represented by the class DefaultRule (package DefaultLogic). It contains three variables, namely Formula prerequisite, Formula[ ] justification and Formula
consequences.
44
The class DefaultTheory (package DefaultLogic) represents a default theory. It consist
of a vector containing the default rules and a vector containing the formulae.
The current default theory is contained in the class DefaultMainClass (package DefaultLogic). This static class implements all algorithms introduced in section 8.
Corresponding to the class DefaultTheory, the class AutoepistemicTheory (package AutoepistemicLogic) represents an autoepistemic theory. It consist of a vector containing
all formulae.
The current autoepistemic theory is contained in the class AutoepistemicMainClass
(package AutoepistemicLogic). In this static class all algorithms introduced in section 9
are implemented.
11 Summary
In this work detailed algorithms were introduced and implemented to solve the extension respectively expansion existence problem, the credulous reasoning problem and the
skeptical reasoning problem for default respectively autoepistemic logic. For all of the
problems di↵erent algorithms were brought up for di↵erent considered Boolean clones.
Having a look at the complexity of those algorithms, one can see that there are large
di↵erences:
In default logic the complexity ranges from ⌃P
2 to NL for the extension existence problem and the credulous reasoning problem and even from ⇧P
2 to NL for the skeptical
0
reasoning problem. In autoepistemic logic the complexity ranges from ⌃P
2 to AC for
the extension existence problem and the credulous reasoning problem and from ⇧P
2 to
AC0 for the skeptical reasoning problem.
If a default respectively autoepistemic theory contains only Boolean function of a certain
Boolean clone, it is obvious that it pays o↵ to use the algorithm corresponding to this
clone.
45
12 Appendix
12.1 Boolean clones
Name
BF
R0
R1
R2
M
S0
S1
S00
S10
S11
D
D2
L
L0
L1
L2
L3
V
V0
V2
E
E0
E2
N
N2
I
I0
I2
Definition
All boolean functions
{f : f is 0-reproducing}
{f : f is 1-reproducing}
R0 \ R1
{f : f is monotone}
{f : f is 0-separating}
{f : f is 1-separating}
S0 \ R0 \ R1 \ M
S1 \ R0 \ R1 \ M
S1 \ M
{f : f is self-dual}
D\M
{f : f is linear}
L \ R0
L \ R1
L \ R2
L\D
W
{f : f ⌘ c0 _ ni=1 ci xi where the ci s are constant}
V \ R0
V \ R2
V
{f : f ⌘ c0 ^ ni=1 ci xi where the ci s are constant}
E \ R0
E \ R2
{f : f depends on at most one variable}
N \D
{f : f is a projection or a constant}
I \ R0
I \ R2
Table 1: List of boolean clones [4]
47
12.2 Post’s Lattice
BF
R1
R0
R2
M
M1
M2
S20
S30
M0
S202
S201
S302
S301
S0
S21
S200
S210
D
S300
S211
S212
S311
S312
S1
S310
D1
S02
S01
S11
D2
S00
S10
V
V1
L
V0
L1
V2
E
L3
L0
L2
E1
E0
E2
N
N2
I
I1
I0
I2
48
S31
S12
References
[1] E. N. Zalta. (2001). ”Non-monotonic Logic”. Stanford Encyclopedia of Philosophy.
Retrieved from: ”http://plato.stanford.edu/entries/logic-nonmonotonic/” (December
2014).
[2] O. Beyersdor↵, A. Meier, M. Thomas and H. Vollmer. (March 2011). ”The complexity
of reasoning for fragments of default logic”. Journal of Logic and Computation.
[3] O. Beyersdor↵, A. Meier, M. Thomas, H. Vollmer. (August 2009). ”The Complexity
of Propositional Implication”. Cornell University Library.
[4] N. Creignou, H.Vollmer. (2014) ”Parameterized Complexity of Weighted Satisfiability Problems: Decision, Enumeration, Counting”. Fundamenta Informaticae.
[5] M. Jantzen. (2008). ”Komplexitätstheorie 3”. Universität Hamburg, Fachbereich
Informatik. Retrieved from: ”https://www.informatik.uni-hamburg.de/TGI/lehre/vl
/SS08/KT/web-content/sec/KT-Folien 86-126.pdf” (January 2015).
[6] G. Gottlob. (1992). ”Complexity Results for Nonmonotonic Logics”. Journal of Logic
and Computation.
[7] M. Thomas. (2010). ”On the complexity of fragments of nonmonotonic logics”. Leibniz Universität Hannover, Fakultät für Elektrotechnik und Informatik
[8] A. Mikitiuk and M. Truszczynski. ”Constrained and rational default logic”. University of Kentucky, Department of Computer Science.
[9] E. Hildebrand. (2008). ”Theoretische Grundlagen zu Default Logic”. Universität Heidelberg, Institut für allgemeine und angewandte Sprach- und Kulturwissenschaft.
[10] R. Reiter. (1980). ”A Logic for Default Reasoning”. University of British Columbia,
Department of Computer Science.
[11] I. Niemelä. (1990). ”Towards Automatic Autoepistemic Reasoning”. Helsinki University of Technology, Department of Computer Science.
[12] G. Schnitger. (2013). ”Schaltkreis-Komplexität”. Goethe-Universität Frankfurt am
Main, Institut für Informatik.
[13] N. Drummond, R. Shearer. (2006). ”The Open World Assumption”. University of
Manchester.
[14] D. Barker-Plummer. (2012). ”Turing Machines”. Stanford Encyclopedia of Philos-
49
ophy. Retrieved from: ”http://plato.stanford.edu/entries/turing-machine/#Equiv”
(February 2015).
[15] A. Bishnu. (2010). ”Oracle Turing Machines”. Indian Statistical Institute. Retrieved from: ”http://www.isical.ac.in/ arijit/courses/spring2010/slides/complexity
lec13.pdf” (February 2015).
[16] R. C. Moore. (1985). ”Semantical considerations on modal logic”. Artificial Intelligence 25.
[17] O. Beyersdor↵. (2013). ”The Complexity of Theorem Proving in Autoepistemic
Logic”. University of Leeds, Faculty of Engineering.
[18] J. E. Savage. (2008). ”Models Of Computation”. Brown University.
[19] H. Vollmer. (2008). ”Komplexitätstheorie”. Leibniz Universität Hannover, Fakultät
für Elektrotechnik und Informatik.
[20] N. Creignou, A. Meier, H. Vollmer and M. Thomas. (2011). ”The Complexity of
Reasoning for Fragments of Autoepistemic Logic”. ACM Transactions on Computational Logic.
[21] E. Post. (1941) ”The two-valued iterative systems of mathematical logic”. Annals
of Mathematical Studies 5.
50