1
Correctness of Program Transformations as a Termination Problem
Conrad Rau, David Sabel and Manfred Schmidt-Schauß
Goethe-University, Frankfurt am Main, Germany
Correctness of Program Transformations as a Termination Problem - - PowerPoint PPT Presentation
Correctness of Program Transformations as a Termination Problem Conrad Rau, David Sabel and Manfred Schmidt-Schau Goethe-University, Frankfurt am Main, Germany IJCAR 2012, Manchester, UK 1 Introduction & Motivation Automate correctness
Goethe-University, Frankfurt am Main, Germany
Correctness of Program Transformations as a Termination Problem
2/13
sr,l
sr,∗
Correctness of Program Transformations as a Termination Problem
3/13
T
lbeta
llet
silly
= ⇒ is convergence preserving
T
Correctness of Program Transformations as a Termination Problem
4/13
T sr, l1 sr, l′
1
sr, l2 sr, l′
2
sr, ln sr, l′
m
1 Determine all overlaps s1
sr,li
2 Construct converging reduction sequence
T
T sr, l sr, l
T sr, l sr, l T
T sr, l, + sr, l, + T
Correctness of Program Transformations as a Termination Problem
5/13
T sr, l1 sr, l′
1
sr, l2 sr, l′
2
sr, ln sr, l′
m
1 Determine all overlaps s1
sr,li
2 Construct converging reduction sequence
T
T sr, l sr, l
T sr, l sr, l T
T sr, l, + sr, l, + T
Correctness of Program Transformations as a Termination Problem
5/13
T sr, l1 sr, l2 sr, ln sr, l1 sr, l′
2
sr, l′
m
1 Determine all overlaps s1
sr,li
2 Construct converging reduction sequence
T
T sr, l sr, l
T sr, l sr, l T
T sr, l, + sr, l, + T
Correctness of Program Transformations as a Termination Problem
5/13
T sr, l1 sr, l2 sr, ln T sr, l1
1 Determine all overlaps s1
sr,li
2 Construct converging reduction sequence
T
T sr, l sr, l
T sr, l sr, l T
T sr, l, + sr, l, + T
Correctness of Program Transformations as a Termination Problem
5/13
T sr, l1 sr, l1 sr, lk T sr, l1 sr, l1
1 Determine all overlaps s1
sr,li
2 Construct converging reduction sequence
T
T sr, l sr, l
T sr, l sr, l T
T sr, l, + sr, l, + T
Correctness of Program Transformations as a Termination Problem
5/13
T sr, l1 sr, l1 sr, lk T sr, l1 sr, l1
1 Determine all overlaps s1
sr,li
2 Construct converging reduction sequence
T
T sr, l sr, l
T sr, l sr, l T
T sr, l, + sr, l, + T
Correctness of Program Transformations as a Termination Problem
5/13
T
T sr, l1 sr, l2 sr, ln−1 sr, ln
T sr, l1 sr, l2 sr, ln−1 sr, ln
T sr, l1 sr, lk, + T1,+ Tm sr,x sr, l′
n
sr, lk,+ sr, l1 T T1,+ Tm sr, l′
n
sr,x
T T1 Tm sr, ln sr, l1
Correctness of Program Transformations as a Termination Problem
6/13
Forking/Answer Diagrams
Correctness of Program Transformations as a Termination Problem
7/13
Rewrite Systems on simple ARS (SRSARS) simple Abstract Reduction Sequences (cARS)
Forking/Answer Diagrams
translated into (by J )
D
Ti,+
− − → to
Ti
− → . . .
Ti
− →
sr,l,+
← − − − to
sr,l
← − − . . .
sr,l
← − −
Correctness of Program Transformations as a Termination Problem
7/13
Rewrite Systems on RS (CRSRS) Concrete Reduction Sequences (cRS) Rewrite Systems on simple ARS (SRSARS) simple Abstract Reduction Sequences (cARS)
Forking/Answer Diagrams
interpreted as (by I) translated into (by J )
D
sr,l
sr,l
sr,l
Ti
Ti
Ti
Correctness of Program Transformations as a Termination Problem
7/13
Rewrite Systems on RS (CRSRS) Concrete Reduction Sequences (cRS) Rewrite Systems on simple ARS (SRSARS) simple Abstract Reduction Sequences (cARS)
Forking/Answer Diagrams
interpreted as (by I) translated into (by J )
Correctness of Program Transformations as a Termination Problem
7/13
T sr, l1 sr, l2 sr, ln−1 sr, ln
T
Correctness of Program Transformations as a Termination Problem
8/13
Rewrite Systems on RS (CRSRS) Concrete Reduction Sequences (cRS) Rewrite Systems on simple ARS (SRSARS) simple Abstract Reduction Sequences (cARS)
Forking/Answer Diagrams
interpreted as (by I) translated into (by J )
Correctness of Program Transformations as a Termination Problem
9/13
Rewrite Systems on RS (CRSRS) Concrete Reduction Sequences (cRS) Rewrite Systems on simple ARS (SRSARS) simple Abstract Reduction Sequences (cARS)
Forking/Answer Diagrams
interpreted as (by I) translated into (by J )
T
T
T
I(J (D))
T
Correctness of Program Transformations as a Termination Problem
9/13
Rewrite Systems on RS (CRSRS) Concrete Reduction Sequences (cRS) Rewrite Systems on simple ARS (SRSARS) simple Abstract Reduction Sequences (cARS)
Forking/Answer Diagrams
interpreted as (by I) translated into (by J ) termination (by P. 2)
T
T
T
I(J (D))
T
J (D)
I(J (D))
Correctness of Program Transformations as a Termination Problem
9/13
Rewrite Systems on RS (CRSRS) Concrete Reduction Sequences (cRS) Rewrite Systems on simple ARS (SRSARS) simple Abstract Reduction Sequences (cARS)
Forking/Answer Diagrams
interpreted as (by I) translated into (by J ) termination (by P. 2)
T
T
T
J (D)
T
Correctness of Program Transformations as a Termination Problem
9/13
Rewrite Systems on RS (CRSRS) Concrete Reduction Sequences (cRS) Rewrite Systems on simple ARS (SRSARS) simple Abstract Reduction Sequences (cARS)
Forking/Answer Diagrams
interpreted as (by I) translated into infinite (by J ) termination (by P. 2)
Ti,+
− − → to
Ti
− → . . .
Ti
− →
sr,l,+
← − − − to
sr,l
← − − . . .
sr,l
← − −
Correctness of Program Transformations as a Termination Problem
9/13
Rewrite Systems on RS (CRSRS) Concrete Reduction Sequences (cRS) Rewrite Systems on simple ARS (SRSARS) simple Abstract Reduction Sequences (cARS)
Forking/Answer Diagrams
Rewrite Systems on NARS (ERSARS) ground ARS with Natural Numbers (gcNARS) interpreted as (by I) translated into infinite (by J ) translated into finite (by K) termination (by P. 2)
Correctness of Program Transformations as a Termination Problem
9/13
llet sr,lll,+ sr,lll,+
packlll
llet
sr, lll
packlll packlll
sr, lll
sr, lll
sr, lll
C packlll
sr, lll sr, lll llet llet sr, lll
Correctness of Program Transformations as a Termination Problem
10/13
llet sr,lll,+ sr,lll,+
packlll
llet
sr, lll
packlll packlll
sr, lll
sr, lll
sr, lll
C packlll
sr, lll sr, lll llet llet sr, lll
Correctness of Program Transformations as a Termination Problem
10/13
llet sr,lll,+ sr,lll,+
packlll
llet
packlll
llet
sr, lll
packlll packlll
sr, lll
sr, lll
sr, lll
unpacklll(1)
sr, lll
sr, lll
C packlll
. . .
sr, lll sr, lll llet llet sr, lll sr, lll
Correctness of Program Transformations as a Termination Problem
10/13
Rewrite Systems on RS (CRSRS) Concrete Reduction Sequences (cRS) Rewrite Systems on simple ARS (SRSARS) simple Abstract Reduction Sequences (cARS)
Forking/Answer Diagrams
Rewrite Systems on NARS (ERSARS) ground ARS with Natural Numbers (gcNARS) interpreted as (by I) translated into infinite (by J ) translated into finite (by K) termination (by P. 2)
Correctness of Program Transformations as a Termination Problem
11/13
Rewrite Systems on RS (CRSRS) Concrete Reduction Sequences (cRS) Rewrite Systems on simple ARS (SRSARS) simple Abstract Reduction Sequences (cARS)
Forking/Answer Diagrams
Rewrite Systems on NARS (ERSARS) ground ARS with Natural Numbers (gcNARS) interpreted as (by I) translated into infinite (by J ) translated into finite (by K) termination (by P. 2) termination by P. 3
T
T
T
K(D)
J (D)
Correctness of Program Transformations as a Termination Problem
11/13
Rewrite Systems on RS (CRSRS) Concrete Reduction Sequences (cRS) Rewrite Systems on simple ARS (SRSARS) simple Abstract Reduction Sequences (cARS)
Forking/Answer Diagrams
Rewrite Systems on NARS (ERSARS) ground ARS with Natural Numbers (gcNARS) interpreted as (by I) translated into infinite (by J ) translated into finite (by K) termination (by P. 2) termination by P. 3
T
T
T
K(D)
T
Correctness of Program Transformations as a Termination Problem
11/13
Rewrite Systems on RS (CRSRS) Concrete Reduction Sequences (cRS) Rewrite Systems on simple ARS (SRSARS) simple Abstract Reduction Sequences (cARS)
Forking/Answer Diagrams
Rewrite Systems on NARS (ERSARS) ground ARS with Natural Numbers (gcNARS) Integer Term Rewrite Systems (ITRS)
Fuhs, Giesl, Pl¨ ucker, Schneider-Kamp, Falke, 2009
Termination Prover (AProVE) interpreted as (by I) translated into infinite (by J ) translated into finite (by K) translated into finite Input termination (by P. 2) termination by P. 3
Correctness of Program Transformations as a Termination Problem
11/13
Rewrite Systems on RS (CRSRS) Concrete Reduction Sequences (cRS) Rewrite Systems on simple ARS (SRSARS) simple Abstract Reduction Sequences (cARS)
Forking/Answer Diagrams
Rewrite Systems on NARS (ERSARS) ground ARS with Natural Numbers (gcNARS) Integer Term Rewrite Systems (ITRS) Termination Prover (AProVE) interpreted as (by I) translated into infinite (by J ) translated into finite (by K) translated into finite Input termination (by P. 2) termination by P. 3 termination
Correctness of Program Transformations as a Termination Problem
11/13
Rewrite Systems on RS (CRSRS) Concrete Reduction Sequences (cRS) Rewrite Systems on simple ARS (SRSARS) simple Abstract Reduction Sequences (cARS)
Forking/Answer Diagrams
Rewrite Systems on NARS (ERSARS) ground ARS with Natural Numbers (gcNARS) Integer Term Rewrite Systems (ITRS) Termination Prover (AProVE) interpreted as (by I) translated into infinite (by J ) translated into finite (by K) translated into finite Input leftmost termination leftmost termination innermost termination
Correctness of Program Transformations as a Termination Problem
11/13
Rewrite Systems on RS (CRSRS) Concrete Reduction Sequences (cRS) Rewrite Systems on simple ARS (SRSARS) simple Abstract Reduction Sequences (cARS)
Forking/Answer Diagrams
Rewrite Systems on NARS (ERSARS) ground ARS with Natural Numbers (gcNARS) Integer Term Rewrite Systems (ITRS) Termination Prover (AProVE) interpreted as (by I) translated into infinite (by J ) translated into finite (by K) translated into finite Input leftmost termination leftmost termination innermost termination
Correctness of Program Transformations as a Termination Problem
11/13
llet sr,x sr,x
llet(srlll(Y)) → srlll(Y) llet(srllet(Y)) → srllet(Y) llet(srtau(Y)) → srtau(Y)
llet sr,x sr,llet sr,x
llet(srlll(srllet(Y))) → srlll(Y) llet(srllet(srllet(Y))) → srllet(Y) llet(srtau(srllet(Y))) → srtau(Y)
llet sr,lll,+ sr,lll,+
llet(plll(Y)) → uplll(K-1,x) if K > 1 llet(srlll(Y)) → llet(plll(Y)) llet(plll(srlll(Y))) → llet(plll(Y)) uplll(K,x) → srlll(uplll(K-1,x)) if K > 1 uplll(1,x) → srlll(Y)
llet sr,x sr,x llet
llet(srlll(Y)) → srlll(llet(Y)) llet(srllet(Y)) → srllet(llet(Y)) llet(srtau(Y)) → srtau(llet(Y))
llet sr,lll,+ sr,lll,+ llet
llet(plll(Y)) → uplll(K-1,x) if K> 1 llet(srlll(Y)) → llet(plll(Y)) llet(plll(srlll(Y))) → llet(plll(Y)) uplll(K,x) → srlll(uplll(K-1,x)) if K> 1 uplll(1,x) → srlll(llet(Y))
T
llet(A) → A
llet
llet
llet
llet
llet
Correctness of Program Transformations as a Termination Problem
12/13
Correctness of Program Transformations as a Termination Problem
13/13