Baumbeschreibungssprachen in der computationalen Logik - PowerPoint PPT Presentation

About This Presentation
Title:

Baumbeschreibungssprachen in der computationalen Logik

Description:

Spracherkennungs-und Anfrage-Aequivalenz von MSO, monadischem Datalog, und Automaten. Thomas Kloecker Betreuer: Tim Priesnitz Seminar Logische Aspekte von XML, – PowerPoint PPT presentation

Number of Views:91
Avg rating:3.0/5.0
Slides: 74
Provided by: nieh151
Category:

less

Transcript and Presenter's Notes

Title: Baumbeschreibungssprachen in der computationalen Logik


1
Spracherkennungs-und Anfrage-Aequivalenz von
MSO, monadischem Datalog, und Automaten.
  • Thomas Kloecker
  • Betreuer Tim Priesnitz
  • Seminar Logische Aspekte von XML,
  • Gerd Smolka, PS Lab, Uni Saarland, SS 2003

2
Uebersicht
0. Datalog vs. SQL monadischer Datalog 1.
Automaten ? monadischer Datalog 2.
Monadischer Datalog ? MSO 3. MSO ? Automaten

Universum Automatentypen
A. Strings B. Ranked Trees C. Unranked Trees 'algebraisch' vs. bottom-up vs. top-down. deterministisch?
3
Uebersicht
0. Datalog vs. SQL monadischer Datalog 1.
Automaten ? monadischer Datalog 2.
Monadischer Datalog ? MSO 3. MSO ? Automaten

Universum Automatentypen
A. Strings B. Ranked Trees C. Unranked Trees 'algebraisch' vs. bottom-up vs. top-down. deterministisch?
4
Uebersicht
0. Datalog vs. SQL monadischer Datalog 1.
Automaten ? monadischer Datalog 2.
Monadischer Datalog ? MSO 3. MSO ? Automaten

Universum Automatentypen Aufgabe
A. Strings B. Ranked C. Unranked 'normal' vs. two -way deterministisch Sprach-erkennung Query-Berechnung
5
Automaten, monadischer Datalog MSO
Datalog

6
Datalog - Beispiel
Presburger Arithmetik

q0
q1
1 0 1 0 ? 0 ...
0 1 1 0 ? 0 ...
1 1 0 1 ? 0 ...
q2
q0 q0 q0 q1 q0 q2
Endlicher Automat für Addition
7
Datalog - Beispiel
nocar(0). nocar(NextPos) - s(Pos, NextPos),
nocar(Pos), in_000(Pos). 000
00 nocar(NextPos) - s(Pos, NextPos),
nocar(Pos), in_011(Pos). 001
10 nocar(NextPos) - s(Pos, NextPos),
nocar(Pos), in_101(Pos). 010
10 nocar(NextPos) - s(Pos, NextPos),
carry(Pos), in_001(Pos). 100 10

cxy
zc' carry(NextPos) - s(Pos, NextPos),
carry(Pos), in_010(Pos). 101
01 carry(NextPos) - s(Pos, NextPos),
carry(Pos), in_100(Pos). 110
01 carry(NextPos) - s(Pos, NextPos),
carry(Pos), in_111(Pos). 111
11 carry(NextPos) - s(Pos, NextPos),
nocar(Pos), in_110(Pos). 011
01 endOfFile(NextPos) - s(Pos, NextPos),
in_BotBotBot(Pos). accept - endOfFile(_).
in_101(0). in_011(1). in_110(2). in_001(3). in_Bot
BotBot(4). s(0,1). s(1,2). s(2,3). s(3,4). s(4,5)
.

