Certification of proving termination of term rewriting by matrix - - PowerPoint PPT Presentation

certification of proving termination of term rewriting by
SMART_READER_LITE
LIVE PREVIEW

Certification of proving termination of term rewriting by matrix - - PowerPoint PPT Presentation

Certification of proving termination of term rewriting by matrix interpretations Adam Koprowski and Hans Zantema Eindhoven University of Technology Department of Mathematics and Computer Science 21 January 2008 SOFSEM08 Nov Smokovec,


slide-1
SLIDE 1

Certification of proving termination of term rewriting by matrix interpretations

Adam Koprowski and Hans Zantema

Eindhoven University of Technology Department of Mathematics and Computer Science

21 January 2008 SOFSEM’08 Nový Smokovec, High Tatras, Slovakia

A.Koprowski, H.Zantema (TU/e) Certification of proving termination ... SOFSEM’08 1 / 24

slide-2
SLIDE 2

Outline

1

Background Termination of Term Rewriting

Term Rewriting Termination of Term Rewriting Automation of Proving Termination

Certification of Termination

CoLoR project: Certification of Termination Proofs Certified Competition

2

Formalization of Matrix Interpretations Matrix Interpretations Method Monotone algebras Matrices Matrix interpretations

3

Conclusions & Future Work

A.Koprowski, H.Zantema (TU/e) Certification of proving termination ... SOFSEM’08 2 / 24

slide-3
SLIDE 3

Outline

1

Background Termination of Term Rewriting

Term Rewriting Termination of Term Rewriting Automation of Proving Termination

Certification of Termination

CoLoR project: Certification of Termination Proofs Certified Competition

2

Formalization of Matrix Interpretations Matrix Interpretations Method Monotone algebras Matrices Matrix interpretations

3

Conclusions & Future Work

A.Koprowski, H.Zantema (TU/e) Certification of proving termination ... SOFSEM’08 3 / 24

slide-4
SLIDE 4

Term Rewriting

Term rewriting is a model of computations.

Example

0 + y → y s(x) + y → s(x + y) 0 ∗ y → 0 s(x) ∗ y → (x ∗ y) + y fact(0) → s(0) fact(s(x)) → s(x) ∗ fact(x)

A.Koprowski, H.Zantema (TU/e) Certification of proving termination ... SOFSEM’08 4 / 24

slide-5
SLIDE 5

Term Rewriting

Term rewriting is a model of computations.

Example

0 + y → y s(x) + y → s(x + y) 0 ∗ y → 0 s(x) ∗ y → (x ∗ y) + y fact(0) → s(0) fact(s(x)) → s(x) ∗ fact(x)

A.Koprowski, H.Zantema (TU/e) Certification of proving termination ... SOFSEM’08 4 / 24

slide-6
SLIDE 6

Term Rewriting

Term rewriting is a model of computations.

Example

0 + y → y s(x) + y → s(x + y) 0 ∗ y → 0 s(x) ∗ y → (x ∗ y) + y fact(0) → s(0) fact(s(x)) → s(x) ∗ fact(x) fact(s(s(s(0))))

A.Koprowski, H.Zantema (TU/e) Certification of proving termination ... SOFSEM’08 4 / 24

slide-7
SLIDE 7

Term Rewriting

Term rewriting is a model of computations.

Example

0 + y → y s(x) + y → s(x + y) 0 ∗ y → 0 s(x) ∗ y → (x ∗ y) + y fact(0) → s(0) fact(s(x)) → s(x) ∗ fact(x) fact(s(s(s(0)))) → 3 ∗ fact(2)

A.Koprowski, H.Zantema (TU/e) Certification of proving termination ... SOFSEM’08 4 / 24

slide-8
SLIDE 8

Term Rewriting

Term rewriting is a model of computations.

Example

0 + y → y s(x) + y → s(x + y) 0 ∗ y → 0 s(x) ∗ y → (x ∗ y) + y fact(0) → s(0) fact(s(x)) → s(x) ∗ fact(x) fact(s(s(s(0)))) →+ 3 ∗ (2 ∗ fact(1))

A.Koprowski, H.Zantema (TU/e) Certification of proving termination ... SOFSEM’08 4 / 24

slide-9
SLIDE 9

Term Rewriting

Term rewriting is a model of computations.

Example

0 + y → y s(x) + y → s(x + y) 0 ∗ y → 0 s(x) ∗ y → (x ∗ y) + y fact(0) → s(0) fact(s(x)) → s(x) ∗ fact(x) fact(s(s(s(0)))) →+ 3 ∗ (2 ∗ (1 ∗ fact(0)))

A.Koprowski, H.Zantema (TU/e) Certification of proving termination ... SOFSEM’08 4 / 24

slide-10
SLIDE 10

Term Rewriting

Term rewriting is a model of computations.

Example

0 + y → y s(x) + y → s(x + y) 0 ∗ y → 0 s(x) ∗ y → (x ∗ y) + y fact(0) → s(0) fact(s(x)) → s(x) ∗ fact(x) fact(s(s(s(0)))) →+ 3 ∗ (2 ∗ (1 ∗ 1))

A.Koprowski, H.Zantema (TU/e) Certification of proving termination ... SOFSEM’08 4 / 24

slide-11
SLIDE 11

Term Rewriting

Term rewriting is a model of computations.

Example

