Confluence and Convergence in Probabilistically Terminating - - PowerPoint PPT Presentation

confluence and convergence in probabilistically
SMART_READER_LITE
LIVE PREVIEW

Confluence and Convergence in Probabilistically Terminating - - PowerPoint PPT Presentation

Confluence and Convergence in Probabilistically Terminating Reduction Systems Maja H. Kirkeby Henning Christiansen Computer Science, Roskilde University, Denmark LOPSTR 2017 Namur, Belgium Maja H. Kirkeby, Henning Christiansen


slide-1
SLIDE 1

Confluence and Convergence in Probabilistically Terminating Reduction Systems

Maja H. Kirkeby Henning Christiansen

Computer Science, Roskilde University, Denmark

LOPSTR – 2017 – Namur, Belgium

Maja H. Kirkeby, Henning Christiansen Confluence in Probabilistically Terminating Reduction Systems

slide-2
SLIDE 2

2/10

Probabilistic Abstract Reduction Systems

PARS cover probabilistic algorithms and programs scheduling strategies protocols . . . Background Almost-sure convergence and almost-sure termination introduced for a subset of probabilistic programs by Hart et al 1983 PARS formulated by Bournez and Kirchner 2002 Almost-surely confluence formulated by Fr¨ uhwirt et al 2002, Bournez and Kirchner 2002

Maja H. Kirkeby, Henning Christiansen Confluence in Probabilistically Terminating Reduction Systems

slide-3
SLIDE 3

3/10

Probabilistic Abstract Reduction Systems

1 a

1 1/2 1/2 Maja H. Kirkeby, Henning Christiansen Confluence in Probabilistically Terminating Reduction Systems

slide-4
SLIDE 4

3/10

Probabilistic Abstract Reduction Systems

1 a

1 1/2 1/2

Abstract Reduction System is a pair R =(A, →) where A is countable and →⊆ A × A.

Maja H. Kirkeby, Henning Christiansen Confluence in Probabilistically Terminating Reduction Systems

slide-5
SLIDE 5

3/10

Probabilistic Abstract Reduction Systems

1 a

1 1/2 1/2

Abstract Reduction System is a pair R =(A, →) where A is countable and →⊆ A × A. R is terminating if there are no infinite paths

Maja H. Kirkeby, Henning Christiansen Confluence in Probabilistically Terminating Reduction Systems

slide-6
SLIDE 6

3/10

Probabilistic Abstract Reduction Systems

1 a

1 1/2 1/2

Abstract Reduction System is a pair R =(A, →) where A is countable and →⊆ A × A. R is terminating if there are no infinite paths R is confluent if for all paths s1 ←∗ s →∗ s2 there is a t such that s1 →∗ t ←∗ s2

Maja H. Kirkeby, Henning Christiansen Confluence in Probabilistically Terminating Reduction Systems

slide-7
SLIDE 7

3/10

Probabilistic Abstract Reduction Systems

1 a

1 1/2 1/2

Abstract Reduction System is a pair R =(A, →) where A is countable and →⊆ A × A. R is terminating if there are no infinite paths R is confluent if for all paths s1 ←∗ s →∗ s2 there is a t such that s1 →∗ t ←∗ s2 R is convergent if R is confluent and terminating

Maja H. Kirkeby, Henning Christiansen Confluence in Probabilistically Terminating Reduction Systems

slide-8
SLIDE 8

3/10

Probabilistic Abstract Reduction Systems

1 a

1 1/2 1/2

Abstract Reduction System is a pair R =(A, →) where A is countable and →⊆ A × A. R is terminating if there are no infinite paths R is confluent if for all paths s1 ←∗ s →∗ s2 there is a t such that s1 →∗ t ←∗ s2 R is convergent if R is confluent and terminating

Maja H. Kirkeby, Henning Christiansen Confluence in Probabilistically Terminating Reduction Systems

slide-9
SLIDE 9

3/10

Probabilistic Abstract Reduction Systems

1 a

1 1/2 1/2