8
Datalog Beispiel Presburger Arithmetik
nocar(0). nocar(NextPos) - s(Pos,
nocar(NextPos) - s(Pos, nocar(NextPos) -
s(Pos, nocar(NextPos) - s(Pos,

cxy
zc' carry(NextPos) - s(Pos, NextPos),
carry(Pos), in_010(Pos). 101
01 carry(NextPos) - s(Pos, NextPos),
carry(Pos), in_100(Pos). 110
01 carry(NextPos) - s(Pos, NextPos),
carry(Pos), in_111(Pos). 111
11 carry(NextPos) - s(Pos, NextPos),
nocar(Pos), in_110(Pos). 011
01 endOfFile(NextPos) - s(Pos, NextPos),
in_BotBotBot(Pos). accept - endOfFile(_).
in_101(0). in_011(1). in_110(2).
in_001(3). in_BotBotBot(4). s(0,1).
s(1,2). s(2,3). s(3,4). s(4,5).
1 0 1 0 ? 0 ...
0 1 1 0 ? 0 ...
1 1 0 1 ? 0 ...

9
Datalog Beispiel Presburger Arithmetik
nocar(0). nocar(NextPos) - s(Pos, NextPos),
nocar(Pos), in_000(Pos). 000
00 nocar(NextPos) - s(Pos, NextPos),
nocar(Pos), in_011(Pos). 001
10 nocar(NextPos) - s(Pos, NextPos),
nocar(Pos), in_101(Pos). 010
10 nocar(NextPos) - s(Pos, NextPos),
carry(Pos), in_001(Pos). 100 10

cxy
zc' carry(NextPos) - s(Pos, NextPos),
carry(Pos), in_010(Pos). 101
01 carry(NextPos) - s(Pos, NextPos),
carry(Pos), in_100(Pos). 110
01 carry(NextPos) - s(Pos, NextPos),
carry(Pos), in_111(Pos). 111
11 carry(NextPos) - s(Pos, NextPos),
nocar(Pos), in_110(Pos). 011
01 endOfFile(NextPos) - s(Pos, NextPos),
in_BotBotBot(Pos). accept - endOfFile(_).
in_101(0). in_011(1). in_110(2). in_001(3). in_Bot
BotBot(4). s(0,1). s(1,2). s(2,3). s(3,4). s(4,5)
.

10
Datalog Beispiel Presburger Arithmetik
nocar(0). nocar(NextPos) - s(Pos, NextPos),
nocar(Pos), in_000(Pos). 000
00 nocar(NextPos) - s(Pos, NextPos),
nocar(Pos), in_011(Pos). 001
10 nocar(NextPos) - s(Pos, NextPos),
nocar(Pos), in_101(Pos). 010
10 nocar(NextPos) - s(Pos, NextPos),
carry(Pos), in_001(Pos). 100 10

cxy
zc' carry(NextPos) - s(Pos, NextPos),
carry(Pos), in_010(Pos). 101
01 carry(NextPos) - s(Pos, NextPos),
carry(Pos), in_100(Pos). 110
01 carry(NextPos) - s(Pos, NextPos),
carry(Pos), in_111(Pos). 111
11 carry(NextPos) - s(Pos, NextPos),
nocar(Pos), in_110(Pos). 011
01 endOfFile(NextPos) - s(Pos, NextPos),
in_BotBotBot(Pos). accept - endOfFile(_).
in_101(0). in_011(1). in_110(2). in_001(3). in_Bot
BotBot(4). s(0,1). s(1,2). s(2,3). s(3,4). s(4,5)
.

11
Datalog Beispiel Presburger Arithmetik
in_101(0). in_011(1). in_110(2). in_001(3). in_Bot
BotBot(4). s(0,1). s(1,2). s(2,3). s(3,4). s(4,5).

nocar(0). nocar(NextPos) - s(Pos, NextPos),
nocar(Pos), in_000(Pos). 000
00 nocar(NextPos) - s(Pos, NextPos),
nocar(Pos), in_011(Pos). 001
10 nocar(NextPos) - s(Pos, NextPos),
nocar(Pos), in_101(Pos). 010
10 nocar(NextPos) - s(Pos, NextPos),
carry(Pos), in_001(Pos). 100 10

cxy
zc' carry(NextPos) - s(Pos, NextPos),
carry(Pos), in_010(Pos). 101
01 carry(NextPos) - s(Pos, NextPos),
carry(Pos), in_100(Pos). 110
01 carry(NextPos) - s(Pos, NextPos),
carry(Pos), in_111(Pos). 111
11 carry(NextPos) - s(Pos, NextPos),
nocar(Pos), in_110(Pos). endOfFile(NextPos) -
s(Pos, NextPos), in_BotBotBot(Pos). accept -
endOfFile(_).

nocar
carry
endOfFile
12
Datalog
in_101(0). in_011(1). in_110(2). in_001(3). in_Bot
BotBot(4). s(0,1). s(1,2). s(2,3). s(3,4). s(4,5).

nocar(0). nocar(NextPos) - s(Pos, NextPos),
nocar(Pos), in_000(Pos). 000
00 nocar(NextPos) - s(Pos, NextPos),
nocar(Pos), in_011(Pos). 001
10 nocar(NextPos) - s(Pos, NextPos),
nocar(Pos), in_101(Pos). 010
10 nocar(NextPos) - s(Pos, NextPos),
carry(Pos), in_001(Pos). 100 10

cxy
zc' carry(NextPos) - s(Pos, NextPos),
carry(Pos), in_010(Pos). 101
01 carry(NextPos) - s(Pos, NextPos),
carry(Pos), in_100(Pos). 110
01 carry(NextPos) - s(Pos, NextPos),
carry(Pos), in_111(Pos). 111
11 carry(NextPos) - s(Pos, NextPos),
nocar(Pos), in_110(Pos). endOfFile(NextPos) -
s(Pos, NextPos), in_BotBotBot(Pos). accept -
endOfFile(_).

nocar
carry
endOfFile
13
Datalog - Grundlegende Konzepte
Extensionaler und intensionaler Programmteil
kurzer Vergleich mit SQL formale Definition
Dialekte basic vs. stratified monadisch
/ voll Prolog Semantik

14
Datalog vs SQL
SQL Datalog
Typen Schema Menge von Namen von Relationen und Attributen Signatur Namen und Aritaeten der extensionalen Praedikate
Modellierung von gespeichert vs berechnet Tables vs Views Extensionale Datenbank (EDB) vs Intensionale Datenbank (IDB)
Expressivitaet Transitiver Abschluss nicht modellierbar Turing complete.

15
Datalog vs SQL
SQL - tables Getraenke(gid, name, preis) Kunden(tid, tname, schuhgroesse) Konsum(gid, tid, menge, datum) ------------------------------------------------------------------------------------------------------------ SQL - views Kunde2(tid, kontonummer) Konsum2(name, preis, menge, datum, schuhgroesse) SELECT blahblah -----------------------------------------------------------------------------------------------------------
Datalog- Signatur (getraenk, kunde, konsum) ----------------------------------------------------------------------------------------------------------- kunde(17, hans, 46). kunde(18, maria, 40). mensch(sokrates). mensch(hans). Datalog- Regeln Alle Menschen sind sterblich. sterblich(X) - mensch(X). ------------------------------------------------------------------------------------------------------- Wenn Hans 2 Paar Schuhe hat, verkauft er das teurere Paar. verkauft(hans, X) - hat(hans,X), hat(hans,Y), schuh(X), schuh(Y), X\Y, teurerAls(X,Y).





16
Datalog - Interaktion / Anfragen
1 ?- sterblich(sokrates). yes.

17
Datalog - Interaktion / Anfragen
1 ?- sterblich(sokrates). yes. 2 ?-
sterblich(X). X sokrates

18
Datalog - Interaktion / Anfragen
1 ?- sterblich(sokrates). yes. 2 ?-
sterblich(X). X sokrates X hans

19
Datalog - Interaktion / Anfragen
1 ?- sterblich(sokrates). yes. 2 ?-
sterblich(X). X sokrates X hans no.

20
Datalog - Interaktion / Anfragen
1 ?- sterblich(sokrates). yes. 2 ?-
sterblich(X). X sokrates X hans no. 3 ?-
sterblich(_). yes.

21
Datalog - formale Definition
Signatur dasselbe wie ranked Alphabet
(Datalog - Sprechweise) Sei eine Signatur ?
gegeben. Ein einfaches Datalog Programm (ueber
?) mit intensionalen Praedikaten PI ist eine
Menge von Regeln der Form
H - B1, , Bn. (wobei die linke Seite H
Head, und die rechte Seite B1, , Bn
Body, genannt werden), wenn gilt 1) Alle Heads
sind in Atome Ru1,.., un mit R in PI . 2) Alle Bj
, 1 lt j lt n, sind entweder Atome Ru1,.., un
mit R in PI , oder Literale ()Ru1,.., un mit R
in ? , 3) ? ? PI ?

22
Datalog - formale Definition
Die Elemente von ? heissen auch extensionale
Praedikate oder Input Praedikate. Das
einfache Datalog Program selbst heisst auch
intensionale Datenbank, oder IDB. Eine Regel
wie die obige, jedoch mit leerem Body, und als
Head ein Atom Ru1,.., un mit R aus ?, heisst
auch ein Fakt. Mengen von Fakten heissen auch
extensionale Datenbank, oder EDB. Die Semantik
des Programms (d.h. der IDB) ist eine Abbildung
EDB ? Zuweisung von Wahrheitswerten an die
intensionalen Praedikate. Ein
stratifiziertes Datalog Programm ist eine
geordnete Folge von einfachen Datalog
Programmen, Strata genannt. Jedes Stratum wird
als EDB (d.h. Input) des naechsthoeheren Stratums
interpretiert.

23
Datalog - formale Definition
Ein Datalog Programm heisst monadisch, wenn
alle intensionalen Praedikate Aritaet 1
haben. Die Signatur fuer monadischen Datalog
auf ranked trees gemaess Gottlob/Koch ist
( root, leaf, (childk)k lt maxAritaet,
(labela) a ? ?, ) Die Signatur fuer
monadischen Datalog auf unranked trees gemaess
Gottlob/Koch ist ( root, leaf,
(labela) a ? ? ) firstChild, lastChild,
nextSibling)