0 + y → y s(x) + y → s(x + y) 0 ∗ y → 0 s(x) ∗ y → (x ∗ y) + y fact(0) → s(0) fact(s(x)) → s(x) ∗ fact(x) fact(s(s(s(0)))) →+ 3 ∗ (2 ∗ ((0 ∗ 1) + 1))

A.Koprowski, H.Zantema (TU/e) Certification of proving termination ... SOFSEM’08 4 / 24

slide-12
SLIDE 12

Term Rewriting

Term rewriting is a model of computations.

Example

0 + y → y s(x) + y → s(x + y) 0 ∗ y → 0 s(x) ∗ y → (x ∗ y) + y fact(0) → s(0) fact(s(x)) → s(x) ∗ fact(x) fact(s(s(s(0)))) →+ 3 ∗ (2 ∗ (0 + 1))

A.Koprowski, H.Zantema (TU/e) Certification of proving termination ... SOFSEM’08 4 / 24

slide-13
SLIDE 13

Term Rewriting

Term rewriting is a model of computations.

Example

0 + y → y s(x) + y → s(x + y) 0 ∗ y → 0 s(x) ∗ y → (x ∗ y) + y fact(0) → s(0) fact(s(x)) → s(x) ∗ fact(x) fact(s(s(s(0)))) →+ 3 ∗ (2 ∗ 1)

A.Koprowski, H.Zantema (TU/e) Certification of proving termination ... SOFSEM’08 4 / 24

slide-14
SLIDE 14

Term Rewriting

Term rewriting is a model of computations.

Example

0 + y → y s(x) + y → s(x + y) 0 ∗ y → 0 s(x) ∗ y → (x ∗ y) + y fact(0) → s(0) fact(s(x)) → s(x) ∗ fact(x) fact(s(s(s(0)))) →+ 6

A.Koprowski, H.Zantema (TU/e) Certification of proving termination ... SOFSEM’08 4 / 24

slide-15
SLIDE 15

Termination of Term Rewriting

One of the most important properties of term rewriting is termination.

Definition

A term rewriting system (TRS) is terminating if it does not admit infinite reductions. In general the problem is undecidable. However, there is a (ever increasing) number of techniques for proving termination of term rewriting.

Example

A.Koprowski, H.Zantema (TU/e) Certification of proving termination ... SOFSEM’08 5 / 24

slide-16
SLIDE 16

Termination of Term Rewriting

One of the most important properties of term rewriting is termination.

Definition

A term rewriting system (TRS) is terminating if it does not admit infinite reductions. In general the problem is undecidable. However, there is a (ever increasing) number of techniques for proving termination of term rewriting.

Example

A.Koprowski, H.Zantema (TU/e) Certification of proving termination ... SOFSEM’08 5 / 24

slide-17
SLIDE 17

Termination of Term Rewriting

One of the most important properties of term rewriting is termination.

Definition

A term rewriting system (TRS) is terminating if it does not admit infinite reductions. In general the problem is undecidable. However, there is a (ever increasing) number of techniques for proving termination of term rewriting.

Example

A.Koprowski, H.Zantema (TU/e) Certification of proving termination ... SOFSEM’08 5 / 24

slide-18
SLIDE 18

Termination of Term Rewriting

One of the most important properties of term rewriting is termination.

Definition

A term rewriting system (TRS) is terminating if it does not admit infinite reductions. In general the problem is undecidable. However, there is a (ever increasing) number of techniques for proving termination of term rewriting.

Example

A.Koprowski, H.Zantema (TU/e) Certification of proving termination ... SOFSEM’08 5 / 24

slide-19
SLIDE 19

Termination of Term Rewriting

One of the most important properties of term rewriting is termination.

Definition

A term rewriting system (TRS) is terminating if it does not admit infinite reductions. In general the problem is undecidable. However, there is a (ever increasing) number of techniques for proving termination of term rewriting.

Example

a(a(x)) → a(b(a(x)))

A.Koprowski, H.Zantema (TU/e) Certification of proving termination ... SOFSEM’08 5 / 24

slide-20
SLIDE 20

Termination of Term Rewriting

One of the most important properties of term rewriting is termination.

Definition

A term rewriting system (TRS) is terminating if it does not admit infinite reductions. In general the problem is undecidable. However, there is a (ever increasing) number of techniques for proving termination of term rewriting.

Example

aa → aba

A.Koprowski, H.Zantema (TU/e) Certification of proving termination ... SOFSEM’08 5 / 24

slide-21
SLIDE 21

Automation of Proving Termination

Recently the emphasis is on automation. There is a number of tools for proving termination automatically. (AProVE, Cariboo, Cime, JamBox, MatchBox, MultumNonMulta, MuTerm, Teparla, Torpa, TPA, TTT, TTTbox, . . . ) An annual termination competition is organized where those tools compete on a number of problems. Both the tools and proofs produced by them are getting more and more complex. Reliability of such tools is a challenge and indeed every year we

  • bserve some disqualifications due to erroneous proofs.

A.Koprowski, H.Zantema (TU/e) Certification of proving termination ... SOFSEM’08 6 / 24

slide-22
SLIDE 22

Automation of Proving Termination

