Embedding Proof Problems into Query-answering Problems and
Problem Solving by Equivalent Transformation
Kiyoshi Akama
1
and Ekawit Nantajeewarawat
2
1
Information Initiative Center, Hokkaido University, Hokkaido, Japan
2
Computer Science, Sirindhorn International Institute of Technology, Thammasat University, Pathumthani, Thailand
Keywords:
Question-answering Problems, Proof Problems, Equivalent Transformation, Solving Logical Problems.
Abstract:
A proof problem is a “yes/no” problem concerning with checking whether one logical formula is a logical
consequence of another logical formula, while a query-answering problem (QA problem) is an “all-answers
finding” problem concerning with nding all ground instances of a query atomic formula that are logical
consequences of a given logical formula. In order to establish a precise relation between these two problem
classes, the concept of an embedding mapping is introduced. When one problem class can be embedded into
another problem class at low computational cost, the former class can be regarded as a subclass of the latter
class and, consequently, problems in the former class can be solved through a method for solving problems in
the latter one. Construction of low-cost embedding mappings from proof problems to QA problems is demon-
strated. By such embedding, proof problems can be solved using a procedure for solving QA problems. A
procedure for solving QA problems based on the equivalent transformation principle is presented. Application
of the procedure to the two problem classes is illustrated.
1 INTRODUCTION
Given a first-order formula K, representing back-
ground knowledge, and an atomic formula (atom) a,
representing a query, a query-answering problem (QA
problem) is to find the set of all ground instances of a
that are logical consequences of K. Characteristically,
it is an “all-answers finding” problem, i.e., all ground
instances of the query atom satisfying the require-
ment must be found. A proof problem, by contrast,
is a “yes/no” problem; it is concerned with checking
whether or not one given logical formula is a logical
consequence of another given logical formula.
Historically, works on logic-based automated rea-
soning have been centered around proof problems
(Chang and Lee, 1973; Gallier, 1986; Fitting, 1996;
Newborn, 2000). Methods for solving proof prob-
lems were developed, e.g., tableau-based methods
(Beth, 1955) and resolution-based methods (Robin-
son, 1965), and they have been subsequently adapted
to address other classes of logical problems, including
some specific subclasses of QA problems, e.g., QA
problems on definite clauses (Lloyd, 1987). As op-
posed to such a proof-centered approach, we present
in this paper a direct approach towards solving QA
problems on the basis of the equivalent transforma-
tion (ET) principle. We show that proof problems can
naturally be considered as QA problems of a special
form; therefore, a method for solving QA problems
also lends itself to solve proof problems in a straight-
forward way.
In order to clearly understand the relation between
proof problems and QA problems, we introduce the
notion of an embedding mapping from one problem
class to another problem class. Using an embedding
mapping, we demonstrate that proof problems can
be formulated as a subclass of QA problems. We
propose a framework for solving QA problems by
ET. A given input QA problem on first-order logic is
converted into an equivalent QA problem on an ex-
tended clause space, called the ECLS
F
space, through
meaning-preserving Skolemization (Akama and Nan-
tajeewarawat, 2011). The obtained QA problem is
then successively transformed on the ECLS
F
space by
application of ET rules until the answer to the original
problem can be readily obtained. With an embedding
mapping from proof problems to QA problems, this
framework can be used for solving proof problems.
To begin with, Section 2 formalizes QA problems
and proof problems. Section 3 defines an embedding
mapping and shows how to embed proof problems
into QA problems. Section 4 introduces extended
253
Akama K. and Nantajeewarawat E..
Embedding Proof Problems into Query-answering Problems and Problem Solving by Equivalent Transformation.
DOI: 10.5220/0004546202530260
In Proceedings of the International Conference on Knowledge Engineering and Ontology Development (KEOD-2013), pages 253-260
ISBN: 978-989-8565-81-5
Copyright
c
2013 SCITEPRESS (Science and Technology Publications, Lda.)
clauses, the extended space ECLS
F
and QA problems
on this space. Section 5 presents our ET-based proce-
dure for solving QA problems. Section 6 defines un-
folding transformation on the ECLS
F
space and pro-
vides some other ET rules on this space. Section 7
illustrates application of our framework. Section 8
concludes the paper.
2 QA PROBLEMS AND PROOF
PROBLEMS
2.1 Interpretations and Models
In this paper, an atom occurring in a first-order for-
mula can be either a usual atom or a constraint atom.
The semantics of first-order formulas based on a log-
ical structure given in (Akama and Nantajeewarawat,
2012) is used. The set of all ground usual atoms, de-
noted by G, is taken as the interpretation domain. An
interpretation is a subset of G . A ground usual atom g
is true with respect to an interpretation I iff g belongs
to I. Unlike ground usual atoms, the truth values of
ground constraint atoms are predetermined indepen-
dently of interpretations. A model of a first-order for-
mula E is an interpretation that satisfies E. The set
of all models of a first-order formula E is denoted by
Models(E). Given first-order formulas E
1
and E
2
, E
2
is a logical consequence of E
1
iff every model of E
1
is a model of E
2
.
2.2 QA Problems
A query-answering problem (QA problem) is a pair
hK, ai, where K is a first-order formula, representing
background knowledge, and a is a usual atom, repre-
senting a query. The answer to a QA problem hK, ai,
denoted by answer
qa
(hK, ai), is defined as the set of
all ground instances of a that are logical consequences
of K. Using Models(K), the answer to a QA problem
hK, ai can be equivalently defined as
answer
qa
(hK, ai) = (
\
Models(K)) rep(a),
where rep(a) denotes the set of all ground instances
of a. Accordingly, a QA problem can also be seen
as a model-intersection problem. When no confu-
sion is caused, answer
qa
(hK, ai) is often written as
answer
qa
(K, a).
2.3 Proof Problems
A proof problem is a pair hE
1
, E
2
i, where E
1
and E
2
are first-order formulas, and the answer to this prob-
lem, denoted by answer
pr
(hE
1
, E
2
i), is defined by
answer
pr
(hE
1
, E
2
i) =
yes if E
2
is a logical
consequence of E
1
,
no otherwise.
It is well known that a proof problem hE
1
, E
2
i can be
converted into the problem of determining whether
E
1
¬E
2
is unsatisfiable (Chang and Lee, 1973),
i.e., whether E
1
¬E
2
has no model. As a result,
answer
pr
(hE
1
, E
2
i) can be equivalently defined by
answer
pr
(hE
1
, E
2
i) =
yes if Models(E
1
¬E
2
)
is the empty set,
no otherwise.
When no confusion is caused, answer
pr
(hE
1
, E
2
i) is
often written as answer
pr
(E
1
, E
2
).
3 EMBEDDING PROOF
PROBLEMS INTO QA
PROBLEMS
3.1 Embedding Mappings
The notion of a class of problems and that of an em-
bedding mapping are formalized below.
Definition 1. A class C of problems is a triple
hPROB, ANS, answeri, where
1. PROB and ANS are sets,
2. answer is a mapping from PROB to ANS.
The sets PROB and ANS are called the problem space
and the answer space, respectively, of C. Their el-
ements are called problems and (possible) answers,
respectively, in C. Given a problem prb PROB,
answer(prb) is the answer to prb in C.
Definition 2. Let C
1
= hPROB
1
, ANS
1
, answer
1
i and
C
2
= hPROB
2
, ANS
2
, answer
2
i be classes of prob-
lems. An embedding mapping from C
1
to C
2
is a pair
hπ, αi, where π is an injective mapping from PROB
1
to PROB
2
and α is a partial mapping from ANS
2
to
ANS
1
such that for any prb PROB
1
, answer
1
(prb) =
α(answer
2
(π(prb))).
Let C
1
and C
2
be classes of problems. Suppose
that (i) there exists an embedding mapping hπ, αi
from C
1
to C
2
, (ii) there exists a procedure P for solv-
ing problems in C
2
, and (iii) there also exist a proce-
dure P
π
for realizing π and a procedure P
α
for real-
izing α. Then a procedure for solving problems in
C
1
can be obtained by making the composition of the
KEOD2013-InternationalConferenceonKnowledgeEngineeringandOntologyDevelopment
254
procedures P
π
, P and P
α
. C
1
is regarded as a subclass
of C
2
iff there exists an embedding mapping hπ, αi
from C
1
to C
2
such that π and α can be realized at
low computational cost.
3.2 Embedding Proof Problems into QA
Problems
Next, we show how to embed proof problems into QA
problems. Assume that:
C
qa
= hPROB
qa
, ANS
qa
, answer
qa
i is the class of
QA problems defined by Section 2.2, i.e., PROB
qa
is the set of all QA problems, ANS
qa
is the power
set of G, and answer
qa
: PROB
qa
ANS
qa
is given
by Section 2.2.
C
pr
= hPROB
pr
, ANS
pr
, answer
pr
i is the class of
proof problems defined by Section 2.3, i.e.,
PROB
pr
is the set of all proof problems, ANS
pr
=
{yes,no}, and answer
pr
: PROB
pr
ANS
pr
is
given by Section 2.3.
In order to construct an embedding mapping from
C
pr
to C
qa
, we want to construct from any ar-
bitrary given proof problem hE
1
, E
2
i a QA prob-
lem hK, yesi such that answer
pr
(E
1
, E
2
) = yes iff
answer
qa
(K, yes) = {yes}, where yes is a 0-ary pred-
icate symbol and the atom yes occurs in neither E
1
nor E
2
. The following approaches can be taken for
constructing such a formula K:
Construct K such that every model of K contains
yes iff answer
pr
(E
1
, E
2
) = yes”.
Construct K such that K has no model iff
answer
pr
(E
1
, E
2
) = yes”.
We refer to the first approach as positive construction,
and the second one as negative construction. They are
given below.
3.2.1 Embedding using Positive Construction
Positive construction of an embedding mapping from
C
pr
to C
qa
can be obtained by Proposition 1.
Proposition 1. Let E
1
and E
2
be first-order formulas.
Assume that:
1. yes is a 0-ary predicate symbol and yes occurs in
neither E
1
nor E
2
.
2. prb
1
is the proof problem hE
1
, E
2
i.
3. prb
2
is the QA problem hyes (E
1
E
2
), yesi.
Then answer
pr
(prb
1
) = yes iff answer
qa
(prb
2
) =
{yes}.
Proposition 1 determines an embedding mapping
hπ
a
, α
a
i from C
pr
to C
qa
as follows:
For any proof problem hE
1
, E
2
i,
π
a
(hE
1
, E
2
i) = hyes (E
1
E
2
), yesi.
α
a
({yes}) = yes” and α
a
(
/
0) = no”.
3.2.2 Embedding using Negative Construction
The next proposition illuminates negative construc-
tion of an embedding mapping from C
pr
to C
qa
.
Proposition 2. Let E
1
and E
2
be first-order formulas.
Assume that:
1. yes is a 0-ary predicate symbol and yes occurs in
neither E
1
nor E
2
.
2. prb
1
is the proof problem hE
1
, E
2
i.
3. prb
2
is the QA problem hE
1
¬E
2
, yesi.
Then answer
pr
(prb
1
) = yes iff answer
qa
(prb
2
) =
{yes}.
Proposition 2 determines an embedding mapping
hπ
b
, α
b
i from C
pr
to C
qa
as follows:
For any proof problem hE
1
, E
2
i,
π
b
(hE
1
, E
2
i) = hE
1
¬E
2
, yesi.
α
b
({yes}) = yes” and α
b
(
/
0) = no”.
4 QA PROBLEMS ON AN
EXTENDED SPACE
To solve a QA problem hK, ai on first-order logic,
the first-order formula K is usually converted into a
conjunctive normal form. The conversion involves
removal of existential quantifications by Skolemiza-
tion, i.e., by replacement of an existentially quantified
variable with a Skolem term determined by a relevant
part of a formula prenex. The classical Skolemiza-
tion, however, does not preserve the logical mean-
ing of a formula—the formula resulting from Sko-
lemization is not necessarily equivalent to the orig-
inal one (Chang and Lee, 1973). In (Akama and
Nantajeewarawat, 2011), a theory for extending the
space of first-order formulas was developed and how
meaning-preservingSkolemization can be achievedin
the obtained extended space was shown. A procedure
for converting first-order formulas into extended con-
junctive normal forms in an extended clause space,
called the ECLS
F
space, was also presented.
The basic idea of meaning-preserving Skolemiza-
tion is to use existentially quantified function vari-
ables instead of usual Skolem functions. Func-
tion variables, extended clauses, extended conjunctive
normal forms and QA problems on ECLS
F
are intro-
duced below.
EmbeddingProofProblemsintoQuery-answeringProblemsandProblemSolvingbyEquivalentTransformation
255
4.1 Function Constants, Function
Variables and func-Atoms
A usual function symbol, say f, in first-order logic
denotes an unevaluated function; it is used for con-
structing from existing terms, say t
1
, . . . ,t
n
, a syntac-
tically new term, e.g., f(t
1
, . . . ,t
n
), possibly recur-
sively, without evaluating the new term f(t
1
, . . . ,t
n
).
A different class of functions is used in the extended
space. A function in this class is an actual mathe-
matical function, say h, on ground terms; when it
takes ground terms, say t
1
, . . . ,t
n
, as input, h(t
1
, . . . ,t
n
)
is evaluated for determining an output ground term.
We called a function in this class a function constant.
Variables of a new type, called function variables, are
introduced; each of them can be instantiated into a
function constant or a function variable, but not into a
usual term.
In order to clearly separate function constants
and function variables from usual function symbols
and usual terms, a new built-in predicate symbol
func is introduced. Given any n-ary function con-
stant or n-ary function variable
¯
f, an expression
func(
¯
f, t
1
, . . . ,t
n
,t
n+1
), where the t
i
are usual terms,
is considered as an atom of a new type, called a func-
atom. When
¯
f is a function constant and the t
i
are
all ground, the truth value of this atom is evaluated as
follows: it is true iff
¯
f(t
1
, . . . ,t
n
) = t
n+1
.
4.2 Extended Clauses
An extended clause C is a closed formula of the form
v
1
, . . . , v
m
: (a
1
··· a
n
¬b
1
··· ¬b
p
¬f
1
··· ¬f
q
),
where v
1
, . . . , v
m
are usual variables, each of a
1
, . . . ,
a
n
, b
1
, . . . , b
p
is a usual atom or a constraint atom,
and f
1
, . . . , f
q
are func-atoms. It is often written sim-
ply as (a
1
, . . . , a
n
b
1
, . . . , b
p
, f
1
, . . . , f
q
). The sets
{a
1
, . . . , a
n
} and {b
1
, . . . , b
p
, f
1
, . . . , f
q
} are called the
left-hand side and the right-hand side, respectively, of
the extended clause C, denoted by lhs(C) and rhs(C),
respectively. When n = 0, C is called a negative ex-
tended clause. When n = 1, C is called an extended
definite clause, the only atom in lhs(C) is called the
head of C, denoted by head(C), and the set rhs(C) is
also called the body of C, denoted by body(C). When
n > 1, C is called a multi-head extended clause. All
usual variables in an extended clause are universally
quantified and their scope is restricted to the clause
itself. When no confusion is caused, an extended
clause, a negative extended clause, an extended defi-
nite clause and a multi-head extended clause will also
be called a clause, a negative clause, a definite clause
and a multi-head clause, respectively.
An extended normal form called existentially
quantified conjunctive normal form (ECNF) is a for-
mula of the form v
h
1
, . . . , v
h
m
: (C
1
··· C
n
),
where v
h
1
, . . . , v
h
m
are function variables and C
1
, . . . ,
C
n
are extended clauses. It is often identified with
the set {C
1
, . . . ,C
n
}, with implicit existential quantifi-
cations of function variables and implicit clause con-
junction. Function variables in such a clause set are
all existentially quantified and their scope covers en-
tirely all clauses in the set.
4.3 QA Problems on ECLS
F
The set of all ECNFs is referred to as the extended
clause space (ECLS
F
). By the above identification of
an ECNF with a clause set, we often regard an ele-
ment of ECLS
F
as a set of (extended) clauses. With
occurrences of function variables, clauses contained
in a clause set in the ECLS
F
space are connected
through shared function variables. By instantiating
all function variables in such a clause set into func-
tion constants, clauses in the obtained set are totally
separated.
A QA problem hCs, ai such that Cs is a clause
set in ECLS
F
and a is a usual atom is called a QA
problem on ECLS
F
. Given a QA problem hK, ai
on first-order logic, the first-order formula K can be
converted equivalently by meaning-preserving Skol-
emization, using the conversion procedure given in
(Akama and Nantajeewarawat, 2011), into a clause
set Cs in the ECLS
F
space. The obtained clause set
Cs may be further transformed equivalently in this
space for problem simplification, by using unfolding
and other transformation rules.
5 SOLVING QA PROBLEMS
Using the notation introduced in Sections 5.1 and 5.2,
our ET-based procedure is presented in Section 5.3.
5.1 Inclusion of Query Information
The following notation is used. A set A of usual atoms
is said to be closed iff for any a A and any substi-
tution θ for usual variables, aθ belongs to A. Assume
that (i) A is the set of all usual atoms, (ii) A
1
and A
2
are disjoint closed subsets of A, and (iii) φ is a bijec-
tion from A
1
to A
2
such that for any a A
1
and any
substitution θ for usual variables, φ(aθ) = φ(a)θ. For
any i, j {1, 2}, an extended clause C is said to be
from A
i
to A
j
iff all usual atoms in rhs(C) belong to
A
i
and all those in lhs(C) belong to A
j
.
KEOD2013-InternationalConferenceonKnowledgeEngineeringandOntologyDevelopment
256
Let hK, ai be a QA problem such that K is a first-
order formula in which all usual atoms belong to A
1
and a A
1
. As will be detailed in Section 5.3, to solve
this problem using ET, K is transformed by meaning-
preserving transformation into a set Cs of extended
clauses from A
1
to A
1
and a singleton set Q consist-
ing only of the clause (φ(a) a) from A
1
to A
2
is
constructed from the query atom a. The resulting
QA problem hCsQ, φ(a)i is then successively trans-
formed using ET rules.
5.2 Triples for Transformation
In order to make a clear separation between a set of
extended clauses from A
1
to A
1
and a set of those
from A
1
to A
2
in a transformation process of QA
problems, the following notation is introduced: Given
a set Cs of extended clauses from A
1
to A
1
, a set Q
of extended clauses from A
1
to A
2
and an atom b in
A
2
, let the triple hCs, Q, bi denote the QA problem
hCs Q, bi. A QA problem hCs, Q, bi can be trans-
formed by changing Cs, by changing Q, or by chang-
ing both Cs and Q.
Definition 3. A transformation of a QA problem
hCs, Q, bi into a QA problem hCs
, Q
, bi is equiva-
lent transformation (ET) iff answer
qa
(Cs Q, b) =
answer
qa
(Cs
Q
, b).
5.3 A Procedure for Solving QA
Problems by ET
Let A
1
be a closed set of usual atoms. Assume that a
QA problem hK, ai is given, where K is a first-order
formula in which all usual atoms belong to A
1
and
a A
1
. To solve the QA problem hK, ai using ET,
perform the following steps:
1. Transform K by meaning-preserving Skolemiza-
tion into a clause set Cs in the ECLS
F
space.
2. Determine (i) a closed set A
2
of usual atoms such
that A
1
and A
2
are disjoint and (ii) a bijection φ
from A
1
to A
2
such that for any a A
1
and any
substitution θ for usual variables, φ(aθ) = φ(a)θ.
3. Successively transform the QA problem hCs,
{(φ(a) a)}, φ(a)i in the ECLS
F
space using un-
folding and other ET rules (see Section 6).
4. Assume that the transformation yields a QA prob-
lem hCs
, Q, φ(a)i. Then:
(a) If Models(Cs
) =
/
0, then output rep(a) as the
answer.
(b) If Models(Cs
) 6=
/
0 and Q is a set of unit clauses
such that the head of each clause in Q is an in-
stance of φ(a), then output as the answer the set
φ
1
(
[
CQ
rep(head(C))).
(c) Otherwise stop with failure.
It is shown in (Akama and Nantajeewarawat, 2013)
that the obtained answer is always correct.
The set A
2
and the bijection φ satisfying the re-
quirement of Step 2 can be determined as follows:
First, introduce a new predicate symbol for each pred-
icate symbol occurring in A
1
. Next, let A
2
be the
atom set obtained from A
1
by replacing the predicate
of each atom in A
1
with the new predicate introduced
for it. Finally, for each atom a A
1
, let φ(a) be the
atom obtained from a by such predicate replacement.
6 ET RULES ON ECLS
F
Next, ET rules for unfolding and definite-clause re-
moval are presented, along with some other ET rules.
6.1 Unfolding Operation on ECLS
F
Assume that (i) Cs is a set of extended clauses, (ii) D
is a set of extended definite clauses, and (iii) occ is
an occurrence of an atom b in the right-hand side of a
clause C in Cs. By unfolding Cs using D at occ, Cs is
transformed into
(Cs {C}) (
[
{resolvent(C,C
, b) | C
D}),
where for each C
D, resolvent(C,C
, b) is defined
as follows, assuming that ρ is a renaming substitution
for usual variables such that C and C
ρ have no usual
variable in common:
If b and head(C
ρ) are not unifiable, then
resolvent(C,C
, b) =
/
0.
If they are unifiable, then resolvent(C,C
, b) =
{C
′′
}, where C
′′
is the clause obtained from C and
C
ρ as follows, assuming that θ is the most general
unifier of b and head(C
ρ):
lhs(C
′′
) = lhs(Cθ)
rhs(C
′′
) = (rhs(Cθ) {bθ}) body(C
ρθ)
The resulting clause set is denoted by UNFOLD(Cs,
D, occ).
EmbeddingProofProblemsintoQuery-answeringProblemsandProblemSolvingbyEquivalentTransformation
257
6.2 ET by Unfolding and Definite-clause
Removal
Let Atoms(p) denote the set of all atoms having a
predicate p. ET rules on ECLS
F
for unfolding and
for definite-clause removal are described below.
6.2.1 ET by Unfolding
Let hCs, ai be a QA problem on ECLS
F
. Assume that:
1. q is the predicate of the query atom a.
2. p is a predicate such that p 6= q.
3. D is a set of extended definite clauses in Cs that
satisfies the following conditions:
(a) For any C D, head(C) Atoms(p).
(b) For anyC
Cs D, lhs(C
) Atoms(p) =
/
0.
4. occ is an occurrence of an atom in Atoms(p) in the
right-hand side of an extended clause in Cs D.
Then hCs, ai can be equivalently transformed into the
QA problem hUNFOLD(Cs, D, occ), ai.
6.2.2 ET by Definite-clause Removal
Let hCs, ai be a QA problem on ECLS
F
. Assume that:
1. q is the predicate of the query atom a.
2. p is a predicate such that p 6= q.
3. D is a set of extended definite clauses in Cs that
satisfies the following conditions:
(a) For any C D, head(C) Atoms(p).
(b) For anyC
Cs D, lhs(C
) Atoms(p) =
/
0.
4. For any C
Cs D, rhs(C
) Atoms(p) =
/
0.
Then hCs, ai can be equivalently transformed into the
QA problem hCs D, ai.
6.3 Some other ET Rules on ECLS
F
Next, ET rules for merging func-atoms having the
same call pattern, for removing isolated func-atoms,
and for removing subsumed clauses are presented.
They are used in examples in Section 7.
6.3.1 Merging func-Atoms with the Same
Invocation Pattern
Let hCs, ai be a QA problem on ECLS
F
. Suppose that
C Cs and rhs(C) contains func-atoms f
1
and f
2
that
differ only in their last arguments. Then:
1. If the last arguments of f
1
and f
2
are unifiable,
with their most general unifier being θ, and C
is
an extended clause such that
lhs(C
) = lhs(Cθ), and
rhs(C
) = (rhs(C) {f
2
})θ,
then hCs, ai can be equivalently transformed into
the QA problem h(Cs {C}) {C
}, ai.
2. If their last arguments are not unifiable, then
hCs, ai can be equivalently transformed into the
QA problem hCs {C}, ai.
6.3.2 Elimination of Isolated func-Atoms
A func-atom func(h, t
1
, . . . ,t
n
, v), where v is a usual
variable, is said to be isolated in an extended clause C
iff there is only one occurrence of v in C.
Now let hCs, ai be a QA problem on ECLS
F
. Sup-
pose that:
1. C Cs such that C contains a func-atom that is
isolated in C.
2. C
is the extended clause obtained from C by re-
moving all func-atoms that are isolated in C.
Then hCs, ai can be equivalently transformed into the
QA problem h(Cs {C}) {C
}, ai.
6.3.3 Elimination of Subsumed Clauses
An extended clause C
1
is said to subsume an ex-
tended clause C
2
iff there exists a substitution θ
for usual variables such that lhs(C
1
)θ lhs(C
2
) and
rhs(C
1
)θ rhs(C
2
).
A subsumed clause can be removed as follows:
Let hCs, ai be a QA problem on ECLS
F
. If Cs con-
tains extended clauses C
1
and C
2
such that C
1
sub-
sumes C
2
, then hCs, ai can be equivalently trans-
formed into the QA problem hCs {C
2
}, ai.
7 EXAMPLES
Example 1 demonstrates how the procedure in Sec-
tion 5.3 solves a QA problem using the ET rules in
Section 6. Example 2 shows how to apply the proce-
dure to solve a proof problem based on the embedding
mapping in Section 3.2.2.
Example 1. Consider the “Tax-cut” problem dis-
cussed in (Motik et al., 2005). This problem is to
find all persons who can have discounted tax, with the
knowledge that (i) any person who has two children
or more can get discounted tax, (ii) men and women
are not the same, (iii) a person’s mother is always a
woman, (iv) Peter has a child named Paul, (v) Paul is
a man, and (vi) Peter has a child, who is someone’s
mother. This background knowledge is represented
KEOD2013-InternationalConferenceonKnowledgeEngineeringandOntologyDevelopment
258
in first-order logic as the formulas F
1
F
6
below, as-
suming that hc, ns, tc, mn, wm and mo stand, respec-
tively, for hasChild, notSame, TaxCut, Man, Woman
and motherOf:
F
1
: x: ((y
1
y
2
:
(hc(x, y
1
) hc(x, y
2
) ns(y
1
, y
2
))) tc(x))
F
2
: xy: ((mn(x) wm(y)) ns(x, y))
F
3
: x: ((y : mo(x, y)) wm(x))
F
4
: hc(Peter, Paul)
F
5
: mn(Paul)
F
6
: x: (hc(Peter, x) (y: mo(x, y)))
Accordingly, the “Tax-cut” problem is formulated as
the QA problem hK, tc(x)i, where K is the conjunc-
tion of F
1
F
6
. Using the meaning-preserving Skol-
emization procedure given in (Akama and Nantajee-
warawat, 2011), the first-order formula K is trans-
formed into a clause set Cs consisting of the following
extended clauses:
C
1
: tc(x) hc(x, y
1
), hc(x, y
2
), ns(y
1
, y
2
)
C
2
: ns(x, y) mn(x), wm(y)
C
3
: wm(x) mo(x, y)
C
4
: hc(Peter, Paul)
C
5
: mn(Paul)
C
6
: hc(Peter, x) func(h
1
, x)
C
7
: mo(x, y) func(h
1
, x), func(h
2
, y)
The clauses C
6
and C
7
together represent the first-
order formula F
6
, where h
1
and h
2
are 0-ary function
variables.
Assume that all usual atoms occurring in Cs be-
long to A
1
, ans is a newly introduced unary predicate
symbol, all ans-atoms belong to A
2
, and for any term
t, φ(tc(t)) = ans(t). Let
C
0
= (ans(x) tc(x)).
To solve the QA problem hK, tc(x)i, the QA problem
hCs, {C
0
}, ans(x)i is successively transformed by ap-
plying the ET rules in Section 6 as follows:
1. By unfolding C
0
at tc(x) using {C
1
}, C
0
is re-
placed with:
C
8
: ans(x) hc(x, y
1
), hc(x, y
2
), ns(y
1
, y
2
)
2. By unfoldingC
8
at the last body atom using {C
2
},
C
8
is replaced with:
C
9
: ans(x) hc(x, y
1
), hc(x, y
2
), mn(y
1
), wm(y
2
)
3. By unfolding C
9
at the third body atom using
{C
5
}, C
9
is replaced with:
C
10
: ans(x) hc(x, Paul), hc(x, y
2
), wm(y
2
)
4. By unfolding C
10
at the last body atom using
{C
3
}, C
10
is replaced with:
C
11
: ans(x) hc(x, Paul), hc(x, y
2
), mo(y
2
, z)
5. By unfolding C
11
at the last body atom using
{C
7
}, C
11
is replaced with:
C
12
: ans(x) hc(x, Paul), hc(x, y
2
), func(h
1
, y
2
),
func(h
2
, z)
6. By removing an isolated func-atom, C
12
is re-
placed with:
C
13
: ans(x) hc(x, Paul), hc(x, y
2
), func(h
1
, y
2
)
7. By unfolding C
13
at the first body atom using
{C
4
,C
6
}, C
13
is replaced with:
C
14
: ans(Peter) hc(Peter, y
2
), func(h
1
, y
2
)
C
15
: ans(Peter) func(h
1
, Paul), hc(Peter, y
2
),
func(h
1
, y
2
)
8. By merging func-atoms with the same invocation
pattern, C
15
is replaced with:
C
16
: ans(Peter) func(h
1
, Paul), hc(Peter, Paul)
9. Since C
16
is subsumed by C
14
, C
16
is removed.
10. By unfolding C
14
at the first body atom using
{C
4
,C
6
}, C
14
is replaced with:
C
17
: ans(Peter) func(h
1
, Paul)
C
18
: ans(Peter) func(h
1
, y
2
), func(h
1
, y
2
)
11. By definite-clause removal,C
1
C
7
are removed.
12. By merging func-atoms with the same invocation
pattern, C
18
is replaced with:
C
19
: ans(Peter) func(h
1
, y
2
)
13. By removing an isolated func-atom, C
19
is re-
placed with:
C
20
: ans(Peter)
14. Since C
17
is subsumed by C
20
, C
17
is removed.
The resulting QA problem is h
/
0, {C
20
}, ans(x)i. Since
Models(
/
0) 6=
/
0 and C
20
is a unit clause whose head is
an instance of φ(tc(x)), the answer to the “Tax-cut”
problem hK, tc(x)i is determined by
φ
1
(
T
{rep(head(C
20
))}) = φ
1
({ans(Peter)})
= {tc(Peter)},
i.e., Peter is the only one who gets discounted tax.
Example 2. Refer to the description of the “Tax-cut”
problem, the first-order formulas F
1
F
6
, the clauses
C
0
C
20
and the clause set Cs = {C
1
, . . . ,C
7
} in Exam-
ple 1. From the background knowledge of the “Tax-
cut” problem, suppose that we want to prove the ex-
istence of someone who gets discounted tax. This
problem is formulated as the proof problem hE
1
, E
2
i,
where E
1
is the conjunction of F
1
F
6
and E
2
is the
first-order formula x : tc(x).
Using Proposition 2, this proof problem is con-
verted into the QA problem hE
1
¬E
2
, yesi. Using the
procedure in Section 5.3, this QA problem is solved
as follows:
EmbeddingProofProblemsintoQuery-answeringProblemsandProblemSolvingbyEquivalentTransformation
259
Convert E
1
¬E
2
by meaning-preserving Skol-
emization, resulting in the clause set Cs {C
0
},
where C
0
is the negative clause ( tc(x)).
Transform the QA problem
hCs {C
0
}, {(φ(yes) yes)}, φ(yes)i
using ET rules. By following the transformation
Steps 1–14 in Example 1 except that the initial
target clause is C
0
instead of C
0
, the clauses C
8
C
20
are successively produced, where for each i
{8, . . . , 20},
lhs(C
i
) =
/
0, and
rhs(C
i
) = rhs(C
i
),
and C
1
C
7
are removed. As a result, Cs {C
0
}
is transformed into {C
20
}, where C
20
= (), and
the QA problem
h{C
20
}, {(φ(yes) yes)}, φ(yes)i
is obtained.
SinceC
20
is the empty clause, the clause set {C
20
}
has no model, i.e., Models({C
20
}) =
/
0. So the
procedure outputs rep(yes) = {yes} as the answer
to the QA problem hE
1
¬E
2
, yesi.
It follows from Proposition 2 that the answer to the
proof problem hE
1
, E
2
i is yes”, i.e., there exists
someone who gets discounted tax.
8 CONCLUSIONS
Previous approaches to solving QA problems are
proof-centered. They were developed for specific
subclasses of QA problems; for example, answer-
ing queries in logic programming and deductive
databases can be regarded as solving QA problems on
definite clauses and those on a restricted form of def-
inite clauses, respectively. There has been no general
solution method for QA problems on full first-order
formulas.
QA problems on full first-order logic are consid-
ered in this paper. We introduced the concept of em-
bedding and proposed how to embed proof problems
into QA problems. This embedding leads to a uni-
fied approach to dealing with proof problems and QA
problems, allowing one to use a method for solving
QA problems to solve proof problems. It enables
a QA-problem-centered approach to solving logical
problems.
Equivalent transformation (ET) is one of the most
fundamental principles of computation, and it pro-
vides a simple and general basis for verification of
computation correctness. We proposed a framework
for solving QA problems by ET. All computation
steps in this framework are ET steps, including trans-
formation of a first-order formula into an equivalent
formula in the extended clause space ECLS
F
and
transformation of extended clauses on ECLS
F
. To the
best of our knowledge, this is the only framework for
dealing with the full class of QA problems on first-
order formulas.
Since many kinds of ET rules can be employed,
the proposed ET-based framework opens up a wide
range of possibilities for computation paths to be
taken. As a result, the framework enables develop-
ment of a large variety of methods for solving logical
problems. The range of possible computation meth-
ods can also be further extended by using computa-
tion spaces other than ECLS
F
. Proof by resolution
can be seen as one specific example of these possible
methods. As demonstrated in (Akama and Nantajee-
warawat, 2012), it can be realized by using two kinds
of ET rules, i.e., resolution and factoring ET rules, on
a computation space that differs slightly from ECLS
F
.
REFERENCES
Akama, K. and Nantajeewarawat, E. (2011). Meaning-
Preserving Skolemization. In Proceedings of the 2011
International Conference on Knowledge Engineering
and Ontology Development, KEOD 2011, pages 322–
327.
Akama, K. and Nantajeewarawat, E. (2012). Proving Theo-
rems Based on Equivalent Transformation Using Res-
olution and Factoring. In Proceedings of the Second
World Congress on Information and Communication
Technologies, WICT 2012, pages 7–12.
Akama, K. and Nantajeewarawat, E. (2013). Embedding
Proof Problems into Query-Answering Problems and
Problem Solving by Equivalent Transformation. Tech-
nical report, Hokkaido University, Sapporo, Japan.
Beth, E. W. (1955). Semantic Entailment and Formal Deriv-
ability. Amsterdam : Noord-Hollandsche Uitg. Mij.
Chang, C.-L. and Lee, R. C.-T. (1973). Symbolic Logic and
Mechanical Theorem Proving. Academic Press.
Fitting, M. (1996). First-Order Logic and Automated The-
orem Proving. Springer-Verlag, second edition.
Gallier, J. H. (1986). Logic for Computer Science: Founda-
tions of Automatic Theorem Proving. Wiley.
Lloyd, J. W. (1987). Foundations of Logic Programming.
Springer-Verlag, second, extended edition.
Motik, B., Sattler, U., and Studer, R. (2005). Query An-
swering for OWL-DL with Rules. Journal of Web Se-
mantics, 3(1):41–60.
Newborn, M. (2000). Automated Theorem Proving: Theory
and Practice. Springer-Verlag.
Robinson, J. A. (1965). A Machine-Oriented Logic Based
on the Resolution Principle. Journal of the ACM,
12:23–41.
KEOD2013-InternationalConferenceonKnowledgeEngineeringandOntologyDevelopment
260