Forward Closure and the Finite Variant Property Christopher Bouchard - - PowerPoint PPT Presentation

forward closure and the finite variant property
SMART_READER_LITE
LIVE PREVIEW

Forward Closure and the Finite Variant Property Christopher Bouchard - - PowerPoint PPT Presentation

Forward Closure and the Finite Variant Property Christopher Bouchard 1 Kimberly A. Gero 1 Christopher Lynch 2 Paliath Narendran 1 1 University at AlbanySUNY, Albany, NY, USA 2 Clarkson University, Potsdam, NY, USA Frontiers of Combining Systems


slide-1
SLIDE 1

Forward Closure and the Finite Variant Property

Christopher Bouchard1 Kimberly A. Gero1 Christopher Lynch2 Paliath Narendran1

1University at Albany—SUNY, Albany, NY, USA 2Clarkson University, Potsdam, NY, USA

Frontiers of Combining Systems 2013

slide-2
SLIDE 2

Motivation

Consider the following two theories: E1: f (g(u, x), g(v, y)) ≈ g(f (u, v), f (x, y)) E2: f (f (x, y), f (x, y)) ≈ f (x, y)

2

slide-3
SLIDE 3

Motivation

Consider the following two theories: E1: f (g(u, x), g(v, y)) ≈ g(f (u, v), f (x, y))

Undecidable unification problem∗

E2: f (f (x, y), f (x, y)) ≈ f (x, y)

Decidable unification problem Can be shown by forward closure

∗ S. Anantharaman, et al.

“Unification modulo Synchronous Distributivity.” 2012.

2

slide-4
SLIDE 4

Section 1 Introduction

slide-5
SLIDE 5

Terms

Purely syntactic Composed of. . .

4

slide-6
SLIDE 6

Terms

Purely syntactic Composed of. . . Constants: t1 = a

4

slide-7
SLIDE 7

Terms

Purely syntactic Composed of. . . Constants: t1 = a Variables: t2 = x

4

slide-8
SLIDE 8

Terms

Purely syntactic Composed of. . . Constants: t1 = a Variables: t2 = x Function Symbols: t3 = g(a, f (x))

4

slide-9
SLIDE 9

Terms

Purely syntactic Composed of. . . Constants: t1 = a Variables: t2 = x Function Symbols: t3 = g(a, f (x)) t3 = g a

f

x

4

slide-10
SLIDE 10

Terms

Purely syntactic Composed of. . . Constants: t1 = a Variables: t2 = x Function Symbols: t3 = g(a, f (x)) t3 = g a

f

x

4

slide-11
SLIDE 11

Terms

Purely syntactic Composed of. . . Constants: t1 = a Variables: t2 = x Function Symbols: t3 = g(a, f (x)) t3 = t3

4

slide-12
SLIDE 12

Rewriting

Rewrite Rule: t1 → t2 Rewrite System: Set of rewrite rules Example (Associativity) f (x, f (y, z)) − → f (f (x, y), z)

5

slide-13
SLIDE 13

Rewriting

Rewrite Rule: t1 → t2 Rewrite System: Set of rewrite rules Example (Associativity) f (x, f (y, z)) − → f (f (x, y), z)

f

x

f

y z − →

f f

x y z

5

slide-14
SLIDE 14

Convergence

Confluence: s t1 t2

∗ ∗ 6

slide-15
SLIDE 15

Convergence

Confluence: s t1 t2 u

∗ ∗ ∗ ∗ 6

slide-16
SLIDE 16

Convergence

Confluence: s t1 t2 u

∗ ∗ ∗ ∗

Termination: No infinite descending chain t0 → t1 → t2 → · · ·

6

slide-17
SLIDE 17

Convergence

Confluence: s t1 t2 u

∗ ∗ ∗ ∗

Termination: No infinite descending chain t0 → t1 → t2 → · · · Confluence + Termination = Convergence

6

slide-18
SLIDE 18

Equational Unification

Unification modulo a set of axioms E Given a set of equations EQ = { s1

?

= t1, . . . , sn

?

= tn } Substitution σ is an E-unifier of EQ iff: σ(s1) ≈E σ(t1) ∧ · · · ∧ σ(sn) ≈E σ(tn)