Recently the emphasis is on automation. There is a number of tools for proving termination automatically. (AProVE, Cariboo, Cime, JamBox, MatchBox, MultumNonMulta, MuTerm, Teparla, Torpa, TPA, TTT, TTTbox, . . . ) An annual termination competition is organized where those tools compete on a number of problems. Both the tools and proofs produced by them are getting more and more complex. Reliability of such tools is a challenge and indeed every year we

  • bserve some disqualifications due to erroneous proofs.

A.Koprowski, H.Zantema (TU/e) Certification of proving termination ... SOFSEM’08 6 / 24

slide-23
SLIDE 23

Automation of Proving Termination

Recently the emphasis is on automation. There is a number of tools for proving termination automatically. (AProVE, Cariboo, Cime, JamBox, MatchBox, MultumNonMulta, MuTerm, Teparla, Torpa, TPA, TTT, TTTbox, . . . ) An annual termination competition is organized where those tools compete on a number of problems. Both the tools and proofs produced by them are getting more and more complex. Reliability of such tools is a challenge and indeed every year we

  • bserve some disqualifications due to erroneous proofs.

A.Koprowski, H.Zantema (TU/e) Certification of proving termination ... SOFSEM’08 6 / 24

slide-24
SLIDE 24

Automation of Proving Termination

Recently the emphasis is on automation. There is a number of tools for proving termination automatically. (AProVE, Cariboo, Cime, JamBox, MatchBox, MultumNonMulta, MuTerm, Teparla, Torpa, TPA, TTT, TTTbox, . . . ) An annual termination competition is organized where those tools compete on a number of problems. Both the tools and proofs produced by them are getting more and more complex. Reliability of such tools is a challenge and indeed every year we

  • bserve some disqualifications due to erroneous proofs.

A.Koprowski, H.Zantema (TU/e) Certification of proving termination ... SOFSEM’08 6 / 24

slide-25
SLIDE 25

Automation of Proving Termination

Recently the emphasis is on automation. There is a number of tools for proving termination automatically. (AProVE, Cariboo, Cime, JamBox, MatchBox, MultumNonMulta, MuTerm, Teparla, Torpa, TPA, TTT, TTTbox, . . . ) An annual termination competition is organized where those tools compete on a number of problems. Both the tools and proofs produced by them are getting more and more complex. Reliability of such tools is a challenge and indeed every year we

  • bserve some disqualifications due to erroneous proofs.

A.Koprowski, H.Zantema (TU/e) Certification of proving termination ... SOFSEM’08 6 / 24

slide-26
SLIDE 26

Outline

1

Background Termination of Term Rewriting

Term Rewriting Termination of Term Rewriting Automation of Proving Termination

Certification of Termination

CoLoR project: Certification of Termination Proofs Certified Competition

2

Formalization of Matrix Interpretations Matrix Interpretations Method Monotone algebras Matrices Matrix interpretations

3

Conclusions & Future Work

A.Koprowski, H.Zantema (TU/e) Certification of proving termination ... SOFSEM’08 7 / 24

slide-27
SLIDE 27

CoLoR overview

CoLoR

CoLoR: Coq Library on Rewriting and Termination. Goal: certification of termination proofs produced by various termination provers. Project started in March 2004 by Frédéric Blanqui. How to do that? CoLoR approach: TPG: common format for termination proofs. Tools output proofs in TPG format. CoLoR: a Coq library of results on termination. Rainbow: a tool for translation from proofs in TPG format to Coq proofs, using results from CoLoR.

A.Koprowski, H.Zantema (TU/e) Certification of proving termination ... SOFSEM’08 8 / 24

slide-28
SLIDE 28

CoLoR overview

CoLoR

CoLoR: Coq Library on Rewriting and Termination. Goal: certification of termination proofs produced by various termination provers. Project started in March 2004 by Frédéric Blanqui. How to do that? CoLoR approach: TPG: common format for termination proofs. Tools output proofs in TPG format. CoLoR: a Coq library of results on termination. Rainbow: a tool for translation from proofs in TPG format to Coq proofs, using results from CoLoR.

A.Koprowski, H.Zantema (TU/e) Certification of proving termination ... SOFSEM’08 8 / 24

slide-29
SLIDE 29

CoLoR overview

CoLoR

CoLoR: Coq Library on Rewriting and Termination. Goal: certification of termination proofs produced by various termination provers. Project started in March 2004 by Frédéric Blanqui. How to do that? CoLoR approach: TPG: common format for termination proofs. Tools output proofs in TPG format. CoLoR: a Coq library of results on termination. Rainbow: a tool for translation from proofs in TPG format to Coq proofs, using results from CoLoR.

A.Koprowski, H.Zantema (TU/e) Certification of proving termination ... SOFSEM’08 8 / 24

slide-30
SLIDE 30

CoLoR overview

CoLoR

CoLoR: Coq Library on Rewriting and Termination. Goal: certification of termination proofs produced by various termination provers. Project started in March 2004 by Frédéric Blanqui. How to do that? CoLoR approach: TPG: common format for termination proofs. Tools output proofs in TPG format. CoLoR: a Coq library of results on termination. Rainbow: a tool for translation from proofs in TPG format to Coq proofs, using results from CoLoR.

A.Koprowski, H.Zantema (TU/e) Certification of proving termination ... SOFSEM’08 8 / 24

slide-31
SLIDE 31

CoLoR overview

CoLoR

