This preview shows pages 1–3. Sign up to view the full content.
This preview has intentionally blurred sections. Sign up to view the full version.View Full Document
Unformatted text preview: An Application of Ramseys Theorem to Proving Programs Terminate Exposition by William Gasarch 1 Introduction We describe an application of Ramseys Theorem to proving programs terminate, by which we mean terminate on any input. This paper is self contained; it does not require knowledge of either Ramseys Theorem or Programming Languages. Our account is based on the articles of B. Cook, Podelski, and Rybalchenko [10, 22] and Lee, Jones, and Ben-Amram . Many other papers [8, 9, 21, 23, 24] have used the techniques I present here. Termination checkers that use the methods of B. Cook, Podelski, and Rybalchenko include Loopfrog , and Terminator . Termination checkers that use the methods of Lee, Jones, and Ben-Amram include ACL2 , AProVE , ARMC , and Julia . Convention 1.1 The statement The Program Terminates means that it terminates no mat- ter what the user does. The user will be supplying inputs as the program runs; hence we are saying that the user cannot come up with some (perhaps bizarre) inputs that make the program run forever. In the summary below we refer to Programs 1,2,3 and 4 which appear later in the paper. 1. Section 3: We prove Program 1 terminates. This proof uses a simple well founded ordering. We then state Theorem 3.2 that encapsulates this kind of proof. 2. Section 4: We prove Program 2 terminates. This proof uses a complicated well founded ordering and Theorem 3.2. 3. Section 5: We prove Program 2 terminates using Ramseys Theorem. We then state Theorems 5.6 and Theorem 5.7 which encapsulates this kind of proof. This proof of termination is easier than the proof is Section 4 in some ways, but more complicated in other ways. 4. Section 6: We prove Program 2 terminates using Theorem 5.6 and hence using Ram- seys Theorem; however, we prove the premise of Theorem 5.6 using matrices. We then state and prove Theorems 6.4 and 6.5 that encapsulates this kind of proof. We discuss how this approach can be made into an algorithm that generates proofs-of-termination in some cases. 5. Section 7: We prove Program 3 terminates using Theorem 5.7 and hence using Ram- seys Theorem; however, we prove the premise of Theorem 5.7 using transition invari- ants. We then state Theorem 7.3 that encapsulates this kind of proof. It seems difficult to obtain a proof that Program 3 terminates without using Ramseys Theorem. 1 Program 0 (x , y) = ( input (NAT) , input (NAT)) While x &gt; control = input (1 ,2) if control = 1 (x , y)=(x+10,y- 1) else if control = 2 (x , y)=(y+17,x- 2) 6. Section 8: We prove Program 3 terminates using Theorem 6.5 and hence using Ram- seys Theorem and matrices. Program 3 has some properties that make this a good illustration....
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