24
Datalog - Semantik
EDB mensch(sokrates).
IDB sterblich(X) - mensch(X).
Interactive Toplevel 1 ?- sterblich(sokrates). yes. 2 ?- sterblich(thomas). no.
25
Datalog - Semantik
shaves(barber, X) - shaves(X, X). 1 ? -
shaves(cartman, cartman). no. 2 ? -
shaves(barber, cartman). yes. 3 ? -
shaves(barber, barber). ERROR out of local stack
26
Datalog - Semantik
Erste Wahl Kleinster Fixpunkt (Perfect
Model) Existiert fuer einfaches Datalog Im
stratified Fall Semantik hierarchisch /
schrittweise kleinster Fixpunkt existiert
nicht.
27
Datalog - stratified
search.pl -- Section 2.16 of Prolog
Tutorial solve(P) - start(Start),
search(Start,Start,Q), reverse(Q,P). searc
h(S,P,P) - goal(S). / done
/ search(S,Visited,P) -
next_state(S,Nxt), / generate next
state / safe_state(Nxt),
/ check safety /
no_loop(Nxt,Visited), / check for loop
/ search(Nxt,NxtVisited,P). /
continue searching... / no_loop(Nxt,Visited) -
\member(Nxt,Visited).
start(). goal(S) - length(S,8). next_state(S
,CS) - member(C,1,2,3,4,5,6,7,8),
\member(C,S). safe_state(CS) -
length(S,L), Sum is CL1, Diff is C-L-1,
safe_state(S,Sum,Diff). safe_state(,_,
_) - !. safe_state(FR,Sm,Df) - length(R,L),
X is FL1,
X \ Sm,
Y is F-L-1, Y \ Df,
safe_state(R,Sm,Df).