CoLoR: Coq Library on Rewriting and Termination. Goal: certification of termination proofs produced by various termination provers. Project started in March 2004 by Frédéric Blanqui. How to do that? CoLoR approach: TPG: common format for termination proofs. Tools output proofs in TPG format. CoLoR: a Coq library of results on termination. Rainbow: a tool for translation from proofs in TPG format to Coq proofs, using results from CoLoR.

A.Koprowski, H.Zantema (TU/e) Certification of proving termination ... SOFSEM’08 8 / 24

slide-32
SLIDE 32

CoLoR overview

CoLoR

CoLoR: Coq Library on Rewriting and Termination. Goal: certification of termination proofs produced by various termination provers. Project started in March 2004 by Frédéric Blanqui. How to do that? CoLoR approach: TPG: common format for termination proofs. Tools output proofs in TPG format. CoLoR: a Coq library of results on termination. Rainbow: a tool for translation from proofs in TPG format to Coq proofs, using results from CoLoR.

A.Koprowski, H.Zantema (TU/e) Certification of proving termination ... SOFSEM’08 8 / 24

slide-33
SLIDE 33

CoLoR architecture overview

A.Koprowski, H.Zantema (TU/e) Certification of proving termination ... SOFSEM’08 9 / 24

slide-34
SLIDE 34

CoLoR architecture overview

A.Koprowski, H.Zantema (TU/e) Certification of proving termination ... SOFSEM’08 9 / 24

slide-35
SLIDE 35

CoLoR architecture overview

A.Koprowski, H.Zantema (TU/e) Certification of proving termination ... SOFSEM’08 9 / 24

slide-36
SLIDE 36

Certified competition

In the termination competition in 2007 a new “certified” category was introduced. Participants:

CiME+ A3PAT TPA+ CoLoR T T T2 + CoLoR

TPA+ CoLoR was the winner with the score of 354. Every successful proof of TPA was using matrix interpretations.

A.Koprowski, H.Zantema (TU/e) Certification of proving termination ... SOFSEM’08 10 / 24

slide-37
SLIDE 37

Certified competition

In the termination competition in 2007 a new “certified” category was introduced. Participants:

CiME+ A3PAT TPA+ CoLoR T T T2 + CoLoR

TPA+ CoLoR was the winner with the score of 354. Every successful proof of TPA was using matrix interpretations.

A.Koprowski, H.Zantema (TU/e) Certification of proving termination ... SOFSEM’08 10 / 24

slide-38
SLIDE 38

Certified competition

In the termination competition in 2007 a new “certified” category was introduced. Participants:

CiME+ A3PAT TPA+ CoLoR T T T2 + CoLoR

TPA+ CoLoR was the winner with the score of 354. Every successful proof of TPA was using matrix interpretations.

A.Koprowski, H.Zantema (TU/e) Certification of proving termination ... SOFSEM’08 10 / 24

slide-39
SLIDE 39

Certified competition

In the termination competition in 2007 a new “certified” category was introduced. Participants:

CiME+ A3PAT TPA+ CoLoR T T T2 + CoLoR

TPA+ CoLoR was the winner with the score of 354. Every successful proof of TPA was using matrix interpretations.

A.Koprowski, H.Zantema (TU/e) Certification of proving termination ... SOFSEM’08 10 / 24

slide-40
SLIDE 40

Outline

1

Background Termination of Term Rewriting

Term Rewriting Termination of Term Rewriting Automation of Proving Termination

Certification of Termination

CoLoR project: Certification of Termination Proofs Certified Competition

2

Formalization of Matrix Interpretations Matrix Interpretations Method Monotone algebras Matrices Matrix interpretations

3

Conclusions & Future Work

A.Koprowski, H.Zantema (TU/e) Certification of proving termination ... SOFSEM’08 11 / 24

slide-41
SLIDE 41

General idea

A popular approach is interpretation into a well-founded monotone algebra. Domain: N, f(x1, . . . , xn) interpreted as polynomial N[x1, . . . , xn] = ⇒ polynomial interpretations (Lankford ’79) Domain: Nd, f( x1, . . . , xn) = A1 x1 + . . . + An xn + b, with Ai ∈ Nd×d, b ∈ Nd = ⇒ matrix interpretations (Endrullis, Waldmann, Zantema ’06)

A.Koprowski, H.Zantema (TU/e) Certification of proving termination ... SOFSEM’08 12 / 24

slide-42
SLIDE 42

General idea

A popular approach is interpretation into a well-founded monotone algebra. Domain: N, f(x1, . . . , xn) interpreted as polynomial N[x1, . . . , xn] = ⇒ polynomial interpretations (Lankford ’79) Domain: Nd, f( x1, . . . , xn) = A1 x1 + . . . + An xn + b, with Ai ∈ Nd×d, b ∈ Nd = ⇒ matrix interpretations (Endrullis, Waldmann, Zantema ’06)

A.Koprowski, H.Zantema (TU/e) Certification of proving termination ... SOFSEM’08 12 / 24

slide-43
SLIDE 43

General idea

A popular approach is interpretation into a well-founded monotone algebra. Domain: N, f(x1, . . . , xn) interpreted as polynomial N[x1, . . . , xn] = ⇒ polynomial interpretations (Lankford ’79) Domain: Nd, f( x1, . . . , xn) = A1 x1 + . . . + An xn + b, with Ai ∈ Nd×d, b ∈ Nd = ⇒ matrix interpretations (Endrullis, Waldmann, Zantema ’06)

