Solving Query-answering Problems with If-and-Only-If Formulas
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:
Equivalent Transformation, Query-answering Problems, Unfolding, Skolemization, Extended Clauses.
Abstract:
A query-answering problem (QA problem) is concerned with finding all ground instances of a query atomic
formula that are logical consequences of a given logical formula describing the background knowledge of the
problem. A method for solving QA problems on full first-order logic has been invented based on the equivalent
transformation (ET) principle, where a given QA problem on first-order logic is converted into a QA problem
on extended clauses and is then further transformed repeatedly and equivalently into simpler forms until its
answer set can be readily obtained. In this paper, such a clause-based solution is extended by proposing
a new method for effectively utilizing a universally quantified if-and-only-if statement defining a predicate,
which is called an iff-formula. The background knowledge of a given QA problem is separated into two parts:
(i) a conjunction of iff-formulas and (ii) other types of knowledge. Special ET rules for manipulating iff-
formulas are introduced. The new solution method deals with both iff-knowledge in first-order logic and a set
of extended clauses. Application of this solution method is illustrated.
1 INTRODUCTION
Query-answering problems (QA problems) form an
important class of problems, which has attracted in-
creasing interest recently. In contrast to proof prob-
lems, which are “yes/no problems, a QA problem
is characteristically an “all-answers finding problem,
i.e., it is concerned with finding all ground instances
of a query atomic formula that follow logically from
a given logical formula representing the background
knowledge of the problem.
Subclasses of QA problems have been considered
in the Semantic Web community (Horrocks et al.,
2005; Motik et al., 2005; Motik and Rosati, 2010)
and in logic programming and deductive databases
(Lloyd, 1987; Minker, 1988). These subclasses are
however relatively small compared to the class of QA
problems considered by human beings in natural lan-
guage sentences. The class of all QA problems on
full first-order logic is very important for natural lan-
guage understanding and human problem solving. A
large number of studies have been carried out in logic
programming based on specific semantics, such as the
well-founded semantics and the stable model seman-
tics. Specific semantics for sets of clauses (possibly
with negation as failure), which can be useful for pro-
gramming, are however not so expressive and natural
for the direct translation of natural language sentences
and for natural language understanding. For this rea-
son, we take full first-order logic with the standard
semantics for QA problems.
A method for solving QA problems on full first-
order logic has been discussed in (Akama and Nan-
tajeewarawat, 2013b; Akama and Nantajeewarawat,
2014), and as far as we know, it provides the only ex-
isting general approach that deals with QA problems
on full first-order logic with standard semantics. This
solution method is based on the equivalent transfor-
mation (ET) principle. A given QA problem is suc-
cessively transformed equivalently into simpler forms
until its answer set can be readily obtained.
To enable the ET-based strategy, meaning-
preserving Skolemization has been developed in
(Akama and Nantajeewarawat, 2011) together with a
new extended space, called the ECLS
F
space, over
the set of all first-order formulas. This extended
space includes function variables, which are variables
ranging over function constants. Since function con-
stants are mappings from tuples of ground terms to
ground terms, atomic formulas (atoms) with func-
tion variables are regarded as “second-order” atoms.
For problem transformation on the extended space,
many ET rules have been devised in (Akama and Nan-
tajeewarawat, 2013c; Akama and Nantajeewarawat,
333
Akama K. and Nantajeewarawat E..
Solving Query-answering Problems with If-and-Only-If Formulas.
DOI: 10.5220/0005097903330344
In Proceedings of the International Conference on Knowledge Engineering and Ontology Development (KEOD-2014), pages 333-344
ISBN: 978-989-758-049-9
Copyright
c
2014 SCITEPRESS (Science and Technology Publications, Lda.)
2013b; Akama and Nantajeewarawat, 2014), includ-
ing ET rules for unfolding, for removing useless def-
inite clauses, for resolution, for factoring, for dealing
with atoms with function variables, and for erasing
independent satisfiable atoms.
In this paper, we extend the ET-based proce-
dure in (Akama and Nantajeewarawat, 2013b; Akama
and Nantajeewarawat, 2014) by introducing a method
for effectively utilizing if-and-only-if formulas (iff-
formulas, for short) in given background knowl-
edge. Iff-formulas are often used for defining con-
cepts in a knowledge base. Compared to unfold-
ing using clauses obtained from given iff-formulas,
the iff-formulas themselves allow clause transforma-
tion with unrestricted applicability for simplification
of QA problems. Iff-formulas are thus useful for ef-
fective and efficient computation.
To begin with, Section 2 formalizes QA prob-
lems on first-order logic, introduces the ECLS
F
space
and meaning-preserving Skolemization, and identi-
fies the main objective of this paper. Section 3 de-
fines iff-formulas and a quadruple form for represent-
ing a QA problem with iff-formulas, and presents the
extended ET-based procedure. Section 4 gives ET
rules for clause transformation using iff-formulas and
for removal of useless iff-formulas. Section 5 com-
pares transformation using iff-formulas with unfold-
ing. Section 6 illustrates application of our method.
Section 7 provides conclusions.
2 QA PROBLEMS ON AN
EXTENDED SPACE
2.1 QA Problems
A query-answering problem (QA problem) on first-
order logic is a pair hK, qi, where K is a first-order for-
mula, representing background knowledge, and q is
a usual atomic formula (atom), representing a query.
When no confusion is caused, the qualification “on
first-order logic” is often dropped. The standard se-
mantics for first-order formulas is used, in the sense
that all models of a given first-order formula are con-
sidered instead of restricting models to be consid-
ered using specific semantics. Interpretations and
models are sets of ground atoms, which are simi-
lar to Herbrand interpretations and Herbrand mod-
els. The answer to a QA problem hK, qi, denoted
by answer(K, q), is the set of all ground instances of
q that are logical consequences of K. As shown in
(Akama and Nantajeewarawat, 2013b), answer(K, q)
can be equivalently defined as
answer(K, q) = (
\
Models(K)) rep(q), (1)
where Models(K) denotes the set of all models of K
and rep(q) the set of all ground instances of q.
The main features of the ET-based method for
solving QA problems on first-order logic with stan-
dard semantics (Akama and Nantajeewarawat, 2013b;
Akama and Nantajeewarawat, 2014) include: (i) the
use of a new extended space, which is an exten-
sion of first-order logic by incorporation of function
variables; (ii) the use of meaning-preserving Skol-
emization (Akama and Nantajeewarawat, 2011), in
place of the conventional Skolemization (Chang and
Lee, 1973), for converting a first-order formula into a
clause set in the extended space; and (iii) the use of
equivalent transformation on the extended space for
computation of solutions. They are described below
along with the primary objective of this paper.
2.2 The Extended Space ECLS
F
A usual function symbol in first-order logic denotes
an unevaluated function; it is used for constructing
from existing terms a syntactically new term with-
out evaluating the obtained term. A different class
of functions, called function constants, is used in
the extended space. A function constant is an ac-
tual mathematical function, say f , on ground terms;
when it takes ground terms, say t
1
, . . . , t
n
, as input,
f(t
1
, . . . , t
n
) is evaluated for determining an output
term. Variables of a new type, called function vari-
ables, are introduced; they can be instantiated into
function constants or function variables, but not into
usual terms.
Given any n-ary function constant or n-ary func-
tion 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 func-
tion constant and the t
i
are all ground, the truth value
of this atom is true iff f(t
1
, . . . , t
n
) = t
n+1
.
In addition to usual atoms and func-atoms, con-
straint atoms may be used in a clause. While the truth
value of a ground usual atom depends on an inter-
pretation, the truth value of a ground constraint atom
is determined in advance independently of any inter-
pretation. Examples of constraint atoms are eq(t
1
,t
2
),
neq(t
1
,t
2
), le(t
1
,t
2
), and ge(t
1
,t
2
), where t
1
and t
2
are
terms. When t
1
and t
2
are ground terms, eq(t
1
,t
2
) and
neq(t
1
,t
2
) are true iff t
1
= t
2
and t
1
6= t
2
, respectively.
When t
1
and t
2
are numbers, le(t
1
,t
2
) and ge(t
1
,t
2
) are
true iff t
1
t
2
and t
1
t
2
, respectively.
A clause C in the extended space is a formula of
the form
a
1
, . . . , a
m
b
1
, . . . , b
n
, f
1
, . . . , f
o
,
KEOD2014-InternationalConferenceonKnowledgeEngineeringandOntologyDevelopment
334
where (i) a
1
, . . . , a
m
are usual atoms, (ii) each of b
1
,
. . . , b
n
is a usual atom or a constraint atom, and (iii) f
1
,
. . . , f
o
are func-atoms. The sets {a
1
, . . . , a
m
} and {b
1
,
. . . , b
n
, f
1
, . . . , f
o
} are called the left-hand side and the
right-hand side, respectively, of the clause C, denoted
by lhs(C) and rhs(C), respectively. When m = 0, C
is called a negative clause. When m = 1, C is called
a 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
m > 1, C is called a multi-head clause. All usual vari-
ables in a clause are universally quantified and their
scope is restricted to the clause itself.
The set of all clause sets in the extended space
is called the ECLS
F
space. Function variables in a
clause set in ECLS
F
are all existentially quantified
and their scope covers entirely all clauses in the set.
Given a clause set Cs in ECLS
F
, let Models(Cs) de-
note the set of all models of Cs.
2.3 Meaning-Preserving Skolemization
In the conventional proof theory, a first-order formula
is usually converted into a conjunctive normal form
in the usual first-order formula space. The conver-
sion involves removal of existential quantifications by
Skolemization, i.e., by replacement of an existentially
quantified variable with a Skolem term determined by
its relevant quantification structure. The conventional
Skolemization, however, does not generally preserve
the logical meaning of a formula (Chang and Lee,
1973); as a result, it causes difficulties in solving QA
problems by equivalent transformation.
In order to transform a first-order formula equiv-
alently into a set of clauses, meaning-preserving
Skolemization was invented in (Akama and Nan-
tajeewarawat, 2008; Akama and Nantajeewarawat,
2011). Let MPS(K) denote the result of meaning-
preserving Skolemization of a given first-order for-
mula K. MPS(K) is obtained from K by repeated sub-
formula transformation and conversion to a clausal
form. For subformula transformation, say T, model-
preserving transformation is used. For example,
T(¬(¬E)) = E and T(¬(E
1
E
2
)) = (¬E
1
) (¬E
2
).
Although the forms of these transformations are simi-
lar to those in the conventional Skolemization, they
are totally different in the sense that the formu-
las E, E
1
, and E
2
may contain func-atoms, func-
tion variables, and function constants. When K =
(x
1
x
2
···x
n
y : E), the transformation T intro-
duces a new function variable and a new func-atom,
i.e., T(K) is the formula
hx
1
x
2
···x
n
y : (E ¬func(h, x
1
, x
2
, . . . , x
n
, y)),
where h is an n-ary function variable. For example,
T(xy : motherOf(y, x))
= hxy : (motherOf(y, x) ¬func(h, x, y)),
which is further converted into the extended clause
(motherOf(y, x) func(h, x, y)). The transformation
rules used in (Akama and Nantajeewarawat, 2011) for
meaning-preserving Skolemization are given in the
appendix.
It was shown in (Akama and Nantajeewarawat,
2008) that:
Theorem 1. Models(K) = Models(MPS(K)) for any
first-order formula K.
2.4 A Triple Form and Equivalent
Transformation (ET)
A triple form of a QA problem is introduced in
(Akama and Nantajeewarawat, 2014) for flexible rep-
resentation and transformation. Let A be the set of
all usual atoms and for any atom a A, let rep(a)
denote the set of all ground instances of a. A triple
form of a QA problem on ECLS
F
is a tuple hCs, q, πi,
where Cs is a clause set in ECLS
F
representing back-
ground knowledge, q is a usual atom representing
a query, and π is a partial mapping from A to A
such that the range of π contains all instances of q.
The answer to the QA problem hCs, q, πi, denoted by
answer(Cs, q, π), is defined by
answer(Cs, q, π) = π((
\
Models(Cs)) rep(q)). (2)
An ET-based procedure for solving QA problems
is a state-transition procedureconsisting of three main
phases:
1. A QA problem hK, qi on first-order logic is
first converted into a QA problem hCs, q, idi on
ECLS
F
, where Cs = MPS(K) and id is the iden-
tity mapping. By Theorem 1, answer(K, q) =
answer(Cs, q, id).
2. The QA problem hCs, q, idi is transformed by suc-
cessive application of various ET rules. In gen-
eral, each application of an ET rule transforms a
given QA problem h
ˆ
Cs, ˆq,
ˆ
πi into h
˜
Cs, ˜q,
˜
πi pre-
serving the answer set, i.e., answer(
ˆ
Cs, ˆq,
ˆ
π) =
answer(
˜
Cs, ˜q,
˜
π).
3. From the resulting simplified QA problem, the an-
swer set of the original QA problem is derived.
Each transition step preserves the answer set of a
given input QA problem and therefore the correctness
of this procedure is guaranteed.
SolvingQuery-answeringProblemswithIf-and-Only-IfFormulas
335
2.5 The Primary Objective of This
Paper
Given a QA problem hK, qi on first-order logic, the
first-order formula K often includes a universally
quantified closed formula of the form (a F),
where a is a usual atom and F is a first-order formula.
This form of knowledge is referred to herein as if-and-
only-if knowledge (for short, iff-knowledge). It is very
useful since it enables direct transformation of a QA
problem by replacement of an instance of a with its
corresponding instance of F. However, the transfor-
mation to a clausal form in the previous triple-form
method (Section 2.4) does not utilize this advantage
(see Section 5).
The primary purpose of the paper is to develop
a new method for effectively utilizing iff-knowledge.
More precisely, we divide the background knowledge
of a QA problem into two parts: (i) a conjunction
of iff-knowledge and (ii) other types of knowledge.
We introduce special ET rules for manipulating iff-
knowledge. For ease of transformation, we assume
in this paper that the form of the formula F in iff-
knowledge (a F) is a disjunction of atom con-
junctions.
3 SOLVING QA PROBLEMS
WITH IFF-FORMULAS
The class of iff-formulas considered in this paper is
formally defined in Section 3.1 along with related no-
tation. In order to make a clear separation between iff-
formulas and knowledge of other types, a quadruple
form of a QA problem is introduced in Section 3.2.
An ET-based procedure for solving QA problems
with iff-formulas is presented in Section 3.3.
In the rest of this paper, let A be the set of all usual
atoms and for any atom a A, let rep(a) denote the
set of all ground instances of a.
3.1 If-and-Only-If Formulas
(Iff-Formulas)
Given an atom or a constraint atom a, let var(a) de-
note the set of all variables occurring in a. Given a
set A of atoms and/or constraint atoms, let var(A) =
S
{var(a) | a A}.
An if-and-only-if formula (for short, iff-formula) I
on A is a formula of the form
a (conj
1
··· conj
n
),
where a A and each of the conj
i
is a set of atoms in
A and/or constraint atoms. The atom a is called the
head of the iff-formula I, denoted by head(I). When
emphasis is given to its head, an iff-formula whose
head is an atom a is often referred to as iff(a).
Let I = (a (conj
1
··· con j
n
)) be an iff-
formula. For each i {1, . . . , n}, con j
i
corresponds
to the the existentially quantified atom conjunction
FOL(conj
i
, a) given by
FOL(conj
i
, a) = y
1
···y
k
:
^
{b | b conj
i
},
where {y
1
, . . . , y
k
} = var(conj
i
) var(a). The iff-
formula I corresponds to the universally quantified
formula
(a (FOL(conj
1
, a) · · · FOL(conj
n
, a))),
which is denoted by FOL(I).
An iff-formula (a (conj
1
··· conj
n
)) is in a
standardform iff for any i, j {1, . . . , n}, if i6= j, then
(var(conj
i
) var(a)) (var(conj
j
) var(a)) = .
An iff-formula I can always be converted into a stan-
dard form, with its meaning given by FOL(I) being
preserved, through variable renaming. It is assumed
that all iff-formulas considered henceforth are in stan-
dard forms.
Assume that I is an iff-formula. The if-part and the
only-if-part of FOL(I) are denoted by FOL
If
(I) and
FOL
onlyIf
(I), respectively. Let IF(I), ONLYIF(I), and
CLS(I) be the clause sets defined as follows:
IF(I) = MPS(FOL
If
(I)).
ONLYIF(I) = MPS(FOL
onlyIf
(I)).
CLS(I) = IF(I) ONLYIF(I).
Note that CLS(I) can be equivalently defined as
MPS(FOL(I)), i.e., it is the clause set obtained by
converting FOL(I) into a conjunctive normal form by
meaning-preserving Skolemization.
Example 1. Suppose that I is an iff-formula
p(x, y) ({q(x, y, z), r(z)} {eq(x, w), s(x, y, w)}),
where w, x, y, and z are usual variables. Then
FOL(I) = xy : p(x, y) ((z : q(x, y, z) r(z))
(w : eq(x, w) s(x, y, w))),
IF(I) = {(p(x, y) q(x, y, z), r(z)),
(p(x, y) eq(x, w), s(x, y, w))},
ONLYIF(I)
= {(q(x, y, z), eq(x, w) p(x, y), func( f
0
, y, x, z),
func( f
1
, y, x, w)),
(q(x, y, z), s(x, y, w) p(x, y), func( f
0
, y, x, z),
func( f
1
, y, x, w)),
(r(z), eq(x, w) p(x, y), func( f
0
, y, x, z),
func( f
2
, y, x, w)),
(r(z), s(x, y, w) p(x, y), func( f
0
, y, x, z),
func( f
2
, y, x, w))}.
KEOD2014-InternationalConferenceonKnowledgeEngineeringandOntologyDevelopment
336
Two iff-formulas I and I
on A are said to be dis-
joint iff rep(head(I)) and rep(head(I
)) are disjoint.
Let E be a set of mutually disjoint iff-formulas on A.
E corresponds to the conjunction
V
{FOL(I) | I E},
which is denoted by FOL(E). Let IF(E) =
S
{IF(I) |
I E}, ONLYIF(E) =
S
{ONLYIF(I) | I E}, and
CLS(E) = IF(E) ONLYIF(E).
A ground substitution for an iff-formula (a
(conj
1
··· conj
n
)) is a substitution θ such that aθ,
conj
1
θ, . . . , conj
n
θ are all ground.
3.2 Quadruples for Transformation of
QA Problems
3.2.1 A Quadruple Form
In order to clearly separate iff-formulas from clauses
in background knowledge, we extend a QA problem
on ECLS
F
into a quadruple hCs, E, q, πi on A, where
(i) Cs is a clause set in the ECLS
F
space such that each
usual atom appearing in Cs belongs to A, (ii) E is a
set of mutually disjoint iff-formulas on A, (iii) q A,
and (iv) π is a partial mapping from A to A such that
the domain of π contains all ground instances of q.
The answer to the QA problem hCs, E, q, πi, denoted
by answer(Cs, E, q, π), is defined by
answer(Cs, E, q, π)
= π((
\
Models(Cs CLS(E))) rep(q)). (3)
3.2.2 Transformation into Quadruples
A QA problem hK, qi on first-order logic is trans-
formed into a quadruple form on ECLS
F
as follows:
1. From K, identify a first-order formula K
and a
set E of mutually disjoint iff-formulas such that
K = K
FOL(E).
2. Convert K
by meaning-preserving Skolemization
into a clause set Cs in the ECLS
F
space, i.e., Cs =
MPS(K
).
3. Construct hCs, E, q, idi, where id is the identity
mapping, as the resulting quadruple.
Finding a nonempty set E of iff-formulas for con-
verting K into K
FOL(E) is useful for solving QA
problems since iff-formulasincrease the possibility of
transforming QA problems with less cost (see Sec-
tion 5). As the number of iff-formulas in the set E
increases, such possibility is higher.
3.3 A Procedure for Solving QA
Problems with Iff-Formulas
Assume that a QA problem hK, qi on first-order logic
is given. To solve this problem using ET, perform the
following steps:
1. Transform hK, qi into a quadruple hCs, E, q, idi
using the transformation given in Section 3.2.
2. Successively transform the quadruple hCs, E,q,
idi in the ECLS
F
space using the following ET
rules: Assume that h
ˆ
Cs,
ˆ
E, ˆq, πi is a QA problem.
(a) If
ˆ
E contains an iff-formula iff(a) and
˜
Cs is
obtained from
ˆ
Cs by replacement using iff(a),
then transform h
ˆ
Cs,
ˆ
E, ˆq, πi into h
˜
Cs,
ˆ
E, ˆq, πi,
(b) If
ˆ
E contains an iff-formula iff(a) and for each
atom b that occurs in
ˆ
Cs or
ˆ
E {iff(a)}, a and
b are not unifiable, then transform h
ˆ
Cs,
ˆ
E, ˆq, πi
into h
ˆ
Cs,
ˆ
E {iff(a)}, ˆq, πi.
(c) Transform h
ˆ
Cs,
ˆ
E, ˆq, πi by transformation of
ˆ
Cs
and/or π using ET rules on ECLS
F
, including
the ET rules for unfolding (UNF) and definite-
clause removal (RMD) in Section 5.2, and
the ET rules given in (Akama and Nantajee-
warawat, 2014) for
side-change transformation (SCH),
resolution (RESO),
elimination of isolated func-atoms (EIF),
elimination of subsumed clauses (ESUB),
elimination of valid clauses (EVAD),
erasing independent satisfiable atoms (EIS),
and
elimination of satisfiable independent clauses
(ESI).
(d) Transform h
ˆ
Cs,
ˆ
E, ˆq, πi using ET rules for con-
straints, e.g., ET rules for equality constraints.
3. Assume that the transformation yields a quadruple
hCs
, E
, q
, φi. Then:
(a) If Cs
is not satisfiable, then output rep(φ(q
))
as the answer set.
(b) If Cs
is a set of unit clauses the head of which
are instances of q
, then output the answer set
S
CCs
rep(φ(head(C))).
(c) Otherwise stop with failure.
The obtained answer set is always correct since all
transformation steps in the procedure are answer-
preserving.
4 ET RULES IN THE PRESENCE
OF IFF-FORMULAS
Next, the replacement operation using an iff-formula
is defined. It is followed by ET rules for replace-
ment using iff-formulas and for removing useless iff-
formulas.
SolvingQuery-answeringProblemswithIf-and-Only-IfFormulas
337
4.1 Replacement Using Iff-Formulas
Assume that (i) Cs is a set of clauses, (ii) occ is an
occurrence of an atom b in a clause C Cs, (iii) iff(a)
is an iff-formula (a (con j
1
· · · con j
n
)), (iv) ρ is
a renaming substitution for usual variables such that
C and iff(a)ρ have no usual variable in common, and
(v) θ is the most general matcher of aρ into b (i.e., the
most general substitution such that aρθ = b). Then:
Let REPL(C, occ, iff(a), ρ, θ) denote the first-
order formula obtained by replacing b at occ
with the disjunction FOL(con j
1
ρθ, aρθ) ···
FOL(conj
n
ρθ, aρθ) using ρ and θ.
Let REPL(Cs,C, occ, iff(a), ρ, θ) denote the con-
junction of REPL(C, occ, iff(a), ρ, θ) and all
clauses in Cs {C}.
Note that occ is an occurrence at any arbitrary
position in C (i.e., it can be in the left-hand
side or the right-hand side of C). In general,
REPL(C, occ, iff(a), ρ, θ) is not a clause. After the re-
placement of occ, a new clause set, say Cs
, is ob-
tained by using meaning-preserving Skolemization,
i.e., Cs
= MPS(REPL(Cs,C, occ, iff(a), ρ, θ)). The
resulting clause set Cs
is often simply said to be ob-
tained by replacement using iff(a) at the occurrence
occ of b in C.
4.2 ET Rules for Iff-Formulas and
Their Correctness
An ET rule on ECLS
F
for replacement using an iff-
formula is given by Theorem 2 and that for remov-
ing a useless iff-formula is given by Theorem 3. Let
hCs, E, q, πi be a QA problem on ECLS
F
.
Theorem 2. (Replacement Using an Iff-Formula)As-
sume that:
1. E contains an iff-formula iff(a).
2. rep(a) rep(q) = .
3. occ is an occurrence of an atom b in a clause C
Cs.
4. ρ is a renaming substitution for usual variables
such that C and iff(a)ρ have no usual variable in
common.
5. θ is the most general matcher of aρ into b.
6. Cs
= MPS(REPL(Cs,C, occ, iff(a), ρ, θ)).
Then hCs, E, q, πi can be equivalently transformed
into hCs
, E, q, πi.
Proof. Assume that iff(a) = (a (conj
1
· · ·
conj
n
)) and F is the disjunction
FOL(conj
1
ρθ, aρθ) · · · FOL(conj
n
ρθ, aρθ).
Then Cs
is obtained by applying meaning-preserving
Skolemization to the formula resulting from replac-
ing aρθ in Cs with F. Since aρθ is logically equiva-
lent to F, Cs and Cs
are logically equivalent in the
presence of CLS(E). Hence answer(Cs, E, q, π) =
answer(Cs
, E, q, π).
Theorem 3. (Removal of an Iff-Formula) Assume
that:
1. E contains an iff-formula iff(a).
2. rep(a) rep(q) = .
3. For each atom b that occurs in
ˆ
Cs or
ˆ
E {iff(a)},
a and b are not unifiable.
Then hCs, E, q, πi can be equivalently transformed
into hCs, E {iff(a)}, q, πi.
Proof. Let Cs
1
= Cs CLS(E) and Cs
2
= Cs
(CLS(E) CLS(iff(a))). Obviously, Models(Cs
1
)
Models(Cs
2
). Based on this, we prove that
rep(q) (
\
Models(Cs
1
))
= rep(q) (
\
Models(Cs
2
)) (4)
by further showing as follows that for any G
Models(Cs
2
), there exists M Models(Cs
1
) such
that G rep(q) = M rep(q). Assume that G
Models(Cs
2
). Let G
= G rep(a). By Assumption 3
of this theorem, G
is also a model of Cs
2
. Assum-
ing that iff(a) = (a (con j
1
··· conj
n
)), let D
p
be defined as the set of definite clauses
{C | (i {1, . . . , n}) &
(θ is a ground substitution for iff(a)) &
(G
contains all atoms in conj
i
θ that are not
instances of a) &
(C is a definite clause with head(C) = aθ
and body(C) = conj
i
θ G
)}.
Let M = M (D
p
) G
, where M (D
p
) is the least
model of D
p
. By Assumption 3 of this theorem, M
is a model of Cs
1
. By Assumption 2 of this theorem,
G rep(q) = G
rep(q) = M rep(q).
As a result, (4) holds. It follows from Equa-
tion (3) in Section 3.2 that answer(Cs, E, q, π) =
answer(Cs, E {iff(a)}, q, π).
Application of Theorems 2 and 3 is illustrated be-
low.
Example 2. Assume that ans is a query atom and K
is the union of a clause set Cs and the set {I
B
,C
1
,C
2
},
where I
B
is the iff-formula
I
B
: B ({C, D} {H})
and C
1
and C
2
are the following clauses:
KEOD2014-InternationalConferenceonKnowledgeEngineeringandOntologyDevelopment
338
C
1
: ans A, B
C
2
: B A,C
By Theorem 2, the clause C
1
can be transformed by
replacement using I
B
into:
C
3
: ans A,C, D
C
4
: ans A, H
Again by Theorem 2, replacement using I
B
is applica-
ble to C
2
, and the replacement transformsC
2
into:
C
5
: C, H A,C
C
6
: D, H A,C
Note that {C
5
,C
6
} = MPS(((CD)H) (AC)).
By Theorem 3, if the clause set Cs contains no oc-
currence of B, then the iff-formula I
B
can be re-
moved.
5 A COMPARISON BETWEEN
REPLACEMENT AND
UNFOLDING
After introducing the unfolding operation on ECLS
F
in Section 5.1 and presenting ET rules for unfold-
ing and for definite-clause removal in Section 5.2, re-
placement using an iff-formula is compared with un-
folding in Section 5.3. Section 5.4 illustrates how iff-
formulas are useful for reduction of computation cost.
5.1 Unfolding Operation on ECLS
F
Assume that Cs is a clause set in ECLS
F
, D is a
definite-clause set in ECLS
F
, and occ is an occurrence
of an atom b in the right-hand side of a clauseC 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:
1. If b and head(C
ρ) are not unifiable, then
resolvent(C,C
, b) = .
2. If they are unifiable, with θ being their most
general unifier, then resolvent(C,C
, b) = {C
′′
},
where C
′′
is the clause obtained from C and C
ρ
as follows:
(a) lhs(C
′′
) = lhs(Cθ)
(b) rhs(C
′′
) = (rhs(Cθ) {bθ}) body(C
ρθ)
The resulting clause set is denoted by UNF(Cs,C, occ,
D).
5.2 ET by Unfolding and
Definite-Clause Removal
For any predicate p, let Atoms(p) denote the set of
all atoms having the predicate p. ET rules on ECLS
F
for unfolding and for definite-clause removal (Akama
and Nantajeewarawat, 2013c) are given below. As-
sume that hCs, E, q, πi is a QA problem on ECLS
F
.
5.2.1 ET by Unfolding (UNF)
Suppose that:
1. p
q
is the predicate of the query atom q.
2. p is a predicate such that p 6= p
q
.
3. D is a set of definite clauses in Cs that satisfies the
following conditions:
(a) For any definite clause C D, head(C)
Atoms(p).
(b) For any clause C
(Cs CLS(E)) D,
lhs(C
) Atoms(p) = .
4. occ is an occurrence of an atom in Atoms(p) in the
right-hand side of a clause C in (Cs IF(E)) D.
Then hCs, E, q, πi can be equivalently transformed
into the QA problem hUNF(Cs,C, occ, D), E, q, πi.
In order to apply unfolding to hCs, E, q, πi, we
have to find a set D of definite clauses in Cs that sat-
isfies Condition 3. By Conditions 3a and 3b, we se-
lect a predicate p and collect all definite clauses with
p-atoms in their heads. To satisfy Condition 3b, a
p-atom can neither appear in the left-hand side of a
multi-head clause in Cs nor appear in an iff-formula
in E. These conditions often disable application of
unfolding ET rules in solving problems with multi-
head clauses.
5.2.2 ET by Definite-Clause Removal (RMD)
Suppose that:
1. p
q
is the predicate of the query atom q.
2. p is a predicate such that p 6= p
q
.
3. D is a set of definite clauses in Cs that satisfies the
following conditions:
(a) For any definite clause C D, head(C)
Atoms(p).
(b) For any clause C
(Cs CLS(E)) D,
lhs(C
) Atoms(p) = .
4. For any clause C
(Cs CLS(E)) D, rhs(C
)
Atoms(p) = .
SolvingQuery-answeringProblemswithIf-and-Only-IfFormulas
339
Then hCs, E, q, πi can be equivalently transformed
into the QA problem hCs D, E, q, πi.
Next, an example showing application of unfold-
ing and definite-clause removal is given.
Example 3. Consider the Oedipus problem described
in (Baader et al., 2007). Oedipus killed his father,
married his mother Iokaste, and had children with her,
among them Polyneikes. Polyneikes also had chil-
dren, among them Thersandros, who is not a patri-
cide. The problem is to find a person who has a pat-
ricide child who has a non-patricide child. The dif-
ficulty of this problem arises from the absence of in-
formation as to whether Polyneikes is a patricide or
not.
Assume that oe, io, po, and th stand,
respectively, for Oedipus, Iokaste, Polyneikes, and
Thersandros. This problem is represented as a
QA problem with the query atom prob(x) and the
background knowledge consisting of the following
clauses:
C
1
: prob(x), pat(y) isChildOf(z, x), pat(z),
isChildOf(y, z)
C
2
: isChildOf(oe, io)
C
3
: isChildOf(po, io)
C
4
: isChildOf(po, oe)
C
5
: isChildOf(th, po)
C
6
: pat(oe)
C
7
: pat(th)
Since C
1
is a multi-head clause containing a pat-atom
in its left-hand side, unfolding at the pat-atom in the
right-hand side of C
1
is disabled. By unfolding at the
first isChildOf-atom, i.e., isChildOf(z, x), in its right-
hand side, the clause C
1
is transformed into the fol-
lowing four clauses:
C
8
: prob(io), pat(y) pat(oe), isChildOf(y, oe)
C
9
: prob(io), pat(y) pat(po), isChildOf(y, po)
C
10
: prob(oe), pat(y) pat(po), isChildOf(y, po)
C
11
: prob(po),pat(y) pat(th), isChildOf(y, th)
By further unfolding at isChildOf-atoms four times
successively, the clauses C
8
C
11
are transformed into:
C
12
: prob(io),pat(po) pat(oe)
C
13
: prob(io),pat(th) pat(po)
C
14
: prob(oe), pat(th) pat(po)
Since the predicate isChildOf does not appear in the
right-hand side of any of C
6
, C
7
and C
12
C
14
, the def-
inite clausesC
2
C
5
are removed. The resulting clause
set is Cs = {C
6
,C
7
,C
12
,C
13
,C
14
}. At this point, pat
is the only predicate of a possible target body atom
for unfolding. However, since each of C
12
, C
13
and
C
14
also contains a pat-atom in its left-hand side, no
further unfolding is applicable to Cs.
Using other equivalent transformation rules, Cs
can be further transformed as follows: By forwarding
transformation (Akama and Nantajeewarawat, 2012b)
with respect to C
7
, the clauses C
13
and C
14
are
changed into:
C
15
: prob(io) pat(po)
C
16
: prob(oe) pat(po)
By erasing independent satisfiable atoms (Akama and
Nantajeewarawat, 2014), C
12
is replaced with:
C
17
: prob(io),pat(po)
By resolution and elimination of subsumed clauses,
C
15
and C
17
are replaced with:
C
18
: prob(io)
The resulting clause set is Cs
= {C
6
,C
7
,C
16
,C
18
}.
Since no atom in the left-hand side of any clause
in Cs
can be instantiated into pat(po), C
16
is re-
moved. The obtained answer set is thus the single-
ton set {prob(io)}, i.e., Iokaste is the only answer to
this problem (no matter whether Polyneikes is a pat-
ricide).
Alternatively, after the original background know-
ledge is simplified by unfolding and definite-clause
removal into Cs = {C
6
,C
7
,C
12
,C
13
,C
14
}, the simpli-
fied QA problem hCs, prob(x)i can also be solved by
using bottom-up computation (Akama and Nantajee-
warawat, 2012a) or by using a SAT solver (Akama
and Nantajeewarawat, 2013a).
5.3 Replacement Using Iff-Formulas vs.
Unfolding
Assume that Cs is a clause set in the ECLS
F
space, C
is a clause in Cs, occ is an occurrence of an atom b in
the right-hand side of C, and iff(a) is an iff-formula.
Consider two QA problems Prb
1
and Prb
2
, given by:
Prb
1
= hCs, E {iff(a)}, q, idi,
Prb
2
= hCs CLS(iff(a)), E, q, idi.
By the definitional equation (3), Prb
1
is equivalent to
Prb
2
.
Whenever replacement is applicable using a re-
naming substitution ρ and the most general matcher
θ of aρ into b, Prb
1
is transformed into an equiv-
alent QA problem Prb
1
= hCs
, E {iff(a)}, q, idi,
where Cs
= MPS(REPL(Cs,C, occ, iff(a),ρ, θ)). Re-
ferring to Section 5.2, if the required conditions for
ET by unfolding Cs CLS(iff(a)) using IF(iff(a))
at occ are satisfied, then Prb
2
can be equiva-
lently transformed by unfolding into a QA prob-
lem Prb
2
= hCs
′′
, E, q, idi, where Cs
′′
= UNF(Cs
CLS(iff(a)),C, occ, IF(iff(a))). The changes are made
KEOD2014-InternationalConferenceonKnowledgeEngineeringandOntologyDevelopment
340
by the above two transformation steps only in the
clause-set parts, i.e., at the first arguments of the
quadruples representing Prb
1
and Prb
2
.
It can be shown that the changes made by them
are exactly the same (i.e., Cs
CLS(iff(a)) = Cs
′′
)
as follows: Assume that iff(a) = (a (conj
1
· · ·
conj
n
)), ρ is a renaming substitution for usual vari-
ables such that C and iff(a)ρ have no usual variable
in common, and θ is the most general matcher of aρ
into b. The substitution θ used above is also the most
general unifier of aρ and b. It is thus also used for
unifying aρ and b in the unfolding step.
By replacement using iff(a) followed by con-
version using meaning-preserving Skolemization,
n copies of C are produced and for each i
{1, . . . , n}, the atom b at occ in the ith copy is re-
placed with conj
i
ρθ. All other atoms in each copy
of C are unchanged.
By the unfolding operation with respect to
IF(iff(a)), which is the set {(a conj
i
) | i
{1, . . . , n}}, C is transformed into n clauses, say,
C
1
, . . . ,C
n
, and for each i {1, . . . , n}, the atom
b at the occurrence occ is replaced with conj
i
ρθ
in the construction of C
i
. Although θ is also ap-
plied to all other atoms in C, it makes no change
to those atoms since C and aρ have no usual vari-
able in common and θ only instantiates variables
occurring in aρ.
Hence the two transformation steps make the same
change to the target clause C. As a result, Cs
CLS(iff(a)) = Cs
′′
.
However, the required conditions for applicability
of the two transformations are totally different. While
replacement is always applicable, the required con-
ditions for unfolding (cf. Section 5.2) are easily vio-
lated when Cs contains a multi-head clause with an
instance of a in its left-hand side. Such violation dis-
ables unfolding. As a consequence, replacement by
iff-formulas in the quadruple form gives higher possi-
bility of transformation compared to unfolding in the
quadruple form (and, thus, also unfolding in the triple
form).
Example 4. Assume that the query atom is prob(x)
and the background knowledge K includes the con-
junction of the following first-order formulas, where
Co, nt, te, AC, and BC are abbreviations
for “course, “non-teaching professor, “teach, “ad-
vanced course, and “basic course,” respectively:
F
1
: x : ((y : (Co(y) te(x, y))) prob(x))
F
2
: x : (nt(x) ¬(y : te(x, y) Co(y)))
F
3
: x : (Co(x) (AC(x) BC(x)))
By meaning-preserving Skolemization (Akama and
Nantajeewarawat, 2011), the conjunction F
1
F
2
F
3
is converted into the following extended clauses,
where f is a unary function variable:
C
1
: prob(x) Co(y), te(x, y)
C
2
: nt(x), te(x, y), Co(y)
C
3
: te(x, y), nt(x) func( f, x, y)
C
4
: Co(x), nt(y) func( f, y, x)
C
5
: Co(x) AC(x)
C
6
: Co(x) BC(x)
C
7
: AC(x), BC(x) Co(x)
These clauses are used in the triple form. Using them,
unfolding at the Co-atom in the body ofC
1
is blocked
due to the presence of a Co-atom in the left-hand side
of the multi-head clauseC
4
. If such an unfolding step
is not blocked, then it transforms C
1
into:
C
a
: prob(x) AC(y),te(x, y)
C
b
: prob(x) BC(y), te(x, y)
By contrast, if the quadruple form is used, then the
clauses C
5
C
7
are replaced with a single iff-formula
I
Co
: Co(x) ({AC(x)} {BC(x)})
and replacement using I
Co
is applicable at the Co-
atom in C
1
. This replacement transforms C
1
into the
following two clauses:
C
8
: prob(x) AC(y),te(x, y)
C
9
: prob(x) BC(y), te(x, y)
The resulting clauses C
8
and C
9
are equal to C
a
and
C
b
, respectively.
5.4 Overcoming Computation Difficulty
by Using Iff-Formulas
Assume that K is the first-order formula
xyz : (app(x, y, z)
((eq(x, []) eq(y, z))
(AXZ : (eq(x, [A|X]) eq(z,[A|Z])
app(X, y, Z))))),
where app stands for append. Consider the QA
problem hK, qi, where q = app([1, 2, 3], [4, 5], x). This
problem is solved by successively transforming the
clause
A
1
: ans(z) app([1, 2, 3], [4, 5], z)
into unit clauses.
We first show that a solution with the triple form,
using only unfolding and resolution, results in com-
putation difficulty. By meaning-preserving Skolemi-
zation, the first-order formula K is converted into the
set Cs consisting of the following clauses, where f
0
f
5
are function variables:
SolvingQuery-answeringProblemswithIf-and-Only-IfFormulas
341
C
1
: app(x, y, z) eq(x, []), eq(y, z)
C
2
: app(x, y, z) eq(x, [A|X]), eq(z, [A|Z]),
app(X,y, Z)
C
3
: eq(x, []), eq(x, [A|X])
app(x, y, z), func( f
0
, z, y, x, A),
func( f
1
, z, y, x, X), func( f
2
, z, y, x, Z)
C
4
: eq(x, []), eq(z, [A|Z])
app(x, y, z), func( f
0
, z, y, x, A),
func( f
1
, z, y, x, X), func( f
2
, z, y, x, Z)
C
5
: eq(x, []), app(X, y, Z)
app(x, y, z), func( f
0
, z, y, x, A),
func( f
1
, z, y, x, X), func( f
2
, z, y, x, Z)
C
6
: eq(y, z), eq(x, [A|X])
app(x, y, z), func( f
3
, z, y, x, A),
func( f
4
, z, y, x, X), func( f
5
, z, y, x, Z)
C
7
: eq(y, z), eq(z, [A|Z])
app(x, y, z), func( f
3
, z, y, x, A),
func( f
4
, z, y, x, X), func( f
5
, z, y, x, Z)
C
8
: eq(y, z), app(X, y, Z)
app(x, y, z), func( f
3
, z, y, x, A),
func( f
4
, z, y, x, X), func( f
5
, z, y, x, Z)
Among C
1
C
8
, there are four clauses whose left-hand
sides contain app-atoms, i.e., C
1
, C
2
, C
5
, and C
8
.
Since C
5
and C
8
are multi-head clauses, unfolding at
the app-atom in the body of the clause A
1
is blocked.
Instead, resolution is applicable to the clause A
1
and it produces the following resolvent clauses:
A
1
: ans(z) app([1, 2, 3], [4, 5], z)
(by applying resolution to A
1
and C
2
)
A
2
: ans([1|z
1
]) app([2, 3], [4, 5], z
1
)
(by applying resolution to A
2
and C
2
)
A
3
: ans([1, 2|z
2
]) app([3], [4, 5], z
2
)
(by applying resolution to A
3
and C
2
)
A
4
: ans([1, 2, 3|z
3
]) app([], [4, 5], z
3
)
(by applying resolution to A
4
and C
1
)
A
5
: ans([1, 2, 3, 4, 5])
The clause A
5
indicates that [1, 2, 3, 4, 5] is one result
of concatenating [1, 2, 3] and [4, 5]. However, we can-
not conclude this is the only result. The reason is
that resolution adds resolvent clauses to the original
clause set and, therefore, the above resolution steps
transform Cs {A
1
} as follows:
Cs {A
1
}
Cs {A
1
, A
2
}
Cs {A
1
, A
2
, A
3
}
Cs {A
1
, A
2
, A
3
, A
4
}
Cs {A
1
, A
2
, A
3
, A
4
, A
5
}
Some other result of concatenating [1, 2, 3] and [4, 5]
may be obtained by other clauses, i.e., C
3
C
8
and A
1
A
4
. To ensure that no such additional result exists,
removal of A
1
A
4
is required. Neither unfolding nor
resolution removes them. Removing A
1
A
4
by other
transformation rules, if possible, tends to take non-
negligible computation cost.
Next, we show that the above difficulty can be re-
solved by using an iff-formula. The original formula
K can be transformedequivalently into the iff-formula
I
app
: app(x, y, z)
({eq(x, []),eq(y, z)}
{eq(x, [A|X]), eq(z, [A|Z]), app(X, y, Z)}).
We then consider the quadruple
h{A
1
}, {I
app
}, ans(x), πi,
where π is a mapping such that for any term t,
π(ans(t)) = app([1, 2, 3], [4, 5],t).
By repeated replacement using I
app
and equivalent
transformation with respect to eq-atoms, the clause
set {A
1
} is transformed into the singleton unit-clause
set {(ans([1, 2, 3, 4, 5]) )} as follows:
{(ans(z) app([1, 2, 3], [4, 5], z))}
(by replacement using I
app
)
{(ans(z) eq([1, 2, 3], []), eq([4, 5], z)),
(ans(z) eq([1, 2, 3], [A|X]), eq(z, [A|Z]),
app(X, [4, 5], Z))}
(by equality solving)
{(ans([1|z
1
]) app([2, 3], [4, 5], z
1
))}
(by replacement using I
app
)
{(ans([1|z
1
]) eq([2, 3], []), eq([4, 5], z
1
)),
(ans([1|z
1
]) eq([2, 3], [A|X]), eq(z
1
, [A|Z]),
app(X, [4, 5], Z))}
(by equality solving)
{(ans([1, 2|z
2
]) app([3], [4, 5], z
2
))}
(by replacement using I
app
)
{(ans([1, 2|z
2
]) eq([3], []), eq([4, 5], z
2
)),
(ans([1, 2|z
2
]) eq([3], [A|X]), eq(z
2
, [A|Z]),
app(X, [4, 5], Z))}
(by equality solving)
{(ans([1, 2, 3|z
3
]) app([], [4, 5], z
3
))}
(by replacement using I
app
)
{(ans([1, 2, 3|z
3
]) eq([], []), eq([4, 5], z
3
)),
(ans([1, 2, 3|z
3
]) eq([], [A|X]), eq(z
3
, [A|Z]),
app(X, [4, 5], Z]))}
(by equality solving)
{(ans([1, 2, 3, 4, 5]) )}
By the removal transformation for an iff-formula, I
app
is removed. Then
answer({A
1
}, {I
app
}, ans(x), π)
= answer({(ans([1, 2, 3, 4, 5]) )}, , ans(x), π)
= π({ans([1, 2, 3, 4, 5])} rep(ans(x)))
= π({ans([1, 2, 3, 4, 5])})
= {app([1, 2, 3], [4, 5], [1, 2, 3, 4, 5])},
which means [1, 2, 3, 4, 5] is the only result of concate-
nating [1, 2, 3] and [4, 5]. The aforementioned diffi-
culty is thus overcome with small computation cost.
KEOD2014-InternationalConferenceonKnowledgeEngineeringandOntologyDevelopment
342
Structural Relational
NFP FP NT curr(x, z) exam(x, y), subject(y, z)
NT ¬∃teach.Co & x: St, y: Co, z: Tp
FP FM mayDoTh(x, y) curr(x, z), expert(y, z)
AC BC Co & x: St, z: Tp, y: FP teach.AC
AC BC mayDoTh(x, y) & x: St, y: NFP
john: FP, teach(john, ai) exam(paul, ai)
mary: FP teach.AC subject(ai, kr), subject(ai, lp)
paul: St, ai: AC, kr: Tp, lp: Tp expert(john, kr), expert(mary, lp)
Figure 1: A knowledge base.
C
1
: NT(x), teach(x,y), Co(y) C
2
: teach(x,y), NT(x) func( f, x, y) C
3
: Co(x), NT(y) func( f, y, x)
C
4
: FM(x) FP(x) C
5
: AC(x), BC(x) C
6
: FP(john)
C
7
: teach(john, ai) C
8
: FP(mary) C
9
: AC(x) teach(mary, x)
C
10
: St(paul) C
11
: AC(ai) C
12
: Tp(kr)
C
13
: Tp(lp) C
14
: exam(paul, ai) C
15
: subject(ai, kr)
C
16
: subject(ai, lp) C
17
: expert(john, kr) C
18
: expert(mary, lp)
C
19
: curr(x, z) exam(x, y), subject(y, z), St(x), Co(y), Tp(z)
C
20
: mayDoTh(x, y) curr(x, z), expert(y, z), St(x), Tp(z), FP(y), AC(w),teach(y, w)
C
21
: mayDoTh(x, y) St(x), NFP(y)
I
1
: NFP(x) {FP(x), NT(x)} I
2
: Co(x) ({AC(x)} {BC(x)})
Figure 2: Extended clauses and iff-formulas in the ECLS
F
space representing the knowledge base in Fig. 1.
6 EXAMPLE
Consider the knowledge base in Fig. 1, slightly mod-
ified from (Donini et al., 1998), where (i) the two
columns refer to the structural component and the
relational component and (ii) the two rows refer to
the intensional level and the extensional level. The
structural component is described using the descrip-
tion logic A LC (Baader et al., 2007). The intensional
part of the relational component is described using an
extension of Horn clauses, where class membership
constraints are specified after the symbol ‘&’. This
intensional part provides the conditions for a student
to do his/her thesis with a professor. The query to be
considered is to find every pair of a student s and a
professor p such that s may do his/her thesis with p.
Using standard translation from ALC to first-
order logic (Baader et al., 2007), the knowledge base
in Fig. 1 can be converted into a conjunction of first-
order formulas. With reference to Fig. 2, the ob-
tained formula conjunction can further be converted
into Cs E, where Cs is the clause set consisting of
C
1
C
21
and E = {I
1
, I
2
}. The problem can then be for-
malized as the quadruple form hCs, E, mayDoTh(x, y),
idi, where id is the identity mapping.
At Step 2 of the procedure in Section 3.3, the
above quadruple is successively transformed. Re-
placement using I
1
is applied to C
21
(Theorem 2), and
I
1
is then removed (Theorem 3). Replacement using
I
2
is applied to C
19
(Theorem 2). The transformation
rules mentioned at Step 2c of the procedure are next
applied in the following order: UNF (25 times), RMD
(8 times), SCH, UNF (6 times), RMD, EIS, ESUB (4
times), RESO (3 times), EIS, EIF, ESUB (5 times),
SCH, and ESI. The final clause set consists only of
the two unit clauses (mayDoTh(paul, john) ) and
(mayDoTh(paul, mary) ), from which the answer
set {mayDoTh(paul, john), mayDoTh(paul, mary)} is
derived.
7 CONCLUSIONS
The ET principle provides a basis for solving a very
large class of QA problems. Our proposed ET-
based procedure for solving QA problems is a state-
transition procedure in which a state is a QA problem
and application of an ET rule results in state transi-
tion. Using ET, a given QA problem is transformed
equivalently into simpler forms until its answer set
can be readily obtained. The design of an appropri-
ate representation of the state space, i.e., an appro-
priate form for representing QA problems, is essen-
SolvingQuery-answeringProblemswithIf-and-Only-IfFormulas
343
tial for ET-based problem solving. A triple form of
a QA problem was previously used, where the first
component is a set of extended clauses with function
variables, representing the background knowledge of
the problem, the second component is a query atom,
and the third one is a mapping for converting ground
atoms into elements of an answer set.
The background knowledge of a QA problem of-
ten includes iff-formulas, which are useful for prob-
lem transformation. By introducing a set of iff-
formulas as a new component, this paper proposes a
quadruple form for representing a QA problem. Iff-
formulas in the quadruple form provide higher chance
of transformation with less cost compared to the triple
form. ET rules for using iff-formulas are invented,
i.e., an ET rule for replacement using an iff-formula
and that for removal of a useless iff-formula. Each
transition step by an ET rule preserves the answer set
of a given input problem and, consequently, the cor-
rectness of the proposed procedure with any combi-
nation of ET rules is guaranteed.
REFERENCES
Akama, K. and Nantajeewarawat, E. (2008). Meaning-
Preserving Skolemization on Logical Structures. In
Proceedings of the 9th International Conference
on Intelligent Technologies, pages 123–132, Samui,
Thailand.
Akama, K. and Nantajeewarawat, E. (2011). Meaning-
Preserving Skolemization. In Proceedings of the 3rd
International Conference on Knowledge Engineering
and Ontology Development, pages 322–327, Paris,
France.
Akama, K. and Nantajeewarawat, E. (2012a). A Delayed
Splitting Bottom-Up Procedure for Model Generation.
In Proceedings of 25th Australasian Joint Conference
on Artificial Intelligence, LNCS 7691, pages 481–
492, Sydney, Australia.
Akama, K. and Nantajeewarawat, E. (2012b). Conjunction-
Based Clauses for Equivalent Transformation of
Query-Answering Problems. International Journal of
Future Computer and Communication, 1:5–8.
Akama, K. and Nantajeewarawat, E. (2013a). Correctness
of Solving Query-Answering Problems Using Satis-
fiability Solvers. In Proceedings of the 5th Asian
Conference on Intelligent Information and Database
Systems, LNAI 7802, pages 404–413, Kuala Lumpur,
Malaysia.
Akama, K. and Nantajeewarawat, E. (2013b). Embedding
Proof Problems into Query-Answering Problems and
Problem Solving by Equivalent Transformation. In
Proceedings of the 5th International Conference on
Knowledge Engineering and Ontology Development,
pages 253–260, Vilamoura, Portugal.
Akama, K. and Nantajeewarawat, E. (2013c). Unfolding-
Based Simplification of Query-Answering Problems
in an Extended Clause Space. International Journal
of Innovative Computing, Information and Control,
9:3515–3526.
Akama, K. and Nantajeewarawat, E. (2014). Equiva-
lent Transformation in an Extended Space for Solv-
ing Query-Answering Problems. In Proceedings of
the 6th Asian Conference on Intelligent Information
and Database Systems, LNAI 8397, pages 232–241,
Bangkok, Thailand.
Baader, F., Calvanese, D., McGuinness, D. L., Nardi, D.,
and Patel-Schneider, P. F., editors (2007). The De-
scription Logic Handbook. Cambridge University
Press, second edition.
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.
Horrocks, I., Patel-schneider, P. F., Bechhofer, S., and
Tsarkov, D. (2005). OWL Rules: A Proposal and
Prototype Implementation. Journal of Web Semantics,
3(1):23–40.
Lloyd, J. W. (1987). Foundations of Logic Programming.
Springer-Verlag, second, extended edition.
Minker, J., editor (1988). Foundations of Deductive
Databases and Logic Programming. Morgan Kauf-
mann Publishers Inc., San Francisco, CA, USA.
Motik, B. and Rosati, R. (2010). Reconciling Description
Logics and Rules. Journal of the ACM, 57(30):1–62.
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.
APPENDIX
Transformation rules used in the meaning-preserving
Skolemization procedure proposed in (Akama and
Nantajeewarawat, 2011) for converting a first-order
formula into an equivalent set of extended clauses are
given below, where α, β, γ are first-order formulas,
x, x
1
, . . . , x
n
, y are usual variables, and h is a function
variable.
¬(¬β) β
¬(β γ) ≡ ¬β ¬γ
¬(β γ) ≡ ¬β ¬γ
β γ ≡ ¬β γ
β γ (¬β γ) (¬γ β)
(α β) γ (α γ) (β γ)
¬∀x : α ≡ ∃x : ¬α
¬∃x : α ≡ ∀x : ¬α
(x : β) γ x : (β γ)
(x : β) γ x : (β γ)
x : (β γ) (x : β) (x : γ)
(h : β) γ ≡ ∃h : (β γ)
x
1
···x
n
y : β ≡ ∃hx
1
···x
n
y :
(β ¬func(h, x
1
, . . . , x
n
, y))
KEOD2014-InternationalConferenceonKnowledgeEngineeringandOntologyDevelopment
344