Tree Automata with Constraints and Tree Homomorphisms Carles Creus - - PowerPoint PPT Presentation

tree automata with constraints
SMART_READER_LITE
LIVE PREVIEW

Tree Automata with Constraints and Tree Homomorphisms Carles Creus - - PowerPoint PPT Presentation

Tree Automata with Constraints and Tree Homomorphisms Carles Creus L opez under the direction of Guillem Godoy Balil Departament de Cincies de la Computaci Height and Equality Constraints HOM in EXPTIME Global Reflexive Disequality


slide-1
SLIDE 1

Tree Automata with Constraints

and

Tree Homomorphisms

Carles Creus L´

  • pez

under the direction of

Guillem Godoy Balil

Departament de Ciències de la Computació

slide-2
SLIDE 2

Height and Equality Constraints HOM in EXPTIME Global Reflexive Disequality Constraints Conclusions

Outline

1

Height and Equality Constraints

2

HOM in EXPTIME

3

Global Reflexive Disequality Constraints

4

Conclusions

slide-3
SLIDE 3

Height and Equality Constraints HOM in EXPTIME Global Reflexive Disequality Constraints Conclusions

Background: Terms

Definition A term is a tree-like structure finite ranked

  • rdered

Example f f a f a b b is a finite tree

slide-4
SLIDE 4

Height and Equality Constraints HOM in EXPTIME Global Reflexive Disequality Constraints Conclusions

Background: Terms

Definition A term is a tree-like structure finite ranked

  • rdered

Example f f a f a b b arities are a:0, b:0, f:2

slide-5
SLIDE 5

Height and Equality Constraints HOM in EXPTIME Global Reflexive Disequality Constraints Conclusions

Background: Terms

Definition A term is a tree-like structure finite ranked

  • rdered

Example f f a f a b b = f b f a f b a

slide-6
SLIDE 6

Height and Equality Constraints HOM in EXPTIME Global Reflexive Disequality Constraints Conclusions

Background: Tree Automata

Example A bottom-up tree automaton (TA) over Σ = {a:0, b:0, f:2} is e.g. A :                a → q1 b → q0 f(q0, q0) → q0 f(q0, q1) → q1 f(q1, q0) → q1 f(q1, q1) → q0 Final states: {q0} f f b a a →∗ f f b q0 a q1 a q1 → f f q1 b a a q1 → f q0 f b a a Recognized language L(A) = {t ∈ T (Σ) : |t|a is even} is regular

slide-7
SLIDE 7

Height and Equality Constraints HOM in EXPTIME Global Reflexive Disequality Constraints Conclusions

Background: Tree Automata

Example A bottom-up tree automaton (TA) over Σ = {a:0, b:0, f:2} is e.g. A :                a → q1 b → q0 f(q0, q0) → q0 f(q0, q1) → q1 f(q1, q0) → q1 f(q1, q1) → q0 Final states: {q0} f f b a a →∗ f f b q0 a q1 a q1 → f f q1 b a a q1 → f q0 f b a a Recognized language L(A) = {t ∈ T (Σ) : |t|a is even} is regular

slide-8
SLIDE 8

Height and Equality Constraints HOM in EXPTIME Global Reflexive Disequality Constraints Conclusions

Background: Tree Automata

Example A bottom-up tree automaton (TA) over Σ = {a:0, b:0, f:2} is e.g. A :                a → q1 b → q0 f(q0, q0) → q0 f(q0, q1) → q1 f(q1, q0) → q1 f(q1, q1) → q0 Final states: {q0} f f b a a →∗ f f b q0 a q1 a q1 → f f q1 b a a q1 → f q0 f b a a Recognized language L(A) = {t ∈ T (Σ) : |t|a is even} is regular

slide-9
SLIDE 9

Height and Equality Constraints HOM in EXPTIME Global Reflexive Disequality Constraints Conclusions

Background: Tree Automata

Applications of TA: Circuit verification XML type representation Decidability of logics Solving equations Term rewriting . . .

slide-10
SLIDE 10

Height and Equality Constraints HOM in EXPTIME Global Reflexive Disequality Constraints Conclusions

Section 1 Height and Equality Constraints

Carles Creus and Guillem Godoy, “Tree automata with height constraints between brothers,” in Rewriting Techniques and Applications, pp. 149–163, 2014.

slide-11
SLIDE 11

Height and Equality Constraints HOM in EXPTIME Global Reflexive Disequality Constraints Conclusions

Section 1 Height and Equality Constraints

Carles Creus and Guillem Godoy, “Tree automata with height constraints between brothers,” in Rewriting Techniques and Applications, pp. 149–163, 2014.

slide-12
SLIDE 12