A.Koprowski, H.Zantema (TU/e) Certification of proving termination ... SOFSEM’08 12 / 24

slide-44
SLIDE 44

Example

Example

a(a(x)) → a(b(a(x), c)) a(x) = 1 1

0 0

  • x +

1

  • b(x, y) =

1 0

0 0

  • x +

1 0

0 0

  • y

c =

  • [b(a(x), c)] =

1 0

0 0

1 1

0 0

  • x +

1

+ 1 0

0 0

  • =

1 1

0 0

  • x

[a(b(a(x), c))] = 1 1

0 0

1 1

0 0

  • x +

1

  • =

1 1

0 0

  • x +

1

  • [a(a(x))] =

1 1

0 0

1 1

0 0

  • x +

1

+

1

  • =

1 1

0 0

  • x +

1

1

  • u1

··· ud

  • v1

··· vd

  • iff ∀i, ui ≥N vi

u1

··· ud

  • >

v1

··· vd

  • iff

u1

··· ud

  • v1

··· vd

  • ∧ u1 >N v1

A.Koprowski, H.Zantema (TU/e) Certification of proving termination ... SOFSEM’08 13 / 24

slide-45
SLIDE 45

Example

Example

a(a(x)) → a(b(a(x), c)) a(x) = 1 1

0 0

  • x +

1

  • b(x, y) =

1 0

0 0

  • x +

1 0

0 0

  • y

c =

  • [b(a(x), c)] =

1 0

0 0

1 1

0 0

  • x +

1

+ 1 0

0 0

  • =

1 1

0 0

  • x

[a(b(a(x), c))] = 1 1

0 0

1 1

0 0

  • x +

1

  • =

1 1

0 0

  • x +

1

  • [a(a(x))] =

1 1

0 0

1 1

0 0

  • x +

1

+

1

  • =

1 1

0 0

  • x +

1

1

  • u1

··· ud

  • v1

··· vd

  • iff ∀i, ui ≥N vi

u1

··· ud

  • >

v1

··· vd

  • iff

u1

··· ud

  • v1

··· vd

  • ∧ u1 >N v1

A.Koprowski, H.Zantema (TU/e) Certification of proving termination ... SOFSEM’08 13 / 24

slide-46
SLIDE 46

Example

Example

a(a(x)) → a(b(a(x), c)) a(x) = 1 1

0 0

  • x +

1

  • b(x, y) =

1 0

0 0

  • x +

1 0

0 0

  • y

c =

  • [b(a(x), c)] =

1 0

0 0

1 1

0 0

  • x +

1

+ 1 0

0 0

  • =

1 1

0 0

  • x

[a(b(a(x), c))] = 1 1

0 0

1 1

0 0

  • x +

1

  • =

1 1

0 0

  • x +

1

  • [a(a(x))] =

1 1

0 0

1 1

0 0

  • x +

1

+

1

  • =

1 1

0 0

  • x +

1

1

  • u1

··· ud

  • v1

··· vd

  • iff ∀i, ui ≥N vi

u1

··· ud

  • >

v1

··· vd

  • iff

u1

··· ud

  • v1

··· vd

  • ∧ u1 >N v1

A.Koprowski, H.Zantema (TU/e) Certification of proving termination ... SOFSEM’08 13 / 24

slide-47
SLIDE 47

Example

Example

a(a(x)) → a(b(a(x), c)) a(x) = 1 1

0 0

  • x +

1

  • b(x, y) =

1 0

0 0

  • x +

1 0

0 0

  • y

c =

  • [b(a(x), c)] =

1 0

0 0

1 1

0 0

  • x +

1

+ 1 0

0 0

  • =

1 1

0 0

  • x

[a(b(a(x), c))] = 1 1

0 0

1 1

0 0

  • x +

1

  • =

1 1

0 0

  • x +

1

  • [a(a(x))] =

1 1

0 0

1 1

0 0

  • x +

1

+

1

  • =

1 1

0 0

  • x +

1

1

  • u1

··· ud

  • v1

··· vd

  • iff ∀i, ui ≥N vi

u1

··· ud

  • >

v1

··· vd

  • iff

u1

··· ud

  • v1

··· vd

  • ∧ u1 >N v1

A.Koprowski, H.Zantema (TU/e) Certification of proving termination ... SOFSEM’08 13 / 24

slide-48
SLIDE 48

Outline

1

Background Termination of Term Rewriting

Term Rewriting Termination of Term Rewriting Automation of Proving Termination

Certification of Termination

CoLoR project: Certification of Termination Proofs Certified Competition

2

Formalization of Matrix Interpretations Matrix Interpretations Method Monotone algebras Matrices Matrix interpretations

3

Conclusions & Future Work

A.Koprowski, H.Zantema (TU/e) Certification of proving termination ... SOFSEM’08 14 / 24

slide-49
SLIDE 49

Monotone algebras

Definition (An extended weakly monotone Σ-algebra)

An extended weakly monotone Σ-algebra (A, [·], >, ) is a Σ-algebra (A, [·]) equipped with two binary relations >, on A such that: > is well-founded; > · ⊆ >; for every f ∈ Σ the operation [f] is monotone with respect to >.

Theorem

