Side-Change Transformation
Kiyoshi Akama
1
, Ekawit Nantajeewarawat
2
and Taketo Akama
3
1
Information Initiative Center, Hokkaido University, Sapporo, Japan
2
Computer Science, Sirindhorn International Institute of Technology, Thammasat University, Pathumthani, Thailand
3
Modeleet Labs, Sapporo, Japan
Keywords:
Model-Intersection Problem, Extended Clause, Equivalent Transformation, Side-Change Transformation,
Computation Control.
Abstract:
Many logical problems, such as proof problems and query-answering problems, can be mapped into model-
intersection (MI) problems, which constitute one of the largest and most fundamentally important classes of
logical problems. To solve MI problems, many equivalent transformation rules have been employed. In this
paper, we introduce a new transformation, called side-change transformation, and propose unfolding/side-
change computation control, i.e., when neither unfolding nor definite-clause removal is applicable, an attempt
is made to transform a given problem using side-change transformation so as to derive an equivalent problem
to which unfolding is applicable. The correctness of side-change transformation is shown. While a resolution-
based proof method increases problem size monotonically no matter what control is taken, a reduction of
problem size can often be achieved by using the unfolding/side-change control.
1 INTRODUCTION
Proof problems and query-answering (QA) problems
are two most important and largest classes of logi-
cal problems, and many solutions to their subclasses
have been intensively studied. When we try to solve
some of these problems on FOL
c
, i.e., the set of all
first-order formulas with built-in constraint atoms, we
bump up against the fact that none of these problem
classes have been solved entirely so far. The conven-
tional Skolemization (Chang and Lee, 1973; Fitting,
1996), by which neither the satisfiability nor the logi-
cal meaning of a formula in FOL
c
can be preserved
in general (Akama and Nantajeewarawat, 2015b), has
been a major hindrance to solve problems in these two
classes correctly.
To overcome the difficulty, new Skolemization,
called meaning-preserving Skolemization (MPS), an
extended clause space, called ECLS
F
, and model-
intersection (MI) problems were introduced (Akama
and Nantajeewarawat, 2011; Akama and Nantajee-
warawat, 2015a). All proof problems and all QA
problems on FOL
c
have been mapped using MPS,
with the answers to them being preserved, into MI
problems on ECLS
F
(Akama and Nantajeewarawat,
2015a; Akama and Nantajeewarawat, 2016a), thereby
guaranteeing the correctness for solving a large class
of logical problems. MI problems on ECLS
F
consti-
tute one of the largest classes of logical problems and
are of fundamental importance.
To solve MI problems, we use many equivalent
transformation (ET) rules. An appropriate strategy
for applying ET rules is essential to solve logical
problems efficiently. One strategy is to repeatedly
apply unfolding and definite-clause removal (Akama
and Nantajeewarawat, 2016b), by which a decrease
of problem size can be expected. However, in the ex-
tended clause space ECLS
F
, unfolding is not necessa-
rily applicable to an atom in the right-hand side of a
clause, and computation may often reaches a state in
which neither unfolding nor definite-clause removal
can be applied.
To get out of such a state, we introduce in this
paper a new transformation called side-change trans-
formation on the extended space ECLS
F
, by which
we try to transform a given problem in order to obtain
an equivalent problem to which unfolding or definite-
clause removal is applicable. The correctness of side-
change transformation is shown.
Side-change transformation, which moves atoms
to the other side of a clause, is a very simple transfor-
mation. It does not change problem size (the num-
ber of clauses and the number of atoms in the set
of clauses representing a problem). However, side-
Akama, K., Nantajeewarawat, E. and Akama, T.
Side-Change Transformation.
DOI: 10.5220/0006934802370246
In Proceedings of the 10th International Joint Conference on Knowledge Discovery, Knowledge Engineering and Knowledge Management (IC3K 2018) - Volume 2: KEOD, pages 237-246
ISBN: 978-989-758-330-8
Copyright © 2018 by SCITEPRESS Science and Technology Publications, Lda. All rights reserved
237
change transformation contributes to efficient compu-
tation when it is used together with extended unfol-
ding transformation in the space ECLS
F
, which is lar-
ger than the clause space taken by the conventional
theory (Akama and Nantajeewarawat, 2016b).
The rest of this paper is organized as follows:
Section 2 introduces side-change transformation and
explains its typical usage. Section 3 illustrates
unfolding/side-change computation control for sol-
ving MI problems. Section 4 begins with a review of
theoretical foundation concerning the extended clause
space ECLS
F
and the semantics of a set of extended
clauses. It then formalizes side-change transforma-
tion and proves the correctness of this transformation.
Section 5 presents some experiments. Section 6 con-
cludes the paper.
2 SIDE-CHANGE
TRANSFORMATION AND ITS
USAGE
2.1 Side-Change Transformation
Let Cs be a clause set and p a predicate occurring in
Cs. An atom whose predicate is p is referred to as a p-
atom. The clause set Cs can be transformed by side-
change transformation of p-atoms (also called side-
change transformation for p) as follows:
1. Determine a new predicate not p for p.
2. Move each p-atom in each clause to its opposite
side in the same clause (i.e., from the left-hand
side to the right-hand side and vice versa) with its
predicate being changed from p to not p.
For example, a singleton clause set
{(p(1,x),q(x,y) p(4,x), p(5,x),r(y))}
is transformed by side-change transformation of p-
atoms into
{(not p(4,x),not p(5,x), q(x, y) not p(1, x),r(y))}.
Let the clause set obtained from Cs by side-change
transformation of p-atoms into not p-atoms be deno-
ted by SIDECH(Cs, p,not p).
2.2 Sufficient Conditions for Enabling
Unfolding Transformation
Let Cs be a set of clauses. To apply unfolding or
definite-clause removal to Cs, we need to determine
a set D of definite clauses and a predicate p such that
(i) D is a subset of Cs, (ii) the head of each definite
clause in D is a p-atom, and (iii) no p-atom appears
in the left-hand side of any clause in Cs D.
When unfolding is not applicable, side-change
transformation is useful for deriving from Cs a new
set of clauses to which unfolding or definite-clause
removal can be applied. Two types of its usage that
enable unfolding are described below.
2.2.1 Type 1
Let p be a predicate and not p a new predicate deter-
mined for side-change transformation for p. Unfol-
ding with respect to not p-atoms can be applied after
side-change transformation for p if each clause C in
Cs satisfies the following two conditions:
1. There is at most one p-atom in the right-hand side
of C.
2. If there is exactly one p-atom in the right-hand
side of C, then all user-defined atoms in the left-
hand side of C are p-atoms.
Example 1. Consider the following clauses:
C
a
: q(x), p(5,x) r(x)
C
b
: p(x,y),r(y, w), s(y,w)
C
c
: p(x,z) p(x,y),r(y,z)
C
d
: p(x,w), p(x,2) p(x,y),t(w)
Each of these clauses satisfies the two conditions
above. By side-change transformation of p, these four
clauses are transformed into:
C
0
a
: q(x) r(x),not p(5, x)
C
0
b
: not p(x,y) r(y,w),s(y, w)
C
0
c
: not p(x, y) not p(x,z),r(y,z)
C
0
d
: not p(x,y) not p(x, w), not p(x,2),t(w)
We obtain the set {C
0
b
,C
0
c
,C
0
d
} of definite clauses for
the predicate not p, which can be used for unfolding
with respect to not p(5,x) in the right-hand side of the
first clause C
0
a
.
Assume that D
not p
is the set of all definite clau-
ses for not p in Cs. If there is no not p-atom in the
right-hand side of any clause in Cs D
not p
, then D
not p
can be removed by definite-clause removal transfor-
mation.
2.2.2 Type 2
Assume that p and q are distinct predicates. Unfol-
ding with respect to q-atoms can be applied after side-
change transformation for p if each clause C in Cs
satisfies the following two conditions:
1. There is at most one q-atom in the left-hand side
of C.
KEOD 2018 - 10th International Conference on Knowledge Engineering and Ontology Development
238
2. If there is exactly one q-atom in the left-hand side
of C, then (i) all other user-defined atoms in the
left-hand side of C are p-atoms and (ii) no p-atom
appears in the right-hand side of C.
Example 2. Consider the following four clauses:
C
e
: s(x,y) q(x, y)
C
f
: q(x, y) r(y)
C
g
: p(x,y),q(x,y) r(x),s(y)
C
h
: p(x,y), p(x,z),q(x,y) t(y,z)
Each of them satisfies the two conditions for Type 2.
By side-change transformation of p, these clauses are
changed into:
C
0
e
: s(x,y) q(x, y)
C
0
f
: q(x, y) r(y)
C
0
g
: q(x,y) not p(x,y),r(x), s(y)
C
0
h
: q(x,y) not p(x,y),not p(x,z),t(y,z)
We obtain the set {C
0
f
,C
0
g
,C
0
h
} of definite clauses for
the predicate q, which can be used for unfolding with
respect to q(x,y) in the right-hand side of C
0
e
.
Assume that D
q
is the set of all definite clauses for
q in Cs. If there is no q-atom in the right-hand side of
any clause in Cs D
q
, then D
q
can be removed by
definite-clause removal transformation.
2.3 Reduction of Problem Size
The resolution proof procedure is one of the most fa-
mous sound and complete proof procedures (Fitting,
1996). It uses two inference rules, i.e., the resolution
inference rule (Robinson, 1965) and the factoring in-
ference rule. Given a set Cs of clauses, the resolution
proof procedure starts with Cs and repeatedly make
inference by resolution or factoring to construct a se-
quence [Cs
0
,Cs
1
,Cs
2
,...], where Cs
0
= Cs. When it
reaches a clause set Cs
n
that contains the empty clause
(), the proof is completed. Each inference step in-
creases the number of clauses by one.
The solution method for MI problems considered
in this paper uses unfolding/side-change control, i.e.,
it attempts to apply transformation in the preference
order of (i) definite-clause removal, (ii) unfolding,
and (iii) side-change transformation. By definite-
clause removal, the number of clauses decreases. Let
p be a predicate and number(p) denote the number
of p-atoms in the right-hand sides of all clauses un-
der consideration. By repeated application of unfol-
ding with respect to p-atoms, we expect number(p)
to become zero and definite-clause removal can then
be applied for removing the definition of p. By side-
change transformation, we expect to obtain new clau-
ses to which further unfolding is applicable. Appro-
C
1
: FM(x) FP(x) C
2
: FP(john)
C
3
: FP(mary) C
4
: teach(john,ai)
C
5
: St(paul) C
6
: AC(ai)
C
7
: Tp(kr) C
8
: Tp(lp)
C
9
: curr(x,z) exam(x,y),subject(y, z), St(x),
Co(y),Tp(z)
C
10
: mdt(x,y) curr(x, z), expert(y,z), St(x), Tp(z),
FP(y),AC(w),teach(y,w)
C
11
: mdt(x,y) St(x), NFP(y)
C
12
: exam(paul,ai) C
13
: subject(ai,kr)
C
14
: subject(ai, lp) C
15
: expert(john,kr)
C
16
: expert(mary,lp)
C
17
: AC(x) teach(mary,x)
C
18
: AC(x),BC(x)
C
19
: AC(x),BC(x) Co(x)
C
20
: Co(x) AC(x)
C
21
: Co(x) BC(x)
C
22
: FP(x) NFP(x)
C
23
: NFP(x), teach(x,y),Co(y)
C
24
: teach(x,y),NFP(x) FP(x),func( f
0
,x,y)
C
25
: Co(y), NFP(x) FP(x), func( f
0
,x,y)
Figure 1: Background knowledge for the mdt problem on
ECLS
F
.
priate combinations of these three types of transfor-
mation are often useful to reduce problem size.
A resolution proof procedure is a refutation met-
hod, i.e., it aims to show that a given clause set has no
model. QA problems, on the other hand, is basically
concerned with finding all models of a given clause
set. The unfolding/side-change control can be used
not only for proof problems but also for QA problems
and MI problems.
3 COMPUTATION CONTROL
WITH SIDE-CHANGE
TRANSFORMATION
Control of rule application with side-change transfor-
mation is demonstrated by using a puzzle. When ne-
cessary, the reader is referred to the concept definiti-
ons in Section 4.
3.1 Problem Description
Consider the clause set Cs consisting of C
1
C
25
in
Fig. 1, which provides the background knowledge on
ECLS
F
for the mayDoThesis problem (for short, the
mdt problem), modified from the original problem gi-
ven in (Donini et al., 1998). All atoms appearing in
Fig. 1 are user-defined atoms. The clauses C
9
C
11
Side-Change Transformation
239
C
26
: teach(john,ai)
C
27
: AC(ai)
C
28
: AC(x) teach(mary,x)
C
29
: AC(x),BC(x)
C
30
: AC(x),BC(x) Co(x)
C
31
: Co(x) AC(x)
C
32
: Co(x) BC(x)
C
33
: NFP(x),teach(x,y), Co(y)
C
34
: mdt(paul,mary) AC(x),teach(mary,x),
Co(ai)
C
35
: mdt(paul,john) AC(x),teach(john,x),Co(ai)
C
36
: mdt(paul,x) NFP(x)
C
37
: teach(mary,x), NFP(mary) func( f
0
,mary,x)
C
38
: teach(john,x), NFP(john) func( f
0
,john,x)
C
39
: Co(x),NFP(mary) func( f
0
,mary,x)
C
40
: Co(x),NFP(john) func( f
0
,john,x)
Figure 2: Clauses obtained by transformation of C
1
C
25
in
Fig. 1.
together provide the conditions for a student to do
his/her thesis with a professor, where for any student
s and any professor p, mdt(s, p) is intended to mean
s may do his/her thesis with p.
Suppose that we want to find all professors with
whom paul may do his thesis. This problem is formu-
lated as a MI problem hCs,ϕi, where ϕ is a mapping
used for constructing the output answer from the in-
tersection of all models of Cs, defined by
ϕ(G) = {x | mdt(paul,x) G}
for any set G of ground user-defined atoms. (The
formal definition of a MI problem is deferred to
Section 4.4.)
3.2 Inapplicability of Unfolding
Consider the clauses C
26
C
40
in Fig. 2, which are
obtained by equivalently transforming the clauses C
1
C
25
in Fig. 1. Unfolding is not applicable to them due
to the following reasons:
Unfolding of the predicate AC is blocked since
C
30
contains an AC-atom and a BC-atom in its left-
hand side.
Unfolding of the predicate Co is blocked since C
39
and C
40
contain Co-atoms and NFP-atoms in their
left-hand sides.
Unfolding of the predicate teach is blocked since
C
37
and C
38
contain teach-atoms and NFP-atoms
in their left-hand sides.
Unfolding of the predicate mdt is blocked since
the answer to the problem is influenced by mdt-
atoms.
As will be subsequently illustrated, unfolding with re-
spect to Co-atoms and with respect to teach-atoms
will be made applicable by side-change transforma-
tion for the predicate NFP.
3.3 Rule Application Control with
Side-Change Transformation
With side-change transformation, the clause set Cs
consisting of C
1
C
25
in Fig. 1 is transformed as fol-
lows, where basic reduction rules given in (Akama
and Nantajeewarawat, 2014) (such as removal of valid
clauses, removal of subsumed clauses, and removal of
duplicate atoms) are also used:
1. By (i) unfolding using the definitions of the predi-
cates FP, Tp, curr, subject, expert, St, and exam,
(ii) removing these definitions along with the de-
finition of FM using definite-clause removal, and
(iii) application of basic reduction rules, the clau-
ses C
1
C
25
are transformed into the clauses C
26
C
40
in Fig. 2.
2. Side-change transformation for NFP enables (i)
unfolding using the definitions of Co and teach,
(ii) elimination of these definitions using definite-
clause removal, and (iii) application of basic re-
duction rules.
3. Side-change transformation for BC enables (i) un-
folding using the definition of AC, (ii) definite-
clause removal, and (iii) application of basic re-
duction rules.
4. The resolution rule together with basic reduction
rules are then applied.
5. Assume that notNFP is the predicate determined
for side-change transformation for NFP at Step 2.
By (i) side-change transformation for notNFP, (ii)
unfolding of NFP, (iii) removal of independent
func-atoms, and (iv) application of basic reduction
rules, we obtain the clauses C
41
and C
42
given as
follows:
C
41
: mdt(paul,mary)
C
42
: mdt(paul,john)
As a result, the MI problem hCs,ϕi in Section 3.1
is transformed equivalently into the MI problem
h{C
41
,C
42
},ϕi. Hence the answer to the original MI
problem hCs,ϕi coincides with the answer to the sim-
pler MI problem h{C
41
,C
42
},ϕi, which can be readily
determined as the set
ϕ(
T
Models({C
41
,C
42
}))
= ϕ({mdt(paul,mary),mdt(paul,john)})
= {mary,john},
where Models({C
41
,C
42
}) denotes the set of all mo-
dels of {C
41
,C
42
}.
KEOD 2018 - 10th International Conference on Knowledge Engineering and Ontology Development
240
4 CORRECTNESS THEOREM
FOR SIDE-CHANGE
TRANSFORMATION
To provide a theoretical basis for the correctness of
side-change transformation, we first review the exten-
ded clause space ECLS
F
, the semantics of an exten-
ded clause set, and the formal definition of a MI pro-
blem. We then show that side-change transformation
preserves the answers to MI problems.
4.1 User-Defined Atoms, Constraint
Atoms, and func-Atoms
We consider an extended formula space that contains
three kinds of atoms, i.e., user-defined atoms, built-
in constraint atoms, and func-atoms. A user-defined
atom takes the form p(t
1
,...,t
n
), where p is a user-
defined predicate and the t
i
are usual terms. A built-in
constraint atom, also simply called a constraint atom
or a built-in atom, takes the form c(t
1
,...,t
n
), where c
is a predefined constraint predicate and the t
i
are usual
terms. Let A
u
denote the set of all user-defined atoms,
G
u
the set of all ground user-defined atoms, A
c
the set
of all constraint atoms, and G
c
the set of all ground
constraint atoms.
A func-atom (Akama and Nantajeewarawat, 2011)
is an expression of the form func( f ,t
1
,...,t
n
,t
n+1
),
where f is either an n-ary function constant or an n-
ary function variable, and the t
i
are usual terms. It is
a ground func-atom if f is a function constant and the
t
i
are ground usual terms.
4.2 Extended Clauses and an Extended
Clause Space
An extended clause C is a formula of the form
(a
1
,...,a
m
b
1
,...,b
n
,f
1
,...,f
p
), where {a
1
,...,
a
m
,b
1
,...,b
n
} A
u
A
c
and f
1
,...,f
p
are func-
atoms. All usual variables occurring in C are im-
plicitly universally quantified and their scope is re-
stricted to the extended clause C itself. The sets
{a
1
,...,a
m
} and {b
1
,...,b
n
,f
1
,...,f
p
} are called the
left-hand side and the right-hand side, respectively,
of the extended clause C, and are denoted by lhs(C)
and rhs(C), respectively. When there is only one user-
defined atom in lhs(C), C is called an extended defi-
nite clause. When no confusion is caused, an exten-
ded clause is simply called a clause. The set of all
extended clauses is denoted by ECLS
F
. The extended
clause space in this paper is the powerset of ECLS
F
.
Let Cs be a set of extended clauses. Implicit ex-
istential quantifications of function variables and im-
plicit clause conjunction are assumed in Cs. Function
variables in Cs are all existentially quantified and
their scope covers all clauses in Cs. With occurren-
ces of function variables, clauses in Cs are connected
through shared function variables. After instantiating
all function variables in Cs into function constants,
clauses in the instantiated set are totally separated.
4.3 Interpretations and Models
An interpretation is a subset of G
u
. A ground user-
defined atom g is true under an interpretation I iff g
belongs to I. Unlike ground user-defined atoms, the
truth values of ground constraint atoms are predeter-
mined independently of interpretations. Let TCON
denote the set of all true ground constraint atoms,
i.e., a ground constraint atom g is true iff g TCON.
A ground func-atom func( f ,t
1
,...,t
n
,t
n+1
) is true iff
f (t
1
,...,t
n
) = t
n+1
.
Let C = (a
1
,...,a
m
b
1
,...,b
n
,f
1
,...,f
p
) be a
ground clause, where {a
1
,...,a
m
,b
1
,...,b
n
} G
u
G
c
and f
1
,...,f
p
are ground func-atoms. C is true un-
der an interpretation I (in other words, I satisfies C)
iff at least one of the following conditions is satisfied:
1. There exists i {1,...,m} such that a
i
I
TCON.
2. There exists i {1,...,n} such that b
i
/ I
TCON.
3. There exists i {1, . . . , p} such that f
i
is false.
An interpretation I is a model of a clause set Cs
ECLS
F
iff there exists a substitution σ for function
variables that satisfies the following conditions:
1. All function variables occurring in Cs are instan-
tiated by σ into function constants.
2. For any clause C Cs and any substitution θ for
usual variables, if Cσθ is a ground clause, then
Cσθ is true under I.
For any Cs ECLS
F
, let Models(Cs) denote the set
of all models of Cs.
4.4 MI Problems on the Extended
Clause Space
A model-intersection problem (MI problem) on
ECLS
F
is a pair hCs,ϕi, where Cs ECLS
F
and ϕ is a
mapping from pow(G
u
) to some set W . The mapping
ϕ is called an extraction mapping (previously called
an exit mapping). The answer to this problem, deno-
ted by ans
MI
(Cs,ϕ), is defined as ϕ(
T
Models(Cs)),
where
T
Models(Cs) is the intersection of all models
of Cs. Note that when Models(Cs) is the empty set,
T
Models(Cs) = G
u
.
Side-Change Transformation
241
The notion of an independent extraction mapping
is next introduced; it is used for giving a sufficient
condition for the correctness of side-change transfor-
mation. Given a set P of predicates, let GAtoms(P)
denote the set of all ground atoms in G
u
the predicates
of which belong to P. An extraction mapping ϕ is said
to be independent of a set P of predicates iff for any
G
1
,G
2
G
u
, if (G
1
G
2
)(G
2
G
1
) GAtoms(P),
then ϕ(G
1
) = ϕ(G
2
).
4.5 Correctness Theorem for
Side-Change Transformation
We show below that side-change transformation is
answer-preserving.
Theorem 1. Let hCs, ϕi be a MI problem on ECLS
F
.
Let p be a predicate occurring in Cs and not p a
new predicate determined for side-change transfor-
mation for p. If ϕ is independent of {p, not p}, then
ans
MI
(Cs,ϕ) = ans
MI
(SIDECH(Cs, p,not p),ϕ).
Proof: Assume that (i) ϕ is independent of
{p,not p}, (ii) Cs
0
= SIDECH(Cs, p,not p), and (iii)
π
p
is a mapping that changes p-atoms into not p-
atoms. Let m be an arbitrary model of Cs. Let a set
m
0
G
u
be constructed from m by
m
0
= (m GAtoms({p}))
{π
p
(x) | x (GAtoms({p}) m)}.
Obviously, m
0
is a model of Cs
0
. This con-
struction determines a mapping ψ from Models(Cs)
to Models(Cs
0
). Obviously, ψ
1
is a mapping from
Models(Cs
0
) to Models(Cs) and ψ ψ
1
is an iden-
tity mapping. Hence ψ is a bijective mapping from
Models(Cs) to Models(Cs
0
). As a result,
T
Models(Cs)
T
Models(Cs
0
) GAtoms({p,
not p}), and
T
Models(Cs
0
)
T
Models(Cs) GAtoms({p,
not p}).
Since ϕ is independent of {p,not p}, it follows that
ϕ(
T
Models(Cs)) is equal to ϕ(
T
Models(Cs
0
)).
5 EXPERIMENTS WITH
SIDE-CHANGE
TRANSFORMATION
5.1 The Agatha QA Problem
Consider the “Dreadsbury Mansion Mystery” pro-
blem (Pelletier, 1986), which is described as follows:
Someone who lives in Dreadsbury Mansion killed
F
1
: x : (live(x, D) kill(x,A))
F
2
: x : (live(x, D) (eq(x,A) eq(x,B)
eq(x,C)))
F
3
: xy : (kill(x,y) hate(x, y))
F
4
: xy : (kill(x,y) ¬richer(x,y))
F
5
: ¬(x : (hate(C, x) hate(A,x) live(x,D)))
F
6
: x : ((neq(x,B) live(x,D)) hate(A,x))
F
7
: x : ((¬richer(x, A) live(x, D)) hate(B, x))
F
8
: x : ((hate(A,x) live(x,D)) hate(B,x))
F
9
: ¬(x : (live(x,D)
y : (live(y,D) hate(x,y))))
F
10
: x : (kill(x,A) killer(x))
Figure 3: Background knowledge represented by first-order
formulas.
Aunt Agatha. Agatha, the butler, and Charles live
in Dreadsbury Mansion, and are the only people who
live therein. A killer always hates his victim, and is
never richer than his victim. Charles hates no one that
Aunt Agatha hates. Agatha hates everyone except the
butler. The butler hates everyone not richer than Aunt
Agatha. The butler hates everyone Agatha hates. No
one hates everyone. The problem is to find who is the
killer.
5.2 Formalization by First-Order
Formulas
Assume that eq and neq are predefined binary con-
straint predicates and for any ground usual terms t
1
and t
2
, (i) eq(t
1
,t
2
) is true iff t
1
= t
2
, and (ii) neq(t
1
,t
2
)
is true iff t
1
6= t
2
. The background knowledge of this
mystery is formalized as the conjunction of the first-
order formulas in Fig. 3, where (i) the constants A,
B, C, and D denote “Agatha, “the butler, “Charles,
and “Dreadsbury Mansion, respectively, and (ii) for
any terms t
1
and t
2
, live(t
1
,t
2
), kill(t
1
,t
2
), hate(t
1
,t
2
),
and richer(t
1
,t
2
) are intended to mean “t
1
lives in t
2
,
t
1
killed t
2
, t
1
hates t
2
, t
1
is richer than t
2
, re-
spectively.
5.3 Meaning-Preserving Skolemization
Meaning-preserving Skolemization transforms a first-
order formula equivalently into a set of extended
clauses (Akama and Nantajeewarawat, 2011). Let
MPS(E) denote the set of extended clauses resulting
from applying meaning-preserving Skolemization to
a given first-order formula E in FOL
c
. MPS(E) is
obtained from E by repeated subformula transforma-
tion and conversion into a clausal form.
Consider the formulas F
1
F
10
in Fig. 3. Refer-
ring to the clauses C
1
C
15
in Fig. 4, MPS(F
1
) =
{C
1
,C
2
}, MPS(F
2
) = {C
3
,C
4
,C
5
,C
6
}, MPS(F
3
) =
KEOD 2018 - 10th International Conference on Knowledge Engineering and Ontology Development
242
C
1
: live(x, D) func( f
0
,x)
C
2
: kill(x,A) func( f
0
,x)
C
3
: live(x,D),neq(x,A),neq(x,B),neq(x,C)
C
4
: live(A, D)
C
5
: live(B, D)
C
6
: live(C, D)
C
7
: hate(x,y) kill(x,y)
C
8
: kill(x,y),richer(x, y)
C
9
: hate(A,x), hate(C, x), live(x,D)
C
10
: hate(A,x) neq(x, B), live(x,D)
C
11
: richer(x,A),hate(B, x) live(x,D)
C
12
: hate(B,x) hate(A,x), live(x,D)
C
13
: hate(x,y),func( f
1
,x,y),live(x,D)
C
14
: live(y, D) live(x,D), func( f
1
,x,y)
C
15
: killer(x) kill(x,A)
Figure 4: The initial state with extended clauses.
{C
7
}, MPS(F
4
) = {C
8
}, MPS(F
5
) = {C
9
}, MPS(F
6
)
= {C
10
}, MPS(F
7
) = {C
11
}, MPS(F
8
) = {C
12
},
MPS(F
9
) = {C
13
,C
14
}, and MPS(F
10
) = {C
15
}. Let
K = F
1
F
2
···F
9
. Then MPS(K F
10
) = {C
1
,C
2
,
...,C
15
}.
5.4 Simplification
We simplify the formalization in Fig. 3 for ease of
computation and presentation. F
1
is simplified using
F
2
into F
0
1
as follows:
F
1
x : (live(x,D) kill(x, A))
x : ((eq(x,A) eq(x,B) eq(x,C))
kill(x, A))
x : ((eq(x,A) kill(x,A))
(eq(x,B) kill(x,A))
(eq(x,C) kill(x,A)))
x : ((eq(x,A) kill(A,A))
(eq(x,B) kill(B,A))
(eq(x,C) kill(C,A)))
kill(A,A) kill(B,A) kill(C,A)
F
0
1
F
9
is simplified using F
2
into F
0
9
as follows:
F
9
¬(x : (live(x,D)
y : (live(y,D) hate(x,y))))
¬(x : (live(x,D)
(hate(x,A) hate(x,B) hate(x,C))))
F
0
9
Assume that
K = F
1
F
2
F
3
F
4
F
6
F
7
F
8
F
9
, and
K
0
= F
0
1
F
2
F
3
F
4
F
6
F
7
F
8
F
0
9
.
The Agatha QA problem is hK F
10
,killer(x)i,
and the simplified Agatha QA problem is hK
0
F
10
,killer(x)i. The set of clauses obtained from
K
0
F
10
is shown in Fig. 5, where MPS(F
0
1
) = {C
16
},
C
16
: kill(A,A),kill(B,A),kill(C,A)
C
17
: live(x,D),neq(x,A),neq(x,B),neq(x,C)
C
18
: live(A, D)
C
19
: live(B, D)
C
20
: live(C, D)
C
21
: hate(x,y) kill(x,y)
C
22
: kill(x,y),richer(x, y)
C
23
: hate(A,x), hate(C, x), live(x,D)
C
24
: hate(A,A)
C
25
: hate(A,C)
C
26
: richer(x,A),hate(B, x) live(x,D)
C
27
: hate(B,x) hate(A,x),live(x, D)
C
28
: hate(x,A), hate(x,B),hate(x,C),live(x,D)
C
29
: killer(x) kill(x, A)
Figure 5: The simplified initial state.
MPS(F
2
) = {C
17
,C
18
,C
19
,C
20
}, MPS(F
3
) = {C
21
},
MPS(F
4
) = {C
22
}, MPS(F
5
) = {C
23
}, MPS(F
6
) =
{C
24
,C
25
}, MPS(F
7
) = {C
26
}, MPS(F
8
) = {C
27
},
MPS(F
9
) = {C
28
}, and MPS(F
10
) = {C
29
}.
5.5 Computation Control
We use priority ordering to control selection and ap-
plication of ET rules. For example, assume that
(subsumed) is an ET rule for elimination of sub-
sumed clauses,
(ud) is an ET rule for unfolding by a set of definite
clauses or deletion of a set of definite clauses, and
(rr n), where n is a nonnegative integer, is the reso-
lution rule with a resolvent consisting of less than
or equal to n atoms.
To represent a preference order among ET rules, a bi-
nary relation > is used. ET rules together with a bi-
nary relation > are referred to as prioritized ET rules
or a prioritized ET rule set. The prioritized ET rules
(subsumed) > (ud) > (rr 4)
indicate that (subsumed) has priority over (ud) and
(ud) has priority over (rr 4). The relation > specifies
computation control for rule selection at each compu-
tation step as follows:
If (subsumed) is applicable, then apply it.
If (subsumed) is not applicable and (ud) is appli-
cable, then apply (ud).
If (subsumed) and (ud) are not applicable and
(rr 4) is applicable, then apply (rr 4).
For more detailed explanation of computation control
and ET rules, the reader is referred to (Akama et al.,
2018).
Side-Change Transformation
243
C
30
: hate(B,C)
C
31
: hate(B,A)
C
32
: killer(x) kill(x, A)
C
33
: hate(x,y) kill(x,y)
C
34
: hate(A,C)
C
35
: hate(A,A)
C
36
: kill(x,y),richer(x, y)
C
37
: kill(A,A),kill(B,A),kill(C,A)
C
38
: richer(B, A), hate(B,B)
C
39
: kill(C,A)
Figure 6: The computation state to which unfolding cannot
be applied.
5.6 The State to Which Unfolding Is Not
Further Applicable
Consider the simplified Agatha QA problem hK
0
F
10
,killer(x)i. Assume that
(eq) is an ET rule for evaluating eq-atoms,
(neq) is an ET rule for evaluating ground neq-
atoms,
(erase) is an ET rule for removing body atoms that
are erasable in a clause, and
(specAtom) is an ET rule for specializing a clause
into a number of clauses.
By using the prioritized ET rules
(eq) > (neq) > (subsumed) > (erase) >
(specAtom) > (ud),
computation reaches the state in Fig. 6, where the
clause (richer(B, A), hate(B,B) ) prevents unfol-
ding with respect to richer-atoms and hate-atoms.
Notice the two clauses in Fig. 6 that contain richer-
atoms:
kill(x, y), richer(x, y)
richer(B,A),hate(B, B)
By side-change transformation with respect to richer,
we obtain the following two clauses:
notricher(x, y) kill(x,y)
hate(B, B) notricher(B,A)
They make unfolding with respect to richer and/or
hate applicable. Unfolding with respect to notricher
and hate yields the following clauses:
kill(B,A)
kill(A, A), kill(B,A),kill(C,A)
killer(x) kill(x,A)
kill(C, A)
Resolution then resolves this state to enable further
application of unfolding. All atoms except killer-
atoms are removed by unfolding. Finally, we obtain
C
41
: hate(B,C)
C
42
: hate(B,A)
C
43
: kill(B,A),kill(C,A)
C
44
: hate(x,y) kill(x,y)
C
45
: hate(A,C)
C
46
: hate(A,A)
C
47
: kill(x,y),richer(x, y)
C
48
: hate(B,B)
C
49
: richer(B, A), hate(B,B)
C
50
: kill(C,A)
Figure 7: The First Stop for Proof.
C
51
: kill(B,A)
C
52
: kill(C,A)
C
53
: kill(B,A),kill(C,A)
Figure 8: The Second Stop for Proof.
a singleton clause set {(killer(A) )} and reach the
conclusion that Agatha is the answer.
Consequently, we add the side-change transfor-
mation rule (chSide) with the lowest priority, resulting
in the prioritized ET rules
(eq) > (neq) > (subsumed) > (erase) >
(specAtom) > (ud) > (chSide),
in order to have a complete fully automatic computa-
tion from the initial state to the final result. We have
a 62-step solution, in which (ud) is applied 30 times,
(chSide) 1 time, (rr 5) 5 times, (subsumed) 16 times,
(erase) 9 times, and (neq) 1 time.
5.7 Formalization of Proof by
First-Order Formulas
Let C
40
be the clause (kill(B,A),kill(C,A) ), and
consider a proof problem hK
0
,C
40
i, referred to as the
simplified Agatha proof problem, which is to prove
that K
0
|= {C
40
}, i.e., neither B nor C killed A. Note
that the answer to the simplified Agatha QA problem
hK
0
,killer(x)i being {A} does not mean that neither
B nor C killed A in any model. B and/or C may be a
killer in some model.
5.8 Two Stops by Inapplicability of
Unfolding
Consider the simplified Agatha proof problem
hK
0
,{C
40
}i. By application of unfolding, com-
putation reaches the state in Fig. 7, which is
very similar to the case of the simplified Aga-
tha QA problem (Section 5.6), i.e., the clause
(richer(B,A),hate(B, B) ) prevents unfolding with
respect to richer-atoms and hate-atoms. By
side-change transformation with respect to richer,
KEOD 2018 - 10th International Conference on Knowledge Engineering and Ontology Development
244
notricher-atoms and hate-atoms can be unfolded. Af-
ter removal of notricher-atoms and hate-atoms by
(ud), we reach the state in Fig. 8. The clause
((kill(B, A), kill(C,A) ) blocks further unfolding.
By side-change transformation, we have:
notkill(B,A)
notkill(C,A)
notkill(B,A),notkill(C,A)
By unfolding with respect to notkill-atoms, we have
an empty clause, i.e., it is proved that ¬kill(B,A)
¬kill(C, A).
By experiments, we have found that there is a
proof consisting of 53 steps, in which (ud) is app-
lied 25 times, (chSide) 2 times, (subsumed) 14 times,
(erase) 11 times, and (neq) 1 time.
5.9 A Solution with Forwarding
Consider the same simplified Agatha proof problem
hK
0
,{C
40
}i. We can also solve this proof problem
using forwarding transformation in place of side-
change transformation, where forwarding is an ET
rule, denoted by (fwd), for removing atoms in the
left-hand side of a clause by using a negative clause
(Akama et al., 2018). Notice the blocker of unfol-
ding in Fig. 7, i.e., (richer(B,A),hate(B,B) ), is
changed into (richer(B,A) ) by forwarding with
( hate(B,B)). Similarly, the blocker of unfolding in
Fig. 8, i.e., (kill(B, A), kill(C, A) ), is changed into
(kill(B, A) ) by forwarding with ( kill(C, A)).
By the computation control
(eq) > (neq) > (subsumed) > (erase) >
(specAtom) > (ud) > (fwd),
we have a 55-step solution, in which (ud) is applied
24 times, (subsumed) 18 times, (fwd) 2 times, (erase)
10 times, and (neq) 1 time.
5.10 A Solution with Resolution
Consider again the proof problem hK
0
,{C
40
}i. To
solve this problem, resolution can be used in place
of side-change transformation.
In case of Fig. 7, the resolvent of the clau-
ses (richer(B,A),hate(B,B) ) and ( hate(B, B))
is (richer(B,A) ). In case of Fig. 8, the resol-
vent of (kill(B,A),kill(C,A) ) and ( kill(C, A))
is (kill(B, A) ).
By the computation control
(eq) > (neq) > (subsumed) > (erase) >
(specAtom) > (ud) > (rr 10),
we have a 57-step solution, in which (ud) is applied 24
times, (subsumed) 20 times, (rr 10) 2 times, (erase) 10
times, and (neq) 1 time.
5.11 A Solution using Resolution
Without Unfolding
The proof problem hK
0
,{C
40
}i can also be solved wit-
hout unfolding by mainly applying resolution through
the prioritized ET rules
(eq) > (neq) > (subsumed) > (erase) >
(specAtom) > (rr 3) > (rr 8) > (rr 20).
By experiments, we know that there is a proof consis-
ting of 43 steps, in which (rr 8) is applied 6 times, (rr
3) 6 times, (subsumed) 24 times, (erase) 6 times, and
(neq) 1 time.
5.12 Applying Resolution to the Agatha
QA Problem
Consider again the simplified Agatha QA problem
hK
0
F
10
,killer(x)i. When we apply resolution to this
QA problem, we have the final set of clauses in Fig. 9.
By the clause (killer(A) ), we know that A is a kil-
ler. However, we do not know whether no one else
is a killer. Compared with the solution by unfolding,
resolution is not appropriate to provide a solution for
QA problems.
Notice the three clauses (kill(A, A) ), (
kill(B, A)), and ( kill(C, A)) in Fig. 9, which show
that A is a killer, while B and C are not. The clauses
in Fig. 9 do not explicitly conclude that A is the only
killer, which suggests that resolution alone is helpful
to understand the solution but is not enough to show
the exact answer to the given QA problem.
6 CONCLUSIONS
MI problems on the extended space ECLS
F
consti-
tute one of the largest classes of logical problems and
are of fundamental importance. Since all proof pro-
blems on FOL
c
and all QA problems on FOL
c
can be
mapped into MI problems on ECLS
F
, improvements
to a solution method for MI problems on ECLS
F
are
essential to efficiently solve logical problems. We in-
troduced side-change transformation on ECLS
F
and
proved the correctness of this transformation. We pro-
posed unfolding/side-change computation control, by
which we expect a reduction of problem size by de-
creasing the number of predicates in problem clauses.
Such a reduction often contributes to more efficient
computation. This computation strategy is in sharp
contrast to the resolution proof procedure, which mo-
notonically increases the problem size regardless of
whatever control it may take.
Side-Change Transformation
245
C
54
: hate(B,x) live(x,D),kill(x, A)
C
55
: hate(B,x) kill(A,x)
C
56
: kill(x,C), kill(x,A),kill(x,B),live(x,D)
C
57
: kill(x,B),kill(x,A),hate(x,C),live(x,D)
C
58
: kill(x,A),hate(x,B), hate(x,C), live(x,D)
C
59
: kill(C,x), kill(A,x)
C
60
: kill(A,x),hate(C,x)
C
61
: killer(A)
C
62
: richer(A, A)
C
63
: kill(B,A)
C
64
: kill(A,B)
C
65
: hate(A,B)
C
66
: kill(B,B)
C
67
: hate(B,B)
C
68
: kill(C,A)
C
69
: kill(C,C)
C
70
: hate(B,C)
C
71
: hate(C,C)
C
72
: hate(B,A)
C
73
: hate(C,A)
C
74
: live(x,D),neq(x,A),neq(x,B),neq(x,C)
C
75
: live(A, D)
C
76
: live(B, D)
C
77
: live(C, D)
C
78
: kill(x,y),richer(x, y)
C
79
: hate(A,x), hate(C, x)
C
80
: hate(x,A), hate(x,B),hate(x,C),live(x,D)
C
81
: hate(A,A)
C
82
: hate(A,C)
C
83
: hate(x,y) kill(x,y)
C
84
: hate(B,x) hate(A,x)
C
85
: richer(x,A),hate(B, x) live(x,D)
C
86
: killer(x) kill(x, A)
C
87
: richer(B, A)
C
88
: kill(A,A)
Figure 9: A final state of a solution by resolution.
ACKNOWLEDGEMENTS
This research was partially supported by JSPS KA-
KENHI Grant Numbers 25280078 and 26540110.
REFERENCES
Akama, K. and Nantajeewarawat, E. (2011). Meaning-
Preserving Skolemization. In 3rd International Con-
ference on Knowledge Engineering and Ontology De-
velopment, pages 322–327, Paris, France.
Akama, K. and Nantajeewarawat, E. (2014). Equiva-
lent Transformation in an Extended Space for Sol-
ving Query-Answering Problems. In 6th Asian Con-
ference on Intelligent Information and Database Sy-
stems, LNAI 8397, pages 232–241, Bangkok, Thai-
land.
Akama, K. and Nantajeewarawat, E. (2015a). A General
Schema for Solving Model-Intersection Problems on
a Specialization System by Equivalent Transforma-
tion. In 7th International Joint Conference on Kno-
wledge Discovery, Knowledge Engineering and Kno-
wledge Management, Volume 2: KEOD, pages 38–49,
Lisbon, Portugal.
Akama, K. and Nantajeewarawat, E. (2015b). Function-
variable Elimination and Its Limitations. In 7th In-
ternational Joint Conference on Knowledge Disco-
very, Knowledge Engineering and Knowledge Mana-
gement, Volume 2: KEOD, pages 212–222, Lisbon,
Portugal.
Akama, K. and Nantajeewarawat, E. (2016a). Model-
Intersection Problems with Existentially Quantified
Function Variables: Formalization and a Solution
Schema. In 8th International Joint Conference on
Knowledge Discovery, Knowledge Engineering and
Knowledge Management, Volume 2: KEOD, pages
52–63, Porto, Portugal.
Akama, K. and Nantajeewarawat, E. (2016b). Unfolding
Existentially Quantified Sets of Extended Clauses. In
8th International Joint Conference on Knowledge Dis-
covery, Knowledge Engineering and Knowledge Ma-
nagement, Volume 2: KEOD, pages 96–103, Porto,
Portugal.
Akama, K., Nantajeewarawat, E., and Akama, T. (2018).
Computation Control by Prioritized ET Rules. In 10th
International Joint Conference on Knowledge Disco-
very, Knowledge Engineering and Knowledge Mana-
gement, Volume 2: KEOD, Seville, Spain.
Chang, C.-L. and Lee, R. C.-T. (1973). Symbolic Logic and
Mechanical Theorem Proving. Academic Press.
Donini, F. M., Lenzerini, M., Nardi, D., and Schaerf, A.
(1998). AL-log: Integrating Datalog and Description
Logics. Journal of Intelligent Information Systems,
16:227–252.
Fitting, M. (1996). First-Order Logic and Automated The-
orem Proving. Springer-Verlag, second edition.
Pelletier, F. J. (1986). Seventy-Five Problems for Testing
Automatic Theorem Provers. Journal of Automated
Reasoning, 2(2):191–216.
Robinson, J. A. (1965). A Machine-Oriented Logic Ba-
sed on the Resolution Principle. Journal of the ACM,
12:23–41.
KEOD 2018 - 10th International Conference on Knowledge Engineering and Ontology Development
246