Realizability in Cyclic Proof Extracting Ordering Information for Infinite Descent 1 School of Computing, University of Kent, Canterbury, UK 2 Department of Computer Science, UCL, London, UK Reuben N. S. Rowe 1 James Brotherston 2 TABLEAUX, Brasília, Brazil, Tuesday 26 th September 2017
Motivation: Program Termination shuffle(y); 1 } rev(y); { y x->next list y n 1 } { y x->next x->next list y n 1 } } } { list x n } list y n { y struct ll { int data; ll *next; } 1 list x n n 0 x NULL list x ->next n void rev(ll *x) ll *y = x -> next; { /* reverses list */ } void shuffle(ll *x) { list x n } { if ( x != NULL ) { { list x->next n 1 } 1/15
Motivation: Program Termination rev(y); { list x n } } } 1 } list y n x->next { y shuffle(y); 1 } list y n x->next { y 1 } struct ll { int data; ll *next; } list y n x->next { y ll *y = x -> next; 1 } { list x->next n if ( x != NULL ) { { { list x n } void shuffle(ll *x) { /* reverses list */ } void rev(ll *x) 1/15 list ( x , n ) ⇔ ( n = 0 ∧ x = NULL ) ∨ list ( x ->next , n − 1 )
Motivation: Program Termination rev(y); } 1 } list y n x->next { y shuffle(y); 1 } list y n x->next { y 1 } struct ll { int data; ll *next; } list y n x->next { y ll *y = x -> next; 1 } { list x->next n if ( x != NULL ) { { /* reverses list */ } void rev(ll *x) 1/15 list ( x , n ) ⇔ ( n = 0 ∧ x = NULL ) ∨ list ( x ->next , n − 1 ) void shuffle(ll *x) { list ( x , n ) } { } { list ( x , n ) }
Motivation: Program Termination x->next } 1 } list y n x->next { y shuffle(y); 1 } list y n { y struct ll { int data; ll *next; } rev(y); ll *y = x -> next; if ( x != NULL ) { { /* reverses list */ } void rev(ll *x) 1/15 list ( x , n ) ⇔ ( n = 0 ∧ x = NULL ) ∨ list ( x ->next , n − 1 ) void shuffle(ll *x) { list ( x , n ) } { { list ( x->next , n − 1 ) } { y = x->next ∧ list ( y , n − 1 ) } } { list ( x , n ) }
Motivation: Program Termination struct ll { int data; ll *next; } } 1 } list y n x->next { y shuffle(y); 1 } list y n x->next { y rev(y); ll *y = x -> next; if ( x != NULL ) { 1/15 list ( x , n ) ⇔ ( n = 0 ∧ x = NULL ) ∨ list ( x ->next , n − 1 ) void rev(ll *x) { list ( x , n ) } { . . . } { list ( x , n ) } void shuffle(ll *x) { list ( x , n ) } { { list ( x->next , n − 1 ) } { y = x->next ∧ list ( y , n − 1 ) } } { list ( x , n ) }
Motivation: Program Termination struct ll { int data; ll *next; } } 1 } list y n x->next { y shuffle(y); 1 } list y n x->next { y rev(y); ll *y = x -> next; if ( x != NULL ) { 1/15 list ( x , n ) ⇔ ( n = 0 ∧ x = NULL ) ∨ list ( x ->next , n − 1 ) void rev(ll *x) { list ( x , n ) } { . . . } { list ( x , n ) } void shuffle(ll *x) { list ( x , n ) } { { list ( x->next , n − 1 ) } { y = x->next ∧ list ( y , n − 1 ) } } { list ( x , n ) }
Motivation: Program Termination struct ll { int data; ll *next; } } 1 } list y n x->next { y shuffle(y); rev(y); ll *y = x -> next; if ( x != NULL ) { 1/15 list ( x , n ) ⇔ ( n = 0 ∧ x = NULL ) ∨ list ( x ->next , n − 1 ) void rev(ll *x) { list ( x , n ) } { . . . } { list ( x , n ) } void shuffle(ll *x) { list ( x , n ) } { { list ( x->next , n − 1 ) } { y = x->next ∧ list ( y , n − 1 ) } { y = x->next ∧ list ( y , n − 1 ) } } { list ( x , n ) }
Motivation: Program Termination struct ll { int data; ll *next; } } 1 } list y n x->next { y shuffle(y); rev(y); ll *y = x -> next; if ( x != NULL ) { 1/15 list ( x , n ) ⇔ ( n = 0 ∧ x = NULL ) ∨ list ( x ->next , n − 1 ) void rev(ll *x) { list ( x , n ) } { . . . } { list ( x , n ) } void shuffle(ll *x) { list ( x , n ) } { { list ( x->next , n − 1 ) } { y = x->next ∧ list ( y , n − 1 ) } { y = x->next ∧ list ( y , n − 1 ) } } { list ( x , n ) }
Motivation: Program Termination struct ll { int data; ll *next; } if ( x != NULL ) { ll *y = x -> next; rev(y); shuffle(y); } 1/15 list ( x , n ) ⇔ ( n = 0 ∧ x = NULL ) ∨ list ( x ->next , n − 1 ) void rev(ll *x) { list ( x , n ) } { . . . } { list ( x , n ) } void shuffle(ll *x) { list ( x , n ) } { { list ( x->next , n − 1 ) } { y = x->next ∧ list ( y , n − 1 ) } { y = x->next ∧ list ( y , n − 1 ) } { y = x->next ∧ list ( y , n − 1 ) } } { list ( x , n ) }
Motivation: Program Termination struct ll { int data; ll *next; } if ( x != NULL ) { ll *y = x -> next; rev(y); shuffle(y); } 1/15 list ( x ) ⇔ ( n = 0 ∧ x = NULL ) ∨ list ( x ->next ) void rev(ll *x) { list α ( x ) } { . . . } { list α ( x ) } void shuffle(ll *x) { list α ( x ) } { { list β ( x->next ) ∧ β < α } { y = x->next ∧ list β ( y ) ∧ β < α } { y = x->next ∧ list β ( y ) ∧ β < α } { y = x->next ∧ list β ( y ) ∧ β < α } } { list α ( x ) }
Motivation: Program Termination shuffle(y); P x Q y Q y P x struct ll { int data; ll *next; } } 1/15 rev(y); if ( x != NULL ) { ll *y = x -> next; list ( x ) ⇔ ( n = 0 ∧ x = NULL ) ∨ list ( x ->next ) void rev(ll *x) { list α ( x ) } { . . . } { list α ( x ) } void shuffle(ll *x) { list α ( x ) } { [ [ · ] ] : Formulas → ℘ ( Models ) { list β ( x->next ) ∧ β < α } [ [ · ] ] ⊥ ⊑ [ [ · ] ] 1 ⊑ . . . [ [ · ] ] α ⊑ [ [ · ] ] α + 1 ⊑ . . . ⊑ [ [ · ] ] { y = x->next ∧ list β ( y ) ∧ β < α } { y = x->next ∧ list β ( y ) ∧ β < α } { y = x->next ∧ list β ( y ) ∧ β < α } } { list α ( x ) }
Motivation: Program Termination ll *y = x -> next; struct ll { int data; ll *next; } } shuffle(y); rev(y); 1/15 if ( x != NULL ) { list ( x ) ⇔ ( n = 0 ∧ x = NULL ) ∨ list ( x ->next ) void rev(ll *x) { list α ( x ) } { . . . } { list α ( x ) } void shuffle(ll *x) { list α ( x ) } { [ [ · ] ] : Formulas → ℘ ( Models ) { list β ( x->next ) ∧ β < α } [ [ · ] ] ⊥ ⊑ [ [ · ] ] 1 ⊑ . . . [ [ · ] ] α ⊑ [ [ · ] ] α + 1 ⊑ . . . ⊑ [ [ · ] ] { y = x->next ∧ list β ( y ) ∧ β < α } ∀ α . [ [ P ( ⃗ x )] ] α ⊆ [ [ Q ( ⃗ y )] ] α ≡ Q ( ⃗ y ) ≤ P ( ⃗ x ) { y = x->next ∧ list β ( y ) ∧ β < α } { y = x->next ∧ list β ( y ) ∧ β < α } } { list α ( x ) }
Motivation: Program Termination struct ll { int data; ll *next; } conditions, in the form of entailments , e.g. Intra-procedural analysis produces verification } shuffle(y); rev(y); ll *y = x -> next; if ( x != NULL ) { 1/15 list ( x ) ⇔ ( n = 0 ∧ x = NULL ) ∨ list ( x ->next ) void rev(ll *x) { list α ( x ) } { . . . } { list α ( x ) } void shuffle(ll *x) { list α ( x ) } { { list β ( x->next ) ∧ β < α } { y = x->next ∧ list β ( y ) ∧ β < α } { y = x->next ∧ list β ( y ) ∧ β < α } x ̸ = NULL ∧ y = x ->next ∧ list ( y ) ⊢ list ( x ) { y = x->next ∧ list β ( y ) ∧ β < α } } { list α ( x ) }
Motivation: Program Termination } (Inference) (Axiom) . . struct ll { int data; ll *next; } . . . . . . 1/15 shuffle(y); rev(y); ll *y = x -> next; if ( x != NULL ) { list ( x ) ⇔ ( n = 0 ∧ x = NULL ) ∨ list ( x ->next ) void rev(ll *x) { list α ( x ) } { . . . } { list α ( x ) } void shuffle(ll *x) { list α ( x ) } { { list β ( x->next ) ∧ β < α } • • · · • . . . . . • { y = x->next ∧ list β ( y ) ∧ β < α } · · • • { y = x->next ∧ list β ( y ) ∧ β < α } • · { y = x->next ∧ list β ( y ) ∧ β < α } · · . . . P ( ⃗ x ) . . . ⊢ . . . Q ( ⃗ y ) . . . } { list α ( x ) }
Motivation: Program Termination } (Inference) (Axiom) . struct ll { int data; ll *next; } . . . . . . . 1/15 shuffle(y); rev(y); ll *y = x -> next; if ( x != NULL ) { list ( x ) ⇔ ( n = 0 ∧ x = NULL ) ∨ list ( x ->next ) void rev(ll *x) { list α ( x ) } { . . . } { list α ( x ) } void shuffle(ll *x) { list α ( x ) } { { list β ( x->next ) ∧ β < α } • • · · • . . . . . • { y = x->next ∧ list β ( y ) ∧ β < α } · · • • Q ( ⃗ y ) ≤ ? P ( ⃗ { y = x->next ∧ list β ( y ) ∧ β < α } x ) • · { y = x->next ∧ list β ( y ) ∧ β < α } · · . . . P ( ⃗ x ) . . . ⊢ . . . Q ( ⃗ y ) . . . } { list α ( x ) }
Motivation: Program Termination } (Inference) (Axiom) . struct ll { int data; ll *next; } . . . . . . . 1/15 shuffle(y); rev(y); ll *y = x -> next; if ( x != NULL ) { list ( x ) ⇔ ( n = 0 ∧ x = NULL ) ∨ list ( x ->next ) void rev(ll *x) { list α ( x ) } { . . . } { list α ( x ) } void shuffle(ll *x) { list α ( x ) } { { list β ( x->next ) ∧ β < α } • • · · • . . . . . • { y = x->next ∧ list β ( y ) ∧ β < α } · · • • Q ( ⃗ y ) < ? P ( ⃗ { y = x->next ∧ list β ( y ) ∧ β < α } x ) • · { y = x->next ∧ list β ( y ) ∧ β < α } · · . . . P ( ⃗ x ) . . . ⊢ . . . Q ( ⃗ y ) . . . } { list α ( x ) }
Recommend
More recommend