Height and Equality Constraints HOM in EXPTIME Global Reflexive Disequality Constraints Conclusions

Background: Local Constraints

A local constraint c in a rule such as: f q0 . . . q1

c

− − → q restricts the applicability of the rule: c must be satisfied. Definition ([BT92]) An AWCBB is an automaton with local constraints, where the constraints are arbitrary boolean combinations of atoms of the form i ≈ j or i ≈ j, where i, j ∈ N.

slide-13
SLIDE 13

Height and Equality Constraints HOM in EXPTIME Global Reflexive Disequality Constraints Conclusions

Background: Local Constraints

Example An AWCBB over Σ = {a:0, b:0, f:2} is e.g. A :      a true − − → q b true − − → q f(q, q) 1≈2 − − → q Final states: {q} f f a a b →∗ f f a q a q b q → f f q a a b q The recognized language L(A) is the set of complete trees where all leaves are identical; non-regular

slide-14
SLIDE 14

Height and Equality Constraints HOM in EXPTIME Global Reflexive Disequality Constraints Conclusions

Background: Local Constraints

Example An AWCBB over Σ = {a:0, b:0, f:2} is e.g. A :      a true − − → q b true − − → q f(q, q) 1≈2 − − → q Final states: {q} f f a a b →∗ f f a q a q b q → f f q a a b q The recognized language L(A) is the set of complete trees where all leaves are identical; non-regular

slide-15
SLIDE 15

Height and Equality Constraints HOM in EXPTIME Global Reflexive Disequality Constraints Conclusions

Background: Local Constraints

Example An AWCBB over Σ = {a:0, b:0, f:2} is e.g. A :      a true − − → q b true − − → q f(q, q) 1≈2 − − → q Final states: {q} f f a a b →∗ f f a q a q b q → f f q a a b q The recognized language L(A) is the set of complete trees where all leaves are identical; non-regular

slide-16
SLIDE 16

Height and Equality Constraints HOM in EXPTIME Global Reflexive Disequality Constraints Conclusions

Height and Equality Constraints

Definition A height and equality constraint is an arbitrary boolean combination of atoms of the forms: i ≈ j i ≈ j h(i) = h(j) + x h(i) < h(j) + x where i, j ∈ N and x ∈ Z. A TACBBHe is a TA with the previous kind of local constraints.

slide-17
SLIDE 17

Height and Equality Constraints HOM in EXPTIME Global Reflexive Disequality Constraints Conclusions

Height and Equality Constraints

Example Balanced tree (AVL) with f labelling the binary nodes: f q q

h(1) = h(2)+0 ∨ h(1) = h(2)+1 ∨ h(1) = h(2)−1

− − − − − − − − − − → q The constraint guarantees that the heights of the children of f differ by at most 1.

slide-18
SLIDE 18

Height and Equality Constraints HOM in EXPTIME Global Reflexive Disequality Constraints Conclusions

Height and Equality Constraints

Goal To decide emptiness and finiteness for TACBBHe.

slide-19
SLIDE 19

Height and Equality Constraints HOM in EXPTIME Global Reflexive Disequality Constraints Conclusions

Approach

  • 1. Find a normal form of the automaton.
  • 2. Prove bound for the height of the minimal recognized term.
slide-20
SLIDE 20

Height and Equality Constraints HOM in EXPTIME Global Reflexive Disequality Constraints Conclusions

Approach: Simplified Setting

Simple height constraints Arbitrary boolean combinations of atoms of the form h(i) = h(j) + 0 h(i) < h(j) + 0 A TACBBh is a TA with the previous kind of local constraints.

slide-21
SLIDE 21

Height and Equality Constraints HOM in EXPTIME Global Reflexive Disequality Constraints Conclusions

Approach for TACBBh: 1. Normal Form

Observation: a constraint need not be very precise, e.g., the height

  • f two children may be unrelated.

Nicer: each constraint only allows one permutation of the children (with respect to their heights).

slide-22
SLIDE 22

Height and Equality Constraints HOM in EXPTIME Global Reflexive Disequality Constraints Conclusions

Approach for TACBBh: 1. Normal Form

Example Consider the symbol g with arity 4 and the rule g(. . .)

h(1) < h(2)+0 ∧ h(1) < h(3)+0 ∧ h(2) = h(4)+0

− − − − − − − − − − → q The possible orderings for the children are: {1} < {2, 4} < {3} {1} < {3} < {2, 4} {1} < {2, 3, 4}

slide-23
SLIDE 23

Height and Equality Constraints HOM in EXPTIME Global Reflexive Disequality Constraints Conclusions

Approach for TACBBh: 1. Normal Form

