This preview shows pages 1–9. Sign up to view the full content.
This preview has intentionally blurred sections. Sign up to view the full version.
View Full DocumentThis preview has intentionally blurred sections. Sign up to view the full version.
View Full DocumentThis preview has intentionally blurred sections. Sign up to view the full version.
View Full DocumentThis preview has intentionally blurred sections. Sign up to view the full version.
View Full Document
Unformatted text preview: An Application of Ramsey’s Theorem to Proving Programs Terminate: An Exposition William GasarchU of MD William GasarchU of MD An Application of Ramsey’s Theorem to Proving Programs Term Credit Where Credit is Due 1. Jon Katz emailed me Proving Programs Terminate by Byron Cook, Andreas Podelski, Andrey Rybalchenko. 2. I emailed Byron Cook, Andreas Podelski, Andrey Rybalchenko for more references, which they provided. 3. Proofs of Termination are their work unless otherwise noted. 4. Ramsey’s Theorem is due to Ramsey (duh). William GasarchU of MD An Application of Ramsey’s Theorem to Proving Programs Term Overview I Problem: Given a program we want to prove it terminates. 1. Impossible in general Halting Problem is Undecidable. 2. But can do this on some simple progs. (We will.) William GasarchU of MD An Application of Ramsey’s Theorem to Proving Programs Term Overview II In this talk I will: 1. Do example of traditional method to prove progs terminate. 2. Discuss traditional method. 3. Do harder example of traditional method. 4. DIGRESSION: A very short lecture on Ramsey Theory. 5. Do that same harder example using Ramsey Theory. 6. Do example with Ramsey Theory that is hard to do traditionally. William GasarchU of MD An Application of Ramsey’s Theorem to Proving Programs Term Notation 1. Will use psuedocode progs. 2. KEY: If A is a set then the command x = input(A) means that x gets some value from A that the user decides. 3. Note: we will want to show that no matter what the user does the program will halt. 4. The code (x,y) = (f(x,y),g(x,y)) means that simultaneously x gets f(x,y) and y gets g(x,y). William GasarchU of MD An Application of Ramsey’s Theorem to Proving Programs Term Easy Example of Traditional Method (x,y,z) = (input(INT), input(INT), input(INT)) While x>0 and y>0 and z>0 control = input(1,2,3) if control = 1 then (x,y,z)=(x+1,y1,z1) else if control = 2 then (x,y,z)=(x1,y+1,z1) else (x,y,z)=(x1,y1,z+1) Sketch of Proof of termination: William GasarchU of MD An Application of Ramsey’s Theorem to Proving Programs Term Easy Example of Traditional Method (x,y,z) = (input(INT), input(INT), input(INT)) While x>0 and y>0 and z>0 control = input(1,2,3) if control = 1 then (x,y,z)=(x+1,y1,z1) else if control = 2 then (x,y,z)=(x1,y+1,z1) else (x,y,z)=(x1,y1,z+1) Sketch of Proof of termination: Whatever the user does x+y+z is decreasing. William GasarchU of MD An Application of Ramsey’s Theorem to Proving Programs Term Easy Example of Traditional Method (x,y,z) = (input(INT), input(INT), input(INT)) While x>0 and y>0 and z>0 control = input(1,2,3) if control = 1 then (x,y,z)=(x+1,y1,z1) else if control = 2 then (x,y,z)=(x1,y+1,z1) else (x,y,z)=(x1,y1,z+1) Sketch of Proof of termination: Whatever the user does x+y+z is decreasing....
View
Full
Document
This note was uploaded on 01/13/2012 for the course CMSC 297 taught by Professor Staff during the Fall '11 term at Maryland.
 Fall '11
 staff

Click to edit the document details