R is almost-sure terminating if the probability of reaching a normal form is 1. Abstract Reduction System is a pair R =(A, →) where A is countable and →⊆ A × A. R is terminating if there are no infinite paths R is confluent if for all paths s1 ←∗ s →∗ s2 there is a t such that s1 →∗ t ←∗ s2 R is convergent if R is confluent and terminating

Maja H. Kirkeby, Henning Christiansen Confluence in Probabilistically Terminating Reduction Systems

slide-10
SLIDE 10

3/10

Probabilistic Abstract Reduction Systems

1 a

1 1/2 1/2

R is almost-sure terminating if the probability of reaching a normal form is 1.

  • i=0

(1/2)i Abstract Reduction System is a pair R =(A, →) where A is countable and →⊆ A × A. R is terminating if there are no infinite paths R is confluent if for all paths s1 ←∗ s →∗ s2 there is a t such that s1 →∗ t ←∗ s2 R is convergent if R is confluent and terminating

Maja H. Kirkeby, Henning Christiansen Confluence in Probabilistically Terminating Reduction Systems

slide-11
SLIDE 11

3/10

Probabilistic Abstract Reduction Systems

1 a

1 1/2 1/2

R is almost-sure terminating if the probability of reaching a normal form is 1.

  • i=0

(1/2)i = 1 Abstract Reduction System is a pair R =(A, →) where A is countable and →⊆ A × A. R is terminating if there are no infinite paths R is confluent if for all paths s1 ←∗ s →∗ s2 there is a t such that s1 →∗ t ←∗ s2 R is convergent if R is confluent and terminating

Maja H. Kirkeby, Henning Christiansen Confluence in Probabilistically Terminating Reduction Systems

slide-12
SLIDE 12

3/10

Probabilistic Abstract Reduction Systems

1 a

1 1/2 1/2

R is almost-sure terminating if the probability of reaching a normal form is 1.

  • i=0

(1/2)i = 1 R is almost-surely convergent if for all s1 ←∗ s →∗ s2 there is a normal form t such that s1 →∗ t ←∗ s2 and P(s1 →∗ t) = P(s2 →∗ t) = 1 Abstract Reduction System is a pair R =(A, →) where A is countable and →⊆ A × A. R is terminating if there are no infinite paths R is confluent if for all paths s1 ←∗ s →∗ s2 there is a t such that s1 →∗ t ←∗ s2 R is convergent if R is confluent and terminating

Maja H. Kirkeby, Henning Christiansen Confluence in Probabilistically Terminating Reduction Systems

slide-13
SLIDE 13

4/10

Probabilistic Abstract Reduction Systems

a 1

1/2 1/2 1/3 1/3 1/6 1/6 Maja H. Kirkeby, Henning Christiansen Confluence in Probabilistically Terminating Reduction Systems

slide-14
SLIDE 14

4/10

Probabilistic Abstract Reduction Systems

a 1

1/2 1/2 1/3 1/3 1/6 1/6

Probabilistic Abstract Reduction System RP = (R, P) where R = (A, →) is an ARS. For each s ∈ A \ RNF,

  • s→t

P(s → t) = 1. For all s and t, P(s → t) > 0 if and only if s → t.

Maja H. Kirkeby, Henning Christiansen Confluence in Probabilistically Terminating Reduction Systems

slide-15
SLIDE 15

4/10

Probabilistic Abstract Reduction Systems

a 1

1/2 1/2 1/3 1/3 1/6 1/6

Probability of a finite path s0 → s1 → . . . → sn with n ≥ 0 P(s0 → s1 → . . . → sn) = n

i=1 P(si−1 → si).

Maja H. Kirkeby, Henning Christiansen Confluence in Probabilistically Terminating Reduction Systems

slide-16
SLIDE 16

4/10

Probabilistic Abstract Reduction Systems

a 1

1/2 1/2 1/3 1/3 1/6 1/6 Maja H. Kirkeby, Henning Christiansen Confluence in Probabilistically Terminating Reduction Systems

slide-17
SLIDE 17

