Complexit y of nonrecursiv e logic programs with complex v - - PDF document

complexit y of nonrecursiv e logic programs with complex
SMART_READER_LITE
LIVE PREVIEW

Complexit y of nonrecursiv e logic programs with complex v - - PDF document

Complexit y of nonrecursiv e logic programs with complex v alues Sergei V orob y o v Andrei V oronk o v MPI f ur Informatik Uppsala Univ ersit y Saarbr uc k en Uppsala German y Sw eden 1 S.V orob y


slide-1
SLIDE 1 Complexit y
  • f
nonrecursiv e logic programs with complex v alues Sergei V
  • rob
y
  • v
MPI f
  • ur
Informatik Saarbr
  • uc
k en German y Andrei V
  • ronk
  • v
Uppsala Univ ersit y Uppsala Sw eden S.V
  • rob
y
  • v,
A.V
  • ronk
  • v.
Complexit y
  • f
nonrecursiv e . . . 1
slide-2
SLIDE 2 Ov erview I Query languages and complexit y; I Complex v alues; I Nonrecursiv e logic programming; I T erm algebras; I Results; I T ec hniques. S.V
  • rob
y
  • v,
A.V
  • ronk
  • v.
Complexit y
  • f
nonrecursiv e . . . 2
slide-3
SLIDE 3 Query languages and complexit y Examples
  • f
query languages: I Relational algebra; I First-order logic; I Logic programming. T yp es
  • f
complexit y: 1. Complexit y (what resources do es it tak e to ev aluate a query); 2. Expressiv e p
  • w
er (what functions can w e express). S.V
  • rob
y
  • v,
A.V
  • ronk
  • v.
Complexit y
  • f
nonrecursiv e . . . 3
slide-4
SLIDE 4 Complex v alues An ything whic h is dieren t from tuples
  • f
simple, atomic
  • b
jects, e.g., I Em b edded tuples; I Lists; I T rees; I Finite sets; I Finite m ultisets; I Images; I V
  • ices;
I HTML pages. S.V
  • rob
y
  • v,
A.V
  • ronk
  • v.
Complexit y
  • f
nonrecursiv e . . . 4
slide-5
SLIDE 5 Complex v alues in logic programming In logic programming v alues dep end
  • n
the signature used: I F unction-free signatures represen t tuples; I Signatures with unary function sym b
  • ls
represen t lists: the term f (g (h(a))) represen ts the list [f ; g ; a]. I Signatures with binary function sym b
  • ls
represen t trees. I Other complex v alues ma y b e represen ted b y using non-free constructors (e.g., set constructor), and c hanging equalit y in terpretation (unication),
  • r
b y using constrain ts. S.V
  • rob
y
  • v,
A.V
  • ronk
  • v.
Complexit y
  • f
nonrecursiv e . . . 5
slide-6
SLIDE 6 Logic programs A logic program is a nite set
  • f
clauses, i.e., form ulas L 1 ^ : : : ^ L n
  • A;
where n
  • 0,
A is an atom and L i are literals. Another notation for clauses: A L 1 ; : : : ; L n : Nonrecursiv e logic programs: the predicates are P 1 ; : : : ; P m . If the head con tains P i , then the b
  • dy
can
  • nly
use P 1 ; : : : ; P i1 . S.V
  • rob
y
  • v,
A.V
  • ronk
  • v.
Complexit y
  • f
nonrecursiv e . . . 6
slide-7
SLIDE 7 Sources
  • f
expressiv e p
  • w
er I Complex v alues, e.g., trees v ersus lists: P (f (x; x) ) Q(x): I Negation: P (x) Q(x); :R (x): I (Absence
  • f
) range restriction: P (f (x ); x) : S.V
  • rob
y
  • v,
A.V
  • ronk
  • v.
Complexit y
  • f
nonrecursiv e . . . 7
slide-8
SLIDE 8 Seman tics F
  • r
recursiv e programs there is no generally accepted seman tics (due to nonmonotone recursion). F
  • r
nonrecursiv e
  • nes
view a program as a set
  • f
explicit denitions
  • f
predicates, using Clark's completion. F
  • r
example, P 3 (x; f (x)) P 1 (x; y ) P 3 (x; g (z )) P 2 (x; y ); P 2 (a; z ) denotes the explicit denition P 3 (x; u)
  • 9y
(y = f (x) ^ P 1 (x; y ))_ 9y 9z (u = g (z ) ^ P 2 (x; y ) ^ P 2 (a; z )): Ev en tually , ev ery predicate ma y b e view ed as explicitly dened in terms
  • f