Definition Given arity m, a normalized constraint is an expression of the form: S1 < S2 < . . . < Sn where {S1, S2, . . . , Sn} is a partition of {1, . . . , m}. Each rule might generate up to 2maxar2 normalized rules.

slide-24
SLIDE 24

Height and Equality Constraints HOM in EXPTIME Global Reflexive Disequality Constraints Conclusions

Approach for TACBBh: 1. Normal Form

Example The normalization of the rule g(. . .)

h(1) < h(2)+0 ∧ h(1) < h(3)+0 ∧ h(2) = h(4)+0

− − − − − − − − − − → q produces these three rules: g(. . .)

{1} < {2,4} < {3}

− − − − − − − − − − → q g(. . .)

{1} < {3} < {2,4}

− − − − − − − − − − → q g(. . .)

{1} < {2,3,4}

− − − − − − − − − − → q

slide-25
SLIDE 25

Height and Equality Constraints HOM in EXPTIME Global Reflexive Disequality Constraints Conclusions

Approach for TACBBh: 2. Bound on height

Definition ExistTerm(h, q) = there exists a term of height h reaching q. Idea of the algorithm: Compute ExistTerm iteratively for increasing values of h. Question: Can each iteration be done efficiently? Yes, the results obtained for smaller h’s ease the computation.

slide-26
SLIDE 26

Height and Equality Constraints HOM in EXPTIME Global Reflexive Disequality Constraints Conclusions

Approach for TACBBh: 2. Bound on height

Definition ExistTerm(h, q) = there exists a term of height h reaching q. Idea of the algorithm: Compute ExistTerm iteratively for increasing values of h. Question: Can each iteration be done efficiently? Yes, the results obtained for smaller h’s ease the computation.

slide-27
SLIDE 27

Height and Equality Constraints HOM in EXPTIME Global Reflexive Disequality Constraints Conclusions

Approach for TACBBh: 2. Bound on height

New idea for the algorithm: Also compute which constraint prefixes are satisfiable. Definition ExistSol(h, c, N) = constraint prefix c is satisfiable for height h.

slide-28
SLIDE 28

Height and Equality Constraints HOM in EXPTIME Global Reflexive Disequality Constraints Conclusions

Approach for TACBBh: 2. Bound on height

Lemma ExistTerm(h, q) =

g(...)

c

− →q ExistSol(h − 1, c, N) Lemma ExistSol(h, S1 < . . . < Sm−1 < Sm, N) =

  • h′<h ExistSol(h′, S1 < . . . < Sm−1, N)
  • q∈N(Sm) ExistTerm(h, q)

If the algorithm finds heights h1 < h2 such that:

  • h′<h1 ExistSol(h′) =

h′<h2 ExistSol(h′)❀ O(maxar|∆|)

ExistTerm(h1) = ExistTerm(h2) ❀ O(2|Q|) then the computations are periodic from h1, with period h2 − h1

slide-29
SLIDE 29

Height and Equality Constraints HOM in EXPTIME Global Reflexive Disequality Constraints Conclusions

Approach for TACBBh: 2. Bound on height

Lemma ExistTerm(h, q) =

g(...)

c

− →q ExistSol(h − 1, c, N) Lemma ExistSol(h, S1 < . . . < Sm−1 < Sm, N) =

  • h′<h ExistSol(h′, S1 < . . . < Sm−1, N)
  • q∈N(Sm) ExistTerm(h, q)

If the algorithm finds heights h1 < h2 such that:

  • h′<h1 ExistSol(h′) =

h′<h2 ExistSol(h′)❀ O(maxar|∆|)

ExistTerm(h1) = ExistTerm(h2) ❀ O(2|Q|) then the computations are periodic from h1, with period h2 − h1

slide-30
SLIDE 30

Height and Equality Constraints HOM in EXPTIME Global Reflexive Disequality Constraints Conclusions

Approach for TACBBh: 2. Bound on height

Lemma ExistTerm(h, q) =

g(...)

c

− →q ExistSol(h − 1, c, N) Lemma ExistSol(h, S1 < . . . < Sm−1 < Sm, N) =

  • h′<h ExistSol(h′, S1 < . . . < Sm−1, N)
  • q∈N(Sm) ExistTerm(h, q)

If the algorithm finds heights h1 < h2 such that:

  • h′<h1 ExistSol(h′) =

h′<h2 ExistSol(h′) ❀ O(maxar|∆|)

ExistTerm(h1) = ExistTerm(h2) ❀ O(2|Q|) then the computations are periodic from h1, with period h2 − h1

slide-31
SLIDE 31

Height and Equality Constraints HOM in EXPTIME Global Reflexive Disequality Constraints Conclusions

Approach for TACBBh: Result