4/10

Probabilistic Abstract Reduction Systems

a 1

1/2 1/2 1/3 1/3 1/6 1/6

Probability of s reaching t ∈ RNF(s) P(s →∗ t) =

δ∈∆(s,t) P(δ)

where ∆(s, t) = {δ | δ = s → . . . → t}. Probability of diverging from s P(s →∞) = 1 −

  • t∈RNF (s)

P(s →∗ t).

Maja H. Kirkeby, Henning Christiansen Confluence in Probabilistically Terminating Reduction Systems

slide-18
SLIDE 18

4/10

Probabilistic Abstract Reduction Systems

a 1

1/2 1/2 1/3 1/3 1/6 1/6

1 a 1 a 1 a 1 a

... ... ... ... ... ... ... ... ... ... ... ... ... ... ... ...

1 a 1 a 1 a

1/3 1/2 1/6 1/3 1/2 1/6 1/2 1/3 1/6

Probability of diverging from s P(s →∞) = 1 −

  • t∈RNF (s)

P(s →∗ t).

Maja H. Kirkeby, Henning Christiansen Confluence in Probabilistically Terminating Reduction Systems

slide-19
SLIDE 19

5/10

Probabilistic Abstract Reduction Systems

R is almost-surely convergent For all s1 ←∗ s →∗ s2 there is a normal form t such that s1 →∗ t ←∗ s2 and P(s1 →∗ t) = P(s2 →∗ t) = 1. 1 a

1 1/2 1/2

a 1 b

1/2 1/2 1/2 1/2

a 1

1/2 1/2 1/3 1/3 1/6 1/6

1 2 3 . . . . . . a

1−1/4 1/4 1−1/42 1/42 1−1/43 1/43 1−1/44 1/44 Maja H. Kirkeby, Henning Christiansen Confluence in Probabilistically Terminating Reduction Systems

slide-20
SLIDE 20

6/10

Almost-surely convergent

R is almost-surely convergent For all s1 ←∗ s →∗ s2 there is a normal form t such that s1 →∗ t ←∗ s2 and P(s1 →∗ t) = P(s2 →∗ t) = 1. Theorem A PARS is almost-surely terminating and confluent if and only if it is almost-surely convergent.

Maja H. Kirkeby, Henning Christiansen Confluence in Probabilistically Terminating Reduction Systems

slide-21
SLIDE 21

6/10

Almost-surely convergent

R is almost-surely convergent For all s1 ←∗ s →∗ s2 there is a normal form t such that s1 →∗ t ←∗ s2 and P(s1 →∗ t) = P(s2 →∗ t) = 1. Theorem A PARS is almost-surely terminating and confluent if and only if it is almost-surely convergent. Two tasks:

Maja H. Kirkeby, Henning Christiansen Confluence in Probabilistically Terminating Reduction Systems

slide-22
SLIDE 22

6/10

Almost-surely convergent

R is almost-surely convergent For all s1 ←∗ s →∗ s2 there is a normal form t such that s1 →∗ t ←∗ s2 and P(s1 →∗ t) = P(s2 →∗ t) = 1. Theorem A PARS is almost-surely terminating and confluent if and only if it is almost-surely convergent. Two tasks: almost-sure termination

Maja H. Kirkeby, Henning Christiansen Confluence in Probabilistically Terminating Reduction Systems

slide-23
SLIDE 23

6/10

Almost-surely convergent

R is almost-surely convergent For all s1 ←∗ s →∗ s2 there is a normal form t such that s1 →∗ t ←∗ s2 and P(s1 →∗ t) = P(s2 →∗ t) = 1. Theorem A PARS is almost-surely terminating and confluent if and only if it is almost-surely convergent. Two tasks: almost-sure termination confluence

Maja H. Kirkeby, Henning Christiansen Confluence in Probabilistically Terminating Reduction Systems

slide-24
SLIDE 24

6/10

Almost-surely convergent