7

slide-19
SLIDE 19

Section 2 Motivation

slide-20
SLIDE 20

Motivation

Equational unification has lots of applications:

Automated reasoning Programming languages (e.g., Maude) Protocol analysis (e.g., Maude-NPA)

9

slide-21
SLIDE 21

Motivation

Equational unification has lots of applications:

Automated reasoning Programming languages (e.g., Maude) Protocol analysis (e.g., Maude-NPA)

But equational unification is undecidable in general

Even when restricted to “nice” theories

9

slide-22
SLIDE 22

Motivation

How to identify decidable cases?

∗ C. Lynch and B. Morawska. “Basic Syntactic Mutation.” 2002. † H. Comon-Lundh and S. Delaune. “The finite variant property: How to get

rid of some algebraic properties.” 2005.

10

slide-23
SLIDE 23

Motivation

How to identify decidable cases? Two important syntactic approaches:

Basic Syntactic Mutation∗ The Finite Variant Property†

∗ C. Lynch and B. Morawska. “Basic Syntactic Mutation.” 2002. † H. Comon-Lundh and S. Delaune. “The finite variant property: How to get

rid of some algebraic properties.” 2005.

10

slide-24
SLIDE 24

Motivation

How to identify decidable cases? Two important syntactic approaches:

Basic Syntactic Mutation∗ The Finite Variant Property†

Forward closure unifies these approaches.

∗ C. Lynch and B. Morawska. “Basic Syntactic Mutation.” 2002. † H. Comon-Lundh and S. Delaune. “The finite variant property: How to get

rid of some algebraic properties.” 2005.

10

slide-25
SLIDE 25

Section 3 Forward Closure

slide-26
SLIDE 26

Forward Closure

Extension of work by Hermann on chain properties∗ Compress rewriting steps New rules capture chains of original rules

∗ M. Hermann. “Chain Properties of Rule Closures.” 1990. 12

slide-27
SLIDE 27

Overlap

Overlap two rules and get a new rule General idea: If t1

ǫ

− − − →

ρ1

t2

p

− − − →

ρ2

t3 then t1

ǫ

− − − − − − − →

ρ1 p ρ2

t3

13

slide-28
SLIDE 28

Overlap

To compute ρ1 p ρ2 for p ∈ FPos(r1): ρ1 : l1 − → r1 ρ2 : l2 − → r2

14

slide-29
SLIDE 29

Overlap

To compute ρ1 p ρ2 for p ∈ FPos(r1): ρ1 : l1 − →

p

r1|p

ρ2 : l2 − → r2

14

slide-30
SLIDE 30

Overlap

θ = mgu(

r1|p

?

= l2 )

15

slide-31
SLIDE 31

Overlap

ρ1 p ρ2 : θ(l1) − → θ(r1[r2]p)

16

slide-32
SLIDE 32

Overlap

ρ1 p ρ2 : θ(l1) − →

p

θ(r2)

16

slide-33
SLIDE 33

Overlap

Example ρ1 : f (g(u1, x1), g(v1, y1)) → g(f (u1, v1), f (x1, y1)) ρ2 : f (g(u2, x2), g(v2, y2)) → g(f (u2, v2), f (x2, y2))

17

slide-34
SLIDE 34

Overlap

Example ρ1 : f (g(u1, x1), g(v1, y1)) → g(f (u1, v1), f (x1, y1)) ρ2 : f (g(u2, x2), g(v2, y2)) → g(f (u2, v2), f (x2, y2)) ρ1 1 ρ2 :

17

slide-35
SLIDE 35

Overlap

Example ρ1 : f (g(u1, x1), g(v1, y1)) → g(f (u1, v1), f (x1, y1)) ρ2 : f (g(u2, x2), g(v2, y2)) → g(f (u2, v2), f (x2, y2)) θ: {u1 → g(u2, x2), v1 → g(v2, y2)} ρ1 1 ρ2 :

17

slide-36
SLIDE 36

Overlap