28
Automaten ? monadischer Datalog
ranked trees Beispiel
d(neg(0), or(0, 1)) Signatur ( root,
leaf, (childk)k lt maxAritaet, (labela) a ? ?,
)

lblAND(root). lblNOT(root-1). lblFALSE(root-1-1). lblOR(root-2). lblTRUE(root-2-2). lblFALSE(root-2-1). root(root). child_1(root, root-1). child_2(root, root-2). child_1(root-1, root-1-1). child_1(root-2, root-2-1). child_2(root-2, root-2-2).
29
Automaten ? monadischer Datalog
accept - truth(root). false(Pos) -
lblFALSE(Pos). truth(Pos) - lblTRUE(Pos). false(
Pos) - lblAND(Pos), child_1(Pos, ChildPos),
false(ChildPos). false(Pos) - lblAND(Pos),
child_2(Pos, ChildPos), false(ChildPos). truth(Pos
) - lblAND(Pos), child_1(Pos, ChildPos_1),
child_2(Pos, ChildPos_2),
truth(ChildPos_1), truth(ChildPos_2). truth(Po
s) - lblOR(Pos), child_1(Pos, ChildPos),
truth(ChildPos). truth(Pos) - lblOR(Pos),
child_2(Pos, ChildPos), truth(ChildPos). false(Pos
) - lblOR(Pos), child_1(Pos, ChildPos_1),
child_2(Pos, ChildPos_2),
false(Pos-1), false(Pos-2). truth(Pos) -
lblNOT(Pos), child_1(Pos, ChildPos),
false(ChildPos). false(Pos) - lblNOT(Pos),
child_1(Pos, ChildPos), truth(ChildPos).