R is almost-surely convergent For all s1 ←∗ s →∗ s2 there is a normal form t such that s1 →∗ t ←∗ s2 and P(s1 →∗ t) = P(s2 →∗ t) = 1. Theorem A PARS is almost-surely terminating and confluent if and only if it is almost-surely convergent. Two tasks: almost-sure termination: e.g. Lyapunov ranking functions.1 confluence

1L.M.Ferrer Fioriti, H.Hermanns, Probabilistic Termination POPL ’15. Maja H. Kirkeby, Henning Christiansen Confluence in Probabilistically Terminating Reduction Systems

slide-25
SLIDE 25

6/10

Almost-surely convergent

R is almost-surely convergent For all s1 ←∗ s →∗ s2 there is a normal form t such that s1 →∗ t ←∗ s2 and P(s1 →∗ t) = P(s2 →∗ t) = 1. Theorem A PARS is almost-surely terminating and confluent if and only if it is almost-surely convergent. Two tasks: almost-sure termination: e.g. Lyapunov ranking functions.1 confluence: e.g. transform to systems suited for automatic confluence analysis.2

1L.M.Ferrer Fioriti, H.Hermanns, Probabilistic Termination POPL ’15. 2P.-L.Curien, G.Ghelli, On Confluence for Weakly Normalizing Systems ’91. Maja H. Kirkeby, Henning Christiansen Confluence in Probabilistically Terminating Reduction Systems

slide-26
SLIDE 26

7/10

Almost-sure termination

Definition A measure V : A → R+ is a Lyapunov ranking function if ∀s ∈ A, ∃ǫ > 0: V(s) ≥

  • s→s′

P(s → s′) · V(s′) + ǫ Lemma (Ferrer Fioriti, Hermanns POPL ’15 ) A PARS RP = ((A, →), P) is a-s. terminating if there is a Lyapunov ranking function over A.

Maja H. Kirkeby, Henning Christiansen Confluence in Probabilistically Terminating Reduction Systems

slide-27
SLIDE 27

7/10

Almost-sure termination

Definition A measure V : A → R+ is a Lyapunov ranking function if ∀s ∈ A, ∃ǫ > 0: V(s) ≥

  • s→s′

P(s → s′) · V(s′) + ǫ Lemma (Ferrer Fioriti, Hermanns POPL ’15 ) A PARS RP = ((A, →), P) is a-s. terminating if there is a Lyapunov ranking function over A. a 1

1/2 1/2 1/3 1/3 1/6 1/6 Maja H. Kirkeby, Henning Christiansen Confluence in Probabilistically Terminating Reduction Systems

slide-28
SLIDE 28

7/10

Almost-sure termination

Definition A measure V : A → R+ is a Lyapunov ranking function if ∀s ∈ A, ∃ǫ > 0: V(s) ≥

  • s→s′

P(s → s′) · V(s′) + ǫ Lemma (Ferrer Fioriti, Hermanns POPL ’15 ) A PARS RP = ((A, →), P) is a-s. terminating if there is a Lyapunov ranking function over A. a 1

1/2 1/2 1/3 1/3 1/6 1/6

V(0) > 1/3V(0) + 1/2V(1) + 1/6V(a)

Maja H. Kirkeby, Henning Christiansen Confluence in Probabilistically Terminating Reduction Systems

slide-29
SLIDE 29

7/10

Almost-sure termination

Definition A measure V : A → R+ is a Lyapunov ranking function if ∀s ∈ A, ∃ǫ > 0: V(s) ≥

  • s→s′

P(s → s′) · V(s′) + ǫ Lemma (Ferrer Fioriti, Hermanns POPL ’15 ) A PARS RP = ((A, →), P) is a-s. terminating if there is a Lyapunov ranking function over A. a 1

1/2 1/2 1/3 1/3 1/6 1/6

V(0) = 100 V(1) = 100 V(a) = 1 V(0) > 1/3V(0) + 1/2V(1) + 1/6V(a)

Maja H. Kirkeby, Henning Christiansen Confluence in Probabilistically Terminating Reduction Systems

slide-30
SLIDE 30

7/10

