Example (Division) ο£± minus ( x, 0 ) β x   minus ( s ( x ) , s ( y )) β minus ( x, y ) ο£² R = quot ( 0 , s ( y )) β 0   quot ( s ( x ) , s ( y )) β s ( quot ( minus ( x, y ) , s ( y ))) ο£³ minus β― ( s ( x ) , s ( y )) minus β― ( x, y ) ο£± β ο£² minus β― ( x, y ) quot β― ( s ( x ) , s ( y )) DP = β quot β― ( s ( x ) , s ( y )) quot β― ( minus ( x, y ) , s ( y )) β ο£³ Dependency Pairs [Arts, Giesl, TCS β00 ] For TRS R build dependency pairs DP ( βΌ function calls) Show: No β call sequence with DP (eval of DP βs args via R ) Dependency Pair Framework [Giesl et al, JAR β06 ] (simplified): while DP οΏ½ = β : 10/25
Example (Division) ο£± minus ( x, 0 ) οΏ½ x   minus ( s ( x ) , s ( y )) οΏ½ minus ( x, y ) ο£² R = quot ( 0 , s ( y )) οΏ½ 0   quot ( s ( x ) , s ( y )) οΏ½ s ( quot ( minus ( x, y ) , s ( y ))) ο£³ minus β― ( s ( x ) , s ( y )) minus β― ( x, y ) ο£± οΏ½ ο£² minus β― ( x, y ) quot β― ( s ( x ) , s ( y )) DP = οΏ½ quot β― ( s ( x ) , s ( y )) quot β― ( minus ( x, y ) , s ( y )) οΏ½ ο£³ Dependency Pairs [Arts, Giesl, TCS β00 ] For TRS R build dependency pairs DP ( βΌ function calls) Show: No β call sequence with DP (eval of DP βs args via R ) Dependency Pair Framework [Giesl et al, JAR β06 ] (simplified): while DP οΏ½ = β : find well-founded order β» with DP βͺ R β οΏ½ 10/25
Example (Division) ο£± minus ( x, 0 ) οΏ½ x   minus ( s ( x ) , s ( y )) οΏ½ minus ( x, y ) ο£² R = quot ( 0 , s ( y )) οΏ½ 0   quot ( s ( x ) , s ( y )) οΏ½ s ( quot ( minus ( x, y ) , s ( y ))) ο£³ ο£± minus β― ( s ( x ) , s ( y )) minus β― ( x, y ) ( οΏ½ )  ο£² quot β― ( s ( x ) , s ( y )) minus β― ( x, y ) DP = ( οΏ½ ) quot β― ( s ( x ) , s ( y )) quot β― ( minus ( x, y ) , s ( y )) ( οΏ½ )  ο£³ Dependency Pairs [Arts, Giesl, TCS β00 ] For TRS R build dependency pairs DP ( βΌ function calls) Show: No β call sequence with DP (eval of DP βs args via R ) Dependency Pair Framework [Giesl et al, JAR β06 ] (simplified): while DP οΏ½ = β : find well-founded order β» with DP βͺ R β οΏ½ delete s β t with s β» t from DP 10/25
Example (Division) ο£± minus ( x, 0 ) οΏ½ x   minus ( s ( x ) , s ( y )) οΏ½ minus ( x, y ) ο£² R = quot ( 0 , s ( y )) οΏ½ 0   quot ( s ( x ) , s ( y )) οΏ½ s ( quot ( minus ( x, y ) , s ( y ))) ο£³ ο£± minus β― ( s ( x ) , s ( y )) minus β― ( x, y ) ( οΏ½ )  ο£² quot β― ( s ( x ) , s ( y )) minus β― ( x, y ) DP = ( οΏ½ ) quot β― ( s ( x ) , s ( y )) quot β― ( minus ( x, y ) , s ( y )) ( οΏ½ )  ο£³ Dependency Pairs [Arts, Giesl, TCS β00 ] For TRS R build dependency pairs DP ( βΌ function calls) Show: No β call sequence with DP (eval of DP βs args via R ) Dependency Pair Framework [Giesl et al, JAR β06 ] (simplified): while DP οΏ½ = β : find well-founded order β» with DP βͺ R β οΏ½ delete s β t with s β» t from DP Find β» automatically and efficiently 10/25
Polynomial interpretations Get β» via polynomial interpretations [ Β· ] over N [Lankford β79] β ranking functions for rewriting Example minus ( s ( x ) , s ( y )) οΏ½ minus ( x, y ) 11/25
Polynomial interpretations Get β» via polynomial interpretations [ Β· ] over N [Lankford β79] β ranking functions for rewriting Example minus ( s ( x ) , s ( y )) οΏ½ minus ( x, y ) Use [ Β· ] with [ minus ] ( x 1 , x 2 ) = x 1 [ s ] ( x 1 ) = x 1 + 1 11/25
Polynomial interpretations Get β» via polynomial interpretations [ Β· ] over N [Lankford β79] β ranking functions for rewriting Example β x, y. x + 1 = [ minus ( s ( x ) , s ( y )) ] β₯ [ minus ( x, y ) ] = x Use [ Β· ] with [ minus ] ( x 1 , x 2 ) = x 1 [ s ] ( x 1 ) = x 1 + 1 Extend to terms: [ x ] = x [ f ( t 1 , . . . , t n ) ] = [ f ] ( [ t 1 ] , . . . , [ t n ] ) β» boils down to > over N 11/25
Example (Constraints for Division)  minus ( x, 0 ) � x   minus ( s ( x ) , s ( y )) minus ( x, y ) �  R = quot ( 0 , s ( y )) � 0   quot ( s ( x ) , s ( y )) � s ( quot ( minus ( x, y ) , s ( y )))   minus ⯠( s ( x ) , s ( y )) minus ⯠( x, y ) ( � )   quot ⯠( s ( x ) , s ( y )) minus ⯠( x, y ) DP = ( � ) quot ⯠( s ( x ) , s ( y )) quot ⯠( minus ( x, y ) , s ( y )) ( � )   12/25
Example (Constraints for Division)  minus ( x, 0 ) � x   minus ( s ( x ) , s ( y )) � minus ( x, y )  R = quot ( 0 , s ( y )) � 0   quot ( s ( x ) , s ( y )) � s ( quot ( minus ( x, y ) , s ( y )))  minus ⯠( s ( x ) , s ( y )) minus ⯠( x, y )  ⻠ quot ⯠( s ( x ) , s ( y )) minus ⯠( x, y ) DP = ⻠quot ⯠( s ( x ) , s ( y )) quot ⯠( minus ( x, y ) , s ( y )) ⻠ Use interpretation [ · ] over N with [ quot ⯠] ( x 1 , x 2 ) = x 1 + x 2 . [ quot ] ( x 1 , x 2 ) = x 1 + x 2 [ minus ⯠] ( x 1 , x 2 ) = x 1 [ minus ] ( x 1 , x 2 ) = x 1 [ 0 ] = 0 [ s ] ( x 1 ) = x 1 + 1 � order solves all constraints 12/25
Example (Constraints for Division) ο£± minus ( x, 0 ) οΏ½ x   minus ( s ( x ) , s ( y )) οΏ½ minus ( x, y ) ο£² R = quot ( 0 , s ( y )) οΏ½ 0   quot ( s ( x ) , s ( y )) οΏ½ s ( quot ( minus ( x, y ) , s ( y ))) ο£³ ο£± ο£² DP = ο£³ Use interpretation [ Β· ] over N with [ quot β― ] ( x 1 , x 2 ) = x 1 + x 2 . [ quot ] ( x 1 , x 2 ) = x 1 + x 2 [ minus β― ] ( x 1 , x 2 ) = x 1 [ minus ] ( x 1 , x 2 ) = x 1 [ 0 ] = 0 [ s ] ( x 1 ) = x 1 + 1 οΏ½ order solves all constraints οΏ½ DP = β οΏ½ termination of division algorithm proved οΏ½ 12/25
Automation Task: Solve minus ( s ( x ) , s ( y )) οΏ½ minus ( x, y ) 13/25
Automation Task: Solve minus ( s ( x ) , s ( y )) οΏ½ minus ( x, y ) 1 Fix a degree, use pol. interpretation with parametric coefficients: [ minus ] ( x, y ) = a m + b m x + c m y, [ s ] ( x ) = a s + b s x 13/25
Automation Task: Solve minus ( s ( x ) , s ( y )) οΏ½ minus ( x, y ) 1 Fix a degree, use pol. interpretation with parametric coefficients: [ minus ] ( x, y ) = a m + b m x + c m y, [ s ] ( x ) = a s + b s x 2 From term constraint to polynomial constraint: s οΏ½ t οΏ½ [ s ] β₯ [ t ] Here: β x, y. ( a s b m + a s c m ) + ( b s b m β b m ) x + ( b s c m β c m ) y β₯ 0 13/25
Automation Task: Solve minus ( s ( x ) , s ( y )) οΏ½ minus ( x, y ) 1 Fix a degree, use pol. interpretation with parametric coefficients: [ minus ] ( x, y ) = a m + b m x + c m y, [ s ] ( x ) = a s + b s x 2 From term constraint to polynomial constraint: s οΏ½ t οΏ½ [ s ] β₯ [ t ] Here: β x, y. ( a s b m + a s c m ) + ( b s b m β b m ) x + ( b s c m β c m ) y β₯ 0 3 Eliminate β x, y by absolute positiveness criterion [Hong, JakuΕ‘, JAR β98 ] : a s b m + a s c m β₯ 0 β§ b s b m β b m β₯ 0 β§ b s c m β c m β₯ 0 Here: 13/25
Automation Task: Solve minus ( s ( x ) , s ( y )) οΏ½ minus ( x, y ) 1 Fix a degree, use pol. interpretation with parametric coefficients: [ minus ] ( x, y ) = a m + b m x + c m y, [ s ] ( x ) = a s + b s x 2 From term constraint to polynomial constraint: s οΏ½ t οΏ½ [ s ] β₯ [ t ] Here: β x, y. ( a s b m + a s c m ) + ( b s b m β b m ) x + ( b s c m β c m ) y β₯ 0 3 Eliminate β x, y by absolute positiveness criterion [Hong, JakuΕ‘, JAR β98 ] : a s b m + a s c m β₯ 0 β§ b s b m β b m β₯ 0 β§ b s c m β c m β₯ 0 Here: 13/25
Automation Task: Solve minus ( s ( x ) , s ( y )) οΏ½ minus ( x, y ) 1 Fix a degree, use pol. interpretation with parametric coefficients: [ minus ] ( x, y ) = a m + b m x + c m y, [ s ] ( x ) = a s + b s x 2 From term constraint to polynomial constraint: s οΏ½ t οΏ½ [ s ] β₯ [ t ] Here: β x, y. ( a s b m + a s c m ) + ( b s b m β b m ) x + ( b s c m β c m ) y β₯ 0 3 Eliminate β x, y by absolute positiveness criterion [Hong, JakuΕ‘, JAR β98 ] : a s b m + a s c m β₯ 0 β§ b s b m β b m β₯ 0 β§ b s c m β c m β₯ 0 Here: 13/25
Automation Task: Solve minus ( s ( x ) , s ( y )) οΏ½ minus ( x, y ) 1 Fix a degree, use pol. interpretation with parametric coefficients: [ minus ] ( x, y ) = a m + b m x + c m y, [ s ] ( x ) = a s + b s x 2 From term constraint to polynomial constraint: s οΏ½ t οΏ½ [ s ] β₯ [ t ] Here: β x, y. ( a s b m + a s c m ) + ( b s b m β b m ) x + ( b s c m β c m ) y β₯ 0 3 Eliminate β x, y by absolute positiveness criterion [Hong, JakuΕ‘, JAR β98 ] : a s b m + a s c m β₯ 0 β§ b s b m β b m β₯ 0 β§ b s c m β c m β₯ 0 Here: Non-linear constraints (QF_NIA), even for linear interpretations 13/25
Automation Task: Solve minus ( s ( x ) , s ( y )) οΏ½ minus ( x, y ) 1 Fix a degree, use pol. interpretation with parametric coefficients: [ minus ] ( x, y ) = a m + b m x + c m y, [ s ] ( x ) = a s + b s x 2 From term constraint to polynomial constraint: s οΏ½ t οΏ½ [ s ] β₯ [ t ] Here: β x, y. ( a s b m + a s c m ) + ( b s b m β b m ) x + ( b s c m β c m ) y β₯ 0 3 Eliminate β x, y by absolute positiveness criterion [Hong, JakuΕ‘, JAR β98 ] : a s b m + a s c m β₯ 0 β§ b s b m β b m β₯ 0 β§ b s c m β c m β₯ 0 Here: Non-linear constraints (QF_NIA), even for linear interpretations Task: Show satisfiability of non-linear constraints over N οΏ½ Prove termination of given term rewrite system 13/25
Extensions Polynomials with negative coefficients and max-operator [Hirokawa, Middeldorp, IC β07 ; Fuhs et al, SAT β07, RTA β08 ] models behavior of functions more closely automation via SMT for QF_NIA, more complex Boolean structure 14/25
Extensions Polynomials with negative coefficients and max-operator [Hirokawa, Middeldorp, IC β07 ; Fuhs et al, SAT β07, RTA β08 ] models behavior of functions more closely automation via SMT for QF_NIA, more complex Boolean structure Polynomials over Q + and R + [Lucas, RAIRO β05 ] non-integer coefficients increase proving power SMT-based automation [Fuhs et al, AISC β08 ; Zankl, Middeldorp, LPAR β10 ; Borralleras et al, JAR β12 ] 14/25
Extensions Polynomials with negative coefficients and max-operator [Hirokawa, Middeldorp, IC β07 ; Fuhs et al, SAT β07, RTA β08 ] models behavior of functions more closely automation via SMT for QF_NIA, more complex Boolean structure Polynomials over Q + and R + [Lucas, RAIRO β05 ] non-integer coefficients increase proving power SMT-based automation [Fuhs et al, AISC β08 ; Zankl, Middeldorp, LPAR β10 ; Borralleras et al, JAR β12 ] Matrix interpretations [Endrullis, Waldmann, Zantema, JAR β08 ] interpretation to vectors over N k , coefficients are matrices useful for deeply nested terms QF_NIA instances with more complex atoms 14/25
Extensions Polynomials with negative coefficients and max-operator [Hirokawa, Middeldorp, IC β07 ; Fuhs et al, SAT β07, RTA β08 ] models behavior of functions more closely automation via SMT for QF_NIA, more complex Boolean structure Polynomials over Q + and R + [Lucas, RAIRO β05 ] non-integer coefficients increase proving power SMT-based automation [Fuhs et al, AISC β08 ; Zankl, Middeldorp, LPAR β10 ; Borralleras et al, JAR β12 ] Matrix interpretations [Endrullis, Waldmann, Zantema, JAR β08 ] interpretation to vectors over N k , coefficients are matrices useful for deeply nested terms QF_NIA instances with more complex atoms βArcticβ matrices on the max-plus semiring on N or Z (instead of plus-times) [Koprowski, Waldmann, Acta Cyb. β09 ] very useful for deeply nested terms can be encoded to QF_ L IA, but (unary!) bit-blasting seems to be faster in practice [Codish, Fekete, Fuhs, Giesl, Waldmann, SMT β12 ] 14/25
Extensions Polynomials with negative coefficients and max-operator [Hirokawa, Middeldorp, IC β07 ; Fuhs et al, SAT β07, RTA β08 ] models behavior of functions more closely automation via SMT for QF_NIA, more complex Boolean structure Polynomials over Q + and R + [Lucas, RAIRO β05 ] non-integer coefficients increase proving power SMT-based automation [Fuhs et al, AISC β08 ; Zankl, Middeldorp, LPAR β10 ; Borralleras et al, JAR β12 ] Matrix interpretations [Endrullis, Waldmann, Zantema, JAR β08 ] interpretation to vectors over N k , coefficients are matrices useful for deeply nested terms QF_NIA instances with more complex atoms βArcticβ matrices on the max-plus semiring on N or Z (instead of plus-times) [Koprowski, Waldmann, Acta Cyb. β09 ] very useful for deeply nested terms can be encoded to QF_ L IA, but (unary!) bit-blasting seems to be faster in practice [Codish, Fekete, Fuhs, Giesl, Waldmann, SMT β12 ] 14/25
Example (bits) ο£± half ( 0 ) β 0 bits ( 0 ) β 0 ο£² R = half ( s ( 0 )) β 0 bits ( s ( x )) β s ( bits ( half ( s ( x )))) half ( s ( s ( x ))) β s ( half ( x )) ο£³ 15/25
Example (bits) ο£± half ( 0 ) β 0 bits ( 0 ) β 0 ο£² R = half ( s ( 0 )) β 0 bits ( s ( x )) β s ( bits ( half ( s ( x )))) half ( s ( s ( x ))) β s ( half ( x )) ο£³ half β― ( s ( s ( x ))) half β― ( x ) ο£± β ο£² bits β― ( s ( x )) half β― ( s ( x )) DP = β bits β― ( s ( x )) bits β― ( half ( s ( x ))) β ο£³ 15/25
Example (bits)  half ( 0 ) � 0 bits ( 0 ) � 0  R = half ( s ( 0 )) � 0 bits ( s ( x )) � s ( bits ( half ( s ( x )))) half ( s ( s ( x ))) � s ( half ( x ))   half ⯠( s ( s ( x ))) half ⯠( x ) ( � )   bits ⯠( s ( x )) half ⯠( s ( x )) DP = ( � ) bits ⯠( s ( x )) bits ⯠( half ( s ( x ))) ( � )   15/25
Example (bits) ο£± half ( 0 ) οΏ½ 0 bits ( 0 ) οΏ½ 0 ο£² R = half ( s ( 0 )) οΏ½ 0 bits ( s ( x )) οΏ½ s ( bits ( half ( s ( x )))) half ( s ( s ( x ))) οΏ½ s ( half ( x )) ο£³ ο£± ο£² DP = bits β― ( s ( x )) bits β― ( half ( s ( x ))) β» ο£³ 15/25
Example (bits) ο£± half ( 0 ) οΏ½ 0 bits ( 0 ) οΏ½ 0 ο£² R = half ( s ( 0 )) οΏ½ 0 bits ( s ( x )) οΏ½ s ( bits ( half ( s ( x )))) half ( s ( s ( x ))) οΏ½ s ( half ( x )) ο£³ ο£± ο£² DP = bits β― ( s ( x )) bits β― ( half ( s ( x ))) β» ο£³ Classic polynomials cannot solve bits β― ( s ( x )) β» bits β― ( half ( s ( x ))) 15/25
Example (bits) ο£± half ( 0 ) οΏ½ 0 bits ( 0 ) οΏ½ 0 ο£² R = half ( s ( 0 )) οΏ½ 0 bits ( s ( x )) οΏ½ s ( bits ( half ( s ( x )))) half ( s ( s ( x ))) οΏ½ s ( half ( x )) ο£³ ο£± ο£² DP = bits β― ( s ( x )) bits β― ( half ( s ( x ))) β» ο£³ Classic polynomials cannot solve bits β― ( s ( x )) β» bits β― ( half ( s ( x ))) [ bits β― ] ( x ) = x, [ half ] ( x ) = x β 1 Remedy: [ s ] ( x ) = x + 1 , 15/25
Example (bits) ο£± half ( 0 ) οΏ½ 0 bits ( 0 ) οΏ½ 0 ο£² R = half ( s ( 0 )) οΏ½ 0 bits ( s ( x )) οΏ½ s ( bits ( half ( s ( x )))) half ( s ( s ( x ))) οΏ½ s ( half ( x )) ο£³ ο£± ο£² DP = bits β― ( s ( x )) bits β― ( half ( s ( x ))) β» ο£³ Classic polynomials cannot solve bits β― ( s ( x )) β» bits β― ( half ( s ( x ))) [ bits β― ] ( x ) = x, [ half ] ( x ) = x β 1 Remedy: [ s ] ( x ) = x + 1 , But: Then β» not well founded any more: 0 β» half ( 0 ) β» half ( half ( 0 )) β» . . . 15/25
Example (bits) ο£± half ( 0 ) οΏ½ 0 bits ( 0 ) οΏ½ 0 ο£² R = half ( s ( 0 )) οΏ½ 0 bits ( s ( x )) οΏ½ s ( bits ( half ( s ( x )))) half ( s ( s ( x ))) οΏ½ s ( half ( x )) ο£³ ο£± ο£² DP = bits β― ( s ( x )) bits β― ( half ( s ( x ))) β» ο£³ Classic polynomials cannot solve bits β― ( s ( x )) β» bits β― ( half ( s ( x ))) [ bits β― ] ( x ) = x, [ half ] ( x ) = x β 1 Remedy: [ s ] ( x ) = x + 1 , But: Then β» not well founded any more: 0 β» half ( 0 ) β» half ( half ( 0 )) β» . . . β Solution [Hirokawa, Middeldorp, IC β07 ] : [ half ] ( x 1 ) = max( x 1 β 1 , 0) β [ half ( s ( x )) ] = max(( x + 1) β 1 , 0) = x 15/25
Example (bits) ο£± half ( 0 ) οΏ½ 0 bits ( 0 ) οΏ½ 0 ο£² R = half ( s ( 0 )) οΏ½ 0 bits ( s ( x )) οΏ½ s ( bits ( half ( s ( x )))) half ( s ( s ( x ))) οΏ½ s ( half ( x )) ο£³ ο£± ο£² DP = ο£³ Classic polynomials cannot solve bits β― ( s ( x )) β» bits β― ( half ( s ( x ))) [ bits β― ] ( x ) = x, [ half ] ( x ) = x β 1 Remedy: [ s ] ( x ) = x + 1 , But: Then β» not well founded any more: 0 β» half ( 0 ) β» half ( half ( 0 )) β» . . . β Solution [Hirokawa, Middeldorp, IC β07 ] : [ half ] ( x 1 ) = max( x 1 β 1 , 0) β [ half ( s ( x )) ] = max(( x + 1) β 1 , 0) = x 15/25
Problem: Expressions like max( x 1 β 1 , 0) are no polynomials For [ s ] > [ t ], show 16/25
Problem: Expressions like max( x 1 β 1 , 0) are no polynomials For [ s ] > [ t ], show [ s ] left > [ t ] right [ s ] left under-approximation of [ s ] [ t ] right over-approximation of [ t ] [ s ] left , [ t ] right polynomials 16/25
Problem: Expressions like max( x 1 β 1 , 0) are no polynomials For [ s ] > [ t ], show [ s ] left > [ t ] right [ s ] left under-approximation of [ s ] [ t ] right over-approximation of [ t ] [ s ] left , [ t ] right polynomials Automation initially: Generate-and-test Approx. for max( p, 0) depend on signum of constant addend of p [ s ( x ) ] right β [ s ( x ) ] = max( x + 1 , 0) = x + 1 [ half ( x ) ] right [ half ( x ) ] = max( x β 1 , 0) β = x 16/25
Problem: Expressions like max( x 1 β 1 , 0) are no polynomials For [ s ] > [ t ], show [ s ] left > [ t ] right [ s ] left under-approximation of [ s ] [ t ] right over-approximation of [ t ] [ s ] left , [ t ] right polynomials Automation initially: Generate-and-test Approx. for max( p, 0) depend on signum of constant addend of p [ s ( x ) ] right β [ s ( x ) ] = max( x + 1 , 0) = x + 1 [ half ( x ) ] right [ half ( x ) ] = max( x β 1 , 0) β = x Solution [Fuhs et al, SAT β07 ] : Encode case analysis . . . [ f ( x ) ] right = a f x 1 + c f ( x ) [ f ( x ) ] = max( a f x 1 + b f , 0) β . . . using side constraints ( b f β₯ 0 β c f ( x ) = b f ) β§ ( b f < 0 β c f ( x ) = 0) Boolean structure in SMT quite handy! 16/25
(SAT and) SMT solving for path orders Path orders: based on precedences of function symbols Recursive Path Order [Dershowitz, TCS β82 ; Codish et al, JAR β11 ] Weighted Path Order [Yamada, Kusakari, Sakabe, SCP β15 ] 17/25
(SAT and) SMT solving for path orders Path orders: based on precedences of function symbols Recursive Path Order [Dershowitz, TCS β82 ; Codish et al, JAR β11 ] Weighted Path Order [Yamada, Kusakari, Sakabe, SCP β15 ] Knuth-Bendix Order [Knuth, Bendix, CPAA β70 ] β SMT-Encoding to QF_LIA [Zankl, Hirokawa, Middeldorp, JAR β09 ] outperformed polynomial time algorithm [Korovin, Voronkov, IC β03 ] in experiments 17/25
(SAT and) SMT solving for path orders Path orders: based on precedences of function symbols Recursive Path Order [Dershowitz, TCS β82 ; Codish et al, JAR β11 ] Weighted Path Order [Yamada, Kusakari, Sakabe, SCP β15 ] Knuth-Bendix Order [Knuth, Bendix, CPAA β70 ] β SMT-Encoding to QF_LIA [Zankl, Hirokawa, Middeldorp, JAR β09 ] outperformed polynomial time algorithm [Korovin, Voronkov, IC β03 ] in experiments Analogy: Exponential-time simplex vs. polynomial-time interior-point methods for QF_LRA? 17/25
Further extensions Constrained term rewriting [Fuhs et al, RTA β09 ; Kop, Nishida, FroCoS β13 ; Rocha, Meseguer, MuΓ±oz, WRLA β14 ] term rewriting with predefined operations from SMT theories, e.g. integer arithmetic, . . . target language for translations from programming languages 18/25
Further extensions Constrained term rewriting [Fuhs et al, RTA β09 ; Kop, Nishida, FroCoS β13 ; Rocha, Meseguer, MuΓ±oz, WRLA β14 ] term rewriting with predefined operations from SMT theories, e.g. integer arithmetic, . . . target language for translations from programming languages Complexity analysis [Hirokawa, Moser, IJCAR β08 ; Noschinski, Emmes, Giesl, JAR β13 ] Can re-use termination machinery to infer and prove statements like βruntime complexity of this TRS is in O ( n 3 ) β 18/25
SMT solvers from termination analysis Annual SMT-COMP, division QF_NIA Year Winner 2009 Barcelogic-QF_NIA 2010 MiniSmt 2011 AProVE 2012 no QF_NIA 2013 no SMT-COMP 2014 AProVE 2015 AProVE 2016 β today, 4 pm 19/25
SMT solvers from termination analysis Annual SMT-COMP, division QF_NIA Year Winner 2009 Barcelogic-QF_NIA 2010 MiniSmt (spin-off of T T 2) T 2011 AProVE 2012 no QF_NIA 2013 no SMT-COMP 2014 AProVE 2015 AProVE 2016 β today, 4 pm β Termination provers can also be successful SMT solvers! 19/25
SMT solvers from termination analysis Annual SMT-COMP, division QF_NIA Year Winner 2009 Barcelogic-QF_NIA 2010 MiniSmt (spin-off of T T 2) T 2011 AProVE 2012 no QF_NIA 2013 no SMT-COMP 2014 AProVE 2015 AProVE 2016 β today, 4 pm β Termination provers can also be successful SMT solvers! (disclaimer: Z3 participated only hors concours in the last years) 19/25
Term Rewrite Systems (TRSs) 1 Imperative Programs 2 20/25
Papers on termination of imperative programs often about integers as data 21/25
Papers on termination of imperative programs often about integers as data Example (Imperative program) if x β₯ 0: while x οΏ½ = 0: x = x β 1 Does this program terminate? 21/25
Papers on termination of imperative programs often about integers as data Example (Imperative program) if x β₯ 0: β 0 : β 1 : while x οΏ½ = 0: β 2 : x = x β 1 Does this program terminate? Example (Equivalent translation to transition system) β [ x β₯ 0] β 0 ( x ) β 1 ( x ) β 1 ( x ) β β 2 ( x ) [ x οΏ½ = 0] β 2 ( x ) β β 1 ( x β 1) β 1 ( x ) β β 3 ( x ) [ x == 0] 21/25
Papers on termination of imperative programs often about integers as data Example (Imperative program) if x β₯ 0: β 0 : β 1 : while x οΏ½ = 0: β 2 : x = x β 1 Does this program terminate? Example (Equivalent translation to transition system) β [ x β₯ 0] β 0 ( x ) β 1 ( x ) β 1 ( x ) β β 2 ( x ) [ x οΏ½ = 0] β 2 ( x ) β β 1 ( x β 1) β 1 ( x ) β β 3 ( x ) [ x == 0] Oh no! β 1 ( β 1) β β 2 ( β 1) β β 1 ( β 2) β β 2 ( β 2) β β 1 ( β 3) β Β· Β· Β· 21/25
Papers on termination of imperative programs often about integers as data Example (Imperative program) if x β₯ 0: β 0 : β 1 : while x οΏ½ = 0: β 2 : x = x β 1 Does this program terminate? Example (Equivalent translation to transition system) β [ x β₯ 0] β 0 ( x ) β 1 ( x ) β 1 ( x ) β β 2 ( x ) [ x οΏ½ = 0] β 2 ( x ) β β 1 ( x β 1) β 1 ( x ) β β 3 ( x ) [ x == 0] Oh no! β 1 ( β 1) β β 2 ( β 1) β β 1 ( β 2) β β 2 ( β 2) β β 1 ( β 3) β Β· Β· Β· β Restrict initial states to β 0 ( z ) for z β Z 21/25
Papers on termination of imperative programs often about integers as data Example (Imperative program) if x β₯ 0: β 0 : β 1 : while x οΏ½ = 0: β 2 : x = x β 1 Does this program terminate? Example (Equivalent translation to transition system) β [ x β₯ 0] β 0 ( x ) β 1 ( x ) β 1 ( x ) β β 2 ( x ) [ x οΏ½ = 0] β 2 ( x ) β β 1 ( x β 1) β 1 ( x ) β β 3 ( x ) [ x == 0] Oh no! β 1 ( β 1) β β 2 ( β 1) β β 1 ( β 2) β β 2 ( β 2) β β 1 ( β 3) β Β· Β· Β· β Restrict initial states to β 0 ( z ) for z β Z β Find invariant x β₯ 0 at β 1 , β 2 21/25
Papers on termination of imperative programs often about integers as data Example (Imperative program) if x β₯ 0: β 0 : β 1 : while x οΏ½ = 0: β 2 : x = x β 1 Does this program terminate? Example (Equivalent translation to transition system) β [ x β₯ 0] β 0 ( x ) β 1 ( x ) β 1 ( x ) β β 2 ( x ) [ x οΏ½ = 0 β§ x β₯ 0] β 2 ( x ) β β 1 ( x β 1) [ x β₯ 0] β 1 ( x ) β β 3 ( x ) [ x == 0 β§ x β₯ 0] Oh no! β 1 ( β 1) β β 2 ( β 1) β β 1 ( β 2) β β 2 ( β 2) β β 1 ( β 3) β Β· Β· Β· β Restrict initial states to β 0 ( z ) for z β Z β Find invariant x β₯ 0 at β 1 , β 2 21/25
Proving termination with invariants Example (Transition system with invariants) β 0 ( x ) β β 1 ( x ) [ x β₯ 0] β 1 ( x ) β β 2 ( x ) [ x οΏ½ = 0 β§ x β₯ 0] β 2 ( x ) β β 1 ( x β 1) [ x β₯ 0] β 1 ( x ) β β 3 ( x ) [ x == 0 β§ x β₯ 0] Prove termination by ranking function [ Β· ] with [ β 0 ] ( x ) = [ β 1 ] ( x ) = Β· Β· Β· = x 22/25
Proving termination with invariants Example (Transition system with invariants) β 0 ( x ) β 1 ( x ) [ x β₯ 0] οΏ½ β 1 ( x ) οΏ½ β 2 ( x ) [ x οΏ½ = 0 β§ x β₯ 0] β 2 ( x ) β» β 1 ( x β 1) [ x β₯ 0] β 1 ( x ) οΏ½ β 3 ( x ) [ x == 0 β§ x β₯ 0] Prove termination by ranking function [ Β· ] with [ β 0 ] ( x ) = [ β 1 ] ( x ) = Β· Β· Β· = x 22/25
Proving termination with invariants Example (Transition system with invariants) β 0 ( x ) β 1 ( x ) [ x β₯ 0] οΏ½ β 1 ( x ) οΏ½ β 2 ( x ) [ x οΏ½ = 0 β§ x β₯ 0] β 2 ( x ) β» β 1 ( x β 1) [ x β₯ 0] β 1 ( x ) οΏ½ β 3 ( x ) [ x == 0 β§ x β₯ 0] Prove termination by ranking function [ Β· ] with [ β 0 ] ( x ) = [ β 1 ] ( x ) = Β· Β· Β· = x Automate search using parametric ranking function: [ β 0 ] ( x ) = a 0 + b 0 Β· x, [ β 1 ] ( x ) = a 1 + b 1 Β· x, . . . 22/25
Proving termination with invariants Example (Transition system with invariants) β 0 ( x ) β 1 ( x ) [ x β₯ 0] οΏ½ β 1 ( x ) οΏ½ β 2 ( x ) [ x οΏ½ = 0 β§ x β₯ 0] β 2 ( x ) β» β 1 ( x β 1) [ x β₯ 0] β 1 ( x ) οΏ½ β 3 ( x ) [ x == 0 β§ x β₯ 0] Prove termination by ranking function [ Β· ] with [ β 0 ] ( x ) = [ β 1 ] ( x ) = Β· Β· Β· = x Automate search using parametric ranking function: [ β 0 ] ( x ) = a 0 + b 0 Β· x, [ β 1 ] ( x ) = a 1 + b 1 Β· x, . . . Constraints e.g.: x β₯ 0 β a 2 + b 2 Β· x > a 1 + b 1 Β· ( x β 1) βdecrease . . . β x β₯ 0 β a 2 + b 2 Β· x β₯ 0 β. . . against a boundβ 22/25
Proving termination with invariants Example (Transition system with invariants) β 0 ( x ) β 1 ( x ) [ x β₯ 0] οΏ½ β 1 ( x ) οΏ½ β 2 ( x ) [ x οΏ½ = 0 β§ x β₯ 0] β 2 ( x ) β» β 1 ( x β 1) [ x β₯ 0] β 1 ( x ) οΏ½ β 3 ( x ) [ x == 0 β§ x β₯ 0] Prove termination by ranking function [ Β· ] with [ β 0 ] ( x ) = [ β 1 ] ( x ) = Β· Β· Β· = x Automate search using parametric ranking function: [ β 0 ] ( x ) = a 0 + b 0 Β· x, [ β 1 ] ( x ) = a 1 + b 1 Β· x, . . . Constraints e.g.: x β₯ 0 β a 2 + b 2 Β· x > a 1 + b 1 Β· ( x β 1) βdecrease . . . β x β₯ 0 β a 2 + b 2 Β· x β₯ 0 β. . . against a boundβ Use Farkasβ Lemma to eliminate β x , QF_LRA solver gives model for a i , b i . 22/25
Proving termination with invariants Example (Transition system with invariants) β 0 ( x ) β 1 ( x ) [ x β₯ 0] οΏ½ β 1 ( x ) οΏ½ β 2 ( x ) [ x οΏ½ = 0 β§ x β₯ 0] β 2 ( x ) β» β 1 ( x β 1) [ x β₯ 0] β 1 ( x ) οΏ½ β 3 ( x ) [ x == 0 β§ x β₯ 0] Prove termination by ranking function [ Β· ] with [ β 0 ] ( x ) = [ β 1 ] ( x ) = Β· Β· Β· = x Automate search using parametric ranking function: [ β 0 ] ( x ) = a 0 + b 0 Β· x, [ β 1 ] ( x ) = a 1 + b 1 Β· x, . . . Constraints e.g.: x β₯ 0 β a 2 + b 2 Β· x > a 1 + b 1 Β· ( x β 1) βdecrease . . . β x β₯ 0 β a 2 + b 2 Β· x β₯ 0 β. . . against a boundβ Use Farkasβ Lemma to eliminate β x , QF_LRA solver gives model for a i , b i . More: [Podelski, Rybalchenko, VMCAI β04 , Alias et al, SAS β10 ] 22/25
Searching for invariants using SMT Termination prover needs to find invariants for programs on integers Statically before the translation [StrΓΆder et al, IJCAR β14 ] In cooperation with a safety prover [Brockschmidt, Cook, Fuhs, CAV β13 ] Using Max-SMT [Larraz, Oliveras, RodrΓguez-Carbonell, Rubio, FMCAD β13 ] Nowadays all SMT-based! 23/25
Extensions Proving non -termination (infinite run from initial states is possible) [Gupta et al, POPL β08 , Brockschmidt et al, FoVeOOS β11 , Chen et al, TACAS β14 , Larraz et al, CAV β14 , Cook et al, FMCAD β14 ] CTL β model checking for infinite state systems based on termination and non-termination provers [Cook, Khlaaf, Piterman, CAV β15 ] Complexity bounds [Alias et al, SAS β10 , Hoffmann, Shao, JFP β15 , Brockschmidt et al, TOPLAS β16 ] 24/25
Conclusion Automated termination analysis for term rewriting and for imperative programs developed in parallel over the last βΌ 15 years 25/25
Conclusion Automated termination analysis for term rewriting and for imperative programs developed in parallel over the last βΌ 15 years Term rewriting: need to encode how to represent data structures 25/25
Conclusion Automated termination analysis for term rewriting and for imperative programs developed in parallel over the last βΌ 15 years Term rewriting: need to encode how to represent data structures Imperative programs on integers: need to consider reachability and invariants 25/25
Conclusion Automated termination analysis for term rewriting and for imperative programs developed in parallel over the last βΌ 15 years Term rewriting: need to encode how to represent data structures Imperative programs on integers: need to consider reachability and invariants Since a few years cross-fertilization 25/25
Recommend
More recommend