Understanding programming and programming languages requires knowledge of the underlying theoretical model. This book explores aspects of programming that are amenable to mathematical proof. The author describes a programming theory which is much simpler and more comprehensive than the current theories to date. In the theoretical model, a specification is just a boolean expression and refinement is just an ordinary implication. The author develops a practical and broad method for writing precise specifications and designing programs whose executions probably satisfy the specifications. Beginning with preparatory material in logic, numbers, sets, lists, functions and relations, the book advances further into program theory, the heart of the book. Subsequent chapters may be selected or omitted according to course emphasis. The text will be useful to students in courses on programming methodology or verification at the advanced undergraduate or beginning graduate level, as well as for software engineers in the field. All technical terms are explained and then demonstrated in the book wherever possible. No advanced mathematical knowledge or programming language is assumed.The book contains numerous exercises and worked-out solutions for specific exercises. Transparency masters and solutions for the remaining exercises are available from the author.
1 Basic Theories.- Boolean Theory.- Number Theory.- Character Theory.- 2 Basic Data Structures.- Bunch Theory.- Set Theory.- String Theory.- List Theory.- 3 Function Theory.- Functions.- Quantifiers.- Function Fine Points.- 4 Program Theory.- Specifications.- Program Development.- Time.- Robustness.- Refinement in Place.- 5 Programming Language.- Scope.- Data Structures.- Control Structures.- Time Dependence.- Assertions.- Subprogram.- Alias.- Functional Programming.- 6 Recursive Definition.- Recursive Data Definition.- Recursive Program Definition.- Limits.- 7 Theory Design and Implementation.- Data Theories.- Program Theories.- Specification by Implementation.- 8 Concurrency.- Independent Composition.- Circuit Design.- Found Concurrency.- 9 Communication.- Implementability.- Input and Output.- Recursively Defined Communication.- Input Composition.- Reaction Controller.- Communicating Processes.- Power Series Multiplication.- 10 Exercises.- Basic Theories.- Basic Data Structures.- Function Theory.- Program Theory.- Programming Language.- Recursive Definition.- Theory Design and Implementation.- Concurrency.- Communication.- 11 Reference.- Justifications.- Sources.- Axioms and Laws.- Symbols and Names.- Precedence.