Optimization and Relaxation in Constraint Logic Languages

Transcription

Optimization and Relaxation in Constraint Logic Languages
Optimization
Kannan
Dept.
and Relaxation
Govindarajan
of
Computer
SUNY
at
Buffalo,
Bharat
Science
Dept.
Buffalo
NY
govin-ktlcs.
f alo.
edu
Computer
SUNY
at
NY
bharat@cs
and
naturall~
arise
e.g.,
engineering
objective
In
be difficult
the
in finding
tribution
of this
14260
paper
optimization
we can
specify
criteria
for
logic
the
use for preference
of relaxation
Essentially,
each
program,
mined
by
the
also
and
as truth
well
as correctness
cept
of preference
lating
optimization
the
function.
strongly
over
these
provides
as well
the
worlds,
conclusion
a unifying
as relaxation
while
suboptimal
for
they
provide
for
for
ribution
the
in practice,
the
best
[10,
11].
While
2) have
been
proposed
do not
optimization
comparing
one—and
logic
thereprogram-
several
approaches
in the
provide
and
of our
paper
relaxing
require
constraint
flexibility
of this
We
present
work
for
literature
a unified,
relaxation,
proposed
log-
nor
approach.
do
The
is t we-fold:
a principled
problems.
specify
in a modular
and
the
for
using
the
for
relaxation.
franleand
criteria
is called
to
is to be opas well
is to be relaxed
preference,
re-
constructs
optimization,
These
of
CLP
predicate
predicate
paradigm
gramming
logical
which
criterion
of the
optimization
provide
way
concept
programming
con-
We
(optimization)
criterion
as
specifying
laxation
which
extension
declaratively
timized
be
relaxation
framework
the
by
if
is inter-
are important
standard
of both
one
themselves.
they
they
to
and,
constraints
choosing
problems,
set-
its
relax-
the
the
these
solutions
function;
either
the
relaxation
framework
treatment
worlds.
is that
(CLP)
ical
logic:
then
outside
optimal
to obtain,
solutions
and
interactive
In
objective
operations—as
solutions
fall
to some
and
these
is deter-
can
they
the
tech-
applications,
layout,
are impossible
meta-level
practical
various
support.
finding
or by relaxing
optimization
com
are
in
document
suboptimal
function
to address
constraints
worlds
in finding
are
relaxation
decision
in
solutions
in section
tout
We
discuss
semantics
Optimization
semantics
Our
facilities
modal
optimal
14580
xerox.
arising
and
respect
(discussed
semantics
from
for
optimal
operational
results.
and
model-theoretic
a model
pred-
manner.
goal,
in suitably-defined
an
with
possible-worlds
is
ming
and
preference
a natural
concepts
an ordering
in
truth
present
in
program
objective
becomes
Our
fore
use for
to these
P L P paradigm
on simple
world
logic
of the
We
I elaxation.
stating
with
alternative
in PL P we can
solutions
in
they
is
predicates,
by
of a relaxation
is based
a preference
optimal
problems
concept
Essentially,
is interested
one
While
framework
as optimization
tings
ested
and
design,
scheduling,
Technology
Approach
problems
engineering
objective
con-
framework
its
solving
graphics,
the
a constraint
and
as
and
optimization
for
constraints
relaxing
The
in
proposed
function
an
we are
by either
(PLP),
in [8].
the
hence
a logical
Our
to
solutions
function.
relaxation
programming
extends
and
objective
and
the
relaxation
the
obtain,
in providing
objective
paper
to formulate
ation
lies
optimal
solutions,
the
predicates
determining
icat es. This
introduce
to
respect
Motivation
such
In
(i.e.,
NY
mantha@wrc.
Constraint
etc.
optimal
with
applications,
language.
certain
expressed
many
was discussed
designate
constraints
optimization
preference
support,
the
&
Corporation
Webster,
edu
niques
constraints,
Mantha
Research
Xerox
buffalo.
operations
involving
decision
suboptimal
programming
called
of
or relaxing
performing
important
in finding
or impossible
constraints
logic
scheduling,
a set
function.
interested
for
to
two
applications
we are interested
solutions
may
are
inmany
design,
optimization,
best)
relaxation
Corporate
Buffalo
1
Optimization
Languages
Surya
Science
Abstract
that
Logic
Jayaraman
of
Buffalo,
14260
buf
in Constraint
are
hence
as
and
the
understood
the
preference
resulting
logic
pro-
(PLP).
formuWe formalize
problems.
give
a possible-worlds
each
solutions.
from
the
among
truth
following
semantics
stands
The
ordering
for
among
Optimization
strongly
optimal
in suitably-defined
illustrate
CLP
worlds,
our
clauses
P as a path
(list
graph:
the
modal
for
a PLP
logic.
subset
in
of feasible
worlds-determined
conveys
the
is
expressed
then
while
with
ordering
relaxation
programming
predicate
of edges)
We
program
suboptimal
proposed
for
of optimization
from
a certain
preferences—explicitly
X to Y in a directed
91
semantics
concepts
world
truth
We briefly
computes
using
solutions.
in
comes
The
declarative
relaxation
which
Permission to make dtgital/hard
copies of all or part of this material for
persoml or classroom use is grsnted without fee provided that the copies
are not made or dkitributed for profit or commercial advantage, the copyright notice, the title of the publication and its date appear, and notice is
given that copyright is by permission of $s ACM, Inc. To copy otherwise,
to republish, to post on servera or to redwtribute to lists, mquirws specific
permission andlor fee.
POPL ’96, St. Petersburg
FLA USA
@ 1996 ACM
&89791 .769_3/95/01
..$3.50
the
and
path
cost,
as
be-
worlds.
constructs.
(X, Y, C, P)
C from
node
path(X,Y,C,
[e(X,Y)])
path(X,Y,Cl+C2,
+
edge(X,Y,C).
[e(X,Z)lLl])
variation
*
the
edge(X,Z,Ci),
path(Z,Y,C2,Ll).
illustrate
ical
the
constructs
specification
as follows
section
of the
(we
for
optimization
shortest-path
present
another
in
PLP,
problem
solution
to
can
this
be given
problem
and
worlds.
path(X,Y,C,P).
<
sh.path(X,Y,C2,p2)
sh_path(X,Y,Cl,Pl)
of
Section
=
programs
C’2 < cl.
tions,
of the
of
a program,
terms
states
the
PLP
to
compute
3 presents
i.e.,
of
main
of
truth
in
the
4 gives
the
preferential
results,
optimal
semantics
of PLP
(PTSLD)
deriva-
SLD
correctness
of
show
strongly
operational
Pruned-Tree
the
opti-
syntax
to
Section
terms
Sec-
to
the
examples
in
the
as follows:
approaches
paradigm.
PLP
5 provides
in
related
paradigmatic
semantics
consequences
-
with
Section
several
flexibility
declarative
for
is organized
work
relaxation.
and
power
in
our
and
programs
semantics
consequences.
ofthispaper
2 compares
mization
a log-
?):
sh-path(X,Y,C,P)
operational
preferential
Therernainder
tion
To
of the
relaxed
and
outlines
their
proofs.
Thefirst
is
clauseis
called
an
solutions
use
clause
s
inpath
(c,
cluery
troduce
an
with
lesser
given
cost
as ‘is less preferred
definition
of sh_path
between
not
fully
goat
to
b that
our
b pass
no
answer.
solve
PLP,
over
sup-
our
does
for
area
how
we in-
icates
in CLP
languages
The
goal
that
timization
st,ated
after
best
follows
the
keyword
RELAX
and
the
criterion
for
goal,
intended
the
WRTkeyword
meaning
of the
solutionsto
then
are
wise,
the
intended
sible
solution
the
notinpath(c,
sh-path(a,
b, C,P)
solutions
that
negation;
PLP
to
clauses
of
the
worlds
is determined
in
preferential
the
strongly
and
space.
This
is
truth
for
relaxation
goals,
the
relaxation
criterion
worlds
that
notion
of
in the
vide
we
do
effectively
not
operat~onal
and
show
The
operational
that
SLD
a program
timization
for
our
preferences
We
optimization
introduce
the
and
results
we first
definitions
and
giv
with
for
which
and
the
ate
for
such
a
92
a total
a class
as the
with
for
semantics
of a least
aggregate
kth-best
operators
using
give
extended
negation,
namely,
the
theorem,
fixed-point
22]
that
valid
for
provide
includes
models
setwo
and
Ross
is a complete
et al [21,
solution,
examined
To
[6].
Tarski’s
can
There
operations,
where
is performed
Sudarshan
of
with
models
By
that
[13]
they
aggregation
is monotonic.
existence
aggregate
Stuckey
that
equiv-
[23]
aggregation.
stable
aggregation
first-order
procedure.
general
ag-
has an
showed
model
programs
a confor
Ganguly
and
the
and
notion
ma.z) in
has been
negation.
aggregation,
for
to the
semantics
fixed-point
through
and
the
using
Kemp
models
operation.
both
operations
well-founded
in more
etc.
semantics
the
there
aggregates
a greedy
programs
program
is that it
solutions,
as mzn and
the
conditions,
recursion
[20] provide
the
of formalizing
aggregate
formulation
interest
sum,
guaranteed
the
peruse
been
over
such
fisrt-order
has
count,
func-
negation-based
related
where
providing
with
using
well-founded
pro-
in
mouotonicity
well-known
truth
of theopthen
program
mantics
in terms
To compute
first-order
programs
are obtained.
of a program,
be relaxed,
to
also
equivalent
alent
be ex-
program
approach
among
(such
databases,
A program
certain
the
is closely
operations
interest
gregation.
such
relaxation,
is given
derivations.
on the
must
those
We
of deductive
under
can
of optimization
of our
ordering
way
prefercontrast,
objective
semantics
direct
of optimization
recent
has also
so-
and
approach
In
to
with
by
with
the
that
programmer
the
our
hand,
some
CornDared
aggregate
be computed
worlds
best
for
refer
worlds.
in
provide
the
the
but
se-
relaxation.
et al [5] considered
logical
To
only
to
the
truth
with
to determine
correctness
transformation
or
worlds.
of optimization
(PTSLD)
that
constrast
all
criterion.
consequences
predicates
in
in
def-
among
field
of
at
the
predicates
predicates
the
in a simple
pred-
discuss
program
minimizing
solutions
notion
siderable
are interested
a program,
conseqrsence
appropriate
preferential
We
optimal
semantics
of Pruned-Tree
form
this
strongly
semantics
ordering
we consider
relax
rekmedpr-efererztial
corresponding
relaxed
satisfy
the
the
application
or
a partial
semantics
into
to
dis-
optimization
feature
optimization
and
of first-order
in terms
for
as
a CLP
to
[18]
with
programmer
the
[16]
into
optimization
Stuckey
programs
predicates
via ne~ation,
results
Our
show
constraint
PLPisgiven
suit
Stuckey
on Kunen-Fitting’s
and
et al [4] allow
optimization
il-
also
of
is a model
of
satisfying
thus
for
and
semantics
lution:
notion
preferences.
to
example
We
as well
a query
for
distinguishing
the
among
which
op-
the
world
program,
refers
This
the
key
of
approaches
[18, 3, 4], the advantage
gives an explicit
treatment
of the
that
finding
based
logic
provide
is rmovided
the
advantages
queries
solutions
optimization
to
Fages
ordering
fea-
constraint
then
the
the
with
a unified
offers
and
a semantics
as maximizing
tion.
Maher
Marriott
allows
3] only
pressed
Other-
treating
it
criteria
[18,
The
[24].
each
worlds.
which
by
the
The
that
ence
is
If the
restricting
relaxation.
consequences
optimal
consequence
and
semantics
the
to’).
goal.
additional
subsumes
by
by
,b, C, P)
satisfy,
in HCLP
where
goal
(c,P),
relaxation
restricted
mocleLtheoretic
worlds
respect
is as follows:
got
preference
paradigm
this
goal
sh-.path(a
this
defined
of posszble
inite
are
we call
relcsxationas
The
solutions
has
relaxing
the
of constraint
negation.
is
be someop-
as ’with
the
P) as an
in
what
the
to
of
must
)satisfynotinpath
solutions
space
predicate
timal
(read
relaxation
sh_path(a,b,C,P
those
lustrates
WRT notinpath(c,p)
also
optimization
mapping
translating
sh_path(a,b,C,P)
incorporate
[3] describes
mantics
RELAX
either
provided
a programming
of optimization,
to
by
for
from
dealt
not
viewpoint.
Fages
as
have
have
aDrxoach
..
both
order;
problem,
but,
Our
system
If
follows:
?-
both.
c, the
objective:
Hence
approaches
approaches
In the
not
related
or relaxation
these
cuss
through
stated
earlier,
semantic
to
sh-path(a,b,C,P),
a and
we obtain
a relaxat~orz
?-
accomplish
between
and
a and
query
noted
framework
above
the
Work
optimization
than’.
use the
path
Related
As
two
is preferred.
in
that
2
the
arbiter
relaxation
paths
fails
is called
for optimization:
one
fe~sible
(hence
for
will
P)
shortest
of
path
constructs
to
Note
andshmath
space
for
clause
criterion
shortest
c.
clause,
Its
solutions
second
the
the
the
go through
above
the
we want
compute
the
The
is to be read
illustrate
that
of the
sh.path,
symbol
all
subset
it states
for
To
not
predicate.
clause).
and
solutions
pose
anorhimization
is some
of a —
The
called
optimization
Sa-
domain
lattice
we are
the
aggreg-
semantics
operations
for
normal
programs.
the
Our
user
In the
laxable
area
Clauses,
with
partial
relaxed
ever,
if all
the
goals
the
relaxation
of goals
local
ness for
our
to
propose
Hierarchical
constraint
may
required,
strong,
a clause,
mining
how
notion
those
optimization
Our
or preference
formulation
benefits
modularity,
tation.
and
We
paper,
is beyond
that
this
paper
latter
only
treats
initial
formulation
relaxation
as top
of this
our
earlier
(not
goals.
a more
This
paper
in
the
<
p is
an
The
3.1
A
PLP
preference
two
logic
parts:
form
of the
Ll,
order
theory
of two
1.
program
not
our
the
where
an
straint
permit
consists
of clauses
H
-
BI,
. . . . B~,
B,
is of the
form
clauses.
11] that
plicable
of the
Moreover,
three
to
earlier
work
P(5
of
that
be
of only
a,p-
clause
satisfied
definite
in
clauses
of at least
or
one
such
a D-predtcate.
O-predicates.
(D
)
program,
the
. . ..Ln
which
spec-
O-predicates,
has
(n>
and
each
L,
or a constraint
states
that
o)
is
an
as in
p(i)
atom
whose
In
essence
CLP.
is less preferred
thcm
has
the
form
The
can
c(ii),
O-predicate
as in CLP.
and
relaxation
also
captures
The
the
only
deal
with
program
sists
definitions
A consists
goals
terms
of the form
of the
arbiter
clauses
c is any
in the
and
in
the
c is
body
query.
(Tc,
in
where
of
A pref-
TO, A)
e-predicates,
of the O-predicates
paper
However,
goals
appear
of
this
where
of p.
relaxation
may
definition
of the
in
or in a toplevel
is a triple
up of the
of the
goal
a D-predicate
a con-
criterion
provided
in
or
to be a relaxable
relaxation
of relaxation
defined
A relaxation
logic
p is said
semantics
meaning
TG is made
c is a C-predicate
to be the
The
is not
we will
O-predicate,
and
and
predicate
c is said
goal.
that
paper,
erence
of as cent aining
of which
must
body
for
arbiter
p is an
the
an
PLP
an arbiter.
each
the
logic
WRT
O-predicate
where
To
con-
D-predicates,
program.
first-
have
one
Programming
3.2
lNote
the
where
In
I II
Paradigms
must
[10,
some
of the
be satisfied
present
relaxation
in
and
f is a
programming,
followed
by
B,s
could
tic.
consider
a preference
11].
(l)m
for
>
O), i.e.,
this
clause
are to be read
We
opt2-
the
existentially
the
also
parat
as in CLP
in
to be ap-
use
show
symbols
depending
on
can
the
be
kinds
partitioned
of c~auses
into
used
variables
that
appear
quantified,
not
intended
meamng
of this
clause
IS that
head IS some subset
of the set of solutmns
only
on
universally
the
to
set
the
the
RHS of the
quantified
of solutlons
body
to
The
the
93
of
how
We
the
and
goals)
finally
examples
first
arbiter
ors for constraint,
PLP,
laxation
as antecedents
representative
PLP.
then
nt’’.shortespathth
predicate
sets
We
trates
. . . . CI are constraints
; they
We now
Each
clauses.
p is a predicate
general,
I,. . . ,Bm,
CI,
a goall
definite
them:
that
are
O), i.e.,
implication.
disjoint
to define
p(i)
Cl
mtzat~on
>
as in CLP
H-Cl,...,
[10,
(n
of terms.
be constraints
clause
and
opti-
inst ante
of an optimization
criterion
goal
predicate
permitted
of optimization
be thought
of the
the
forms:
sequence
2.
may
theory
for
. . ..L~.
RELAX
we
Framework
a first-order
ground
constraints
and
O-predicate
O-predicate
A relaxation
this
We gave
did
in
in
from
p(ii)-Ll,
a C-predicate,
Paradigms
body
of a preference
is a C-predicate
this
this
Programming
The
in the heads
optimization
each
instance
to be reduced.
goal
an
the
corresponding
guard
H
optimization
For
a candidate
is true.
I in the
derzveri
part
is
the
as the
head
of only
of form:
p(ti)if
relaxation.
3
G’-
imple-
[8] in that
account
for
for
where
the
Finally,
were
extends
comprehensive
to
stands
p(i)
than
detail
paper.
they
the
is either
clauses
support
(efficient
[9] which
clauses;
before
referred
clause
the
heads
clause,
head
clause
appear
the
offers
relaxation).
in
of
other
implemen-
in
work
of the
one
arbiter
providing
efficient
point
clauses
only
to capture
powerful
relaxation
an
of definite
contain
optimization).
provided
at least
ifies
that
a general
points
scope
of relaxation
level
in providing
to
last
bodies
show
the
D-predicates
The
in the
for
and
and
head
of the
extends
in
of
constraints
semantics,
two
optimization
goals
relaxable)
solutions
enough
and
first
the
3.
relaxation.
amenable
the
(i.e.,
the
is more
are
notion
order
\\’e
pear
to or-
The
deter-
declarative
demonstration
mentation)
and
being
illustrate
but
note
a simple
serves
body
order
by
provide
of optimization
of having
a
as
and
PLP
not
which
(such
at
solution
the
[24]
constraints
is powerful
does
mal
to compare
required
in HCLP.
latter
and
remaining
heads
core).
of an optimization
O-predicate
importance
hierarchy.
comparator.
in PLP
the
the
hierarchy,
the
to the
of relaxation
because
the
satisfy
of optimization
HCLP
only
satisfy
that
indicates
required
in the
clauses
for
appear
( O stands
instance
How-
in
a weight
in order
the
only
of these
( C stands
O-predicates
in terms
Borning
with
linear
appear
bodies
clauses
expressive-
and
constraints
into
a constraint
according
notion
for
to other
they
Given
are optimal
etc. ) that
to
limited
2.
the
are to be
i.e.,
a paradigm
tagged
is introduced
well
are
(HCLP),
them
solutions
interest
the
CLP
relative
constraints.
only
body;
goals
way,
Wilson
the
predzcates
Re-
satisfiable.
in this
provides
weak,
of a comparator
are not
applications.
all constraints
alternative
body
criteria
C-predicates
and
is a definite
in the
the
1.
manner.
introduced
clause
goals
in which
be optionally
of a constraint
ganize
order
in the
intended
the
enables
flexible
et al [I]
a relaxable
over
the
relaxation
in aver
Mantha
order
dictates
stating
operations
where
a partial
order
of preference
such
of relaxation,
Horn
clause
formulation
to program
present
an
example
clauses
of
for
relaxation
an
problem.
preference
example
a greedy
from
illus-
resolution.
constraints
can
heuris-
which
ambiguity
in HCLP
and
of dynamzc
grammar,
use of weighted
illustrate
with
of optimization
an example
and
com-
be expressed
relaxation
scheduling
(or
and
rethe
Dynamic
Programming:
dynamic-programming
The
formulation
program
of the
below
ifstmt
is a
shortest-path
X, N,O)
sh.dist(X,
Y,l,
sh_dk.t(X,
Y, N+l,
.
C)
-+
X <>
Cl+C2)
Y I edge(X,
-
sh-dist(X,
Z,l,
sh-dist(X,Y,N,Cl)
~
N >
1,
sh.dist(Z,
X <>
grammar
(the
press
Y [
the
famous
each
then.
stmtseq
clause
the
else”
have
pairs
(DCG)
usual
yistoexthe
solution,
grammar
ambi-
their
up with
resulting
gramnzars
rewriting
stmtseq
thearnbiguit
else
The
eke
“dangling
and
waytoresolve
that
dejinzte
than
I
stmtseq
cond
preference
using
stmtseq
then
exhibits
unmatched
succinct
then
cond
Anatural
our
low
*
C2 <
cond
nonterminals
plevious
Y, N, C2).
sh-dist(X,Y,N,C2)
This
guity
definitions).
Y, C).
Cl),
if
if
lem.
sh-dist(X,
::=
prob-
[19],
to avoid
closest
shownbeis far
more
ambiguity:
cl.
ifstmt(if(C,T))
[if],
–->
cond(C),
[then],
stmtseq(T)
(We
show
the
the
only
optimal
sub-pro
each
such
to achieve
for
<>
the
as the
guard:
Heuristics:
greedy
ing
such
are
algorithms,
used
nomial
of the
such
ring
for
in
these
In
by
partial
to
also
make
cases,
tsp(Tour,Cost)
be
used
it may
for
X
poly-
(PLGs)
from
performing
below
[Next
[H],Tour,Cin,Cout)
(City,List,Next
constraint
where
.
in
closest(A,_,_,_,C2)
+-c1
cost,
predicate,
by making
which
tsp,
use of the
~ncorpora,tes
the
also
a general
criteria
for
A good
useofthi
may
be viewed
language
with
choosing
and
a well-known
among
scalability
as a form
natural
for
select,
to that
the
[if],
two
cond(C),
to obtain
for
aneffiefficiently
A
of
tially,
>
C2.
same
and
its
HCLP
parator
(The
clause
clef-
program
be
into
the
the
to
to definite
constraint
program
the
in
the
used
Essenenforce
the
comparator
PLP
the
application.
translation
from
clause
programs.
For
program
the
be
systematically
to the
HCLP
by
to
program.
that
suit
. . .. Hn).
both
can
Therefore,
programmed
of con-
H1,
in the
We
solutions
enforces.
following
(Ho,
comparator
PLP
ofla-
be partitioned
collections
=
a PLP
of the
schemeissimilar
grammars
consider
the
answer.
clauses
among
can
translation
edge
optimal
can
parametrized
and
program
albiter
ordering
closest,
and
the
is
1, where
a totally-ordered
constraints
scheme
constraints
H
conala-
collection
H
is the
write
A
and
strength
from
in
If H,
we
constraint
PLP.
domain,
Hisafinite
constraints
i,
how
in
c with
are taken
set of required
a HCLP
show
simulated
an appropriate
strengths.
HCLP
the
the
be
adapted
in
comThe
definite
example,
from
[24]:
)
concept
of preference
specifying
alternative
the
solutions
is ambiguity
of optimization—in
language
tour
heuristic.
The
means
best
predicate,
get-vertices,
hence omitted.
Grammars:
provides
the
nearest-neighbor
initions
of the predicates
are straightforward
and
?reference
computes
optimization
logic
transla-
Since
memorization)
hierarchy
strength
determining
the
Thetop-level
this
preference
namely,
a constraint
The
Ho is the
domain
+
1 cis
to their
hierarchy.
, edge(City,Next,Cost).
<
up
to
refer
analogous
We
can
of constraints
with
translate
closest(A,_,-,-,Cl)
as
be possible
using
over
A constraint
according
,
,Cin+Cost,Cout)
[24]
constraints,
straints
,Next,Rest,Cost)
,Rest,Cost)
(L.ist,Next,Rest)
.
*
,CitylTourI,T
We
and
pairs
disambiguation.
HCLP
strengths
beled
closest(City,List
select
in
domain.
tsp(Rest,
should
c is a relation
beled
tsp(T,
else
programs.
prefix,
(e.g.,
is a gram-
is a straightforward
Relaxation:
relaxation
[l,Tour,O,Cost).
[CitylTour],T,Cin,Cout)
closest
the
Constraint
[14].
tsp([],T,T,C,C).
tsp(List,
a common
scheme
each
thescherneis
the
a modular
then.
clause
T)
for
trees
clause
in
if(C,
prefer-
straint
[],Tour,Cin,Cout)
PLPs;
definite
strntseq(T),it
parsing
third
that
rules
terms
parse
grammars
There
)).
grammatical
specifies
unpaired
clause
into
into
The
it
criterion
[7].
have
[then],
the
tsp([HIT],
definite
PLGs
DCGS
the
usual
argument
constructed
and
previous
of
cient
to specify
as illustrated
tsp(V,
closest
DCGrules
quality
and
manner
(Cl,if(C2,T,E)
the
rules.
clause,
grammars
tion
tget_vertices(V),
stnrtseq(E).
~
The
the
grammar
extension
from
are
grammar.
represent
arbiter
the
problems
the
productions
T,E)
cleclarative
in obtain-
be possible
TSP
-if(C,
with
space
solutions
.
[then],
[elsel,
)
clause
matical
Heuristics
search
two
corresponding
to formulate
(TSP).
other,
heuristic
and
the
1,
first
of adefinite
nece-
N >
hard
the
The
the
implication.
compromising
the
In
be
are useful
partial
over
neighbor
strntseq(T),
1), domain
Y and
cond(C),
ifstmt(if(Cl,if(C2,T),E)
of
also shows
of the
problem
comparing
solution
nearest
X <>
completely
[if],
ifstmt(if
call.
section
example
which
salesman
many
of
the
pruning
recursive
combinatorially
problems
solution.
one
can
-->
al-
of +, would
conditions
to
without
aid
expresses
Thus
(in
This
or heuristics,
heuristics
the
each
as antecedents
traveling
in size,
at
effect.
solutions
as the
sh_dist.
problem
Preferences
acceptable
the
ifstmt(if(C,T,E))
theoptirnalsolutions
monotonicity
the
be read
distance;
with
explicitly
on
occurs
of this
a similar
Y should
computed
uses only
calls
solutions
shortest
a dynamic-programming
tosh_dist
fo~mulation
knowledge,
be
the
program
blernpropertyof
recursive
suboptimal
previous
of
can
This
call
subsequent
need
path
argument).
gorithm:
sary
computation
associated
an extra
to
the
grammars.
selection
to
—
a(X),
a(X)
t--
strong
a(X)
F
required
X<4.
a goal.
resolution—which
In
programming
We
b(X)
illustrate
example:
94
accordance
weakX
X =
with
>
6.
1.
X > 0,
the
required
operational
X <
semantics
[24], given
atop-levelq
collects
all relaxable
ueryq)t
constraints
hetranslatedP
arising
from
and
after
required
processes
them
all
10,
of HCLP
LPProgram
q into
a list,
constraints
arising
from
g have
program
been
b(X,
[weak
a(X,
[strong
a(X,
[required
1] ,0)
X =
1
I 01,0).
X > 0,
X<4
The
of
program
parameters
ing
-
a(X,
HCLP
Our
example
of a, clause
between
any
two
translated
predicate
help
be translated,
scheme,
Er-rorSeq)
query
would
be:
is independent
and
depends
in particular,
+
hclp(L,ErrorSeql
the
Given
aquery,
swer
for
The
only
cornpute-error(
)<
hclp(L,
on
be-
where
relaxable
constraints.
HCLPscheme
icate
computes
The
specific
is incorporated
compute-error.
aggregate
error
of the hierarchy.
able
an
b.
The
the
<ErrorSeq~.
repeated
constraints
constraints.
The
for
the
The
satisfy
The
comparator
Z’h entry
in
the
for
the
in
the
used
definition
calls
in
schedules
wanted
sequence
is the
terested
Such
problems
ules;
the
schedule
Declarative
We
solution
required
error-sequences
first
and
is done
least
cost.
to
the
can
13elow,
In many
scheduling
probschedules
andwe
are interested
m jobs
in minimizing
follows.
4
prograrns(without
with
For
taken
be expressed
NO, Nl,
and
P is a processor;
instance,
n processors
time
in
PLP
N2arenodes
S, S1, and
then
incurs
we are
all
the
we
Preference
logic
framework
that
contain
S2 are schedules;
vide
as
sched-
and
T is a
schedule(S).
~
opt.schedule(Sl)
-
t
initial(N),
schedule(N,N)
~
v
step(NO,Ni),
toplevel
catetakes
each
world
the
worlds
in node
task
to
a scenario,
inttton
fails,
selecting
is natural
and
lesscost
be clear
to
For
we would
then
subject,
wtthout
opt.schedule,
problem.
where
job
has
been
of
this
a new
the
seek
a modular
processor
best
preference
their
schedule
requirement
can
that
the
to
be
true
if in
pl~
does
not
Informally,
model
be expressed
the
iff
relation
first-order
the
associated
so is PjF.
~
T(Z)
We
+
syn-
logic
by
rule
treat
Ll,...,
of
each
L~
A
LI
A
... A
in
a
[17] provides
Ln)
apossibleworkls
frame
Fis
W’is
anon-empty
<
is a binary
relation
over
~
a preference
frame
Yaloug
determines
worlds.
PfF
iff
(Vo
PfF
every
is
world
w s
v.
The
is given
the
truth
semantics
an orset
W.
A
with
of atoInic
of preference
as follows:z
EW)[(~~F)-(t.
true
in
PfF
~v)].
a world
v where
If
to be aprejerence
any world
preference
schedule
p(f)
a brief
The
as a formula
form
*fiPfF
solution
(say
WRT free(pl,S),
to
then
V that
of the
with
[17].
clef-
said
to processor
with
pro-
an ordering
starting
of
pref-
We
clauses.
M
function
formulae
and
arbiter
for
programs
and
model
at individual
logic
program
syntax
ofrnodallogic,
formulae
logic.
of preference
‘Pf
‘Pj(p(ri)
worlds
[8],
relax-
in the modal
theory
modal
theory
operator
program
model
for this logic.
A preference
of the form
(W, a), where
possible
with
as theories
the
by the
the
clause
logic
programs
from
logic
extends
modal
logic
of clauses)
for preference
If F is a formula
a valuation
In such
schedule
some
the
of
changing
if
want
a partic-
example.
optimal
explicitly
avoid
preference
in bodies
for the
modal
preference
initial,
hence
of thernodel
logic
semantics
dered pair
anew
are omittedas
we
free(P,S)
assigned
of step,
i.e.,
opt_schedule(S)
we define
produces
scheduling
in this
of
by making
we can
of simple
are viewed
and
is enforced
p(i) -
Thesteppredi-
and
that
Optimization
semantics
to the
preference
instance,
involve
this processor.
This
by a relaxation
goal such as
RELAX
and
definitions
should
requirements
of
the
it
NO as input
The
samejobs,
meanings
additional
to
N1 after
a processor.
alltasksdone,
intended
in node
(S).
first
because
However,
logic
of
is amodel
thereview
schedule(Nl,N2).
isopt_schedule
aschedule
schedule
ular
predicate
at
method,
goals
uses ideas
world
Inthetraditiou
The
appear
a
of clauses.
[17],
among
formation:
schedule(N,S).
bodies
programs
alltasksdone(N).
schedule(N0,N2)
might
to preference
programs
where
dejinite
schedule(S)
declarative
theory
Theory
logic
logic
adding
lesscost(Sl,S2).
it
in the
a possible
tax
samejobs(Sl,S2),
between
and
predicate.
model
of preference
erence
jobs.
the
Model
We
optschedule(S2)
path
of recomputation
relaxation
introduction
+
It
slot
shortest
a modular
or an equivalent
extend
goals
4.1
task.
opt-schedule(S)
b.
is:
Semantics
review
in-
suppose
and
to finish
the
an-
a and
problem.
to the
costs
with
to
potential
a particular
Relaxation:
reassociate
gives
tothesh.path
this
ation
Preference
computed
between
of thepred-
lexicographically.
lems,
of the
problem.
program
at the Lth level
well the relax-
of two
is called
cost
program
of the
above
relaxable
constraints
error
measures
how
comparison
cost
WRT C > CO,
the
above
specification
-
error-sequence
in the
that
sh-path(i,a,b,C,P)
CO is already
use of memorization
predicate
WRT C > D.
the
second-lowest
goal
in
ntb-lowest
n_sh_path(N,X,Y,D,-),
sh-path(X,Y,C,P)
n.sh_path(2,a,b,C,P),
be the
goal
the
sh.path(X,Y,C,P).
-
relaxation
RELAX
the
L, ErrorSeq).
ErrorSeq2)
with
in a graph:
*
?-
C will
path
of the
only
comparator
ErrorSeq2
help
nodes
RELAX
the
use of a relaxation
the
n-sh-path(N+l,X,Y,C,P)
and
The
illustrates
to compute
n.sh_path(l,X,Y,C,P)
X < 10,
used.
hclp(L,
second
body
cost
Ervor-Sey),
the
to
of the
above
I, O).
requi,red
g(f),
hclp(L,
definition
HCLP
the
I 0] ,0).
query
L,[]),
example,
the
!
aHCLP
q(i,
For
as follows:
X > 6
weak
Given
satisfied.
is translated
w
F is true
is true
crlterionat
in
at
a world
world
w.
u where
F is true
is at least
model
M is said to be supported
a, preference
is related
to
w by
w then
In other
F
is
words,
as good
as w.
A
if, for any two
S, no
2We write
P.
truth
95
value
I=fi
true
G
atthe
to
mdlcate
world
w
that
In
the
the
formula
preference
G
model
IS asmgned
M
the
worlds
u, and
that
I=fi
v, if u) ~ v then
PfA
and
is also
the
Given
apreference
said
+~
preference
model
such
7L,
there
that
M
=
(W,
PfA
the
~, V),
thereis
ent
model
relation
a world
the
enforced
W_&
for
Preference
We
build
models
for
We
assign
ordinal
levels
such
that,
if
an
clause
defining
t,o 02
is
than
number
of levels
numbered
stages
logic
to the
O-predicate
they
are
preference
another
less
Logic
the
Oz
ordinal
of
programs
O-precZzcates
appears
O-predicate
the
assigned
O-predicates
1, . . . . n.
the
body
013.
the
program
model
O-predicates
model
is n,
We first
and
is constructed
of
C-predicates
mutually
are
(or
defined
using
moclel
at level
1 extends
the
instances
of
with
at level
among
worlds
these
over
O-predicates
ence
model
can
level
1. The
erence
in
set
all
in
Given
by
that
[8]
41n
arbiter
theory.
and
Given
of O-predicates,
intended
to
be
construct
the
sort
lt
among
the
presence
for
that,
do not
that
We
have
with
of a relaxation
the
1
at
level
k
then
the
relaxation
have
extend
relaxation
queries
any
relaxation
the
goals
in
model
the
the-
bodies
of
Queries
following
Given
query
if there
P
such
a preference
w’)
A (0 #
that
w
definition
for
logzc program
the set of correct
to be a naive
zs a world
that
plausible
a correct
query.
G such
8 is said
for
w
~
P
and
a re-
valuat~ons
relaxed
zn the
CW and
to G
correct
intended
valua-
preference
v3w’3’((w’
+
model
GO’)
A
(w
~
0’}).
Intuitivelyj
@ is a nazve
able
G,
query
if
there
is no better
rence
of Gtl’
relaxed
there
is
world
for
correct
a world
some
problem
valuation
where
w where
substitution
to
Go
intuitively
a relax-
occurs
there
b“ different
though
a pathological
w
w’ than
of relaxation,
for
the
a more
de-
4.1
Gzven
query
from
by
and
is an occur0. This
appealing,
as illustrated
optzmalvaluattons
zs empty,
and
C( u).
to G wzth
a preference
G = RELAX
of correct
sattsfy
logic
the
program
Base4
a preference
there
Then
p(t~
logic
WRT C(Z)
to p(~
are
at least
to P
w also
A C(Z)
two
the set of naive
respect
intended
P with
is BP
and
to be the
set
program
P
a correct
predicate
.411 the
{A
and
optimal
call
graph
of constraints,
tion
atom
suffers
the
following
program
such
P
that
wzth
and
the set
respect
solutzons
relaxed
for
correct
to P
p(o
that
valuatz.
ns
empty.
( -)
1.
clause,
, p(~#2}.
, p(q6’3}.
instance-the
P
similar
among
the
m
a cycle
this
to
the
only
get
assigned
generahzed
of the
number
and
C( ii)O,
are satisfiable.
order
move
to
the
are not
96
that
tive
In
Her-
[12]
obtain
worlds
solutions
to the
$3 is also
notice
not
this
that
using
an optimiza-
intended
preference
of p(~:
valuation
WO1M
relaxable
a relaxed
because
wit h the
query
correct
would
t), such
valuation.
hold
that
th
is L93. By
irrespec-
both
p(~d,
❑
a satisfactory
have
of the
solution
any
argument
of substitutions
that
c(U).
.91 is the
correct
than
62 and
satisfy
instances
a relaxed
is better
solution
reasoning,
Furthermore,
O-predicates
62 is not
UQ —which
of p(~);
that
that
in the
following
{p(f)@l
solution
p( ~
that
are worlds
the
{p(i)o,
G,
for
there
contain
~
world
for
solution
further
p is defined
~
a goal
of P.
Since
w,
in
optimal
Suppose
loss of generality
2. w~
The
a valu-
c(u,).
solutions
of them.
that
81 is the
satisfy
nomoptimal
both
model
of the
Suppose
not
without
I P & A}.
prechcates
refers
two
c BP
valuation
consequence
01 does
pruned
n levels
consequence
Sketch:
Assume
model
an
Proof
clearly,
93 are
ordinal
Base
theory
valuation
a relaxation
defining
preference
A is a preferential
logic
model
of clauses.
Proposition
1.
k + 1 con-
clauses
solutions
proposition.
for
k +
ordering
examples
Herbrand
is defined
d is said
bra,,cl
for
model
G if GO is a preferential
same
The
stage-
of hierarchic]
k + 1.
programs
We begin
from
P ~ A) if A is a preferential
consequence
model
at level
n.
The declarative
se-
a preference
topologlcally
a model
clauses
optimal
at level
with
solutions
the
notion
the
Relaxation
definition
pref-
level
conflict
Furthermore,
the
main-
orderings
k + 1.
a preference
whose
we say
can
model
k + 1 ex-
at level
the
1.
the
of P is the
program
(written
of the preference
Dp,
k +
n levels
model
(1-predicates
3\Ve
in
O-pred~cates
at
model
model
level
to
of the
of
O-predicates
that
at
P with
preference
the
worlds
is referred
program
and
at
of the
becomes
we
optimal
of Relaxation
4.3.1
tion
of the
at level
If
the
might
opti-
orderings
too.
LS empty,
worlds
preference
instances
world
the
at level
description
Given
k with
bodies
laxation
clauses
are true
consequences
each
is enforced
O-predicates
mantics,
the
levels.
Theory
logic
Definition
prefer-
that
model
preference
those
worlds
A c Bp,
the
ordering
consequences
preference
defining
the
n.
1 so
defining
O-predicates
set of atoms
in
L’-
at level
possible
the
a
of the
intended
level.
the
the
as in [2],
level
the
a
have
arbiter
all the
world
at, level
O-predicates
at level
The
1 in
preference
The
the
defining
1 is the
k + 1 so that
the
tailed
by
1.
clauses
the
intended
reader
program.
1 contains
of preferential
clauses
tains
level
optimal
model
at level
The
clauses
only
to
disallowing
captures
solutions
to programs
clauses
1.
the
the
O-predicates
set of preferential
at level
worlds
tend
ation
the
strongly
The
model
is enforced
at
model
minimal
the
terms
they
in the
lower
develop
C-predicates
clauses,
the
in
at level
the
world
for
1 in
at level
that
at level
and
a model
O-predmztes
some
of
definite
Each
program
logic
only
model.
becomes
only
Since
minimal
it
defined
O-predicates
mannerj.
unique
that
The
1 are
other
recursive
yi-eclicates
-.‘
level
at the
because
to preference
in n
ory
at
higher
at one
thereby
Model
4.3
goals
O-predicates
clauses
level,
to the
regard
all levels
at differ-
obtain
the
as follows:
1. The
at
for
construction
constructed
us to
without
clauses
arbiter
worlds
enables
a
assigned
Suppose
arbiter
by
contribute
of
level
set of worlds
optimization
stages.
the
This
one
at a lower
wise
program
ordinal
to
in
The
in
in the
in
01,
to
Programs
at
one
enforced
approach,
different.
by
tained
w’ different
w ~ w’.
Models
are
solutions
those
4.2
above
levels
mal
+.
w:
no world
In
such
preference
minimizes
optimalif
that
is a formula
A supported
model
to be strongly
from
A.
instances
C-predicate.
definition,
of the
we need
O-predicate
to
rethat
Definition
z
franle
.4 preference
OJ a preference
<I subset
the
of the
worlds
relntzon
set
among
among
frame
F1
is sad
to
be a sub-
frame
Fz
if the set of worlds
o,f worlds
in
F2
the
the
worlds
worlds
in
and
FI
~n FI
the
is
relation
worlds
logic
program
of
M,.
which
3
kwulde
Gtuen
query
G=
erence
nloclel
tended
jJreference
a preference
RELAXp(~
for
P
WRT c(z),
the
(if
m FI.
and
G
modelM
the
P
the WOVICIS in M such that
the
appear
ZII each (oorla’ correspond
such
only
to
a re-
relaxecl
M,
that
c is a constraint,
in-
contains
instances
valuat~ons
ofp(t)
that
the
that
satisfy
laxed
c(u).
1
Given
laxation
query
ists
is unique.
and
G,
Proof
Sketch:
tendecl
preference
preference
ence
aprejerence
the
any
intended
preference
moclel
model
P
and
preference
logic
is unique
is constructed
Since
the
interpreted
uniformly
the
intended
relaxed
relaxed
program
at any
erence
a re-
model
intended
modeiex-
and
[8].
The
from
the
C-predicatein
across
the
program
preference
relaxed
showing
model
is well
is
relaxed
in
are used
the
❑
defined.
example,
tionland
consider
the
the
relaxation
WRT notinpath(c,
P).
mode]
only
will
such
contain
that
in
the
paths
b, C,P)
path
query?The
is
are
relaxed
preference
between
a andb
in
model
that
true.
will
instances
optimal
correspond
do not
pass
C ,P)
whose
level
cates
at level
we can
of
used
c.
Programs
We
now
grams
extend
where
The
difficulty
in
programs
each
tnstance
body
might,
and
Let
previous
clause
to
consult
in the
than
goal
of each
that
of 02.
to the
relaxation
goal
head.
of level
bodies
level
a model
as the
the
O-predicate)
is de-
Therefore
each
for
and
definitions
O-predicate
n + 1. ’31e
relaxation
the
goals
the
world
core
of the
in
bodies
predzcates,
relaxed
M,
and
of
logic
the
clauses,
a relaxation
preference
of the
intended
P
predicates
level
4
2)
but
only
query
with
G = RELAX
mode]
preference
for
P
and
model
of
WRT
G’ is
3(
where
each
member
c(Z))
of R is
c is a C-predzcate
1 of the
index,
(or
a
of the
set of
P.
A set
program
is an instance
2 is
programs
is the
set S is an extension
be
2, the
at level
of the
(P(~j,
may
(not
necessarily
of p(f)
that
query
are
RELAX
relaxed
p(fi
consequences
WRT
C( ii,),
goals)
A
w =
q is an
O-predicate
by a clause
(w~th
m
in
the
ordinary
program
and
n
re-
if
the
of the form:
world
(S, R)
holds:
‘J
M sazd
For
that
to S,
if
q(Z)O
A
Al
q(~)~
dl(til
), . . . . dl(tit
))
that
to
n
l...
rj (U3 )OuJ
such
a clause
instance
belongs
~=
such
ground
satisfies
mandul,
Zs a valuation
to satisfy
every
S,
such
then
that
is satisfiable,
rJ (VJ)6UJ
belows
(where
of the
there
the
0
head
exzst
II, ,
conjunction
i.e.,
to the
,for
all
j,
set in R
at level
level
P(9
model
base
at level
Suppose
~%pb(Fc)8vL
it be-
symbols,
relaxation
one
that
at level
of the
1, and
to R if p(i)
defined
laxation
to belong
1 =1...
at
with
so that
without
body,
as outlined
goals
preference
where
at level
relaxation
is a valuation
in the
semantics
predicates
program
., ~redi.
in the
models
O-predicates
set of sets,
set of instances
‘Based
a preference
in the
consequences
followtng
O-
is constructed
D-predicates
defining
in a
at the
an
2,
O.predicates
be easily
appears
is at least
any
i.e.,
model
an
can
(at
level
O-predicate
containing
that
them.
as before,
least
(or
have
O-predicates
for
that
2 in
at level
goals
relaxation
S is a subset
as R(P(r),C(ti)),
Definition
O-
program.
Given
frame
the
here
goal
an
the
for
k
illustrate
at level
clauses
k.
1, the
in
appears
is less than
of the
as in CILP ). The
of P and
model
that
defining
presented
level
a level
the
O-predicate
a D-predicate
defining
of the
1 in the
same
1 do not
same
extending
comes
the
of 01
is the
O-predicates
01
k +
model
preference
we
with
up to level
semantics
the
the
ground)
of an O-predicate
(at level 1) and c(ii) is an instance
of a C-predicate
(or a constraint,
as in CLP)6
and R(r( t),ctti))
the
goal.
construct
world
I?(P( ~),.~ ~)) belongs
preference
the
of a clause
level
of a relaxation
of clauses
instances
the
is at the
at level
I is the
body
the
to
O-predicate
semantics
n, it is assigned
predicates
goals
The
if
m terms
that
and
any
the
relaxation
levels
program
case when
However,
fined
of the
ordinal
in
level
1. We now
relaxation
of D- and
O-predicate
preferential
is that
goal
relaxed
p is an
pro-
preference
for
a relaxation
denoted
constraint
bodies
the
to
any
track
R is an indexed
a set,
Since
relaxed
definitions
(S, R.) where
of clauses.
in
a different
that
in
Oz is such
with
bodies
theory
goals
truth
assign
us assume
extendecl
by
the
we
above
in the
a model
relaxation
and
1.
Once
are of level
at
consequences
have
the
worlds
models
queries
the
pref-
define
paragraph.
to keep
in the
structure
Goals
presented
occur
providing
the
a relaxation
~Jredwate
goals
of
D-predicates
stages.
theory
need
before,
Relaxation
model
with
to ascertain
As
in
the
relaxation
logic
model
with
most
the
preference
preference
O-
defined,
O-predicates
the
relaxed
1 cannot
In order
a pair
4.3.2
is at
been
k+
in
an
the
worlcls.
describing
the
determine
in the
worlds
to shortest
through
to know
We
re-
goals
intended
the
at level
defining
the
model
may
with
k has
of relaxation
worlds
by
For
query
level
whose
G
the
relaxation
orders
intencled
models
the
levels
geuerai,
by defining
relaxed
goals
process
detail.
we need
intended
(a ,b,
The
in strongly
sec-
b, C,P)
relaxed
of sh-path
also
true
from
sh-path(a,
the
instances
P)
that
program
RELAX
worlds
those
notinpath(c,
sh-path(a,
shortest
various
relaxed
query
higher
defined.
at a level
at
correspond
set of atonls
in the
In
once
been
arbiter
the
to define
above
has
for
G’.
at
(with
only
present
a relaxation
goals.
be defined
also
should
a relaxation
model
preference
greater
For
the
to relaxation
are
world
P and
a program
can
constructing
those
The
D-predicates
level
the
the
are
of P and
model
how
determine
IVhen
goal
set of worlds
level
that
C(U)
optimal
and
preference
respect
prefer-
relaxation
the
can
in-
intended
intended
the
worlds,
P, its
of
at that
such
world
of p(f)
of relaxation
preference
iutendecl
For
model.
logic
and
terms
of clauses)
preclicate
Theorenl
strongly
O-prediccdes
bodies
instances
of a program
consequences
the
of
consequences
in
M
each
C(Z) is satisfiable).
in some
relaxed
be defined
in
in
instances
that
model
The
all
worlds
appear
the
such
are true
ale
the
corresponding
preference
pref-
of the
M,
that
to valuations
P and
is a sub-frame
for
all
of p(f)
the
that
Definition
contains
instances
among
a restr~ctzon
to the
that
zn F1 w
for
61t
O-
on
the
rather
should
pre-mterpretatlon
than
be
noted
the
that
ful enough
to capture
the
crlterlon
M an O-vredtcate
c(ti],
pred]cate
a sub-
paper
P such
97
We
h;ve,
that
Herhrand
the
Interprets
the
constraint
pre-mterpretat]on,
semantics
presented
here
M power-
meaning
of programs
where
the relaxation
that
IS at a lower
level
than
the relaxable
however,
not
discussed
such
programs
in
this
indexed
such
by (r] (vj )19, Cl(ii]
that
p,(~,
Definition
(at
)$q,
5
level
2)
laxation
Suppose
defined
goals)
q(~)
)$),
q M an
world
lon~s
j
=
~,
is satd
For
that
a
for
belongs
=
k, I),
valuations
curs
in
and
are no
in
world
(S, R) in the intended
corresponding
the
In
of the
assign
the
a clause,
the
The
instance
example
truth
R
the
{
n-sh-path(l,
a, b,5,
10,
u],
n-sh-path(l,a,c,
15, [e(a,b)
Notice
by
that
later
r~ (ti~ )0 (or
if a variable
the
in
the
CJ(iiJ )0)
clause,
same
ordinary
the
set S and
section
is not
thatforthe
instance
to be present,
we need
goal
RELAX
6
The
of all possible
predicates
preference
worlds
at level
as supported
by the
as determined
7
level
2 M the
some
strongly
The
set
that
that
instances
set
satisfy
the
the
The
arbiter.
by the
Definition
at lel~el
(S, R)
2 such
at
P =
[e(a,c)].
to
C >
15 )is{sh_path(a,c,25,
goals
valuation
optimal
world
the
set in
of P
Once
that
the
preference
respect
model
relaxed
level
able
2 consists
clauses
exzsts
definzng
the
worlds
The
the
set S.
without
in
consequences
members
at
of the
model
to relaxation
also
be
and
a relaxation
are
sub-frames
the
set
with
goal
of the
G
predicate
(whose
model
of G such
criterion
that
at level
also
for
of
at level
(S, Ii)
fies
of
in the
the
k, each
world
O-predicates
2 such
preference
clauses
model
defining
at level
predicates
relaxed
k is such
k.
that
n as described
For
edges
example,
{edge
(a, b,5)
set of preferential
{edge
(a, b,5),
, edge(b,
c,lO)
consequences
edge(b,
n-sh.path
c,l
O),
in
path(a,
[e(a,b)]),
c,25,
[e(a,
path(b,
c,lO,
the
logic
set
program
relaxed
intended
case for
preference
[17,
S
tn
some
model
P wzth
relax-
preference
model
logic
programs
8].
the
operational
semantics
relaxation
operational
goals
semantics
bodies
of prefer-
[8],
for
we present
programs
with
of clauses.
Semarrtics
the
tains
it satzs-
review
which
of
a derivation
stands
for
computing
in
[8].
of definite
Optimization
sense
can
and
of
we
[10,
11];
Tree
optimal
assume
optimization
be extended
schernecalled
Pruned
the
Below
constraints
5.1.1
with
c,25)}.
the
valuattonsto
that
clauses
as goals
the
the
con-
constraints
describe
case where
in bodies
queries
program
without
we subsequently
to the
PTSLD-
SLD-derivation,
how
this
program
com
of clauses.
P be
The
all
[e(b,
a definite
clause
SLD-tree
for
of whose
Pu
c,25)}
l? TSLD-Derivations
A partial
{G}.
a substitution
c)]),
c)]),
98
branches
Because
a substitution,
U
found
{path(a,b,5,
to
~n themtendedprejerence
without
in the
briefly
scheme
world
1 is:
edge(a,
belongs
aground
If a preference
program
, edge(a,
at level
P,
consequence
Semantics
of the
efficiently
Let
the
to the
reviewing
p~esented
above.
consider
the
goals
goals
now
for
logic program
has n levels of predicate
symbols,
the relaxed
intendecl
preference
model
is the preference
model
at
level
body,
programs
derivation,
con-
k – 1. Each
at level
zf A
Operational
We
that
of the
(satisfiable)
to the
at most
)}.
logzcprogram
Foranypreference
briefly
logic
5.1
instances
present
has access
of level
is C = 25,
preferential
(S, R)
Operational
sists
Now
the
only
2)
in S.
sequences
In
the
by (sh_path(a,c,C,P),
[e(a,c)]
A)
is similar
relaxation
P
level
instances
corresponding
of G are
re-
2 can
models
is
onlv . those
contains
model,
)
the
IS unkque.
an extension
with
of level
relaxed
O-predicate
preference
world
relaxation
the
~
relaxation
After
determined,
program
O-predicates
Essentially
S in each
relaxable
of the
queries
determined.
been
of the
2
proof
5
set S zn
the preference
2 has
of the
WRT C > 15.
sh-path(a,c,C,P)
world
zn the
and
among
models
P
optimal
goals
ordering
at level
preference
[e(a,c)]
truth
of P.
the
2.
various
,a,c,25,
the
preference
to be arelaxed
(written
ence
the
for
M satd
strongly
relaxation
worlds
in
n.sh_path(2
Gzvenapreference
aton~A
the
(S, R)
2. The
S are:
)}
Thesetinllindexed
Definition
in
truth
among
are
in
ground.
of O-predicates
that
at level
one
),
intended
optimal
relation
of preferential
of atoms
is only
,e(b,c)]),
sh-path(a,c,C,P)
oc-
the
illust~ates
model
model
to determine
relaxed
Theorem
Definition
c)]),
a world
of the
necessarily
[e(b,
[e(a,b)]),
[e(a,c)]
the
value
whether
instance
2, there
are present
[e(b,c)]
n_sh.path(2,a,c,25,
such
by consulting
relevant
that
n-sh-path(l,b,c,
indexed
of the
is determined
by
that
to determine
by consulting
goals
is indexed
goal.
to
have
words,
is determined
relaxation
R that
of
other
satisfies
body
body
valuations
variable.
(S, R)
the
in
the
in
level
preference
of n-sh-path
c,lO,
c)l)}
O-predzcatesat
be-
laxable
goals
sh.path(b,
is a valua-
valuatzon
be consistent
clifferent
U
b) ,e(b,
the
of S.
must
two
e(a,b)])}
[e(a,
there
corresponding
The
c),
Since
A
~1
set
is a
if
q(I)O
1 . . . m
all]
to the
all
a clause
q(i)$j
~,p%(%,)$~,
where,
for
M a member
v,,
c,15,
set of instances
such
con~unction
and,
[e(b,
[e(a,b)]),
sh-path(a,
n re-
...
instance
valuations
r] (VJ)8C3
C,(.ii,)t))j
c,i5,
{sh-path(a,b,5,
program
and
WRT c~(ti~).
ground
is satzsfiablel
p,(~t)d?l,
the
ordtnary
to satisfy
every
exist
.t}tat
the
I . . . IL stdch
such
in
m
WRT CI(Z1),.
Zf there
r,(tij)$aj
tlon
D-predicate
r~(fi~)
(S, R)
holds:
(rj(fij)(i,
path(a,
i, q, is a valuation
of the form:
w =
to S
all
(wzth
*pl(:tl),RELAXrl(til)
followzng
for
of S.
by a clause
p,,,(~~),RELAX
A
and,
is a member
on the
program
Pu
every
edge
path
is the
from
the
each
node
to the
not
derivations
is labeled
in the
of the
root
goal.
SLD-tree,
SLD-tree
composition
node
a positive
or failed
inthe
with
G
is a finite
are successful
we associate
which
and
{G},
SLD-tree
substitutions
of the
tree.
of
by
Definition
Given
Pu{G},
Tl
we define
by choosing
o,f T1 , Am
two
TI
+
partial
a non-empty
bezng
the
SLD-trees
Tz to mean
selected
that
TI
cmd
Tz
Tz is derived
leaf
1 =+
Al,..
goal,
and
creating
jor
A
from
., An,,
. . . . Ah
chddren
A
of 1
for
(A,
,...,
general
A
B,,,,
+-
unifier
be expanded
in
and
deraoation)
G
.,.,
TI
to
get
be a goal.
T2.
a Preference
Logic
derivation
derivation
for
node
every
most
the
or
that
leaf
0
M
description
_
-
such
the
of
to
above
as we
would
children
for
all
appear
clause
for
of the
the
body
by
the
arbiter
proofs;
the
of
to
for
at
the
one
met
the
goal
variable
for
Definition
original
=-
at
differ.
be com-
or pruned.
if
result
the
it
ends
of the
in
a
complete
respect
to P.
at
another.
we simply
If
for
argument
of
...,
a partzal
A,
in T
SLD-tree
an
and
is said
B1 , . . . . Bk
Dl,
...,
such
Dn.
Dn,
is p
t)where
that
and
nl
to be pruned
and
nz
node
and
By
induction
soundness
for
we can
<
answer
answer
preference
logic
PTSLD
and
this
ing
from
nodes
nl
p(~tt2
is an instance
and
n2
02 are
such
that
of p(iil
the
Stratified
out
that
p(~OI
) and
are
not
is
~ from
some
least
appears
JQZ, then
of
zs sub~’ect
instance
with
in-
■
a cor-
exists
-y such
that
for
can
q~.
because
be completed,
PTSLD
search
is infinite
but
to the
.9 =
arbitrary
arise
cannot
the
a computed
tree
there
emanatis a well-
goal.
Logic
Programs
the
PTSLD
that
logic
holds:
to the
an instance
body
of a ~
< ~(p..).
For
tree
is finite,
optimization
preference
following
if
search
the
set of O-predicates
preference
in
that
O-predicates.
that
is
A
if the
n, such
in the
f(l’1)
the
because
There
set
of an
clause
defining
any O-predzcate
predi-
program
P
is
is a map-
{1, . . . . n},
for
O-predicate
PI
an O-predtcate
P, its rank
is
to be f(P).
as the
of p(d),
constraint
when
arise
stratified.
ping
associated
an
even
n =-
restrictive
the following
Since
G, and
complete
Preference
can
if there
. . ..Ln
substitutions
not
goal
answer
O-
interpreted
to P, we say that
if there
the
goal
optimal
to be stratified
of
and
when
to
when
P, a goal
respect
some
SLD-
solutions
semantics.
Incompleteness
an optimization
PTLSD
of
are
to
is sound.
a substitution
for
happen
the
for
answer
uninstantiated
are
program
answer
of the
clauses
program
programs.
correct
All
~
is complete
derivation
can
levels
pruning
derivations
logic
optimal
operational
9 of G with
q and
PTSLD
o,f
to
to the program
completeness
[15].
the
logic
semantics
However,
defined
p(fi)+L1,
,for
of computed
optimal
the
and
by the
that
a preference
optimal
on
to be sufficiently
show
set
respect
a preference
as the
— clauses
have
be the
a correct
clauses
considered
as the
Stratified
t+
definite
are
to
G with
0 u
the
and
said
of ~~e form.
p(ti)
then
Sketch:
It turns
a
are descendants
p is an O-predicate,
to P,
PTSLD-dertvatton
Given
tree
5.1.2
by
P U {G},
an internat
0 is said
we
position
T for
G,
respect
the
by
p,
wtth
$ zs a computed
Proof
defiued
this
replace
considered
of solving
this
is
use
a goal
a complete
search
the
are computed
over
purpose
of in-
made
and
to G
zf 0 c 6.
suppose
wdh
optimal
unbound
pair
requirement
and
of p being
binding
Given
Al,
to an arbiter
G,
G
rect
achieve
Gd
to P,
operational
creating
with
the
This
view
~
respect
Given
exactly
to
P
El is sa~d
wzth
voked,
hand
in
of
order
positions
run-time,
instance
and
where
solution
n~ =—
. . .. D.~,
P
incompleteness
10
addition
to
failed
complete
the
answer
3 (Soundness)
exactly
of each
right
purpose
clause
exz.sts a node
In
is
be
to the query
G
cates
IL, where
to
and
zn G}.
wrzte
predicates
optimal
— clause
in
these
optimization
prefer
the
be invoked
clause
values
is not
on
the
positions
arbiter
the
We
clerivations
heads
unification.”
nl
is said
successful,
a program
P
answers
P cmd a goal
goal
the
bodies
quantified,
treat
p must
argument
the
only
Furthermore,
O-predicate
by
the
the
with
Given
Gzven
Theorem
a
simplifies
and
unifies
existentially
a P
of p in any
to
and
is supported
only
GO.
O-predicates
a node.
because
node
is said
optimal
vc{r~ab/es
P.
TSLD-
selected
O-predzcate
restriction
instances
treat
needed
enforce
T,
12
optimal
p, we assume
it is a candidate
that
are
stances
argument
then
A),
is an
of the
semantics
we can
an
requirement
of an
restriction,
at those
unbound
derivation
either
To, . . . . T,
tree.
be a correct
the
To =
succeed.
of
sounclness,
variables
are
P U {G}
with result T., let @ = {6114 is the composition
the swb.stztutions
along
a successful
path
in T. restricted
clause
that
To,
O-predzcate
operational
variables
— clauses
of the
head
This
appropriate
— clauses
Since
the
(7c,
P U {G}
of an O-predicate
clauses,
if the
P =
is an
clause.
of the
only
11’hen
expanded
if instance
of multiple
of the
a PTSLD
paths
PTSLD-derivation
~f P ~
(TSLD
sequence
P U {G}
the
1 is said
be a definite
tnflnite
for
instance
one
otherwise,
answer
be
ground
at
“back
P
Program
Tc- A TO.
to
by
the
such
to
T,+l.
the
in
its
Definition
SLD-derivation
for
C;, a, TSLD
sides
Ak)$
The
Let
is a finite
SLD-trees
P
A,
A Tree
Given
that
in
and
cluery
in
B,
of Am
of partial
TL +
Bq, Arn+,,n,Ak)$.,
BI,
of P u {G}
{i, TI,
i,
A,,,
clause
program
all
PTSLD-derivation.
every
most
occuring
if
complete
o,f the form:
–
tree
plete
need
programs
do
However,
dynamic
allow
there
are
many
programs,
are
definitions
programs,
such
of shortest,
of O-predicates.
stratified
above
recursive
formulation
definitions
in locally
presented
not
programming
recursive
interested
logic
they
Hence
described
path,
we are
below.
satisfiable:
Definition
{p(i)@,
The
= P(ti)
substitution
Definition
11
p(7)&
Oz as said
Given
TSLD-derivation
irk whzch,
at each
scenda,nt
,
= p(z)}
U
to be better
a preference
U,{
than
log~c program
L#Itl
Z}
locally
$1.
There
P,
A preference
a Prunecl
an
is a mappzng
nocle.
There
ground
99
for
O-predicate
defining
logic
progrclm
if the following
{1, . . . . n}
(F’TSLIl-derivation)
is a ‘TSLD-derivation
step,
the leaf to be expanded
as not a cle-
of a prwned
13
stratified
an
the
P1
f
least
M a well-founded
of all
the
such
n
appears
O-predicate
znstunces
from
two
in
P2,
P
is said
conditions
set
of
that
the
then
f (Pl
ordertng
+k
O-predicates
O-predicates
zf an
body
to
be
hold:
to
instance
of a -
of
clause
) < f (P2 ).
over
of rank
the
set
of
k, defined
as follows:
(i)
predkcates
+~:
and
hale
ground
of rank
k
(ZZ) ground
the property
of rank
k
o,f the
tnstances
all
each
appears
O-predtcate
of
to
znstances
that
that
map
base
the
1
the
of rank
of
k that
O-pred~cate
is +~
the
appears
in
nocle
than
one
CLP
framework
the
head.
that
in
positions
biter
defining
of a ground
clauses
4
PTSLD
preference
logic
Proof
Sketch:
<k
of each
and
rank
one
are
induction
soundness
finite
on
the
used
and
ar-
for
locally
of
strati-
trees.
of SLD-resolution.
first-order
main
difference
node
by
in
the
a set
the
is not
the
the
solutions,
of constraints
clause
by
Pruning
node
when
program.
The
case
a single
is that
the
rule
out
the
associated
with
that
another
one
adding
can
solution
14
purhal
Gtven
SLD-trees
tomean
that
TI
program
and
T2 for
T2 is derived
from
P,
P U {G},
G and
we define
T1 by choosing
set
., A,n,
of T1 , choosing
T1 +
T2
a non-empty
goal
ct D-predicate,),
and
a clause
creating
({ Al,
Am
P
chitdren
A
~
head
C;,
is a C-predtcate
. . . . c;,
Bl,
or
. . . . Bq
Given
the
addition
Note
of
further
not
we can
that
be different
may
define
with
block
without
PTSLD-
constraints
PTSLD
in
derivations
constraints
a preference
a computed
ts is
P
optimal
a vuluatzon
node
in
for
bodies
of
@ that
zn a tree T
logic
program
valuation
satisfies
at the end
P
and
to G’ wzth
the
a
respect
constraints
at
of a PTSLD
derzvatzon
completeness
theorems
a
crnd G.
also formulate
soundness
similar
5
suppose
to the
Given
to P,
respect
to P.
proof
and
definite
clause
a preference
then
optimal
0 is a correct
is similar
to the
case,
logzc program
$ M a computed
respect
Theorem
in
P,
6
a goal
to
(whose
programs
16
G,
and
Ak}, {Cj})Cj})
a goal
above,
to
from
Al,..
The
optzmal
definite
P
valuation
and
answer
clause
u goal
for
G
wzth
to G
wtth
case.
two
kflf
/=({
more
in
set of constraints.
definitions
logic
a com
in
SLD-tree
need
similar
preference
has
set of constraints
a manner
G,
have
to the
a goal
to the
the
in
Theorem
solution.
a CLP
definition
to
the
bodies
the
-y.
programs
The
Definition
the
solution
logic
We can
solution.
a node
nz in
the
preference
in a manne~
but
by
pruned
in
a set of solutions.
solution
two
node
for
for
each
substitution
is accomplished
that
it is possible
prunes
semantics
logic
definite
labeled
set of constraints
multiple
operational
a constraint
of constraints.
to
the
is
from
tree
constraints
Since
describe
theory
each
blocks
solution
successful
Y\Te no~v briefly
be satisfiable
derivations
to
❑
the
framework
may
abstracts
one
Definition
of O-predicates
completeness
CLP
which
Therefore
n I and
Using
in the
it
clauses.
O-predicates,
instances
with
{m-y}
i.e.
another
by the
search
rank
ground
argument
another.
are complete
with
on the
those
not
over
derlwcttions
defined
only
that
solution
programs
By
the ordering
we consider
instance
to prefer
Theorem
fied
<k
a SLD-tree
way.
nodes
nodes,
Note
m
associated
a constraint
instance
the
Each
straint
clauses
of an
body
O-
order?ng
of optzmtzatton
instance
in
facts
of the
P
G
the
Given
and
wzth
that
that
P,
PTSLD
there
PTSLD
then
to
logic
there
that
program
derivation
tf 8 M a correct
then
tree
exasts
preference
the
G is finite,
respect
successful
u such
a stratified
C; such
is
optzmal
answer
a successful
is satisfied
a substitution
P
emanatmg
node
in
by an
valuat~on
that
$ = crq.
q such
of 1 of the form:
. . .. A.l,Bl,l,
Bq, A~+l,~+l,
. . .. Ah}.
The
{CJ}U{C}U
proof
is similar
to the
clefinite
clause
case.
{c:})
z.f {c~}
u {C}
U {cl}
constraints
generated
tn
the
body
of the
to be expanded
De firlition
is soivable7j
where
bg the equation
Am
clause
are
15
Gtven
Al,
. . .. AJ}.
{C,,,})
and
an
{Cn]],
such
that
w
p(t)where
biter
n,
M an
of the form:
p(z)
{p(i)
the
= p(z)}
We
{C,.,
the
that
then
in
the
constraints
‘F
n
where
({Dl,
p(~)
a variant
Z and
is an
the
where
f?l,
of n,
Definition
relaxation
,Dn,
},
relwr(p(i),
Dm
tncluding,
., ., Ln.
to
In
an
ar-
u~,{L,}
tree
q such
of the
{Cj},
etc
chffer
} U {Cn,
the
{C~l
~ is said
)
for
by renammg
new
of node
nl
that
states
that
to
clauses
— p~(~~),
and
a
for
. . . ,p,, (,tn]
p iy
for
p,
of clauses:
2.
-
Z #i
I p,(Tl),...
c,rbzter
clause
relux_p_ca(%)
—
for
LI,
y
ables.
and
flv
100
. . . ,pn(in),
c(ii)
)p(En)n)
of p of the form
c(i))
znclucles
~ relaz-p~.cz(%’z)
. . ,J5,1U11T2,
@l and
that
i81
The
and
C(W1),
OZ are
and
p(fl
) 3
the followzng
fQI , and
-
C(IW2),
variable
@2 do not
substitutions
al
crz is the
renamtng
share
zs the
most
substitutions
any
most
common
general
genera!
variunifier
unljier
of F2
Ft+z.
relax_pF_ca(Fl)
vamables
retax(p(i),
-p~-cn(~$l)
where
positions
L,,,
pI(ZI)i
clauses:
such
to
every
. . . .
Llalcmj.
and
solutions
argument
pair
p(i)
P
the function
the set of relaxed
clause
I
arbiter
of constraints
those
returns
program
c(u),
--+ Z = t
of ?I
a set
c(z))
to con~-
to queries.
logic
p(t>WRT
= RELAX
every
valuations
a preference
G
for
optimal
Gkuen
of Relaxation
of PTSLD-derivations
1. reluz-p-cv(z)
p(i2)
get pruned.
stand
17
relax
}
the
correct
query
Furthermore,
projection
to be pruned,
zf all
relaxed
the followzng
of p(~).
set
Semantics
an extension
addition
zs such that P(~)-Y M an
to the variables
tn {Cn, },
to be pruned
, to
with
that
is a constraint
node
of i obtained
al
}
tnstance
solution
is sazd
U {Cn,
present
the
a
where
is subject
--- LI,
constraint
{-Iy}
The
Operational
. . .. Bk}.
P U {G},
=({
. . . ,Dm,.
and
substitution
p(F)a
update
7\Ve use {C},
of i
n =
var~a~les
in {cn~
and the projection
a solution.
a node
~
T for
arsodenz
are descendants
= p(?@}
by the
) U {~-j},
M not
}),
O-predicate,
u {p(~)
(?1 Of v to the
instance
o,fp(ii)
is such
n,
We now
1 as sazd
constraint
zs satzsj$abie
o,
node
and
5.2
leaf
pute
SLD-tree
{C~,
znternal
The
is the set of
and the C~s
T2.
a lJartial
p
suppose
constraints.
in T1 to get
=({
nodenl
{C}
= A,
E#f2).
s
retax_pF_cQ(fz)
—
Ll,
. . . . L,l,
(t
#
The
relaxeci
For
query
example,
?-
corresponding
given
RELAX
the
query
WRT notinpath(c,p),
(X,
C, P), notinpath(c,
j,
Y)
a,bC,P)_noti
=
(a,
b)
P)) returns
the follow-
npath(C,c)(X,
1 path(X,Y,
y
,C,P),
C,P)
Y)#(a,
b)
-
npath(c,P)
not:
relax_sh-dist(a,b,~,Pl_notinpathLc,c~(X,y
(X,
C,P)
lpath(X,Y,C,P).
relax-sh-dist(.,b,~,p)-notinpa’thf.,~j(a,b
,C2,F’2)
—
notinpath(c,Pl),
notinpath(c,P2).
relax_sh_dist(G,b,C,p)notinpath(C,~~(X
,Y,C1,P1)
~
relaxsh.dist(a,b,c,p)notlnpa’thfc,c)(x
,y,C2,p2)
-
C2 <
Cl,
(X,
Y)
#
(a,
with
respect
set
relaz(p(t),
c(ti))
rela. ~_pt_cti
into
the
tainecl
the
clauses
from
plicable
to p(aint
C(U)
to
the
p(f)
are
applicable
c(z),
clauses
modified.
to p(t~
\,ersion,
one
and
clauses
for
are
instance
not
are
that
1
applicable
key difference
two
clauses
the
applicable
presentation
in
laxation
goals
version
of the
ing
on the
not
allow
and
therefore
not
for
in the
body
p is
relaxed
containing
toiwith
the
a very
with
to
operational
specific
which
occur
relaxed
the
allow
re-
the
relaxed
name
depend-
it is invoked.
in
the
semantics
of the
we now
of clauses,
and
bodies
[9] did
the
PTSLD-derivations
when
there
of an
is captured
of pairs
by
by enabling
a relaxation
Sketch:
By induction
P.
For
the
of
O-predicates
in
the
program
relax _pF_cfi
for
presenting
of program
and
the
_yi_cti (t)a
ence
model
(C’, T)
18
enforce
p satisfy
C.
inductive
case
where
Cisacollection
PTSLD-tree.
(C,, T,),
pair
and
timal
valuation
lfthe
T,+l)
following
and
Proof
Sketch:
O-predicc~tes
for
the
not
selected
toang-
in
a relaxalde
respect
in
goal,
to clauses
the
leaf
C,+l
=
to
Tis
apartial
from
thepazr
the
selected
is a relaxable
relux(p(i),
goal
c(ti)),
relaz_pr_cU(t>,
in
the
leaf
p(~)
T% +
relatable
and T, +
T,+l
to
T,
T,+l
goal
with
a stratified
qoalG’,
pairs
a relatable
(P, G),
clause.
is derived
(CI,
a preference
in
C,+l
=
is replaced
respect
T,
Sketch:
program.
the
G
. . ..{ C., T,),...
in
the
(C,,
PTSLD-tree
and
prefer-
clauses
the
argument
is
for
solutions
works
a preference
to
for
the
Jogic
computed
by
on
induction
program.
It
proop-
the
makes
levels
use
computed
of
for
the
relax-
■
of clauses.
preference
that
of P,
node
and
there
at the
8’
program
P and
PTSLD-derivation
suppose
then
tree
that
iogic
the relaxecl
G is finite,
PTSLD
GO is a relaxed
is a successful
end
of the
is a valuation
that
furthermore,
By induction
P
C,
is
each (C,+l,
a set
T,+l
the
RELAX
p(f)
and
nocle
relaxed
PT-
satzsfies
0 =
the
was
the
such
arbiter
jor
8’1)
relaxed
the
some
the
the
the
the
by
our
are
for
the
complete
are
correct
the
program
no
Therefore
optimal
is finite
operational
semantics
semantics
answers
was complete
to
was
rela.t.p;
answers.
for
.cti( ~
)
T,).
to
the
result.
101
relaxable
The
query
inductive
ale
concerned,
case is similar.
original
program.
we
comof
and
Therefore
the
declarative
semantics
of the transformed
program
with the relaxed
intended
preference
model
as far
transformed
C(Z)),
original
is capable
gram,
the
seman-
(the
of
for
answer
operational
of
it is complete
relaxation
P U relaz(p(f),
c(ii)
sub-optimal
semantics
relaxation
O-predicates.
operational
potential
O-predicates
the
Furthermore,
as there
by
from
of the
Suppose
as any
is computed
that
prunes
operational
p(~
defining
emanating
Therefore,
all
cluery
as general
p(F)
tree
case:
WRT c(ii).
of clauses
at least
search
on the level
base
PTSLD-derivations
and
query
plete).
a
the
bodies
program
and
For
Consider
the
by
2s a sequence
where
and
the
was
P
tics.
C; U
to the clauses
program
PTSLD-derivation
TI),
and T, is a partial
from
logic
instance
q.
Proof
the
Given
P
such
at
computing
19
arbiter
when
of answers
G such
derivation
goals
in C,+. I.
Definition
the
intended
.$ is a relaxed
in bodies
consequence
program
is
with
be erpanded
WRT c(fi),
is
the
query
from
an answer
the
RELAX
then
show
relaxed
GO.
proof
in
appear
successful
query
in C’%.
goal
P ~
Given
in
for
>.
‘~ If
we can
the form
be e.rpandedin
C% and
instance
preference
in the
in the
The
P
that
soundness
that
2
the
SLD
holds:
goal
If
such
The
above
goals
G,
prefer-
the
world
and
is an
intended
Similarly,
same
of levels
there
intended
ordering
the
O-predicates
Clearly,
world
C( u,)).
❑
then
assumptions
1. If
same
G is a goal
constraints
wclerived
P
prefer-
too.
of
the
the
c(z)).
7 (Soundness)
gram
preferential
as a deriva-
lsapairof
ofclauses
Thepair(C,+l,
the
Essentially
a relaxation
SLD-trees.
Aprograrn-tree
of
at
a relax-
number
in
in any
in some
of the
Suppose
is true.
model
occurs
and
relaz(p(~,
1.
relaxed
occurs
con-
af relaz_pF_cti(Qb’
the
C( ii )).
of P U relrsx(p(t],
substitution
Definition
p(fja
P
PU
case
a world
G as c(~)t)
preference
relax
only
of
is
in the
the
is a pair
is a rela~ed
on the levels
in
a world
of P and
program
if and
P U r-eluz(p(~),
to
if an instance
Lemma
did
is encountered.
derivation
partial
(1)8
a
to G
satdsfies
(C, T)
p(t~@
base
and
].
consequence
program
ation
O-predicate
them
goal
G,
the
belongs
@ that
logic
of P and
P
valuation
where
c(z),
WRT
Proof
emanat~ng
program
if there
a successful
of clauses
described
version
p(t~
in
lemma
specialized.
FVeextend
tion
gets
goals
name
Since
bodies
here
is
program
derivation
a preference
preferential
model
logtc
in T
PTSLD
consequence
Theorem
thebody
presentation
following.
arguments
the
our
in the
O-prechcafe
exact
rec[uire
This
is the
to occur
relaxation
to beso
ment
~]
between
Given
relux_pi_cz
to
T
optinlal
node
G = RELAX
intended
ob-
is ap-
as before.
The
a successful
goal
that
by adding
of a clause
to ~with
isnot
which
forp
a preference
is is a valuation
of a relaxed
end
p(~tl
O-pred/cate
is modified
p that
we obtain
that
for
clause
goal
is applicable
other
a new
Every
If some
then
that
the
the
forp.
herelaxation
body;
not
introduces
program,
to P
the
model
The
where
computed
at
ence
to be successful
derivation,
Given
straints
instance
b).
is said
the
a relaxed
is a relaxed
~
4.
G,
ential
,C1,P1)
Cl,
20
goal
ation
—
at
tree.
Lemuna
.1. relax-sh-dist(a,b,~,p~notinpathtc,~)(a,b
C2 <
PTSLD-derivation
(C, T)
Definition
set of clauses:
1. relax_sh_dist(
A relaxed
is a pair
PTSLD
sh_dj.st(a,b,C,p)
re~u~(sh_dist(a,b,
ing
to G is relax.p(f).
have
if
pro-
Since
the
coincides
as answers
our
desired
■
Theorem
ence
8 (Conlpleteness)
logic
ond
program
C; is a goal
anating
from
such
it
a successful
that
the
that
satisfies
P
and
constraints
that
then
end
at the
there
that
node
in
is
the
Sketch:
The
is a
Trondheim
there
O-predtcatesin
the
is by
induction
program.
on
It makes
the
levels
of
Brown,
ematacs
6
Conclusions
The
concept
problems
earlier
work
provides
requiring
[8],
be specified
a unifying
approach
optimization
we showed
how
declaratively
logic
programming.
@ showing
how
the
and
of
7th
Intl.
Systems,
Symp.
LNAI
689,
and
a
T.
Wakayama.
Unified
Approach
Reasoning.
Preferto
Annuls
Intelligence,
Non-
of Afath-
10:233–280,
1994.
On
optimization
in the
[4]
problems
paradigm
of preference
This
paper
extends
our
paradigm
can also capture
notion
of
given
by practical
preference
a query
considerations,
relaxation
RELAX p(f)
c is a C-predicate,
satisfies
c.
c and
to answer
the
the
best
we must
cluery.
We
for such
notion
of
preferential
relaxed
consisted
changing
the
defining
p ensure
LNCS
erential
the
program
to
transformed
The
if
for
to the
with
to
start
with,
they
arbiter
were
are
for computing
also
[7]
We
to
are investigating
efficient.
Given
operational
so that
the
[8]
clauses
for
preferential
better
query
to it.
For
paths,
force
in
for
every
evenlength
paths
that
are
a constraint
composed
such
the
not
c is not
is not
any
into
the
predicate
a node
if it
c(ti)
when
over
the
satisfy
in
inpath
distributes
some
of paths
path
as there
of odd
as evenlength
We
try
‘Jle
programs
programs
laxation
as the
goal
than
investigating
O-predicates
to be the
with
in this
the
level
the
in
same
can
level
in
the
relaxation
paper
of
body
of the
semantics
relaxation
as the
level
goals
be termed
the
re-
[11]
is passed
of a -
[12]
Therefore,
[13]
over
of clauses
when
goals
of the
in
had
to
in
be
head.
we allow
the
level
bodies
of the
-
O-predicate
at the
C.
Op-
PLILP
Zaniolo.
Logic
’94,
Minimum
Programming.
Principles
of
The
In
and
In
Database
and
Proc.
Systems,
model
A.
Proc.
5th
Symposzum
1081–1086,
B.
stable
Robert
editors,
on
seman-
Kowalski
,Jo~nt
Logzc
and
InternaProgranz-
1988.
Jayaraman,
Grammars.
Science,
Govindarajan,
and
Technical
SUNY
B.
Logic
at
S. Mantha.
Report
Buffalo,
Jayaraman,
Programming.
and
In
Programming,
K.
Goviudarajan,
in
pages
port
95-22,
falo,
1995.
Dept.
J. Jaffar
and
ming.
Proc.
In
B.
Pref-
94-27,
Dept.
1994.
S. Mantha.
Proc.
12th
731–745,
Jayaraman,
Constraint
Logic
Pref-
Intl,
Conf.
1995.
and
S. Ma,ntha.
Languages.
Technical
of Computer
J. L.
Lassez.
Idth
Science,
Constraint
A Chf
Languages,
J. Jaffar
and
M.
Symp.
pages
J. Maher.
A Survey.
SIJNY
Logic
Re-
111-119,
Re-
at
Buf-
Program-
on Principles
of Pro-
1987.
Constraint
Journal
P. C. Kannelakis,
of Logic
D.
G. M.
Query
Prznczples
length
relaxation
at the
K.
straint
em
in bodies
clause
O-predicate
Preferences
Relational
Symposium
Lifschitz.
Bowen,
Logic
ming:
a graph
distribute
present
with
Logic
Program-
Programming,
1994.
over
stratified
O-predicate
V.
C+ovindarajan,
gramming
B.
Kemp
and
with
[14]
P.
J. K.
D. B. Shmoys
a Guzded
Tour
We
and
Chichester,
Sons,
of
The
ACM
pages
Stuckey.
Con-
SYmp.
299-313,
Semantics
In Proc.
on
1990.
of
Logic
International
Log2c
1991.
Lenstra,
(eds. ).
strictly
are
J.
P. Z. Revesz.
Proc.
Systems,
Symposium,
E. L. Lawler,
and
In
Aggregates.
Programming
a re-
Kuper,
Languages.
of Database
Programs
paths.
considered
Handling
call,
are even
not
[10]
to
cannot
length.
does
on
Conference
laxation
the
the
P in
of P.
and
programming.
pages
on Logic
do not
in
that
A.
the
of p
recursive
structure
sub-path
sub-path
C(U),
we can
the
Sci-
1991.
and
Kenneth
erence
more
C(Z)
C-predicate
Sola.
Intl.
in
Symp.
logic
K.
T.
6th
S. Greco,
for
for
opera-
definition
recursively,
by pushing
example,
only
do not
the
WRT
the
Computer
con-
be made
p(f)
RELAX
if p is defined
“distributes”
which
can
C(V) into
that
is possible
because
if and
to p(~
efficiency
this
goal
“pushes”
solutions
Intuitively,
under
relaxation
a relaxable
However,
laxable
conditions
preference
semantics
succeed.
gain
for
Theoretical
Programming
Predicates
of Computer
[9]
semantics
Foundations
on
1994.
Gelfond
erence
sequences.
tloual
Predicates
Conf.
pref-
complete
complete
relaxed
by
respect
M.
ming,
clauses
relaxed
the
PTSLD-derivations
program
~
1.9th
and
Proc.
154-163,
tional
the
program
computing
changes
oper-
operational
original
PTSLD-derivations
are sound
and
844,
ACM
tics
for p
we introduced
The
[6]
may
answers
consequence.
The
p that
own
theoretic
and
changes
that
that
model
of p.
consequences.
p ensure
sub-optimal
relaxations
10th
for
In
S. Ganguly,
pages
p on its
of Optimization
Proc.
and
Logic
Maximum
the
O-predtcate
answer
for
the
program
for
best
J. Fowler,
Constraint
Essentially,
p is an
of i,ransforming
clefinition
resulting
the
provided
semantics
paper.
answer
consider
ational
semantics
this
In
Technology
timization.
previous
work
the notion
of
we introduced
where
we want
However,
satisfy
in
WRT c(ii),
Semantics
1993.
F. Fages,
in
[5]
Motivated
the
Languages.
to
relaxation.
relaxation.
lower
Mantha,
.4rtificzal
of Software
of preference
formulating
the
Logical
Hierarchies
1993.
in Deductive
F. Fages.
ence,
not
Proc.
Intelligent
Towards
and
in CLP
and
S.
Wakayama.
Relaxation
In
for
Logics:
T.
❑
[3]
can
and
Constraint
Norway,
Monotonicity
use of thelemrna
above.
In
of
Methodologies
[2] A.
Q = tl’q.
proof
Mantha,
Programming.
on
ence
Proof’
S.
Logic
PT-
8’
and
Brown,
Reconstruction
that
of the
G such
[1] A.
emsuch
of P,
at the
References
preferof clauses
PTSLD-derivation
tree
from
the
such
Ij
in bodzes
if O is a valuation
PTSLD
emanating
ts a valuation
ZS cz stratzj$ed
consequence
zn the
derivation
P
goals
relaxed
then
preferential
node
valuation
If
selaxatton
w finite,
G@ is a relaxed
SLD
with
A. H. G. R.innooy
Traveling
Combinatorial
United
Salesman
Optimization.
Kingclorn,
I<an,
Wiley
1985.
of the
clauses
[15]
head.
J.
W.
Lloyd.
Springer-verlag,
102
Foundations
1987.
of
Logic
and
Problem:
Programming.
[16]
M. J. Maher
and
in Constraint
Lnsk
P. J. Stuckey.
Logic
and
R.
A.
Overbeek,
~can Conference
19,39
[17]
S. Mantha.
on
[18]
ber
199].
Ii.
Marriott
st, ra,int
Logic
PhD
Preference
P.
J.
Programs
Programming
Proc.
Progrcammingj
thesis,
and
Logic
Query
Languages,
editors,
First-Order
Appltcutions.
Expanding
Programming
Amer-
pages
20–36,
and
of Utah,
Stuckey.
with
and
Systems,
and
H. D.
Warren.
their
Novem-
Semantics
of
Optimization.
Languages
E. L.
North
Theories
University
Power
In
(30n-
Letters
on
2(1-4):181–196,
1993.
[19]
F. (2. N.
Pereira
C+rammars
malism
for
and
Artificial
K. A. Ross
ductive
and
In
Systems,
S. Sndarshan
Relevance
and
in
with
Y. Sagiv.
R.
the International
Aggregation
Databases.
Conference
on
in De-
on Principles
1992,
Ramakrishnan.
Deductive
1980.
Aggregation
Symp.
114–126,
For-
Transition
13:231 -27’8,
ACM
pages
Clause
of the
Augmented
Monotonic
Proc.
Definite
- A Survey
Intell~gencej
Databases.
[If Database
[21]
Analysis
a Comparison
Networks.
[ZU]
D.
Language
In
Verg
and
Proceedings
Large
of
Databases,
1991.
[’?]
S.
Sudarshan,
(0. Beeri.
mantics
for
D.
Srivast
Extending
the
A.
van
Sets
Programs.
[24]
M.
Wilson
Logic
K.
JACM,
and
Pro..
pages
Ross,
Well-Fonnded
Programming.
1G:277-318.
In
Symposium,
Gelder,
and
R.
and
J.S.
Semantics
Borning.
Journal
and
and
Valid
International
590-608,
38(3):620-650,
A.
Ramakrishnan,
Well-Founded
Aggregation.
Programming
[23]
ava,
Schlipf.
for
SeLogic
1993.
Unfounded
General
Logic
1991.
Hierarchical
of
Logic
Constraint
Programming,
1993.
103