Finite Automata on Unranked Trees: Extensions by Arithmetical and Equality Constraints Karianto Wong RWTH Aachen University Oberseminar
Motivation and Context Unranked trees: ◮ finite, ordered trees <collection> ◮ number of children of a node is <category> not bounded a priori (i.e., does not <name>Board Games</name> <item> depend on the node’s label) <name>Go</name> <players>2</players> ◮ formal models for XML documents <age>9–99</age> </item> Example: a collection of games <name>Chess</name> <players>2</players> </item> collection </category> <category> <name>Puzzles</name> <item> category category <name>Rubik’s Cube</name> <age>8–12</name> </item> </category> type type item item item </collection> age age name players name players name Karianto Wong | RWTH Aachen University Finite Automata on Unranked Trees: Arithmetical and Equality Constraints | 2
Motivation and Context (2) XML-related tasks and problems (see, e.g., survey [Schwentick, 2007]); ◮ specification (“define languages of unranked trees”) ◮ validation (“does a tree satisfy a specification?”) ◮ satisfiability (“is a specification satisfiable?”) ◮ query (“select some nodes or some subtrees of a tree”) ◮ . . . Automata-theoretical approach, e.g.: ◮ (parallel) tree automata ◮ tree-walking automata ◮ Document-Type Definitions (i.e., extended context-free grammars) Karianto Wong | RWTH Aachen University Finite Automata on Unranked Trees: Arithmetical and Equality Constraints | 3
Motivation and Context (2) XML-related tasks and problems (see, e.g., survey [Schwentick, 2007]); ◮ specification (“define languages of unranked trees”) ◮ validation (“does a tree satisfy a specification?”) ◮ satisfiability (“is a specification satisfiable?”) ◮ query (“select some nodes or some subtrees of a tree”) ◮ . . . Automata-theoretical approach, e.g.: ◮ (parallel) tree automata ◮ tree-walking automata Topic of the thesis ◮ Document-Type Definitions (i.e., extended context-free grammars) Karianto Wong | RWTH Aachen University Finite Automata on Unranked Trees: Arithmetical and Equality Constraints | 3
Scope and Contributions of the Thesis Extensions of finite, bottom-up unranked tree automata: • 1. Arithmetical (i.e., counting) properties • Example: “There are twice as many • • • red nodes as blue nodes” • • • • • • • Karianto Wong | RWTH Aachen University Finite Automata on Unranked Trees: Arithmetical and Equality Constraints | 4
Scope and Contributions of the Thesis Extensions of finite, bottom-up unranked tree automata: • 1. Arithmetical (i.e., counting) properties • Example: “There are twice as many • • • red nodes as blue nodes” • • • • • • • a 2. Equality between subtrees Example: “The first subtree of the root . . . is equal to the last one” Karianto Wong | RWTH Aachen University Finite Automata on Unranked Trees: Arithmetical and Equality Constraints | 4
Scope and Contributions of the Thesis Extensions of finite, bottom-up unranked tree automata: • 1. Arithmetical (i.e., counting) properties • Example: “There are twice as many • • • red nodes as blue nodes” • • • • • • • a 2. Equality between subtrees Example: “The first subtree of the root . . . is equal to the last one” For both extensions, study the following: ◮ expressive power ◮ decidability of emptiness (i.e. satisfiability) Karianto Wong | RWTH Aachen University Finite Automata on Unranked Trees: Arithmetical and Equality Constraints | 4
Outline 1. Automata with arithmetical constraints Parikh unranked tree automata Emptiness problem 2. Automata with subtree-equality constraints Equality constraints between siblings Emptiness problem 3. Conclusion Karianto Wong | RWTH Aachen University Finite Automata on Unranked Trees: Arithmetical and Equality Constraints | 5
Outline 1. Automata with arithmetical constraints Parikh unranked tree automata Emptiness problem 2. Automata with subtree-equality constraints Equality constraints between siblings Emptiness problem 3. Conclusion Karianto Wong | RWTH Aachen University Finite Automata on Unranked Trees: Arithmetical and Equality Constraints | 6
Outline 1. Automata with arithmetical constraints Parikh unranked tree automata Emptiness problem 2. Automata with subtree-equality constraints Equality constraints between siblings Emptiness problem 3. Conclusion Karianto Wong | RWTH Aachen University Finite Automata on Unranked Trees: Arithmetical and Equality Constraints | 7
Finite Automata on Unranked Trees Unranked tree automaton A = ( Q , Σ , ∆ , F ) ◮ Bottom-up tree automaton Σ = { a , b , c } T ( A ) = set of trees over ◮ Finite state set Q with final states F ⊆ Q Σ with leaf sequences ◮ Symbols in Σ have no fixed arities of the form a ∗ b ∗ ◮ Transition relation ∆ with transitions � � q ∈ F L , a , q a q q q target state L ⊆ Q ∗ a c b current symbol regular q b q b q q a c a b b ◮ Run is assignment of states to nodes ( q ∗ a q ∗ q a q b complying with ∆ b , a , q ) a b ◮ Tree is accepted if there exists some run ∈ ∆ with state in F assigned to the root. Karianto Wong | RWTH Aachen University Finite Automata on Unranked Trees: Arithmetical and Equality Constraints | 8
Finite Automata on Unranked Trees Unranked tree automaton A = ( Q , Σ , ∆ , F ) ◮ Bottom-up tree automaton Σ = { a , b , c } T ( A ) = set of trees over ◮ Finite state set Q with final states F ⊆ Q Σ with leaf sequences ◮ Symbols in Σ have no fixed arities of the form a ∗ b ∗ ◮ Transition relation ∆ with transitions � � q ∈ F L , a , q a q q q target state L ⊆ Q ∗ a c b current symbol regular q b q b q q a c a b b ◮ Run is assignment of states to nodes ( q ∗ a q ∗ q a q b complying with ∆ b , a , q ) a b ◮ Tree is accepted if there exists some run ∈ ∆ with state in F assigned to the root. Extensions: how to incorporate arithmetical properties? Example: “There are as many a -labeled nodes as b -labeled ones” Karianto Wong | RWTH Aachen University Finite Automata on Unranked Trees: Arithmetical and Equality Constraints | 8
Parikh Automata Introduced in [Klaedtke/Rueß, 2002] for words and ranked trees Main idea: ◮ Run is assignment of states and vectors of natural numbers to nodes ◮ Acceptance is based on existence of run satisfying: 1. the root is assigned a final state (and a final vector) 2. the sum of all occurring vectors satisfies a Presburger formula (first-order logic over ( N , + , < ) – satisfiability decidable) Karianto Wong | RWTH Aachen University Finite Automata on Unranked Trees: Arithmetical and Equality Constraints | 9
Parikh Automata Introduced in [Klaedtke/Rueß, 2002] for words and ranked trees Main idea: ◮ Run is assignment of states and vectors of natural numbers to nodes ◮ Acceptance is based on existence of run satisfying: 1. the root is assigned a final state (and a final vector) 2. the sum of all occurring vectors satisfies a Presburger formula (first-order logic over ( N , + , < ) – satisfiability decidable) q , [ 1 0 ] Example property: “there are as a many a -nodes as b -nodes” q , [ 1 0 ] q , [ 0 0 ] ◮ use vectors of dimension two q , [ 0 1 ] a c b ◮ assign [ 1 0 ] to a -nodes q b , [ 0 1 ] q b , [ 0 1 ] q , [ 0 q a , [ 1 0 ] 0 ] ◮ assign [ 0 1 ] to b -nodes c a b b ◮ use Presburger formula ψ ( x 1 , x 2 ) : = ( x 1 = x 2 ) q a , [ 1 q b , [ 0 0 ] 1 ] a b Karianto Wong | RWTH Aachen University Finite Automata on Unranked Trees: Arithmetical and Equality Constraints | 9
Local Arithmetical Constraints Remark: The example property is a global one, i.e., it is posed to (run) tree as a whole. [Example: “There are as many a -nodes as b -nodes (in the whole tree)”] How about local properties (i.e. concerning only the children of a node)? Example: “Each node has at least as many a -labeled children as b -labeled ones” Karianto Wong | RWTH Aachen University Finite Automata on Unranked Trees: Arithmetical and Equality Constraints | 10
Local Arithmetical Constraints Remark: The example property is a global one, i.e., it is posed to (run) tree as a whole. [Example: “There are as many a -nodes as b -nodes (in the whole tree)”] How about local properties (i.e. concerning only the children of a node)? Example: “Each node has at least as many a -labeled children as b -labeled ones” Idea: Constrain application of transitions by Presburger formulas [Seidl/Schwentick/Muscholl, Dal Zilio/Lugiez, 2003] ◮ transition: ( L , α , a , q ) q a ◮ α : Presburger formula with free variables a interpreted as number of occurrences q b of states in the child nodes q a a b Example: α ( x q a , x q b ) = ( x q a ≥ x q b ) q a q a q b q a a a a b ( q ∗ a q ∗ b , α , a , q ) q a q b a b ∈ ∆ Karianto Wong | RWTH Aachen University Finite Automata on Unranked Trees: Arithmetical and Equality Constraints | 10
Recommend
More recommend