30
Automaten ? monadischer Datalog
Definition Gegeben ein monadisches
Datalog-Programm P ueber ranked trees mit
ausgezeichnetem Praedikat accept, und mit LEERER
EDB. Fuer einen Sigma-gelabelten Baum T
definiere edb(T) Uebersetzung von T in
TauRanked(Sigma) Schreibweise, P(T) das
Datalog Programm mit IDB P und EDB edb(T),
und M(P(T)) das eindeutig bestimmte minimale
Modell von P(T) dann ist die von P erkannte
Sprache L(P) ? (N -gt Sigma)r-Baum definiert
durch T in L(P) ltgt M(P(T)) accept. ( In
der Praxis T in L(P) ltgt Prolog (oder
sonstige Implementierung) antwortet "yes" auf die
Frage "accept." ) Gegeben ein deterministischer
Baumautomat A ueber Sigma, mit Zustandsmenge
Q, und Uebergangsfunktionen Delta(Sigma) in Qn
-gt Q fuer sigma in Sigma und ar(sigma) n. Satz
(Gottlob) es ex ein monadisches Datalog-Programm
P, derart dass L(P) L(A)

31
Automaten ? monadischer Datalog
Beweis / Konstruktion Fuer jedes q in Q
intensionales Praedikat, ebenfalls q genannt.
Fuer sigma in Sigma, ar(sigma) n, q-bar
(q1,...,qn) in Qn, sei die Regel R(sigma,
Q-bar) wie folgt definiert ( wobei
delta(sigma)(q-bar) q ) q(Pos) -
label_sigma(Pos), child(Pos, ChildPos1),
q1(ChildPos1),....... Fuer Endzustaende
q definiere die Regel R_fin(q) durch accept
- q(root). Fuer jede Regel deltaaccept -
truth(root).

32
Automaten ? monadischer Datalog
Gegeben ein deterministischer Baumautomat A ueber
Sigma, mit Zustandsmenge Q, und
Uebergangsfunktionen Delta(Sigma) in Qn -gt Q
fuer sigma in Sigma und ar(sigma) n. Satz
(Gottlob) es ex ein monadisches Datalog-Programm
P, derart dass L(P) L(A) Beweis /
Konstruktion Fuer jedes q in Q intensionales
Praedikat, ebenfalls q genannt. Fuer sigma in
Sigma, ar(sigma) n, q-bar (q1,...,qn) in Qn,
sei die Regel R(sigma, Q-bar) wie folgt
definiert ( wobei delta(sigma)(q-bar) q
) q(Pos) - label_sigma(Pos), q1(Pos-1),...,qn(Po
s-n). ( verkuertzt Schreibweise
) q(Pos) - label_sigma(Pos), child(Pos,
ChildPos1), q1(ChildPos1),.......
( geschwaetzige Schreibweise ) Fuer
Endzustaende q definiere die Regel R_fin(q)
durch accept - q(root). Fuer jede Regel
deltaaccept - truth(root). false(Pos) -
lblFALSE(Pos). truth(Pos) - lblTRUE(Pos). false(
Pos) - lblAND(Pos), child_1(Pos, ChildPos),
false(ChildPos). false(Pos) - lblAND(Pos),
child_2(Pos, ChildPos), false(ChildPos). truth(Pos
) - lblAND(Pos), child_1(Pos, ChildPos_1),
child_2(Pos, ChildPos_2),
truth(ChildPos_1), truth(ChildPos_2). truth(Po
s) - lblOR(Pos), child_1(Pos, ChildPos),
truth(ChildPos). truth(Pos) - lblOR(Pos),
child_2(Pos, ChildPos), truth(ChildPos). false(Pos
) - lblOR(Pos), child_1(Pos, ChildPos_1),
child_2(Pos, ChildPos_2),
false(Pos-1), false(Pos-2). truth(Pos) -
lblNOT(Pos), child_1(Pos, ChildPos),
false(ChildPos). false(Pos) - lblNOT(Pos),
child_1(Pos, ChildPos), truth(ChildPos).