Let R, R′ be TRSs over a signature Σ, (A, [·], >, ) be an extended monotone Σ-algebra such that: [ℓ, α] [r, α] for every rule ℓ → r in R, for all α : X → A and [ℓ, α] > [r, α] for every rule ℓ → r in R′ and for all α : X → A. Then SN(R) implies SN(R ∪ R′).

A.Koprowski, H.Zantema (TU/e) Certification of proving termination ... SOFSEM’08 15 / 24

slide-50
SLIDE 50

Monotone algebras

Definition (An extended weakly monotone Σ-algebra)

An extended weakly monotone Σ-algebra (A, [·], >, ) is a Σ-algebra (A, [·]) equipped with two binary relations >, on A such that: > is well-founded; > · ⊆ >; for every f ∈ Σ the operation [f] is monotone with respect to >.

Theorem

Let R, R′ be TRSs over a signature Σ, (A, [·], >, ) be an extended monotone Σ-algebra such that: [ℓ, α] [r, α] for every rule ℓ → r in R, for all α : X → A and [ℓ, α] > [r, α] for every rule ℓ → r in R′ and for all α : X → A. Then SN(R) implies SN(R ∪ R′).

A.Koprowski, H.Zantema (TU/e) Certification of proving termination ... SOFSEM’08 15 / 24

slide-51
SLIDE 51

Formalization of monotone algebras

Monotone algebras are formalized as a functor. We additionally require >T and T to be decidable. (where s >T t ≡ ∀α : X → A, [s, α] > [t, α]) More precisely the requirement is to provide a relation ≫, such that

≫ ⊆ >T and ≫ is decidable similarly for .

The structure returned by the functor contains all the machinery required to prove (relative)-(top)-termination in Coq.

A.Koprowski, H.Zantema (TU/e) Certification of proving termination ... SOFSEM’08 16 / 24

slide-52
SLIDE 52

Formalization of monotone algebras

Monotone algebras are formalized as a functor. We additionally require >T and T to be decidable. (where s >T t ≡ ∀α : X → A, [s, α] > [t, α]) More precisely the requirement is to provide a relation ≫, such that

≫ ⊆ >T and ≫ is decidable similarly for .

The structure returned by the functor contains all the machinery required to prove (relative)-(top)-termination in Coq.

A.Koprowski, H.Zantema (TU/e) Certification of proving termination ... SOFSEM’08 16 / 24

slide-53
SLIDE 53

Formalization of monotone algebras

Monotone algebras are formalized as a functor. We additionally require >T and T to be decidable. (where s >T t ≡ ∀α : X → A, [s, α] > [t, α]) More precisely the requirement is to provide a relation ≫, such that

≫ ⊆ >T and ≫ is decidable similarly for .

The structure returned by the functor contains all the machinery required to prove (relative)-(top)-termination in Coq.

A.Koprowski, H.Zantema (TU/e) Certification of proving termination ... SOFSEM’08 16 / 24

slide-54
SLIDE 54

Formalization of monotone algebras

Monotone algebras are formalized as a functor. We additionally require >T and T to be decidable. (where s >T t ≡ ∀α : X → A, [s, α] > [t, α]) More precisely the requirement is to provide a relation ≫, such that

≫ ⊆ >T and ≫ is decidable similarly for .

The structure returned by the functor contains all the machinery required to prove (relative)-(top)-termination in Coq.

A.Koprowski, H.Zantema (TU/e) Certification of proving termination ... SOFSEM’08 16 / 24

slide-55
SLIDE 55

Outline

1

Background Termination of Term Rewriting

Term Rewriting Termination of Term Rewriting Automation of Proving Termination

Certification of Termination

CoLoR project: Certification of Termination Proofs Certified Competition

2

Formalization of Matrix Interpretations Matrix Interpretations Method Monotone algebras Matrices Matrix interpretations

3

Conclusions & Future Work

A.Koprowski, H.Zantema (TU/e) Certification of proving termination ... SOFSEM’08 17 / 24

slide-56
SLIDE 56

Formalization of matrices

Matrices over arbitrary semi-ring of coefficients. a number of basic operations over matrices such as: [·], Mi,j, M + N, M ∗ N, MT, . . . and a number of basic properties such as:

M + N = N + M, M ∗ (N ∗ P) = (M ∗ N) ∗ P monotonicity of ∗ . . .

A.Koprowski, H.Zantema (TU/e) Certification of proving termination ... SOFSEM’08 18 / 24

slide-57
SLIDE 57

Formalization of matrices

Matrices over arbitrary semi-ring of coefficients. a number of basic operations over matrices such as: [·], Mi,j, M + N, M ∗ N, MT, . . . and a number of basic properties such as:

M + N = N + M, M ∗ (N ∗ P) = (M ∗ N) ∗ P monotonicity of ∗ . . .

A.Koprowski, H.Zantema (TU/e) Certification of proving termination ... SOFSEM’08 18 / 24

slide-58
SLIDE 58

Formalization of matrices

Matrices over arbitrary semi-ring of coefficients. a number of basic operations over matrices such as: [·], Mi,j, M + N, M ∗ N, MT, . . . and a number of basic properties such as:

M + N = N + M, M ∗ (N ∗ P) = (M ∗ N) ∗ P monotonicity of ∗ . . .

A.Koprowski, H.Zantema (TU/e) Certification of proving termination ... SOFSEM’08 18 / 24

slide-59
SLIDE 59

Outline

1

Background Termination of Term Rewriting

