Learning Deterministically Recognizable Tree Series — Revisited
Andreas Maletti
Learning Deterministically Recognizable Tree Series Revisited - - PowerPoint PPT Presentation
Learning Deterministically Recognizable Tree Series Revisited Andreas Maletti , 22 May 2007 00 Motivation Goal Given with
Andreas Maletti
TU Dresden, 22 May 2007 Learning deterministic wta slide 2 of 26
Notation Weighted tree automaton Myhill-Nerode congruence Learning algorithm An example
TU Dresden, 22 May 2007 Learning deterministic wta slide 3 of 26
❤❚✝✐ ✐: set of all mappings of type ❚✝ ✦ ❆
TU Dresden, 22 May 2007 Learning deterministic wta slide 4 of 26
Notation Weighted tree automaton Myhill-Nerode congruence Learning algorithm An example
TU Dresden, 22 May 2007 Learning deterministic wta slide 5 of 26
✭◗❀ ✝❀ ❆❀ ✖❀ ❋✮ is a weighted tree automaton (wta)
wta ✭◗❀ ✝❀ ❆❀ ✖❀ ❋✮ is deterministic if for every ✛ ✷ ✝✭❦✮ and ✇ ✷ ◗❦ there exists at most one q ✷ ◗ such that ✖❦✭✛✮✇❀q ✻❂ ✵.
TU Dresden, 22 May 2007 Learning deterministic wta slide 6 of 26
◗ ❂ ❢S❀ VP❀ NP❀ NN❀ ADJ❀ VB❣ and ❋ ❂ ❢S❣ Alice ✵✿✺ ✦ NN Bob ✵✿✺ ✦ NN loves ✵✿✺ ✦ VB hates ✵✿✺ ✦ VB ugly ✵✿✷✺ ✦ ADJ nice ✵✿✷✺ ✦ ADJ mean ✵✿✷✺ ✦ ADJ tall ✵✿✷✺ ✦ ADJ ✛ NN VP
✵✿✺
✦ S ✛ NP VP
✵✿✺
✦ S ✛ VB NN
✵✿✺
✦ VP ✛ VB NP
✵✿✺
✦ VP ✛ ADJ NN
✵✿✺
✦ NP ✛ ADJ NP
✵✿✺
✦ NP
TU Dresden, 22 May 2007 Learning deterministic wta slide 7 of 26
✛ ✛ mean Bob ✛ hates ✛ ugly Alice mean ✵✿✷✺ ✦ ADJ
TU Dresden, 22 May 2007 Learning deterministic wta slide 8 of 26
✛ ✛ ADJ✵✿✷✺ Bob ✛ hates ✛ ugly Alice Bob ✵✿✺ ✦ NN
TU Dresden, 22 May 2007 Learning deterministic wta slide 8 of 26
✛ ✛ ADJ✵✿✷✺ NN✵✿✺ ✛ hates ✛ ugly Alice ✛ ADJ NN
✵✿✺
✦ NP
TU Dresden, 22 May 2007 Learning deterministic wta slide 8 of 26
✛ ◆P✵✿✵✻✷✺ ✛ hates ✛ ugly Alice hates ✵✿✺ ✦ VB
TU Dresden, 22 May 2007 Learning deterministic wta slide 8 of 26
✛ ◆P✵✿✵✻✷✺ ✛ VB✵✿✺ ✛ ugly Alice ugly ✵✿✷✺ ✦ ADJ
TU Dresden, 22 May 2007 Learning deterministic wta slide 8 of 26
✛ ◆P✵✿✵✻✷✺ ✛ VB✵✿✺ ✛ ADJ✵✿✷✺ Alice Alice ✵✿✺ ✦ NN
TU Dresden, 22 May 2007 Learning deterministic wta slide 8 of 26
✛ ◆P✵✿✵✻✷✺ ✛ VB✵✿✺ ✛ ADJ✵✿✷✺ NN✵✿✺ ✛ ADJ NN
✵✿✺
✦ NP
TU Dresden, 22 May 2007 Learning deterministic wta slide 8 of 26
✛ ◆P✵✿✵✻✷✺ ✛ VB✵✿✺ ◆P✵✿✵✻✷✺ ✛ VB NP
✵✿✺
✦ VP
TU Dresden, 22 May 2007 Learning deterministic wta slide 8 of 26
✛ ◆P✵✿✵✻✷✺ ❱P✵✿✵✵✼✽✶✷✺ ✛ NP VP
✵✿✺
✦ S
TU Dresden, 22 May 2007 Learning deterministic wta slide 8 of 26
❙✵✿✵✵✵✷✹✹✶✹✵✻✷✺ So the tree ✛ ✛ mean Bob ✛ hates ✛ ugly Alice is accepted with weight ✵✿✵✵✵✷✹✹✶✹✵✻✷✺.
TU Dresden, 22 May 2007 Learning deterministic wta slide 8 of 26
✛ ✛ Alice loves Bob Alice ✵✿✺ ✦ NN
TU Dresden, 22 May 2007 Learning deterministic wta slide 9 of 26
✛ ✛ NN✵✿✺ loves Bob loves ✵✿✺ ✦ VB
TU Dresden, 22 May 2007 Learning deterministic wta slide 9 of 26
✛ ✛ NN✵✿✺ VB✵✿✺ Bob Bob ✵✿✺ ✦ NN
TU Dresden, 22 May 2007 Learning deterministic wta slide 9 of 26
✛ ✛ NN✵✿✺ VB✵✿✺ NN✵✿✺ ?
TU Dresden, 22 May 2007 Learning deterministic wta slide 9 of 26
So the tree ✛ ✛ Alice loves Bob is rejected (accepted with weight ✵).
TU Dresden, 22 May 2007 Learning deterministic wta slide 9 of 26
A tree series ✥ ✷ ❆❤ ❤❚✝✐ ✐ is deterministically recognizable if there exists a deterministic wta accepting ✥.
TU Dresden, 22 May 2007 Learning deterministic wta slide 10 of 26
Notation Weighted tree automaton Myhill-Nerode congruence Learning algorithm An example
TU Dresden, 22 May 2007 Learning deterministic wta slide 11 of 26
In the sequel, let ✥ ✷ ❆❤ ❤❚✝✐ ✐ with ❆ ❂ ✭❆❀ ✰❀ ✁❀ ✵❀ ✶✮ a semifield.
Two trees t❀ ✉ ✷ ❚✝ are equivalent if there exists ❛ ✷ ❆ ♥ ❢✵❣ such that for every context ❝ ✷ ❈✝ ❛ ✁ ✭✥❀ ❝❬t❪✮ ❂ ✭✥❀ ❝❬✉❪✮ ✿ This equivalence relation is denoted by ✑. ✥ ❂ s✐③❡ ❆ ❂ ✭❩ ❬ ❢✶❣❀ ♠✐♥❀ ✰❀ ✶❀ ✵✮ t ✑ ✉ t❀ ✉ ✷ ❚✝ ❛ ❂ s✐③❡✭✉✮ s✐③❡✭t✮ ❛ ✰ s✐③❡✭❝❬t❪✮ ❂ ❛ ✰ s✐③❡✭❝✮ ✶ ✰ s✐③❡✭t✮ ❂ s✐③❡✭✉✮ ✰ s✐③❡✭❝✮ ✶ ❂ s✐③❡✭❝❬✉❪✮
TU Dresden, 22 May 2007 Learning deterministic wta slide 12 of 26
In the sequel, let ✥ ✷ ❆❤ ❤❚✝✐ ✐ with ❆ ❂ ✭❆❀ ✰❀ ✁❀ ✵❀ ✶✮ a semifield.
Two trees t❀ ✉ ✷ ❚✝ are equivalent if there exists ❛ ✷ ❆ ♥ ❢✵❣ such that for every context ❝ ✷ ❈✝ ❛ ✁ ✭✥❀ ❝❬t❪✮ ❂ ✭✥❀ ❝❬✉❪✮ ✿ This equivalence relation is denoted by ✑.
Let ✥ ❂ s✐③❡ and ❆ ❂ ✭❩ ❬ ❢✶❣❀ ♠✐♥❀ ✰❀ ✶❀ ✵✮. Then t ✑ ✉ for every t❀ ✉ ✷ ❚✝ because with ❛ ❂ s✐③❡✭✉✮ s✐③❡✭t✮ ❛ ✰ s✐③❡✭❝❬t❪✮ ❂ ❛ ✰ s✐③❡✭❝✮ ✶ ✰ s✐③❡✭t✮ ❂ s✐③❡✭✉✮ ✰ s✐③❡✭❝✮ ✶ ❂ s✐③❡✭❝❬✉❪✮
TU Dresden, 22 May 2007 Learning deterministic wta slide 12 of 26
✑ is a congruence on ✭❚✝❀ ✝✮.
✑ ✥
TU Dresden, 22 May 2007 Learning deterministic wta slide 13 of 26
✑ is a congruence on ✭❚✝❀ ✝✮.
The following are equivalent:
Note: The implementation of ✑ yields a minimal deterministic wta accepting ✥.
TU Dresden, 22 May 2007 Learning deterministic wta slide 13 of 26
Let ❈ ✒ ❈✝. Two trees t❀ ✉ ✷ ❚✝ are ❈-equivalent if there exists ❛ ✷ ❆ ♥ ❢✵❣ such that for every context ❝ ✷ ❈ ❛ ✁ ✭✥❀ ❝❬t❪✮ ❂ ✭✥❀ ❝❬✉❪✮ ✿ The ❈-equivalence relation is denoted by ✑❈.
✑❈✝
✑ ❈ ✒ ❈✝ ✑ ✑❈
TU Dresden, 22 May 2007 Learning deterministic wta slide 14 of 26
Let ❈ ✒ ❈✝. Two trees t❀ ✉ ✷ ❚✝ are ❈-equivalent if there exists ❛ ✷ ❆ ♥ ❢✵❣ such that for every context ❝ ✷ ❈ ❛ ✁ ✭✥❀ ❝❬t❪✮ ❂ ✭✥❀ ❝❬✉❪✮ ✿ The ❈-equivalence relation is denoted by ✑❈.
coincide.
TU Dresden, 22 May 2007 Learning deterministic wta slide 14 of 26
Notation Weighted tree automaton Myhill-Nerode congruence Learning algorithm An example
TU Dresden, 22 May 2007 Learning deterministic wta slide 15 of 26
Learn a small ❈ ✒ ❈✝ such that ✑ and ✑❈ coincide.
A maximally adequate teacher answers two types of queries:
– ❄ if ❙✭▼✮ ❂ ✥; or – some t ✷ ❚✝ such that ✭❙✭▼✮❀ t✮ ✻❂ ✭✥❀ t✮.
TU Dresden, 22 May 2007 Learning deterministic wta slide 16 of 26
✭❊❀ ❚❀ ❈✮ is an observation table if
✭❊❀ ❚❀ ❈✮ ❝❛r❞✭❊✮ ❂ ❝❛r❞✭❚❂✑❈ ✮
TU Dresden, 22 May 2007 Learning deterministic wta slide 17 of 26
✭❊❀ ❚❀ ❈✮ is an observation table if
❚ ❭ ▲❈ ❂ ❀ means: “No dead states” ✭❊❀ ❚❀ ❈✮ ❝❛r❞✭❊✮ ❂ ❝❛r❞✭❚❂✑❈ ✮
TU Dresden, 22 May 2007 Learning deterministic wta slide 17 of 26
✭❊❀ ❚❀ ❈✮ is an observation table if
❝❛r❞✭❊✮ ❂ ❝❛r❞✭❊❂✑❈ ✮ means: “No equivalent states” ✭❊❀ ❚❀ ❈✮ ❝❛r❞✭❊✮ ❂ ❝❛r❞✭❚❂✑❈ ✮
TU Dresden, 22 May 2007 Learning deterministic wta slide 17 of 26
✭❊❀ ❚❀ ❈✮ is an observation table if
TU Dresden, 22 May 2007 Learning deterministic wta slide 17 of 26
Require: an observation table ✭❊❀ ❚❀ ❈✮ Ensure: return a complete observation table ✭❊✵❀ ❚❀ ❈✮ such that ❊ ✒ ❊✵ for all t ✷ ❚ do
if t ✻✑❈ ❡ for every ❡ ✷ ❊ then ❊ ✥ ❊ ❬ ❢t❣
TU Dresden, 22 May 2007 Learning deterministic wta slide 18 of 26
Let ❚ ❂ ✭❊❀ ❚❀ ❈✮ complete observation table. Construct ✭◗❀ ✝❀ ❆❀ ✖❀ ❋✮
✖❦✭✛✮❡✶✁✁✁❡❦❀❚ ✭t✮ ❂ ✭✥❀ t✮ ✁
❦
❨
✐❂✶
✭✥❀ ❡✐✮✶
TU Dresden, 22 May 2007 Learning deterministic wta slide 19 of 26
Let ❚ ❂ ✭❊❀ ❚❀ ❈✮ complete observation table. Construct ✭◗❀ ✝❀ ❆❀ ✖❀ ❋✮
✖❦✭✛✮❡✶✁✁✁❡❦❀❚ ✭t✮ ❂ ✭✥✭❚ ✮❀ t✮ ✁
❦
❨
✐❂✶
✭✥✭❚ ✮❀ ❡✐✮✶
TU Dresden, 22 May 2007 Learning deterministic wta slide 19 of 26
Let ❚ ❂ ✭❊❀ ❚❀ ❈✮ complete observation table. Define ✥✭❚ ✮✿ ❚✝ ✦ ❆ ♥ ❢✵❣ by
✭✥✭❚ ✮❀ t✮ ❂ ✭✥❀ t✮
✭✥❀ t✮ ❂ ✵ t ✷ ❚ ❝ ✷ ❈ ✭✥❀ ❝❬t❪✮ ✻❂ ✵ ✭✥✭❚ ✮❀ t✮ ❂ ✭✥❀ ❝❬t❪✮ ✁ ✭✥❀ ❝❬❚ ✭t✮❪✮✶
✶
TU Dresden, 22 May 2007 Learning deterministic wta slide 20 of 26
Let ❚ ❂ ✭❊❀ ❚❀ ❈✮ complete observation table. Define ✥✭❚ ✮✿ ❚✝ ✦ ❆ ♥ ❢✵❣ by
✭✥✭❚ ✮❀ t✮ ❂ ✭✥❀ t✮
✭✥✭❚ ✮❀ t✮ ❂ ✭✥❀ ❝❬t❪✮ ✁ ✭✥❀ ❝❬❚ ✭t✮❪✮✶
✶
TU Dresden, 22 May 2007 Learning deterministic wta slide 20 of 26
Let ❚ ❂ ✭❊❀ ❚❀ ❈✮ complete observation table. Define ✥✭❚ ✮✿ ❚✝ ✦ ❆ ♥ ❢✵❣ by
✭✥✭❚ ✮❀ t✮ ❂ ✭✥❀ t✮
✭✥✭❚ ✮❀ t✮ ❂ ✭✥❀ ❝❬t❪✮ ✁ ✭✥❀ ❝❬❚ ✭t✮❪✮✶
TU Dresden, 22 May 2007 Learning deterministic wta slide 20 of 26
❚ ✥ ✭❀❀ ❀❀ ❢✄❣✮ ❢initial observation table❣
▼ ✥ ▼✭❚ ✮ ❢construct new wta❣
t ✥ EQUAL?✭▼✮ ❢ask equivalence query❣ if t ❂ ❄ then
return ▼ ❢return the approved wta❣ else
❚ ✥ EXTEND✭❚ ❀ t✮ ❢extend the observation table❣
TU Dresden, 22 May 2007 Learning deterministic wta slide 21 of 26
Require: a complete observation table ❚ ❂ ✭❊❀ ❚❀ ❈✮ and a counterexample t ✷ ❚✝ Ensure: return a complete observation table ❚ ✵ ❂ ✭❊✵❀ ❚ ✵❀ ❈✵✮ such that ❊ ✒ ❊✵ and ❚ ✒ ❚ ✵ and one inclusion is strict Decompose t into t ❂ ❝❬✉❪ where ❝ ✷ ❈✝ and ✉ ✷ ✝✭❊✮ ♥ ❊
return EXTEND✭❚ ❀ ❝❬❚ ✭✉✮❪✮ ❢normalize and continue❣
return COMPLETE✭❊❀ ❚ ❬ ❢✉❣❀ ❈ ❬ ❢❝❣✮ ❢add ✉ and ❝ to table❣
TU Dresden, 22 May 2007 Learning deterministic wta slide 22 of 26
Notation Weighted tree automaton Myhill-Nerode congruence Learning algorithm An example
TU Dresden, 22 May 2007 Learning deterministic wta slide 23 of 26
◗ ❂ ❢S❀ VP❀ NP❀ NN❀ ADJ❀ VB❣ and ❋ ❂ ❢S❣ Alice ✵✿✺ ✦ NN Bob ✵✿✺ ✦ NN loves ✵✿✺ ✦ VB hates ✵✿✺ ✦ VB ugly ✵✿✷✺ ✦ ADJ nice ✵✿✷✺ ✦ ADJ mean ✵✿✷✺ ✦ ADJ tall ✵✿✷✺ ✦ ADJ ✛ NN VP
✵✿✺
✦ S ✛ NP VP
✵✿✺
✦ S ✛ VB NN
✵✿✺
✦ VP ✛ VB NP
✵✿✺
✦ VP ✛ ADJ NN
✵✿✺
✦ NP ✛ ADJ NP
✵✿✺
✦ NP
TU Dresden, 22 May 2007 Learning deterministic wta slide 24 of 26
◗ ❂ ❢NP❀ VB❀ VP❀ S❀ ADJ❣ and ❋ ❂ ❢S❣ Alice
✶
✦ NP Bob
✶
✦ NP loves
✶
✦ VB hates
✶
✦ VB ugly
✶
✦ ADJ nice
✶
✦ ADJ mean
✶
✦ ADJ tall
✶
✦ ADJ ✛ NP VP
✵✿✵✸✶✷✺
✦ S ✛ VB NP
✶
✦ VP ✛ ADJ NP
✵✿✶✷✺
✦ NP
TU Dresden, 22 May 2007 Learning deterministic wta slide 25 of 26
Springer 2003
TU Dresden, 22 May 2007 Learning deterministic wta slide 26 of 26