33
Contribution
theorem satisfiability of structural
subtyping constraints for recursive types
is DEXPTIME complete. new relationship to
modal logics extension of Wand Tiuryns
appoach

34
Spracherkennung vs. Anfragen
Sprache ? Baeume ? ? Anfrage ? Baeume ?
(? ? ( Knoten ? ? ) ) Korrespondenz Automaten
lt--gt MSO hochheben auf Anfragen unranked
case conclusion???????
35
(No Transcript)
36
Position 1 2 3 4 5 6 7 8
U A A B A A C A A
V A A C A A B A A
37
Position 1 2 3 4 5 6 7 8
U A A B A A C A A
V A A C A A B A A
38
Position 1 2 3 4 5 6 7 8
U A A B A A C A A
V A A C A A B A A
39
(No Transcript)
40
(No Transcript)
41
forth(4)
back(7)
42
Related Work
subtype constraints for programming
languages
Mitchell
91 logical problems satisfiability,
Fuh, Mishra 90, Amadio, Cardelli 93, Eifrig,
Smith, Trifonow 95 ...
entailment, and

Pottier 98, Rehof, Henglein 97, Niehren,
Priesnitz
first-order validity
Aiken, Zu, Niehren, Priesnitz, Treinen,
Kuncak satisfiability checking for type
reconstruction

43
forth(4)
back(7)
44
Contribution
theorem satisfiability of structural
subtyping constraints for recursive types
is DEXPTIME complete. new relationship to
modal logics extension of Wand Tiuryns
appoach

45
Types
basic types int, real function types
pair types polymorphic types ?x.
x?x Milner
?

pair int
?
int int
46
Types are Trees
signature of function symbols a,b,f

f
f
a f
a
a f
a f
.
.
a b
.
a
constants only finite trees
(ground terms) infinite trees
f ( a
, f(a,b) )
47
Subtyping
subtypes (substitution) int real
Mitchell 91 ordering is lifted to ground
terms Example
a b f(a,a) f(a,b)

t1 s1 t2 s2 f(t1, t2)
f(s1, s2)

48
Structural versus Non-Structural
f
f
f

? f
f
a f


? ?
?
a b
? t t
for every tree t
49
Constraint Languages
terms t over basic types,
smallest/greatest types ?,
function (pair) types,
and type variables subtype
constraints are conjunctions of inequations
t1 t2


50
Open Questions
Is entailment of non-structural subtyping
decidable? - structural case solved Rehof,
Henglein 97,98 - many approaches
Niehren, Priesnitz, Aiken, Zu, Treinen
satisfiability of subtyping with constant
ordering - complexity for structural
subtyping with recursive types
Wand, Tiuryn between PSPACE and DEXPTIME
- decidability for non-structural subtyping

51
Structural Subtyping with Constants
constant ordering is lattice O(n )
Kozen, Palsberg, Schwartzbach 94, Palsberg,
Wand, OKeefe 97 arbitrary ordering
3

lower bound upper bound
constants only NP-hard in NP
finite trees
PSPACE-hard in PSPACE infinite trees
DEXPTIME-hard in DEXPTIME
Pratt, Tiuryn 93,96 easy
Tiuryn, Wand 93 Frey 2002
new! Tiuryn, Wand 93
52
Example NP-hardness
signature with 4 constants c lt a, c lt b, d lt
a, d lt b

consider constraint c x a ? d y
b ? y x x ? y y x


axx b
a xxb
which has exactly 2 solutions
c yyd
cyy d
53
Negation Gate
has exactly 2 solutions az3z2, bz4z1,
cxz5, dyz6 axz1, byz2, cz4z6,
dz3z5


true z1 z2 b
b z7 true
negation gate x ?z
x z3 z4 y
y z
false z5 z6 d
d z8 false
plug it together
54
Negation Gate for Vectors
f
f
f
f true
f false
f false
f false
f false
f false
f true
f true
f true
.
.
.
.
.
.
.
.
.
true
false
false
false
false
false
true
true
true
.
.
.
.
.
.
.
.
.
constants are unary
55
Negation Gate Implementation
new variables a8 a8 a ( a8 ) x
is boolsche false8 x true8 same
idea to implement ? only negate at
position p ? negate all positions at
p1
a
a
a
p
56
Example 1-Bit-Counter