Almost-sure termination

Definition A measure V : A → R+ is a Lyapunov ranking function if ∀s ∈ A, ∃ǫ > 0: V(s) ≥

  • s→s′

P(s → s′) · V(s′) + ǫ Lemma (Ferrer Fioriti, Hermanns POPL ’15 ) A PARS RP = ((A, →), P) is a-s. terminating if there is a Lyapunov ranking function over A. a 1

1/2 1/2 1/3 1/3 1/6 1/6

V(0) = 100 V(1) = 100 V(a) = 1 100 = V(0) > 1/3V(0) + 1/2V(1) + 1/6V(a) = 83 + 1/2

Maja H. Kirkeby, Henning Christiansen Confluence in Probabilistically Terminating Reduction Systems

slide-31
SLIDE 31

8/10

Confluence

Lemma (Curien, Ghelli RTA ’91) Given two ARS R = (A, →R) and R′ = (A, →R′) and a mapping G : A → A′, then R is confluent if the following holds. R′ is confluent, R is normalizing, if s →R t then G(s) ↔∗

R′G(t),

∀t ∈ RNF, G(t) ∈ R′

NF, and

∀t, u ∈ RNF, G(t) = G(u) ⇒ t = u.

Maja H. Kirkeby, Henning Christiansen Confluence in Probabilistically Terminating Reduction Systems

slide-32
SLIDE 32

8/10

Confluence

Lemma (Curien, Ghelli RTA ’91) Given two ARS R = (A, →R) and R′ = (A, →R′) and a mapping G : A → A′, then R is confluent if the following holds. R′ is confluent, R is normalizing, if s →R t then G(s) ↔∗

R′G(t),

∀t ∈ RNF, G(t) ∈ R′

NF, and

∀t, u ∈ RNF, G(t) = G(u) ⇒ t = u. a 1 1 a

1/2 1/2 1/3 1/3 1/6 1/6

number′ a′

Maja H. Kirkeby, Henning Christiansen Confluence in Probabilistically Terminating Reduction Systems

slide-33
SLIDE 33

8/10

Confluence

Lemma (Curien, Ghelli RTA ’91) Given two ARS R = (A, →R) and R′ = (A, →R′) and a mapping G : A → A′, then R is confluent if the following holds. R′ is confluent, R is normalizing, if s →R t then G(s) ↔∗

R′G(t),

∀t ∈ RNF, G(t) ∈ R′

NF, and

∀t, u ∈ RNF, G(t) = G(u) ⇒ t = u. a 1 1 a

1/2 1/2 1/3 1/3 1/6 1/6

number′ a′

G G G Maja H. Kirkeby, Henning Christiansen Confluence in Probabilistically Terminating Reduction Systems

slide-34
SLIDE 34

9/10

Confluence iff

Lemma Given two ARS R = (A, →R) and R′ = (A, →R′) and a mapping G : A → A′, satisfying (surjective) ∀s′ ∈ A′, ∃s ∈ A, G(s) = s′, R and R′ are normalizing, if s →R t then G(s) ↔∗

R′ G(t), and

if G(s) ↔∗

R′ G(t) then s ↔∗ R t,

∀t ∈ RNF, G(t) ∈ R′

NF, and ∀t′ ∈ R′ NF, G −1(t′) ⊆ RNF,

∀t, u ∈ RNF, G(t) = G(u) ⇒ t = u, then R is confluent iff R′ is confluent. a 1 b

1/2 1/2 1/2 1/2

a 1 b a′ number′ b′

G G G G Maja H. Kirkeby, Henning Christiansen Confluence in Probabilistically Terminating Reduction Systems

slide-35
SLIDE 35

10/10

Contributions

Self-contained definitions of PARS; proving basic properties Almost-sure convergence generalized to PARS Theorem: almost-sure convergence ⇔ almost-sure termination ∧ confluence Unfolded methods for (dis-) proving almost-sure convergence

Maja H. Kirkeby, Henning Christiansen Confluence in Probabilistically Terminating Reduction Systems