Theorem Deciding emptiness and finiteness for TACBBh is in EXPTIME.

slide-32
SLIDE 32

Height and Equality Constraints HOM in EXPTIME Global Reflexive Disequality Constraints Conclusions

Approach for the general case TACBBHe

Recall: the general case has constraints with atoms of the forms i ≈ j i ≈ j h(i) = h(j) + x h(i) < h(j) + x

slide-33
SLIDE 33

Height and Equality Constraints HOM in EXPTIME Global Reflexive Disequality Constraints Conclusions

Approach for the general case TACBBHe: 1. Normal Form

Definition Given arity m, a normalized constraint is an expression of the form: P1 ⊗1 P2 ⊗2 . . . ⊗n−1 Pn where P1 ⊎ P2 ⊎ . . . ⊎ Pn is a partition of {1, . . . , m}, and ⊗i ∈ {=1, =2, . . . , =w−1, ≤w} Moreover, we also need a deterministic automaton, leading to: number of states = 2|Q| number of rules ≈ |Σ|2|Q|maxar2maxar2wmaxar

slide-34
SLIDE 34

Height and Equality Constraints HOM in EXPTIME Global Reflexive Disequality Constraints Conclusions

Approach for the general case TACBBHe: 2. Bound

Simple case General case ExistTerm(h) NumTerms(h) ExistSol(h) NumSols(h) ExistTerm(h) depended on: ExistSol(h − 1) NumTerms(h) depends on: NumSols(h − 1) ExistSol(h) depended on: ExistTerm(h)

  • h′<h ExistSol(h′)

NumSols(h) depends on: NumTerms(h)

  • h′≤h−w NumSols(h′)

NumSols(h′) for h−w < h′ < h NumTerms(h) ❀ 2O(|Q|log(maxar))

  • h′≤h−w NumSols(h′)

❀ O(maxar2|∆|) NumSols(h′) for h − w < h′ < h ❀ 2O(w maxar|∆| log(maxar))

slide-35
SLIDE 35

Height and Equality Constraints HOM in EXPTIME Global Reflexive Disequality Constraints Conclusions

Approach for the general case TACBBHe: 2. Bound

Simple case General case ExistTerm(h) NumTerms(h) ExistSol(h) NumSols(h) ExistTerm(h) depended on: ExistSol(h − 1) NumTerms(h) depends on: NumSols(h − 1) ExistSol(h) depended on: ExistTerm(h)

  • h′<h ExistSol(h′)

NumSols(h) depends on: NumTerms(h)

  • h′≤h−w NumSols(h′)

NumSols(h′) for h−w < h′ < h NumTerms(h) ❀ 2O(|Q|log(maxar))

  • h′≤h−w NumSols(h′)

❀ O(maxar2|∆|) NumSols(h′) for h − w < h′ < h ❀ 2O(w maxar|∆| log(maxar))

slide-36
SLIDE 36

Height and Equality Constraints HOM in EXPTIME Global Reflexive Disequality Constraints Conclusions

Approach for the general case TACBBHe: Result

Theorem Deciding emptiness and finiteness for TACBBHe is in 2EXPTIME.

slide-37
SLIDE 37

Height and Equality Constraints HOM in EXPTIME Global Reflexive Disequality Constraints Conclusions

Section 2 HOM in EXPTIME

Carles Creus, Adri` a Gasc´

  • n, Guillem Godoy, and Lander Ramos,

“The HOM problem is EXPTIME-complete,” in Logic in Computer Science, pp. 255–264, 2012.

slide-38
SLIDE 38

Height and Equality Constraints HOM in EXPTIME Global Reflexive Disequality Constraints Conclusions

Section 2 HOM in EXPTIME

Carles Creus, Adri` a Gasc´

  • n, Guillem Godoy, and Lander Ramos,

“The HOM problem is EXPTIME-complete,” in Logic in Computer Science, pp. 255–264, 2012.

slide-39
SLIDE 39

Height and Equality Constraints HOM in EXPTIME Global Reflexive Disequality Constraints Conclusions

Background: Tree Homomorphism

Definition A tree homomorphism is any function H : T (Σ1) → T (Σ2) such that H(σ(t)) = H(σ)(H(t)) Example H :    H(a) = a H(b) = a H(f(x1, x2)) = f(H(x1), H(x1))

H f f b a a = f H f b a H f b a = f f H b H b f H b H b = f f a a f a a

slide-40
SLIDE 40

Height and Equality Constraints HOM in EXPTIME Global Reflexive Disequality Constraints Conclusions

Background: Tree Homomorphism