Term Rewriting Termination of Term Rewriting Automation of Proving Termination

Certification of Termination

CoLoR project: Certification of Termination Proofs Certified Competition

2

Formalization of Matrix Interpretations Matrix Interpretations Method Monotone algebras Matrices Matrix interpretations

3

Conclusions & Future Work

A.Koprowski, H.Zantema (TU/e) Certification of proving termination ... SOFSEM’08 19 / 24

slide-60
SLIDE 60

Polynomial interpretations in the setting of monotone algebras

A = Z, > = >Z, =≥Z, interpretations represented by polynomials [f(x1, . . . , xn)] = PZ(x1, . . . , xn), >T not decidable (positiveness of polynomial) — heuristics required.

A.Koprowski, H.Zantema (TU/e) Certification of proving termination ... SOFSEM’08 20 / 24

slide-61
SLIDE 61

Polynomial interpretations in the setting of monotone algebras

A = Z, > = >Z, =≥Z, interpretations represented by polynomials [f(x1, . . . , xn)] = PZ(x1, . . . , xn), >T not decidable (positiveness of polynomial) — heuristics required.

A.Koprowski, H.Zantema (TU/e) Certification of proving termination ... SOFSEM’08 20 / 24

slide-62
SLIDE 62

Polynomial interpretations in the setting of monotone algebras

A = Z, > = >Z, =≥Z, interpretations represented by polynomials [f(x1, . . . , xn)] = PZ(x1, . . . , xn), >T not decidable (positiveness of polynomial) — heuristics required.

A.Koprowski, H.Zantema (TU/e) Certification of proving termination ... SOFSEM’08 20 / 24

slide-63
SLIDE 63

Polynomial interpretations in the setting of monotone algebras

A = Z, > = >Z, =≥Z, interpretations represented by polynomials [f(x1, . . . , xn)] = PZ(x1, . . . , xn), >T not decidable (positiveness of polynomial) — heuristics required.

A.Koprowski, H.Zantema (TU/e) Certification of proving termination ... SOFSEM’08 20 / 24

slide-64
SLIDE 64

Matrix interpretations in the setting of monotone algebras

fix a dimension d, A = Nd, (u1, . . . , ud) (v1, . . . , vd) iff ∀i, ui ≥N vi, (u1, . . . , ud) > (v1, . . . , vd) iff (u1, . . . , ud) (v1, . . . , vd) ∧ u1 >N v1, interpretations represented as: [f(x1, . . . , xn)] = M1x1 + . . . + Mnxn + v where Mi ∈ Nd×d, v ∈ Nd, >T and T are decidable in this case but thanks to introducing ≫ we do not need to prove completeness of their characterization. Domain fixed to N with natural orders > and ≥.

A.Koprowski, H.Zantema (TU/e) Certification of proving termination ... SOFSEM’08 21 / 24

slide-65
SLIDE 65

Matrix interpretations in the setting of monotone algebras

fix a dimension d, A = Nd, (u1, . . . , ud) (v1, . . . , vd) iff ∀i, ui ≥N vi, (u1, . . . , ud) > (v1, . . . , vd) iff (u1, . . . , ud) (v1, . . . , vd) ∧ u1 >N v1, interpretations represented as: [f(x1, . . . , xn)] = M1x1 + . . . + Mnxn + v where Mi ∈ Nd×d, v ∈ Nd, >T and T are decidable in this case but thanks to introducing ≫ we do not need to prove completeness of their characterization. Domain fixed to N with natural orders > and ≥.

A.Koprowski, H.Zantema (TU/e) Certification of proving termination ... SOFSEM’08 21 / 24

slide-66
SLIDE 66

Matrix interpretations in the setting of monotone algebras

fix a dimension d, A = Nd, (u1, . . . , ud) (v1, . . . , vd) iff ∀i, ui ≥N vi, (u1, . . . , ud) > (v1, . . . , vd) iff (u1, . . . , ud) (v1, . . . , vd) ∧ u1 >N v1, interpretations represented as: [f(x1, . . . , xn)] = M1x1 + . . . + Mnxn + v where Mi ∈ Nd×d, v ∈ Nd, >T and T are decidable in this case but thanks to introducing ≫ we do not need to prove completeness of their characterization. Domain fixed to N with natural orders > and ≥.

A.Koprowski, H.Zantema (TU/e) Certification of proving termination ... SOFSEM’08 21 / 24

slide-67
SLIDE 67

Matrix interpretations in the setting of monotone algebras

fix a dimension d, A = Nd, (u1, . . . , ud) (v1, . . . , vd) iff ∀i, ui ≥N vi, (u1, . . . , ud) > (v1, . . . , vd) iff (u1, . . . , ud) (v1, . . . , vd) ∧ u1 >N v1, interpretations represented as: [f(x1, . . . , xn)] = M1x1 + . . . + Mnxn + v where Mi ∈ Nd×d, v ∈ Nd, >T and T are decidable in this case but thanks to introducing ≫ we do not need to prove completeness of their characterization. Domain fixed to N with natural orders > and ≥.

A.Koprowski, H.Zantema (TU/e) Certification of proving termination ... SOFSEM’08 21 / 24

slide-68
SLIDE 68

Matrix interpretations in the setting of monotone algebras