Example ρ1 : f (g(u1, x1), g(v1, y1)) → g(f (u1, v1), f (x1, y1)) ρ2 : f (g(u2, x2), g(v2, y2)) → g(f (u2, v2), f (x2, y2)) θ: {u1 → g(u2, x2), v1 → g(v2, y2)} ρ1 1 ρ2 : f (g(g(u2, x2), x1), g(g(v2, y2), y1)) → g(g(f (u2, v2), f (x2, y2)), f (x1, y1))

17

slide-37
SLIDE 37

Overlap

Example ρ1 : f (g(u1, x1), g(v1, y1)) → g(f (u1, v1), f (x1, y1)) ρ2 : f (g(u2, x2), g(v2, y2)) → g(f (u2, v2), f (x2, y2)) θ: {u1 → g(u2, x2), v1 → g(v2, y2)} ρ1 1 ρ2 : f (g(g(u2, x2), x1), g(g(v2, y2), y1)) → g(g(f (u2, v2), f (x2, y2)), f (x1, y1))

17

slide-38
SLIDE 38

Overlap

Example ρ1 : f (g(u1, x1), g(v1, y1)) → g(f (u1, v1), f (x1, y1)) ρ2 : f (g(u2, x2), g(v2, y2)) → g(f (u2, v2), f (x2, y2)) θ: {u1 → g(u2, x2), v1 → g(v2, y2)} ρ1 1 ρ2 : f (g(g(u2, x2), x1), g(g(v2, y2), y1)) → g(g(f (u2, v2), f (x2, y2)), f (x1, y1))

17

slide-39
SLIDE 39

Redundancy

Not all overlaps are added to the forward closure. A rule l → r is redundant in a rewrite system R iff:

18

slide-40
SLIDE 40

Redundancy

Not all overlaps are added to the forward closure. A rule l → r is redundant in a rewrite system R iff:

l → r is an instance of a more general rule in R, or

18

slide-41
SLIDE 41

Redundancy

Not all overlaps are added to the forward closure. A rule l → r is redundant in a rewrite system R iff:

l → r is an instance of a more general rule in R, or Every ground instance of l ≈ r can be proven by smaller ground instances of rules in R

18

slide-42
SLIDE 42

Redundancy

Not all overlaps are added to the forward closure. A rule l → r is redundant in a rewrite system R iff:

l → r is an instance of a more general rule in R, or Every ground instance of l ≈ r can be proven by smaller ground instances of rules in R

l r t

R ∗ R ∗ 18

slide-43
SLIDE 43

Redundancy

Not all overlaps are added to the forward closure. A rule l → r is redundant in a rewrite system R iff:

l → r is an instance of a more general rule in R, or Every ground instance of l ≈ r can be proven by smaller ground instances of rules in R

l r t

R ∗ R ∗ 18

slide-44
SLIDE 44

Computing Forward Closure

Start with a rewrite system R

19

slide-45
SLIDE 45

Computing Forward Closure

Start with a rewrite system R Overlap each rule in R with each rule in R

19

slide-46
SLIDE 46

Computing Forward Closure

Start with a rewrite system R Overlap each rule in R with each rule in R Throw out redundant rules

19

slide-47
SLIDE 47

Computing Forward Closure

Start with a rewrite system R Overlap each rule in R with each rule in R Throw out redundant rules Call this FC 1(R)

19

slide-48
SLIDE 48

Computing Forward Closure

Start with a rewrite system FC k(R) Overlap each rule in FC k(R) with each rule in R Throw out redundant rules Call this FC k+1(R)

19

slide-49
SLIDE 49

Computing Forward Closure

Finally, FC(R) =

k≥0

FC k(R)

20

slide-50
SLIDE 50

Computing Forward Closure

Finally, FC(R) =

k≥0

FC k(R) If FC k(R) = FC k+1(R) for some k, FC(R) is finite Otherwise, FC(R) is infinite

20

slide-51
SLIDE 51

Forward Closure

A term t is an innermost redex of R if it can only be rewritten by R at the root. Key Idea: In FC(R), every innermost redex of R can be rewritten to its normal form in one step.

21

slide-52
SLIDE 52