Definition A tree homomorphism is any function H : T (Σ1) → T (Σ2) such that H(σ(t)) = H(σ)(H(t)) Example H :    H(a) = a H(b) = a H(f(x1, x2)) = f(H(x1), H(x1))

H f f b a a = f H f b a H f b a = f f H b H b f H b H b = f f a a f a a

slide-41
SLIDE 41

Height and Equality Constraints HOM in EXPTIME Global Reflexive Disequality Constraints Conclusions

Background: HOM Problem

Definition The HOM problem is defined as: Input: a tree automaton A and a tree homomorphism H. Question: is H(L(A)) regular? Guillem Godoy, Omer Gim´ enez, Lander Ramos, and Carme ` Alvarez, “The HOM problem is decidable,” in Symposium on Theory of Computing, pp. 485–494, 2010. Omer Gim´ enez, Guillem Godoy, and Sebastian Maneth, “Deciding regularity of the set of instances of a set of terms with regular constraints is EXPTIME-complete,” in SIAM Journal on Computing, 40(2):446–464, 2011.

slide-42
SLIDE 42

Height and Equality Constraints HOM in EXPTIME Global Reflexive Disequality Constraints Conclusions

Reduction to Emptiness

Tree Automata with Implicit HOM Equalities Represent H(L(A)) using a new class of automata: TAihom g f a q1 q1 f q2 b − − → q Not enough since the reductions also require automata capable of testing disequalities, so. . .

slide-43
SLIDE 43

Height and Equality Constraints HOM in EXPTIME Global Reflexive Disequality Constraints Conclusions

Reduction to Emptiness

Tree Automata with Implicit HOM Equalities Represent H(L(A)) using a new class of automata: TAihom g f a q1 q1 f q2 b − − → q Not enough since the reductions also require automata capable of testing disequalities, so. . .

slide-44
SLIDE 44

Height and Equality Constraints HOM in EXPTIME Global Reflexive Disequality Constraints Conclusions

Reduction to Emptiness

Tree Automata with Disequalities and Implicit HOM Equalities Reduce the problems to a new class of automata: TAihom,≈ g f a q1 q1 f q2 b

c

− − → q where c is a conjunction of atoms of the form p ≈ p′, where p, p′ ∈ N∗.

slide-45
SLIDE 45

Height and Equality Constraints HOM in EXPTIME Global Reflexive Disequality Constraints Conclusions

Reduction to Emptiness

Example A transition rule of the form f f q1 q2 q2

1.1.1 ≈ 2

− − − − − − → q can be applied at the root of a term if it satisfies f f t1 t2 t3 t1 reaches q1, t2 and t3 reach q2, t2 is equal to t3, t1’s first child is different from t3.

slide-46
SLIDE 46

Height and Equality Constraints HOM in EXPTIME Global Reflexive Disequality Constraints Conclusions

Reduction to Emptiness

There effectively exist polynomials P1, P2, P3, P4 satisfying: Theorem (reducing HOM to TAihom,≈ emptiness) Given a TA A and a tree homomorphism H, a TAihom,≈ B can be computed in time 2P1(|A|,|H|) satisfying: B ≤ P2(|A|, |H|), L(B) is empty if and only if H(L(A)) is regular. Theorem (reducing TAihom,≈ finiteness to TAihom,≈ emptiness) Given a TAihom,≈ A, a TAihom,≈ B can be computed in time 2P3(A,log |A|) satisfying: B ≤ P4(A), L(B) is empty if and only if L(A) is finite.

slide-47
SLIDE 47

Height and Equality Constraints HOM in EXPTIME Global Reflexive Disequality Constraints Conclusions

Reduction to Emptiness

Goal To decide HOM and emptiness/finiteness of TAihom,≈ in EXPTIME. It suffices to decide emptiness in EXPTIME, where . is the only factor in the exponent.

slide-48
SLIDE 48

Height and Equality Constraints HOM in EXPTIME Global Reflexive Disequality Constraints Conclusions

Emptiness Algorithm

Hubert Comon and Florent Jacquemard, “Ground reducibility is EXPTIME-complete,” in Information and Computation, 187(1):123–153, 2003. Basic idea Exponential time algorithm for finding an accepted term: Generate terms iteratively, where new terms are constructed using previous ones. Discarding criterion to remove “useless” terms. Guarantees:

→ Termination with time exponential on .. → Completeness of the algorithm.

slide-49
SLIDE 49

Height and Equality Constraints HOM in EXPTIME Global Reflexive Disequality Constraints Conclusions

Emptiness Algorithm: Discarding Criterion

A term t is useless when it can be replaced in any accepted term:

accepted term smaller accepted term replacement t s

slide-50
SLIDE 50

Height and Equality Constraints HOM in EXPTIME Global Reflexive Disequality Constraints Conclusions

Emptiness Algorithm: Discarding Criterion – Equalities

replacements multiple

slide-51
SLIDE 51

Height and Equality Constraints HOM in EXPTIME Global Reflexive Disequality Constraints Conclusions

Emptiness Algorithm: Discarding Criterion – Disequalities

never falsified at most 1 falsifies at most 1 falsifies at most 1 falsifies (if independent) (if equivalent) never falsified close: far:

slide-52
SLIDE 52

Height and Equality Constraints HOM in EXPTIME Global Reflexive Disequality Constraints Conclusions

Emptiness Algorithm: Discarding Criterion

A term t is discarded when: we already have K(A) smaller terms s1, . . . , sK(A), t is equivalent to all si’s, t and the si’s form an independent set.

slide-53
SLIDE 53

Height and Equality Constraints HOM in EXPTIME Global Reflexive Disequality Constraints Conclusions

Result

Theorem The following problems are in EXPTIME: emptiness and finiteness for TAihom,≈ regularity of H(L(A)), i.e., HOM problem H1(L(A1)) ⊆ H2(L(A2)) finiteness of H1(L(A1)) \ H2(L(A2)) Red(R1) ⊆ Red(R2) NF(R1) ⊆ NF(R2) where A, A1, A2 are TA, H, H1, H2 are tree homomorphisms, R1, R2 are term rewrite systems, Red(.) denotes the set of reducible terms and NF(.) the set of normal forms of a term rewrite system.

slide-54
SLIDE 54

Height and Equality Constraints HOM in EXPTIME Global Reflexive Disequality Constraints Conclusions

Section 3 Global Reflexive Disequality Constraints

Carles Creus, Adri` a Gasc´

  • n, and Guillem Godoy,