fix a dimension d, A = Nd, (u1, . . . , ud) (v1, . . . , vd) iff ∀i, ui ≥N vi, (u1, . . . , ud) > (v1, . . . , vd) iff (u1, . . . , ud) (v1, . . . , vd) ∧ u1 >N v1, interpretations represented as: [f(x1, . . . , xn)] = M1x1 + . . . + Mnxn + v where Mi ∈ Nd×d, v ∈ Nd, >T and T are decidable in this case but thanks to introducing ≫ we do not need to prove completeness of their characterization. Domain fixed to N with natural orders > and ≥.

A.Koprowski, H.Zantema (TU/e) Certification of proving termination ... SOFSEM’08 21 / 24

slide-69
SLIDE 69

Matrix interpretations in the setting of monotone algebras

fix a dimension d, A = Nd, (u1, . . . , ud) (v1, . . . , vd) iff ∀i, ui ≥N vi, (u1, . . . , ud) > (v1, . . . , vd) iff (u1, . . . , ud) (v1, . . . , vd) ∧ u1 >N v1, interpretations represented as: [f(x1, . . . , xn)] = M1x1 + . . . + Mnxn + v where Mi ∈ Nd×d, v ∈ Nd, >T and T are decidable in this case but thanks to introducing ≫ we do not need to prove completeness of their characterization. Domain fixed to N with natural orders > and ≥.

A.Koprowski, H.Zantema (TU/e) Certification of proving termination ... SOFSEM’08 21 / 24

slide-70
SLIDE 70

Matrix interpretations in the setting of monotone algebras

fix a dimension d, A = Nd, (u1, . . . , ud) (v1, . . . , vd) iff ∀i, ui ≥N vi, (u1, . . . , ud) > (v1, . . . , vd) iff (u1, . . . , ud) (v1, . . . , vd) ∧ u1 >N v1, interpretations represented as: [f(x1, . . . , xn)] = M1x1 + . . . + Mnxn + v where Mi ∈ Nd×d, v ∈ Nd, >T and T are decidable in this case but thanks to introducing ≫ we do not need to prove completeness of their characterization. Domain fixed to N with natural orders > and ≥.

A.Koprowski, H.Zantema (TU/e) Certification of proving termination ... SOFSEM’08 21 / 24

slide-71
SLIDE 71

Conclusions & Future Work

We presented: formalization of the matrix interpretations method, that allowed TPA+ CoLoR to win the certified competition in 2007. Future work: extension to arctic matrices (max/plus semi-ring over N ∪ {−∞}). Formalization of further termination techniques. Collaboration with termination tools’ authors to extend applicability

  • f CoLoR.

A.Koprowski, H.Zantema (TU/e) Certification of proving termination ... SOFSEM’08 22 / 24

slide-72
SLIDE 72

Conclusions & Future Work

We presented: formalization of the matrix interpretations method, that allowed TPA+ CoLoR to win the certified competition in 2007. Future work: extension to arctic matrices (max/plus semi-ring over N ∪ {−∞}). Formalization of further termination techniques. Collaboration with termination tools’ authors to extend applicability

  • f CoLoR.

A.Koprowski, H.Zantema (TU/e) Certification of proving termination ... SOFSEM’08 22 / 24

slide-73
SLIDE 73

Conclusions & Future Work

We presented: formalization of the matrix interpretations method, that allowed TPA+ CoLoR to win the certified competition in 2007. Future work: extension to arctic matrices (max/plus semi-ring over N ∪ {−∞}). Formalization of further termination techniques. Collaboration with termination tools’ authors to extend applicability

  • f CoLoR.

A.Koprowski, H.Zantema (TU/e) Certification of proving termination ... SOFSEM’08 22 / 24

slide-74
SLIDE 74

Conclusions & Future Work

We presented: formalization of the matrix interpretations method, that allowed TPA+ CoLoR to win the certified competition in 2007. Future work: extension to arctic matrices (max/plus semi-ring over N ∪ {−∞}). Formalization of further termination techniques. Collaboration with termination tools’ authors to extend applicability

  • f CoLoR.

A.Koprowski, H.Zantema (TU/e) Certification of proving termination ... SOFSEM’08 22 / 24

slide-75
SLIDE 75

Conclusions & Future Work

We presented: formalization of the matrix interpretations method, that allowed TPA+ CoLoR to win the certified competition in 2007. Future work: extension to arctic matrices (max/plus semi-ring over N ∪ {−∞}). Formalization of further termination techniques. Collaboration with termination tools’ authors to extend applicability

  • f CoLoR.

A.Koprowski, H.Zantema (TU/e) Certification of proving termination ... SOFSEM’08 22 / 24

slide-76
SLIDE 76

The end

http://color.loria.fr Thank you for your attention.

A.Koprowski, H.Zantema (TU/e) Certification of proving termination ... SOFSEM’08 23 / 24

slide-77
SLIDE 77

Homework

If you are bored in the evening (or like puzzles) are the following systems terminating:

Example

aa → bc bb → ac cc → ab

Example

aab → babaa bb →

A.Koprowski, H.Zantema (TU/e) Certification of proving termination ... SOFSEM’08 24 / 24

slide-78
SLIDE 78

Homework

If you are bored in the evening (or like puzzles) are the following systems terminating:

Example

aa → bc bb → ac cc → ab

Example

aab → babaa bb →

A.Koprowski, H.Zantema (TU/e) Certification of proving termination ... SOFSEM’08 24 / 24