Section 4 Equivalence of FC and the FVP

slide-53
SLIDE 53

Forward Closure and the Finite Variant Property

We show that a system has a finite forward closure if and only if it has the finite variant property.

23

slide-54
SLIDE 54

Finite Variant Property

The variants of t are all pairs (t′, θ) such that:

θ is a normalized substitution θ(t) →! t′

Variants capture the idea of rewriting to normal form Finite Variant Property: Every term has a finite set of most general variants

24

slide-55
SLIDE 55

Equivalence of FC and the FVP

FVP FC BP IR-BP

25

slide-56
SLIDE 56

Boundedness Property

Bound on the lengths of rewrite chains For each term t there is a bound #(t) such that (θ↓)(t)

≤ #(t)

− − − − − − → θ(t)↓

26

slide-57
SLIDE 57

Equivalence of FC and the FVP

FVP FC BP IR-BP

27

slide-58
SLIDE 58

IR-Boundedness Property

Bound on the lengths of rewrite chains from the root There is a global bound n such that, if a term t is an innermost redex, then t

≤n

− − − → t↓.

28

slide-59
SLIDE 59

Equivalence of FC and the FVP

FVP FC BP IR-BP

29

slide-60
SLIDE 60

Boundedness ⇒ IR-Boundedness

t − → t↓ Suppose t is an innermost redex

30

slide-61
SLIDE 61

Boundedness ⇒ IR-Boundedness

f (t1, . . . , tn) − → t↓ Suppose t is an innermost redex Then t = f (t1, . . . , tn), where t1, . . . , tn are normalized

30

slide-62
SLIDE 62

Boundedness ⇒ IR-Boundedness

θ(f (x1, . . . , xn)) − → t↓ Suppose t is an innermost redex Then t = θ(f (x1, . . . , xn)) Where θ = {x1 → t1, . . . , xn → tn} is normalized

30

slide-63
SLIDE 63

Boundedness ⇒ IR-Boundedness

θ(tf ) − → t↓ Suppose t is an innermost redex Then t = θ(tf ) Where θ = {x1 → t1, . . . , xn → tn} is normalized And tf = f (x1, . . . , xn)

30

slide-64
SLIDE 64

Boundedness ⇒ IR-Boundedness

θ(tf )

≤ #(tf )

− − − − − − → t↓ Suppose t is an innermost redex Then t = θ(tf ) Where θ = {x1 → t1, . . . , xn → tn} is normalized And tf = f (x1, . . . , xn)

30

slide-65
SLIDE 65

Boundedness ⇒ IR-Boundedness

θ(tf )

≤n

