Automated Verification of Imperative Programs Using Regular Language Semantics
Automated Verification of Imperative Programs Using Regular Language Semantics
Simon Buist Bachelor of Science in Computer Science with Honours The University of Bath May 2013
This dissertation may be made available for consultation within the University Library and may be photocopied or lent to other libraries for the purposes of consultation.
Signed:
COPYRIGHT
Attention is drawn to the fact that copyright of this dissertation rests with its author. The Intellectual Property Rights of the products produced as part of the project belong to the author unless otherwise specied below, in accordance with the University of Baths policy on intellectual property (see http://www.bath.ac.uk/ordinances/22.pdf). This copy of the dissertation has been supplied on condition that anyone who consults it is understood to recognise that its copyright rests with its author and that no quotation from the dissertation and no information derived from it may be published without the prior written consent of the author.
Declaration
This dissertation is submitted to the University of Bath in accordance with the requirements of the degree of Bachelor of Science in the Department of Computer Science. No portion of the work in this dissertation has been submitted in support of an application for any other degree or qualication of this or any other university or institution of learning. Except where specically acknowledged, it is the work of the author.
Signed:
Abstract Your abstract should appear here. An abstract is a short paragraph describing the aims of the project, what was achieved and what contributions it has made.
Contents
1 Introduction 1.1 Example Section . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 1.1.1 1.2 1.3 Example Subsection . . . . . . . . . . . . . . . . . . . . . . . . . . . 1 1 1 2 2 2 2 2 3 4 5 6 7 8 11 12 13
short section title . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . Example lists . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 1.3.1 1.3.2 1.3.3 Enumerated . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . Itemized . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . Description . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .
2 Literature Survey 3 Requirements 4 Design 5 Implementation and Testing 6 Results 7 Conclusions A Design Diagrams B User Documentation C Raw results output
ii
iii 14 15
List of Figures
1.1 An example gure . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 1
iv
List of Tables
1.1 An example table . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 1
Acknowledgements
Add any acknowledgements here.
vi
Chapter 1
Introduction
This is the introductory chapter.
1.1
Example Section
1.1.1
Example Subsection
. . . and sub-sections Example sub-subsection . . . and sub-subsections. Table 1.1: An Items Item 1 Item 2 example table Values Value 1 Value 2
CHAPTER 1. INTRODUCTION
1.2
Another section
Another section, just for good measure. You can reference a table, gure or equation using \ref, just like this reference to table 1.1, or this reference to gure 1.1.
1.3
1.3.1
Example lists
Enumerated
1. Example enumerated list a nested enumerated list item 2. Second item in the list
1.3.2
Itemized
Example itemized list a nested itemized list item Second item in the list
1.3.3
Description
Chapter 2
Literature Survey
This is the chapter for your Literature Survey. You will wish to cite authors like (Lamport, 1986) or (Patashnik, 1988). Alternate commands are used to cite Lamport (1986) as a noun, or cite Lamports (1986) work possessively, or add text to the citation, (e.g. Lamport, 1986). Here I am citing an InProceedings entry: (Aguilar and Cerrada, 2001), here an InCollection: (Armano, Marchesi and Murru, 2002), here an Article: (Armano, Murru and Roli, 2002), a MastersThesis (Camilli, 1990), PhdThesis: (Booker, 1982), TechReport: (Butz, Goldberg and Stolzmann, 1999), Book: (Bck, Fogel and Michalewicz, 1997), Proceedings: (Wu, a 1999), and nally, Misc: (Proceedings of the International Workshop on Learning Classier Systems (IWLCS-2000), in the Joint Workshops of SAB 2000 and PPSN 2000, 2000). If these citations do not compile correctly, ensure you have the Harvard package installed. You can pick up the Harvard package in the zip le of the dissertation template les you downloaded.
Chapter 3
Requirements
If you are doing a primarily software development project, this is the chapter in which you review the requirements decisions and critique the requirements process.
Chapter 4
Design
This is the chapter in which you review your design decisions at various levels and critique the design process.
Chapter 5
public static void main () { System . out . println ( " Hello World " ) ; } Code listings are produced using the package Listings. This has many useful options, so have a look at the package documentation for further ideas.
Chapter 6
Results
This is the chapter in which you review the outcomes, and critique the outcomes process. You may include user evaluation here too.
Chapter 7
Conclusions
This is the chapter in which you review the major achievements in the light of your original objectives, critique the process, critique your own learning and identify possible future work.
Bibliography
Aguilar, J. and Cerrada, M. (2001), Fuzzy classier system and genetic programming on system identication problems, in L. Spector, E. D. Goodman, A. Wu, W. Langdon, H.-M. Voigt, M. Gen, S. Sen, M. Dorigo, S. Pezeshk, M. H. Garzon and E. Burke, eds, Proceedings of the Genetic and Evolutionary Computation Conference (GECCO2001), Morgan Kaufmann, San Francisco, California, USA, pp. 12451251. Armano, G., Marchesi, M. and Murru, A. (2002), Nxcs: Hybrid approach to stock indexes forecasting, in S.-H. Chen, ed., Genetic Algorithms and Genetic Programming in Computational Finance, Kluwer, chapter 6, pp. 125158. Armano, G., Murru, A. and Roli, F. (2002), Stock market prediction by a mixture of genetic-neural experts, International Journal of Pattern Recognition and Articial Intelligence 16(5), 501526. Bck, T., Fogel, D. B. and Michalewicz, Z., eds (1997), Handbook of Evolutiona ary Computation, Institute of Physics Publishing and Oxford University Press. http://www.iop.org/Books/Catalogue/. URL: http://www.iop.org/Books/Catalogue/ Booker, L. B. (1982), Intelligent Behavior as an Adaptation to the Task Environment, PhD thesis, The University of Michigan. Butz, M., Goldberg, D. E. and Stolzmann, W. (1999), New challenges for an ACS: Hard problems and possible solutions, Technical Report 99019, University of Illinois at Urbana-Champaign, Urbana, IL. URL: http://www-illigal.ge.uiuc.edu/cgi-bin/orderform/orderform.cgi Camilli, A. (1990), Classier systems in massively parallel architectures, Masters thesis, University of Pisa. (In Italian). Lamport, L. (1986), LaTeX : A Document Preparation System, Addison-Wesley. Patashnik, O. (1988), BibTeX ing. Documentation for general BibTeX users. Proceedings of the International Workshop on Learning Classier Systems (IWLCS-2000), in the Joint Workshops of SAB 2000 and PPSN 2000 (2000). Pier Luca Lanzi, Wolfgang Stolzmann and Stewart W. Wilson (workshop organisers). 9
BIBLIOGRAPHY
10
Wu, A. S., ed. (1999), Proceedings of the 1999 Genetic and Evolutionary Computation Conference Workshop Program.
Appendix A
Design Diagrams
11
Appendix B
User Documentation
12
Appendix C
13
Appendix D
Code
14
APPENDIX D. CODE
D.1
File: yourCodeFile.java
Listing D.1: A sample
17
PrintWriter pw = new PrintWriter ( bw ) ; while ( cont ) { System . out . println ( " Enter a line of input " ) ; s1 = br . readLine () ; System . out . println ( " The line has " + s1 . length () + " characters " ) ; if ( s1 . length () == 0) { cont = false ; } else { pw . println ( s1 ) ; } pw . close () ;
18 19
1 2 3 4 5 6
20 21
7 8 9 10 11
12
13 14 15
16
public class MyFileWriter 22 { 23 public static void main ( String [] args ) throws java . io . IOException { String s1 ; 24 String s2 ; 25 boolean cont = true ; 26 // set up the buffered reader to read 27 from the keyboard 28 BufferedReader br = new BufferedReader 29 ( new Inpu tStrea mReade r ( 30 System . in ) ) ; 31 // Set up the output file 32 } FileWriter fw = new FileWriter ( " 33 MyFileWriter . txt " ) ; 34 } BufferedWriter bw = new 35 } BufferedWriter ( fw ) ;
15