equalit y =. S.V
  • rob
y
  • v,
A.V
  • ronk
  • v.
Complexit y
  • f
nonrecursiv e . . . 8
slide-9
SLIDE 9 T erm algebra Explicit denitions
  • v
er what? T erm algebra
  • f
a signature
  • ,
denoted T A() : 1. the domain is the set
  • f
all ground terms
  • f
; 2. ev ery term is in terpreted b y itself. The p erfect mo del
  • f
a logic program L: the mo del induced b y the explicit denitions. Note: language-dep enden t in general, language-indep enden t for range-restricted programs. S.V
  • rob
y
  • v,
A.V
  • ronk
  • v.
Complexit y
  • f
nonrecursiv e . . . 9
slide-10
SLIDE 10 The SUCCESS problem SUCCESS(): sev eral equiv alen t reform ulations: 1. Giv en a logic program L and a predicate P , is P nonempt y in the p erfect mo del
  • f
L? 2. Giv en a logic program and n ullary predicate suc c ess , is success true in the p erfect mo del
  • f
L? 3. The com bined complexit y. 4. The program complexit y. S.V
  • rob
y
  • v,
A.V
  • ronk
  • v.
Complexit y
  • f
nonrecursiv e . . . 10
slide-11
SLIDE 11 Results function sym b
  • ls
no unary an y not range-restricted no negation PSP A CE NEXP NEXP with negation PSP A CE LA TIME(2 O (n) ) NONELEM (n) range-restricted no negation PSP A CE PSP A CE NEXP with negation PSP A CE PSP A CE LA TIME(2 O (n) ) S.V
  • rob
y
  • v,
A.V
  • ronk
  • v.
Complexit y
  • f
nonrecursiv e . . . 11
slide-12
SLIDE 12 Complexit y classes LA TIME (2 O (n) ) is the class
  • f
problems solv able b y alternating T uring mac hines running in time 2 O (n) with a linear n um b er
  • f
alternations. NTIME(2 O (n) )
  • LA
TIME(2 O (n) )
  • DSP
A CE(2 O (n) ): e (n) = n; e k +1 (n) = 2 e k (n) ; e 1 (n) = e n (0): NONELEM(f (n)) is the class
  • f
problems with lo w er and upp er b
  • unds
  • f
the form e 1 (f (cn)) and e 1 (f (dn)). S.V
  • rob
y
  • v,
A.V
  • ronk
  • v.
Complexit y
  • f
nonrecursiv e . . . 12
slide-13
SLIDE 13 function sym b
  • ls
no unary an y not range-restricted no negation PSP A CE NEXP NEXP with negation PSP A CE LA TIME(2 O (n) ) NONELEM(n) range-restricted no negation PSP A CE PSP A CE NEXP with negation PSP A CE PSP A CE LA TIME(2 O (n) ) S | folklore; S | using complexit y
  • f
term algebras; S | upp er b
  • und
b y constrain t SLD-resolution, lo w er b y dierence lists; S | upp er b
  • und
b y constrain t SLD-resolution, lo w er b
  • und
b y tiling; S | upp er b
  • und
b y guessing terms
  • f
restricted depth, lo w er trivial; S | upp er b
  • und
b y guessing terms
  • f
restricted depth, lo w er using the theory
  • f
t w
  • sucessor
functions; S.V
  • rob
y
  • v,
A.V
  • ronk
  • v.
Complexit y
  • f
nonrecursiv e . . . 13
slide-14
SLIDE 14 T erm algebra and nonrecursiv e logic programs Theorem 1 T h(T A()) is p
  • lynomial-time
e quivalent to SUCCESS () . I SUCCESS() is PSP A CE
  • complete
for function-free
  • (Sto
c kmey er and Mey er, 1973); I SUCCESS() is LA TIME(2 O (n) )-complete for monadic
  • (F
erran te and Rac k
  • ,
1979; V
  • lger
1983); I SUCCESS() is in NONELEM(n) for
  • with
binary sym b
  • ls
(upp er b
  • und
b y quan tier elimination Malcev, 1961, lo w er b
  • und
in V
  • rob
y
  • v,
1996). S.V
  • rob
y
  • v,
A.V
  • ronk
  • v.
Complexit y
  • f
nonrecursiv e . . . 14
slide-15
SLIDE 15 Upp er b
  • unds
without negation Theorem 2 (Dantsin, V
  • r
  • nkov,
1997) If unic ation
  • ver
a domain D is solvable in nondeterministic p
  • lynomial
time, then the SUCCESS pr
  • blem
for lo gic pr
  • gr
ams without ne gation
  • ver