− − − → t↓ Suppose t is an innermost redex Then t = θ(tf ) Where θ = {x1 → t1, . . . , xn → tn} is normalized And tf = f (x1, . . . , xn) Let n = max{#(tf ) | f ∈ Σ}

30

slide-66
SLIDE 66

Boundedness ⇒ IR-Boundedness

t

≤n

− − − → t↓ Suppose t is an innermost redex Then t = θ(tf ) Where θ = {x1 → t1, . . . , xn → tn} is normalized And tf = f (x1, . . . , xn) Let n = max{#(tf ) | f ∈ Σ}

30

slide-67
SLIDE 67

IR-Boundedness ⇒ Boundedness

t

≤ #(t)

− − − − − − → t↓ #(t) =

31

slide-68
SLIDE 68

IR-Boundedness ⇒ Boundedness

t

≤ #(t)

− − − − − − → t↓ #(t) = n

31

slide-69
SLIDE 69

IR-Boundedness ⇒ Boundedness

t

≤ #(t)

− − − − − − → t↓ #(t) = n + n

31

slide-70
SLIDE 70

IR-Boundedness ⇒ Boundedness

t

≤ #(t)

− − − − − − → t↓ #(t) = n + n + n

31

slide-71
SLIDE 71

IR-Boundedness ⇒ Boundedness

t

≤ #(t)

− − − − − − → t↓ #(t) = n + n + n + n

31

slide-72
SLIDE 72

IR-Boundedness ⇒ Boundedness

t

≤ #(t)

− − − − − − → t↓ #(t) = n + n + n + n + · · ·

31

slide-73
SLIDE 73

IR-Boundedness ⇒ Boundedness

t

≤ #(t)

− − − − − − → t↓ #(t) = n + n + n + n + · · · + n

31

slide-74
SLIDE 74

IR-Boundedness ⇒ Boundedness

t

≤ #(t)

− − − − − − → t↓ #(t) = n · |FPos(t)|

31

slide-75
SLIDE 75

IR-Boundedness ⇒ Boundedness

(θ↓)(t)

≤ #(t)

− − − − − − → θ(t)↓ #(t) = n · |FPos(t)|

31

slide-76
SLIDE 76

IR-Boundedness ⇒ Boundedness

(θ↓)(t)

≤ #(t)

− − − − − − → θ(t)↓ #(t) = n · |FPos(t)|

31

slide-77
SLIDE 77

Equivalence of FC and the FVP

FVP FC BP IR-BP

32

slide-78
SLIDE 78

Equivalence of FC and the FVP

FVP FC BP IR-BP

32

slide-79
SLIDE 79

Section 5 Undecidability of FC

slide-80
SLIDE 80

Undecidability of Finiteness of Forward Closure

Reduction from the Uniform Mortality Problem for deterministic Turing machines

34

slide-81
SLIDE 81

Uniform Mortality Problem

· · · 1 0 1 1 0 1 0 · · · q Given a deterministic Turing machine Does every configuration halt in k or fewer steps (for some k)? Undecidable∗

∗ G.G. Hillebrand, et al. “Undecidable Boundedness Problems for Datalog Pro-

grams.” 1995.

35

slide-82
SLIDE 82

Undecidability of Finiteness of Forward Closure

Reduction from the Uniform Mortality Problem for deterministic Turing machines Start with a Turing machine M Create a rewrite system RM FC(RM) is finite iff M is uniformly mortal

36

slide-83
SLIDE 83

Section 6 Modularity of FC

slide-84
SLIDE 84

Modularity

Given rewrite systems R1 and R2, when does the following condition hold? |FC(R1)| + |FC(R2)| < ∞ = ⇒ |FC(R1 ∪ R2)| < ∞ We consider conditions on the signatures of R1 and R2.

38

slide-85
SLIDE 85

Modularity for Disjoint Systems

If R1 and R2 are rewrite systems with disjoint signatures Then FC(R1) ∪ FC(R2) = FC(R1 ∪ R2).

39

slide-86
SLIDE 86

Shared Constants

If R1 and R2 share constants Then FC(R1 ∪ R2) may be infinite even if FC(R1) and FC(R2) are finite. Example R1 := {f (a, h(x)) → h(f (b, x))} R2 := {b → a} f (a, h(x)) → h(f (a, x)) ∈ FC(R1 ∪ R2)

40

slide-87
SLIDE 87

Shared Constants

If R1 and R2 share constants Then FC(R1 ∪ R2) may be infinite even if FC(R1) and FC(R2) are finite. Example R1 := {f (a, h(x)) → h(f (b, x))} R2 := {b → a} f (a, h(h(x))) → h(h(f (b, x))) ∈ FC(R1 ∪ R2)

40

slide-88
SLIDE 88

Shared Constants

If R1 and R2 share constants Then FC(R1 ∪ R2) may be infinite even if FC(R1) and FC(R2) are finite. Example R1 := {f (a, h(x)) → h(f (b, x))} R2 := {b → a} f (a, h(h(x))) → h(h(f (a, x))) ∈ FC(R1 ∪ R2)

40

slide-89
SLIDE 89

Summary of Results

Finiteness of forward closure is equivalent to the finite variant property Finiteness of forward closure is undecidable Having the finite variant property is undecidable Finiteness of forward closure is preserved by union if the signatures are disjoint, but not if they share constants.

41

slide-90
SLIDE 90

Future Work

Forward closure modulo theory More detailed modularity results

42

slide-91
SLIDE 91

Thank You

cbou@cs.albany.edu Research supported in part by NSF grant CNS-0905286

43