Unfolding Existentially Quantified Sets of Extended Clauses
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:
Unfolding, Extended Clause, Function Variable, Model-intersection Problem, Equivalent Transformation.
Abstract:
Conventional theories cannot solve many logical problems due to the limitations of the underlying clause
space. In conventional clauses, all variables are universally quantified and no existential quantification is
allowed. Conventional clauses are therefore not sufficiently expressive for representing first-order formulas.
To extend clauses with the expressive power of existential quantification, variables of a new type, called
function variables, have been introduced, resulting in a new space of extended clauses, called ECLS
F
. This
new space is necessary to overcome the limitations of the conventional clause space. To solve problems
on ECLS
F
, many equivalent transformation rules are used. We formally defined unfolding transformation on
ECLS
F
, which is applicable not only to definite clauses but also to multi-head clauses. The proposed unfolding
transformation preserves the answers to model-intersection problems and is useful for solving many logical
problems such as proof problems and query-answering problems on first-order logic with built-in constraint
atoms.
1 INTRODUCTION
Conventional clauses are not sufficiently expres-
sive for equivalently representing first-order formulas
since all variables in a clause are universally quanti-
fied and no existential quantification is allowed. In-
stead of the usual clause space, we use an extended
clause space, called the ECLS
F
space, in which
a clause may contain three kinds of atoms: user-
defined atoms, built-in constraint atoms, and func-
atoms. Variables of a new type, called function vari-
ables, appear in the first argument positions of func-
atoms, and they are existentially quantified at the top
level of a clause set under consideration.
A model-intersection problem (MI problem) on
ECLS
F
is a pair hCs,ϕi, where Cs is a set of ex-
tended clauses in ECLS
F
and ϕ is a mapping, called
an exit mapping, used for constructing the output
answer from the intersection of all models of Cs.
More formally, the answer to a MI problem hCs,ϕi
is ϕ(
T
Models(Cs)), where Models(Cs) is the set of
all models of Cs and
T
Models(Cs) is the intersection
of all such models.
Note that we can take the intersection of all ele-
ments of Models(Cs) since each interpretation (hence
each model) is, in our semantics, a set of ground
user-defined atoms, which is similar to a Herbrand
interpretation (Chang and Lee, 1973; Fitting, 1996).
The logical structure theory (Akama and Nantajee-
warawat, 2006; Akama and Nantajeewarawat, 2011a)
has already shown the generality and usefulness of
this semantics.
MI problems on ECLS
F
constitute a very large
class of logical problems, which is of great impor-
tance. Let FOL
c
denote the set of all first-order for-
mulas with built-in constraint atoms. As depicted by
Fig. 1, all proof problems and all query-answering
(QA) problems on FOL
c
are mapped, preserving their
answers, into MI problems on ECLS
F
(Akama and
Nantajeewarawat, 2015). By solving MI problems on
ECLS
F
, we can solve proof problems and QA prob-
lems on FOL
c
.
A proof problem is a “yes/no” problem; it is con-
cerned with checking whether or not one given logi-
cal formula entails another given logical formula. A
QA problem is an “all-answers finding” problem, i.e.,
finding all ground instances of a given query atom
Figure 1: Embedding logical problems into MI problems.
96
Akama, K. and Nantajeewarawat, E.
Unfolding Existentially Quantified Sets of Extended Clauses.
DOI: 10.5220/0006051500960103
In Proceedings of the 8th International Joint Conference on Knowledge Discovery, Knowledge Engineering and Knowledge Management (IC3K 2016) - Volume 2: KEOD, pages 96-103
ISBN: 978-989-758-203-5
Copyright
c
2016 by SCITEPRESS – Science and Technology Publications, Lda. All rights reserved
that are logical consequences of a given formula. The
usual clause space taken by conventional logic pro-
gramming is too small to consider all proof problems
on FOL
c
and all QA problems on FOL
c
. By con-
trast, the ECLS
F
has enough knowledge representa-
tion power for dealing with all these problems. This
is the fundamental reason why we should take the
ECLS
F
space in place of the usual clause space.
A general schema for solving MI problems
on ECLS
F
by equivalent transformation (ET) has
been proposed (Akama and Nantajeewarawat, 2015),
where problems are solved by repeated problem sim-
plification using ET rules. The proposed solution
schema for MI problems comprises the following
steps: (i) formalize a given problem as a MI problem
or map it into a MI problem, (ii) prepare ET rules,
(iii) construct an ET sequence, and (iv) compute the
answer.
This paper proposes unfolding transformation on
the ECLS
F
space, and proves its correctness. Unfold-
ing transformation (also simply called unfolding) has
been one of the most important equivalent transfor-
mation for definite clauses. In contrast to a definite
clause, a clause in ECLS
F
may contain more than one
user-defined atom in its left-hand side and also func-
tion variables in its right-hand side. Unfolding in the
ECLS
F
space therefore requires a new definition and
a new correctness proof.
The rest of the paper is organized as follows: Sec-
tion 2 introduces the extended space with function
variables and the semantics of extended clauses. Sec-
tion 3 formalizes MI problems and provides a solu-
tion method for them based on equivalent transforma-
tion (ET). Section 4 defines occurrence relations and
unfolding transformation. Section 5 shows a correct-
ness theorem for unfolding. Section 6 provides con-
clusions. The proofs of all results presented in this
paper can be found in (Akama and Nantajeewarawat,
2016).
The notation that follows holds thereafter. Given
a set A, pow(A) denotes the power set of A. Given
two sets A and B, Map(A,B) denotes the set of all
mappings from A to B, and for any partial mapping
f from A to B, dom( f) denotes the domain of f, i.e.,
dom( f) = {a | (a A) & ( f(a) is defined)}.
2 AN EXTENDED CLAUSE SPACE
2.1 Built-in Atoms
Built-in atoms are essential for representation of
knowledge using first-order formulas. For instance,
the predicate length may be defined as follows:
length(X,Y) iff (not((X = []) or (Y = 0))
and (not(length(X,Y1)) or
not(Y := Y1+ 1) or
length([A|X],Y))),
where (X = []), (Y = 0), and (Y := Y1+ 1) are built-
in atoms. The meanings of built-in atoms are defined
by specifying the set of all true ground atoms. For
example:
(s = t) is true iff s andt are the same ground terms.
(s := t 1) is true iff s and t are numbers and s is
equal to t 1.
This is different from the semantics of user-defined
atoms. The truth or falsity of a ground user-defined
atom is determined by an interpretation. A ground
user-defined atom g is true with respect to an inter-
pretation I iff g is an element of I.
A first-order formula may determine several mod-
els, and the truth or falsity of a ground user-defined
atom depends on a model under consideration, i.e.,
a ground user-defined atom may be contained in one
model but not in another model. The truth or falsity of
a ground built-in atom is predetermineduniquely. The
objective of representation by first-order formulas is
to determine a set of models, where built-in atoms are
useful and indispensable as shown in the length ex-
ample above.
2.2 Incompleteness of the Usual Clause
Space
Let CLS be the set of all clauses consisting only of
user-defined atoms, and CLS
c
the set of all clauses
consisting of user-defined atoms and built-in atoms.
Corresponding to these, let FOL be the set of all first-
order formulas consisting only of user-defined atoms,
and FOL
c
the set of all first-order formulas consisting
of user-defined atoms and built-in atoms.
It is well-known that there is a mapping SKO such
that each first-order formula in FOL is transformed by
SKO into a set of clauses in CLS preserving satisfia-
bility. This enables resolution-based theorem prov-
ing, and motivates us to consider SKO and CLS as a
foundation for logical problem solving.
However, we need to stress that SKO and CLS
have serious limitations:
SKO does not preserve the logical meanings of
formulas in FOL and those in FOL
c
.
Existential quantification cannot be represented
by clauses in CLS nor those in CLS
c
.
SKO does not preserve satisfiability for FOL
c
.
Unfolding Existentially Quantified Sets of Extended Clauses
97
Thus CLS and CLS
c
are not appropriate for entirely
solving all proof problems, QA problems, and MI
problems on FOL and FOL
c
.
These difficulties are overcome by meaning pre-
serving Skolemization (MPS) and an extended clause
space, called ECLS
F
. In particular:
MPS preserves the logical meanings of formulas
in FOL and those in FOL
c
.
Existential quantification can be represented by
clauses in ECLS
F
.
All proof problems and all QA problems on FOL
and those on FOL
c
can be transformed into MI
problems on ECLS
F
.
2.3 Insufficiency of Conventional Logic
Programming
Most of logic programming research uses subspaces
of CLS
c
, i.e., conventional logic programs are sets of
normal clauses and provide no representation power
of existential quantification. So they can never pro-
vide a general framework of solving logical problems.
Even if a logic programming language (e.g., Pro-
log) is Turing complete, it does not mean that every-
thing can be done using such a language. A pro-
gramming language is said to be Turing complete if
it can be used to simulate any computable function.
Our problem in this paper, however, is not to simulate
procedures, but to invent procedures for giving cor-
rect solutions to MI problems. Such invention is not
an easy task, but once a procedure is invented, a sim-
ulation of it is rather an easy task. Turing complete-
ness means not so large advantages; most practical
programming languages are Turing complete.
2.4 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
be 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,
2011b) 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.
There are two types of variables: usual variables
and function variables. A function variable is instan-
tiated into a function constant or a function variable,
but not into a usual term. Let FVar be the set of all
function variables and FCon the set of all function
constants. A substitution for function variables is a
mapping from FVar to FVarFCon. Each n-ary func-
tion constant is associated with a mapping from G
n
t
to
G
t
, where G
t
denotes the set of all ground usual terms.
2.5 Extended Clauses
An extended clause C is a formula of the form
a
1
,. . . ,a
m
b
1
,. . . ,b
n
,f
1
,. . . ,f
p
,
where each of a
1
,. . . ,a
m
,b
1
,. . . ,b
n
is a user-defined
atom or a built-in constraint atom, and f
1
,. . . , f
p
are
func-atoms. All usual variables occurring in C are
implicitly universally quantified and their scope is
restricted 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. Let userLhs(C) denote the
number of user-defined atoms in the left-hand side of
C. When userLhs(C) = 0, C is called a negative ex-
tended clause. When userLhs(C) = 1, C is called an
extended definite clause. When userLhs(C) > 1, C is
called a multi-head extended clause.
When no confusion is caused, an extended clause,
a negative extended clause, an extended definite
clause, and a multi-head extended clause are also
called a clause, a negative clause, a definite clause,
and a multi-head clause, respectively.
Let DCL denote the set of all extended definite
clauses with no constraint atom in their left-hand
sides. Given a definite clause C DCL, the user-
defined atom in lhs(C) is called the head of C, de-
noted by head(C), and the set rhs(C) is called the
body of C, denoted by body(C). Given D DCL, let
head(D) = {head(C) | C D}.
2.6 An Extended Clause Space
The set of all extended clauses is denoted by ECLS
F
.
The extended clause space in this paper is the power-
set 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. Func-
tion variables in Cs are all existentially quantified and
KEOD 2016 - 8th International Conference on Knowledge Engineering and Ontology Development
98
their scope covers all clauses in Cs. With occur-
rences of function variables, clauses in Cs are con-
nected through shared function variables. After in-
stantiating all function variables occurring in Cs into
function constants, clauses in the instantiated set are
totally separated.
2.7 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
.
A ground clause C = (a
1
,. . . ,a
m
b
1
,. . . , b
n
,
f
1
,. . . ,f
p
) ECLS
F
, where {a
1
,. . . ,a
m
,b
1
,. . . , b
n
}
G
u
G
c
and f
1
,. . . ,f
p
are ground func-atoms, is true
under an interpretation I (in other words, I satisfiesC)
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.
Given Cs ECLS
F
and a substitution for function
variables σ Map(FVar,FVar FCon), let Csσ =
{Cσ | C Cs}, i.e., Csσ is the clause set obtained
from Cs by instantiating all function variables appear-
ing in it using σ.
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.
Let Models be a mapping that associates with each
clause set the set of all of its models, i.e., Models(Cs)
is the set of all models of Cs for any Cs ECLS
F
.
Note that the standard semantics is taken in this
paper, i.e., all models of a formula are considered in-
stead of specific ones, such as those considered in the
minimal model semantics (Clark, 1978; Lloyd, 1987)
(i.e., the semantics underlying definite logic program-
ming) and those considered in the stable model se-
mantics (Gelfond and Lifschitz, 1988; Gelfond and
Lifschitz, 1991) (i.e., the semantics underlying an-
swer set programming).
3 SOLVING MI PROBLEMS BY
EQUIVALENT
TRANSFORMATION (ET)
3.1 MI Problems on ECLS
F
A model-intersection problem (for short, 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 exit mapping. The answer to
this problem, denoted by ans
MI
(Cs,ϕ), is defined by
ans
MI
(Cs,ϕ) = ϕ(
\
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
.
Example 1. Assume that Cs consists of the following
four clauses:
pat(oe)
prob(io), pat(po)
prob(io) pat(po)
prob(oe) pat(po)
Consider a MI problem hCs,ϕi, where for any G
G
u
, ϕ(G) = {x | prob(x) G}. Obviously,
M
1
= {pat(po), prob(io), prob(oe), pat(oe)} is a
model of Cs, and
M
2
= {prob(io), pat(oe)} is also a model of Cs.
Moreover, for any M G
u
, M is a model of Cs iff
there exists M
0
G
u
such that
1. M = M
0
M
1
or M = M
0
M
2
, and
2. pat(po) / M
0
.
So
T
Models(Cs) = {prob(io), pat(oe)}. Therefore
ans
MI
(Cs,ϕ) = {io}.
3.2 Target Mappings
Given a MI problem hCs,ϕi, since ans
MI
(Cs,ϕ) =
ϕ(
T
Models(Cs)), the answer to this MI problem is
determined uniquely by Models(Cs) and ϕ. As a re-
sult, we can equivalently consider a new MI problem
with the same answer by switching from Cs to another
clause set Cs
if Models(Cs) = Models(Cs
), i.e., MI
problems can be transformed into simpler forms by
equivalent transformation (ET) preserving the map-
ping Models.
In order to use more partial mappings for simpli-
fication of MI problems, we extend our consideration
from the specific mapping Models to a class of partial
mappings, called GSETMAP, defined below.
Unfolding Existentially Quantified Sets of Extended Clauses
99
Definition 1. GSETMAP is the set of all partial map-
pings from pow(ECLS
F
) to pow(pow(G
u
)).
As defined in Section 2.7, Models(Cs) is the set
of all models of Cs for any Cs ECLS
F
. Since a
model is a subset of G
u
, Models is regarded as a total
mapping from pow(ECLS
F
) to pow(pow(G
u
)). Since
a total mapping is also a partial mapping, the map-
ping Models is a partial mapping from pow(ECLS
F
)
to pow(pow(G
u
)), i.e., it is an element of GSETMAP.
A partial mapping M in GSETMAP is of par-
ticular interest if
T
M(Cs) =
T
Models(Cs) for any
Cs dom(M). Such a partial mapping is called a tar-
get mapping.
Definition 2. A partial mapping M GSETMAP is a
target mapping iff for any Cs dom(M),
T
M(Cs) =
T
Models(Cs).
It is obvious that:
Theorem 1. The mapping Models is a target map-
ping.
The next theorem provides a sufficient condition
for a mapping in GSETMAP to be a target mapping.
Theorem 2. Let M GSETMAP. M is a target map-
ping if the following conditions are satisfied:
1. M(Cs) Models(Cs) for any Cs dom(M).
2. For any Cs dom(M) and any m Models(Cs),
there exists m
M(Cs) such that m
m.
3.3 Answer Mappings
A set of problems that can be solved at low cost is
useful to provide a desirable final destination for ET
computation. It can also be specified as a partial map-
ping that is preserved by ET. Such a specification is
useful to invent and to justify a new ET rule. This
motivates the concept of answer mapping, which is
formalized below.
Definition 3. Let W be a set. A partial mapping A
from
pow(ECLS
F
) × Map(pow(G
u
),W)
to W is an answer mapping iff for any hCs,ϕi
dom(A), ans
MI
(Cs,ϕ) = A(Cs,ϕ).
If M is a target mapping, then M can be used for
constructing answer mappings.
Theorem 3. Let M be a target mapping. Suppose that
A is a partial mapping such that
dom(M) = {x | hx, yi dom(A)}, and
for any hCs,ϕi dom(A),
A(Cs,ϕ) = ϕ(
\
M(Cs)).
Then A is an answer mapping.
3.4 ET Steps and ET Rules
Next, a schema for solving MI problems based on ET
preserving answers is formulated.
Let STATE be the set of all MI problems. Elements
of STATE are called states.
Definition 4. Let hS,S
i STATE × STATE. hS,S
i is
an ET step iff if S = hCs,ϕi and S
= hCs
,ϕ
i, then
ans
MI
(Cs,ϕ) = ans
MI
(Cs
,ϕ
).
Definition 5. A sequence [S
0
,S
1
,. . . ,S
n
] of ele-
ments of STATE is an ET sequence iff for any i
{0,1, . . . ,n 1}, hS
i
,S
i+1
i is an ET step.
The role of ET computation constructing an ET
sequence [S
0
,S
1
,. . . ,S
n
] is to start with S
0
and to reach
S
n
from which the answer to the given problem can be
easily computed.
The concept of ET rule on STATE is defined by:
Definition 6. An ET rule r on STATE is a partial
mapping from STATE to STATE such that for any
S dom(r), hS,r(S)i is an ET step.
We also define ET rules on pow(ECLS
F
) as fol-
lows:
Definition 7. An ET rule r with respect to a target
mapping M is a partial mapping from pow(ECLS
F
) to
pow(ECLS
F
) such that for any Cs dom(r), M(Cs) =
M(r(Cs)).
We can construct an ET rule on STATE from an
ET rule with respect to a target mapping.
Theorem 4. Assume that M is a target mapping and
r is an ET rule with respect to M. Suppose that ¯r is a
partial mapping from STATE to STATE such that
dom(r) = {x | hx,yi dom(¯r)}, and
¯r(S) = hr(Cs), ϕi if S = hCs,ϕi dom(¯r).
Then ¯r is an ET rule on STATE.
3.5 A Correct Solution Method based
on ET Rules
A MI problem hCs,ϕi, where Cs ECLS
F
and ϕ is
an exit mapping, can be solved as follows:
KEOD 2016 - 8th International Conference on Knowledge Engineering and Ontology Development
100
Figure 2: ET computation paths constructed by a combina-
tion of target mappings and answer mappings.
1. Let A be an answer mapping.
2. Prepare a set R of ET rules on STATE.
3. Take S
0
such that S
0
= hCs, ϕi to start computa-
tion from S
0
.
4. Construct an ET sequence [S
0
,. . . ,S
n
] by applying
ET rules in R, i.e., for each i {0,1, . ..,n 1},
S
i+1
is obtained from S
i
by selecting and applying
r
i
R such that S
i
dom(r
i
) and r
i
(S
i
) = S
i+1
.
5. Assume that S
n
= hCs
n
,ϕ
n
i. If the computation
reaches the domain of A, i.e., hCs
n
,ϕ
n
i dom(A),
then compute the answer by using the answer
mapping A, i.e., output A(Cs
n
,ϕ
n
).
Given a set Cs of clauses and an exit map-
ping ϕ, the answer to the MI problem hCs,ϕi, i.e.,
ans
MI
(Cs,ϕ) = ϕ(
T
Models(Cs)), can be directly ob-
tained by the computation shown in the leftmost path
in Fig. 2. Instead of taking this computation path, the
above solution takes a different one, i.e., the lowest
path (from Cs to Cs
) followed by the rightmost path
(through the answer mapping A) in Fig. 2.
The selection of r
i
in R at Step 4 is nondeterminis-
tic and there may be many possible ET sequences for
each MI problem. Every output computed by using
any arbitrary ET sequence is correct.
Theorem 5. When an ET sequence starting from S
0
=
hCs,ϕi reaches S
n
in dom(A), the above procedure
gives the correct answer to hCs,ϕi.
4 UNFOLDING ON ECLS
F
4.1 Occurrence Relations
For definite-clause unfolding, a body atom in a target
clause is specified for unification with each head atom
in a set of definite clauses. An atom occurrenceis usu-
ally used for such specification, which is generalized
into an occurrence relation defined below.
Given Cs ECLS
F
, a subset occ of Cs×A
u
is said
to be an occurrence relation on Cs iff for any C Cs,
if hC,bi occ, then b rhs(C).
Assume that occ is a given occurrence relation
on Cs. Let dom(occ) = {C | hC,bi occ} and
ran(occ) = {b | hC,bi occ}. Let gran(occ) be de-
fined as the set
{bθ | (hC,bi occ) &
(θ is a substitution for usual variables) &
(bθ is ground)}.
For any clause C, let occ(C) = {b | hC,bi occ}.
Example 2. Assume that Cs consists of the following
clauses:
C
1
: p
6
, p
4
C
2
: p
5
, p
4
C
3
: p
4
, p
1
C
4
: p
1
, p
2
C
5
: p
3
p
6
C
6
: p
4
C
7
: p
2
p
5
, p
3
Let occ = {hC
4
, p
2
i}. Then occ is an occurrence rela-
tion on Cs, with dom(occ) = {C
4
}.
4.2 Unfolding Operation on ECLS
F
An unfolding operation for a clause set Cs by using
an arbitrary set D of definite clauses is defined below.
For unfolding to preserve answers to MI problems,
some additional conditions on Cs, D, and a specified
occurrence relation are required. They will be given
in Section 5 (Theorem 6).
Assume that
Cs ECLS
F
,
D is a set of definite clauses in DCL, and
occ is an occurrence relation on Cs.
By unfolding Cs using D at occ, Cs is transformed
into UNF(Cs,D,occ), which is defined by
UNF(Cs,D, occ) = (Cs dom(occ))
Reso(dom(occ),D, occ),
Unfolding Existentially Quantified Sets of Extended Clauses
101
where Reso(dom(occ),D,occ) is the set
S
{resolvent(C,C
,b) | (C dom(occ)) & (C
D) &
(b occ(C))},
and for any C dom(occ), any C
D, and any
b occ(C), 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, 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
ρ):
(a) lhs(C
′′
) = lhs(Cθ)
(b) rhs(C
′′
) = (rhs(Cθ) {bθ}) body(C
ρθ)
5 CORRECTNESS THEOREM
5.1 Correctness of Unfolding
We provide in Theorem 6 a sufficient condition for
unfolding to preserve the answer to a MI problem.
Given Cs ECLS
F
, let gleft(Cs) denote the set of
all ground instances of user-defined atoms in the left-
hand sides of extended clauses in Cs.
Theorem 6. Assume that:
1. Cs ECLS
F
.
2. D Cs DCL such that
gleft(D) gleft(Cs D) = .
3. occ is an occurrence relation on Cs such that
dom(occ) Cs D.
4. gran(occ) gleft(Cs D) = .
5. ϕ is an exit mapping.
Then ans
MI
(Cs,ϕ) = ans
MI
(UNF(Cs,D,occ),ϕ).
Given a set Cs of extended clauses, one way to
apply unfolding is as follows:
1. Select a clause C in Cs.
2. Select an atom b in the right-hand side of C.
3. Assuming that p is the predicate of the selected
atom b, determine the set D consisting of all
clauses in Cs that contain p-atoms in their left-
hand sides.
4. If C / D and D consists only of definite clauses,
then unfold Cs with respect to b using D into Cs
,
i.e., make Cs
= UNF(Cs,D,occ), where occ =
{hC, bi}.
According to Theorem 6, this unfolding transforma-
tion is equivalent transformation.
Example 3. Consider the clause set Cs and the
clauses C
1
C
7
in Example 2. Unfolding can be ap-
plied successively to this clause set as follows:
By unfolding Cs with respect to p
2
in C
4
using
D = {C
7
}, we obtain Cs
1
= (Cs {C
4
}) {C
4
},
where C
4
= ( p
1
, p
5
, p
3
).
By unfolding Cs
1
with respect to p
3
in C
4
using
D
= {C
5
}, we obtain Cs
2
= (Cs
1
{C
4
}){C
′′
4
},
where C
′′
4
= ( p
1
, p
5
, p
6
).
By unfolding Cs
2
with respect to p
3
in C
7
using
D
= {C
5
}, we obtain Cs
3
= (Cs
2
{C
7
}) {C
7
},
where C
7
= (p
2
p
5
, p
6
).
The resulting set Cs
3
contains the following clauses:
C
1
: p
6
, p
4
C
2
: p
5
, p
4
C
3
: p
4
, p
1
C
′′
4
: p
1
, p
5
, p
6
C
5
: p
3
p
6
C
6
: p
4
C
7
: p
2
p
5
, p
6
No further application of unfolding is possible to the
clause set Cs
3
.
5.2 Target Mapping MM
The answer preservation of a given MI problem by
unfolding comes from the preservation of a target
mapping, called MM, which is given as follows:
Given a set Cs of extended clauses, MM(Cs) is the
set of all the least models of D(σ, sel,Cs) such that
σ is a possible function-variable instantiation and sel
is a possible head-atom selection function, where
D(σ,sel,Cs) is the set of all ground definite clauses
obtained by
1. applying the function-variable instantiation σ to
clauses in Cs,
2. instantiating the resulting clauses by using all pos-
sible usual-variable instantiations,
3. simplification of the instantiated clauses, and
4. applying the head-atom selection function sel to
the resulting simplified clauses.
The precise definition of MM can be found in (Akama
and Nantajeewarawat, 2016).
KEOD 2016 - 8th International Conference on Knowledge Engineering and Ontology Development
102
To illustrate, suppose that Cs consists of the fol-
lowing three clauses:
taxcut(x) hc(x,y),hc(x,z),(y 6= z)
hc(Peter, Paul)
hc(Peter, x) func( f,x)
Then MM(Cs) is the union of
{{hc(Peter, Paul),hc(Peter,t),taxcut(Peter)}
| (t is a ground term) & (t 6= Paul)}
and {{hc(Peter, Paul)}}.
6 CONCLUSIONS
The usual clause space has been extensively em-
ployed to compute the answers to proof problems and
QA problems on first-order logic. However, it has
not been successfully used for larger classes of proof
problems and QA problems. A fundamental reason
is the incompleteness of its representation power of
existential quantification.
Considering the representation power of built-in
constraint atoms and existential quantification, we
take the ECLS
F
space. The ECLS
F
space is sufficient
for representing all proof problems on FOL
c
and all
QA problems on FOL
c
. MI problems on FOL
c
consti-
tute a large class of logical problems that can integrate
all proof problems on FOL
c
and all QA problems on
FOL
c
.
Equivalent transformation is a general principle
for solving MI problems on ECLS
F
, where many
equivalent transformation rules (ET rules) are used.
Many solution algorithms and procedures will be de-
veloped by inventing new ET rules. In the usual
space, unfolding has been one of the most important
and most often used ET rules. It is natural to try to ex-
tend unfolding rules used in the definite-clause space
into unfolding on the ECLS
F
space.
The basic differences between the two spaces are
as follows: A clause in the ECLS
F
space may con-
tain (i) more than one atom in its left-hand side and
(ii) function variables in its right-hand side. We pro-
posed an unfolding operation that can be applied in
the ECLS
F
space, which avoids the influence of non-
definite clauses in a given clause set Cs. A set D of
definite clauses in Cs is selected and used for unfold-
ing at specified target atoms. The predicates appear-
ing in the heads of definite clauses in the selected set
D are required not to appear in the left-hand sides of
clauses outside D.
In this paper, we also have reported a correctness
theorem for unfolding transformation on the ECLS
F
space. The proof is given in (Akama and Nantajee-
warawat, 2016) and is based on preservation of the
target mapping MM. The preservation of MM im-
plies, with an unchanged exit mapping, the preserva-
tion of the answer to a given MI problem.
ACKNOWLEDGEMENTS
This research was partially supported by JSPS KAK-
ENHI Grant Numbers 25280078 and 26540110.
REFERENCES
Akama, K. and Nantajeewarawat, E. (2006). Logical Struc-
tures on Specialization Systems: Formalization and
Satisfiability-Preserving Transformation. In Proceed-
ings of the 7th International Conference on Intelligent
Technologies, pages 100–109, Taipei, Taiwan.
Akama, K. and Nantajeewarawat, E. (2011a). Construction
of Logical Structures on Specialization Systems. In
Proceedings of the 2011 World Congress on Informa-
tion and Communication Technologies, WICT 2011,
pages 1030–1035, Mumbai, India.
Akama, K. and Nantajeewarawat, E. (2011b). 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. (2015). A General
Schema for Solving Model-Intersection Problems on a
Specialization System by Equivalent Transformation.
In Proceedings of the 7th International Joint Confer-
ence on Knowledge Discovery, Knowledge Engineer-
ing and Knowledge Management (IC3K 2015), Vol-
ume 2: KEOD, pages 38–49, Lisbon, Portugal.
Akama, K. and Nantajeewarawat, E. (2016). Unfolding Ex-
istentially Quantified Sets of Extended Clauses. Tech-
nical report, Information Initiative Center, Hokkaido
University.
Chang, C.-L. and Lee, R. C.-T. (1973). Symbolic Logic and
Mechanical Theorem Proving. Academic Press.
Clark, K. L. (1978). Negation as Failure. In Gallaire, H.
and Minker, J., editors, Logic and Data Bases, pages
293–322. Plenum Press, New York.
Fitting, M. (1996). First-Order Logic and Automated The-
orem Proving. Springer-Verlag, second edition.
Gelfond, M. and Lifschitz, V. (1988). The Stable Model
Semantics for Logic Programming. In Proceedings
of International Logic Programming Conference and
Symposium, pages 1070–1080. MIT Press.
Gelfond, M. and Lifschitz, V. (1991). Classical Negation
in Logic Programs and Disjunctive Databases. New
Generation Computing, 9:365–386.
Lloyd, J. W. (1987). Foundations of Logic Programming.
Springer-Verlag, second, extended edition.
Unfolding Existentially Quantified Sets of Extended Clauses
103