D is in NEXP. Pro
  • f
b y using constrain t SLD-resolution: clauses lik e P n (f (x; y )) P n1 (x); P n1 (y ) giv e exp
  • nen
tially long branc hes, but at the end w e solv e exp
  • nen
tially long sets
  • f
equations b y using the nondeterministic unication algorithm. S.V
  • rob
y
  • v,
A.V
  • ronk
  • v.
Complexit y
  • f
nonrecursiv e . . . 15
slide-16
SLIDE 16 Upp er b
  • unds
with range restriction P n (f (x; y )) P n1 (x); P n1 (y ) F
  • r
P n to b e true
  • n
terms
  • f
depth k + 1, P n1 m ust b e true
  • n
terms
  • f
depth k : term depth gro ws slo wly. S.V
  • rob
y
  • v,
A.V
  • ronk
  • v.
Complexit y
  • f
nonrecursiv e . . . 16
slide-17
SLIDE 17 Lo w er b
  • unds
without negation The Tiling Problem: can w e co v er b y tiles the square
  • f
size 2 n
  • 2
n b y tiles from a giv en nite set, suc h that some conditions
  • n
adjacen t tiles are held? Represen t tilings b y terms: the term [t 1 ; t 2 ; t 3 ; t 4 ] represen ts the tiling t 1 t 2 t 3 t 4 S.V
  • rob
y
  • v,
A.V
  • ronk
  • v.
Complexit y
  • f
nonrecursiv e . . . 17
slide-18
SLIDE 18 Lo w er b
  • unds
without negation (con t.) 2 n+1 tiles z }| { 2 n+1 tiles z }| { X 1 X 2 Y 1 Y 2 X 3 X 4 Y 3 Y 4 Z 1 Z 2 U 1 U 2 Z 3 Z 4 U 3 U 4 X 1 X 2 X 3 X 4 X 2 Y 1 X 4 Y 3 Y 1 Y 2 Y 3 Y 4 X 3 X 4 Z 1 Z 2 X 4 Y 3 Z 2 U 1 Y 3 Y 4 U 1 U 2 Z 1 Z 2 Z 3 Z 4 Z 2 U 1 Z 4 U 3 U 1 U 2 U 3 U 4 S.V
  • rob
y
  • v,
A.V
  • ronk
  • v.
Complexit y
  • f
nonrecursiv e . . . 18
slide-19
SLIDE 19 Enco ding tiling i+1 ([ [X 1 ; X 2 ; X 3 ; X 4 ] ; [ Y 1 ; Y 2 ; Y 3 ; Y 4 ]; [Z 1 ; Z 2 ; Z 3 ; Z 4 ]; [U 1 ; U 2 ; U 3 ; U 4 ]] ; T ) tiling i ([X 1 ; X 2 ; X 3 ; X 4 ]; T ); tiling i ([X 2 ; Y 1 ; X 4 ; Y 3 ]; ); tiling i ([Y 1 ; Y 2 ; Y 3 ; Y 4 ] ; ); tiling i ([X 3 ; X 4 ; Z 1 ; Z 2 ] ; ); tiling i ([X 4 ; Y 3 ; Z 2 ; U 1 ] ; ); tiling i ([Y 3 ; Y 4 ; U 1 ; U 2 ]; ); tiling i ([Z 1 ; Z 2 ; Z 3 ; Z 4 ]; ); tiling i ([Z 2 ; U 1 ; Z 4 ; U 3 ]; ); tiling i ([U 1 ; U 2 ; U 3 ; U 4 ]; ): S.V
  • rob
y
  • v,
A.V
  • ronk
  • v.
Complexit y
  • f
nonrecursiv e . . . 19
slide-20
SLIDE 20 Dierence lists Unary function sym b
  • ls
without range restriction: can create big dierences using dierence lists. dif (f (x); x) dif (g (x); x) : : : dif n+1 (x; y ) dif n (x; z ); dif n (z ; y ) dif n (s; t) holds if and
  • nly
if the \dierence" b et w een s and t is 2 n . Using large dierence, w e can still enco de the Tiling Problem . . . S.V
  • rob
y
  • v,
A.V
  • ronk
  • v.
Complexit y
  • f
nonrecursiv e . . . 20
slide-21
SLIDE 21 Bags and sets Some results ab
  • ut
bags and sets: 1. Without negation NEXP
  • complete
(Dan tsin and V
  • ronk
  • v,
1997). 2. Unrestricted: undecidable. S.V
  • rob
y
  • v,
A.V
  • ronk
  • v.
Complexit y
  • f
nonrecursiv e . . . 21