“Emptiness and finiteness for tree automata with global reflexive disequality constraints,” in Journal of Automated Reasoning, 51(4):371–400, 2013.

slide-55
SLIDE 55

Height and Equality Constraints HOM in EXPTIME Global Reflexive Disequality Constraints Conclusions

Section 3 Global Reflexive Disequality Constraints

Carles Creus, Adri` a Gasc´

  • n, and Guillem Godoy,

“Emptiness and finiteness for tree automata with global reflexive disequality constraints,” in Journal of Automated Reasoning, 51(4):371–400, 2013.

slide-56
SLIDE 56

Height and Equality Constraints HOM in EXPTIME Global Reflexive Disequality Constraints Conclusions

Background: Global Constraints

Definition A global constraint is an arbitrary boolean combination of atoms of the form q ≈ q′ or q ≈ q′, where q,q′ are states. Emmanuel Filiot, Jean-Marc Talbot, and Sophie Tison, “Satisfiability of a spatial logic with tree variables,” in Computer Science Logic, pp. 130–145, 2007.

slide-57
SLIDE 57

Height and Equality Constraints HOM in EXPTIME Global Reflexive Disequality Constraints Conclusions

Background: Global Constraints

Example A :            a → q0 g(q0) → q0 g(q0) → q1 f(q1, q1) → q f(q1, q) → q Final states: {q} Global constraint: q1 ≈ q1

f g . . . g a f g . . . g a . . . f g . . . g a g . . . g a

slide-58
SLIDE 58

Height and Equality Constraints HOM in EXPTIME Global Reflexive Disequality Constraints Conclusions

Background: Global Constraints

Example A :            a → q0 g(q0) → q0 g(q0) → q1 f(q1, q1) → q f(q1, q) → q Final states: {q} Global constraint: q1 ≈ q1

f q g q1 . . . g q0 a q0 f q g q1 . . . g q0 a q0 . . . f q g q1 . . . g q0 a q0 g q1 . . . g q0 a q0

slide-59
SLIDE 59

Height and Equality Constraints HOM in EXPTIME Global Reflexive Disequality Constraints Conclusions

Background: Global Constraints

Example A :            a → q0 g(q0) → q0 g(q0) → q1 f(q1, q1) → q f(q1, q) → q Final states: {q} Global constraint: q1 ≈ q1

f q g q1 . . . g q0 a q0 f q g q1 . . . g q0 a q0 . . . f q g q1 . . . g q0 a q0 g q1 . . . g q0 a q0

slide-60
SLIDE 60

Height and Equality Constraints HOM in EXPTIME Global Reflexive Disequality Constraints Conclusions

Background: Global Constraints

TAG≈,≈,N TAG≈,≈ TAG∧

≈,≈

TAG∧

TAG∧

≈,≈A

(TAGED) TAG∧

TAG∧

≈R

TAG∧

≈A

TAG∧

≈A

TAG∧

≈R

TAG∧

≈I

(RTA) TA TAG∧

≈I

slide-61
SLIDE 61

Height and Equality Constraints HOM in EXPTIME Global Reflexive Disequality Constraints Conclusions

Global Reflexive Disequality Constraints

Definition A TAG∧

≈R is a tree automaton with a global constraint satisfying:

the constraint is a conjunction of atoms over ≈, and if q ≈ q′ is in the constraint, then so are q ≈ q and q′ ≈ q′.

slide-62
SLIDE 62

Height and Equality Constraints HOM in EXPTIME Global Reflexive Disequality Constraints Conclusions

Global Reflexive Disequality Constraints

Goal To decide emptiness and finiteness for TAG∧

≈R.

slide-63
SLIDE 63

Height and Equality Constraints HOM in EXPTIME Global Reflexive Disequality Constraints Conclusions

Approach: Initial idea

Pumpings are a usual tool to reason about emptiness/finiteness:

pumping q q q

But they are not good for us, unless. . .

slide-64
SLIDE 64

Height and Equality Constraints HOM in EXPTIME Global Reflexive Disequality Constraints Conclusions

Approach: Initial idea

Pumpings are a usual tool to reason about emptiness/finiteness:

pumping q q q q q

But they are not good for us, unless. . .

slide-65
SLIDE 65

Height and Equality Constraints HOM in EXPTIME Global Reflexive Disequality Constraints Conclusions

Approach: Initial idea

Pumpings are a usual tool to reason about emptiness/finiteness:

pumping q q q q q q' q' q'

But they are not good for us, unless. . .

slide-66
SLIDE 66

Height and Equality Constraints HOM in EXPTIME Global Reflexive Disequality Constraints Conclusions

Approach: Initial idea + Extra assumptions

q1 q2 q3 q4 q

We can construct a run reaching q such that: it is arbitrarily high, and each of its constrained subruns is arbitrarily high.

slide-67
SLIDE 67

Height and Equality Constraints HOM in EXPTIME Global Reflexive Disequality Constraints Conclusions

Approach: Initial idea + Extra assumptions

q1 q2 q3 q4 q

We can construct a run reaching q such that: it is arbitrarily high, and each of its constrained subruns is arbitrarily high.

slide-68
SLIDE 68

Height and Equality Constraints HOM in EXPTIME Global Reflexive Disequality Constraints Conclusions

Approach: Initial idea + Extra assumptions

q1 q2 q3 q4 q' q' q'' q'' q''' q''' q

We can construct a run reaching q such that: it is arbitrarily high, and each of its constrained subruns is arbitrarily high.

slide-69
SLIDE 69

Height and Equality Constraints HOM in EXPTIME Global Reflexive Disequality Constraints Conclusions

Approach: Initial idea + Extra assumptions

q1 q2 q3 q4 q' q' q'' q'' q''' q''' q

Definition Q∞ is the set of the states q having a run reaching q that: can be made arbitrarily high, and each of its constrained subruns can be made arbitrarily high.

slide-70
SLIDE 70

Height and Equality Constraints HOM in EXPTIME Global Reflexive Disequality Constraints Conclusions

Approach: Initial idea + Extra assumptions

States in Q∞ simplify reasonings:

q q q

slide-71
SLIDE 71

Height and Equality Constraints HOM in EXPTIME Global Reflexive Disequality Constraints Conclusions

Approach: Initial idea + Extra assumptions

States in Q∞ simplify reasonings:

q1 q2 q3 q4 q' q' q'' q'' q''' q''' q q

slide-72
SLIDE 72

Height and Equality Constraints HOM in EXPTIME Global Reflexive Disequality Constraints Conclusions

Approach: Initial idea + Extra assumptions

States in Q∞ simplify reasonings:

q q q

slide-73
SLIDE 73

Height and Equality Constraints HOM in EXPTIME Global Reflexive Disequality Constraints Conclusions

Approach: Initial idea + Extra assumptions

States in Q∞ simplify reasonings:

q1 q2 q3 q4 q' q' q'' q'' q''' q''' q q q

slide-74
SLIDE 74

Height and Equality Constraints HOM in EXPTIME Global Reflexive Disequality Constraints Conclusions

Approach: Initial idea + Extra assumptions

In summary: Any conflict below or above a state in Q∞ can be solved. Thus, simplify the setting by: Always pruning the subruns reaching a state in Q∞. Assuming no constrained states occur above states in Q∞.

slide-75
SLIDE 75

Height and Equality Constraints HOM in EXPTIME Global Reflexive Disequality Constraints Conclusions

Approach: Algorithm

Construct runs with a non-deterministic algorithm that: Starts at the root and expands towards the leaves. Does not expand nodes with states in Q∞. For each disequality constraint it finds, it either:

Satisfies the constraint immediately. Forwards the constraint to be satisfied by the child nodes.

This requires to expand in order of height. Problem There might be arbitrarily many nodes to expand!

  • However. . .

We can avoid the expansion of certain nodes. The number of remaining nodes can be bounded.

slide-76
SLIDE 76

Height and Equality Constraints HOM in EXPTIME Global Reflexive Disequality Constraints Conclusions

Approach: Algorithm

Construct runs with a non-deterministic algorithm that: Starts at the root and expands towards the leaves. Does not expand nodes with states in Q∞. For each disequality constraint it finds, it either:

Satisfies the constraint immediately. Forwards the constraint to be satisfied by the child nodes.

This requires to expand in order of height. Problem There might be arbitrarily many nodes to expand!

  • However. . .

We can avoid the expansion of certain nodes. The number of remaining nodes can be bounded.

slide-77
SLIDE 77

Height and Equality Constraints HOM in EXPTIME Global Reflexive Disequality Constraints Conclusions

Approach: Algorithm – Whose expansions to avoid

When several nodes to expand: have to reach the same state, will recognize the same subterm, will have no constrained state, then expand only one of them.

slide-78
SLIDE 78

Height and Equality Constraints HOM in EXPTIME Global Reflexive Disequality Constraints Conclusions

Approach: Algorithm – How many are expanded

Expansions that will not have constrained state All terms they expand to have height bounded by |Q|. → At most |Σ|maxar|Q| different terms. → At most |Q||Σ|maxar|Q| of those nodes to expand.

slide-79
SLIDE 79

Height and Equality Constraints HOM in EXPTIME Global Reflexive Disequality Constraints Conclusions

Approach: Algorithm – How many are expanded

Expansions that will have constrained states At most |Q||Σ|maxar|Q| paths lead to a constrained state.

slide-80
SLIDE 80

Height and Equality Constraints HOM in EXPTIME Global Reflexive Disequality Constraints Conclusions

Approach: Algorithm – How many are expanded

Expansions that will have constrained states At most |Q||Σ|maxar|Q| paths lead to a constrained state.

slide-81
SLIDE 81

Height and Equality Constraints HOM in EXPTIME Global Reflexive Disequality Constraints Conclusions

Approach: Algorithm – How many are expanded

In total, the algorithm expands at most 2|Q||Σ|maxar|Q| paths.

slide-82
SLIDE 82

Height and Equality Constraints HOM in EXPTIME Global Reflexive Disequality Constraints Conclusions

Approach: Algorithm – Decision

Decide emptiness by trying to: construct an accepted term without cycling. Decide infiniteness by trying to: construct an accepted term cycling once, or construct an accepted term seeing a state in Q∞.

slide-83
SLIDE 83

Height and Equality Constraints HOM in EXPTIME Global Reflexive Disequality Constraints Conclusions

Result

Theorem Deciding emptiness and finiteness for TAG∧

≈R is in 3EXPTIME.

slide-84
SLIDE 84

Height and Equality Constraints HOM in EXPTIME Global Reflexive Disequality Constraints Conclusions

Section 4 Conclusions

slide-85
SLIDE 85

Height and Equality Constraints HOM in EXPTIME Global Reflexive Disequality Constraints Conclusions

Conclusions – Height and Equality Constraints

Result Decision algorithms for emptiness and finiteness for TACBBh (exponential) and TACBBHe (double exponential). Future work Hardness of the problems.

For TACBBHe it is at least EXPTIME-hard.

Height constraints with arbitrary positions. Use more powerful (dis)equality constraints like the ones of, e.g., reduction automata or TAihom,≈.

slide-86
SLIDE 86

Height and Equality Constraints HOM in EXPTIME Global Reflexive Disequality Constraints Conclusions

Conclusions – HOM in EXPTIME

Result Decision algorithms for emptiness and finiteness for TAihom,≈ that take exponential time. Result Classified as EXPTIME-complete the problems of set inclusion, finiteness of set difference, regularity (HOM problem) for images of regular languages under tree homomorphisms.

slide-87
SLIDE 87

Height and Equality Constraints HOM in EXPTIME Global Reflexive Disequality Constraints Conclusions

Conclusions – Global Reflexive Disequality Constraints

Result Decision algorithms for emptiness and finiteness for TAG∧

≈R that

take triple exponential time. Future work Hardness of the problems.

At least NP-hard.

Current algorithms have very high complexity. The general case is non-elementary; it would be nice to have at least a bound of the form: 222···2n Study other relevant subclasses of global constraints.

slide-88
SLIDE 88

Thank you for your attention!