true a
given signature with 4 unary symbols
false b
define counter by
true
false
true8 x false8 ? true8 y false8 ?
x ?y ? xtrue(y)
false
true
true
false
false
true
x
y
57
Regular Tree Constraints Models
Complete Infinite Tree.
x ?y
x ?y
x ?y
1
2
1
x y
x y
2
1
2
x ?y
alternative v ? true,false for p in
(1?2)
p
58
Regular Tree Constraints
given signature with constant ordering,
alphabet A of letters i, regular
expressions r over A, regular tree
constraints are conjunctions of 4 types ( x
y ) ( x y ) ( x c
) ( c x )
59
Tiuryn Wands Approach

Satisfiability of structural subtype
constraints over infinite trees is O(n)-reducible
to regular tree constraints.
Tiuryn, Wand 93
60
Propositional Dynamic Logic (PDL)
Pratts dynamic logic logic for program
verification propositional fragment by
Fischer, Ladner

61
PDL Models

x ?y
x ?y
x ?y
2
1
2
x ? y
x y
x y
1,2
2
2
models are rooted directed labeled graphs
62
PDL Language
alphabet A 1,2,...n regular
expressions r over A PDL Syntax f P
?? f ? f ? f ? r f modal operator r
f for all r-sucessors holds f

P Q
1
2
P Q
1?2 (P?Q)
63
Example 1-Bit-Counter

1 (P ? 1 P) ? P has one solution in the
class of unary infinite deterministic trees


P
?P
P
?P
64
Tree PDL
1
2

1
2
1
2
theorem satisfiability of Tree PDL is
DEXPTIME-complete proof reduction to
deterministic PDL models are
restricted to be functional

2
1,2
2
forbidden
Satisfiability of Deterministic PDL is
DEXPTIME-complete. Ben-Ari,
Halpern, Pnueli 82 Parikh 78
65
Regular Tree Constraints ? Tree PDL
theorem regular tree constraints are
a fragment of tree DPL example
signature x y ?
Px ? Py ( x y )
? r (Px ? iPy) ( x
false ) ? r (Px ? false)
e e
p pi p in r
p p in r
66
Core Tree PDL
Core Tree PDL is defined by a restricted syntax
f r1?1 ? ? rn?n where r
is e or (1?2) ? P ?? ? ? ? ? ? ? r
? where r is 1 or 2
67
Satisfiability of Core Tree PDL
theorem satisfiability of Core Tree PDL
is DEXPTIME-complete
possibilities for the hardness-proof encode
Halting-Problem of alternating linear-space
bounded Turing machine. Exists a winning
strategy in a two person tiling game?

Maarten de Rijke PDL Emptiness of the
intersection of some tree automta.
Helmut
Seidl haskell overloading
68
Sat. of Core Tree PDL is DEXPTIME-hard
regard n tree automata (Q, S, d, q ) with S
f, a, b
init
except one nonempty infinite tree (1?2) ( Pf ?
Pa ? Pb ? P) (1?2) (Pa ? Pb ? P) ? 1?2 P
e ? P
except one nonempty finite tree mark with
counter all exponential deep nodes (1?2)
Pdeep ? P
Pf
Pa
Pb
Pdeep PdeepPdeep Pdeep
69
Sat. of Core Tree PDL is DEXPTIME-hard
every tree automata accepts a tree e Pq
init
(1?2) (Pf ? 1 Pq ? 2 Pq ) ? Pq if
f(q,q) ?q in d (1?2) Pa ? Pq
if a ?q in d
init
70
Core Tree PDL ? Subtype Constraints
main theorem sat. of core tree PDL is
O(n)-reducible to sat.
of structural subtype constraints
over infinite trees.
reduce example (1?2) (P ?
iP)
P2 (P ? P1 ( i P ) )
P2 (P ? P1
( i P ) ) false8 P2, P, P1, P
true8 ? P1true( P) ? P2 P ? P1 ?
P2true 8
i

71
Conclusion
modal logic approach to subtyping
constraints non-structural case still
open can we extend our approach? what
about entailment?

72
thank you
73
Result Pratt, Tiuryn 96
Satisfiability of Structural Subtype
Constraints is NP-complete in the Model of
single Leafs. (Signature contains only
Constants)
Write a Comment
User Comments (0)
About PowerShow.com