Download A Practical Theory of Programming by Eric C.R. Hehner PDF

By Eric C.R. Hehner

Figuring out programming and programming languages calls for wisdom of the underlying theoretical version. This publication explores points of programming which are amenable to mathematical facts. the writer describes a programming concept that's a lot less complicated and extra accomplished than the present theories up to now. within the theoretical version, a specification is simply a boolean expression and refinement is simply a normal implication. the writer develops a pragmatic and huge procedure for writing unique standards and designing courses whose executions most likely fulfill the requisites. starting with preparatory fabric in common sense, numbers, units, lists, features and kinfolk, the ebook advances additional into application conception, the center of the e-book. next chapters should be chosen or passed over based on direction emphasis. The textual content should be precious to scholars in classes on programming technique or verification on the complex undergraduate or starting graduate point, in addition to for software program engineers within the box. All technical phrases are defined after which confirmed within the ebook anywhere attainable. No complicated mathematical wisdom or programming language is believed. The ebook comprises a number of routines and worked-out options for particular routines. Transparency masters and options for the rest workouts can be found from the writer.

Show description

Read Online or Download A Practical Theory of Programming PDF

Best children's ebooks books

Michelle Obama: First Lady (Women of Achievement)

During this all-new biography, readers will learn the way Michelle Obama overcame stumbling blocks to be successful and the way her tale is influencing different younger ladies at the present time.

Extra resources for A Practical Theory of Programming

Example text

A computer executes it by behaving according to the solution, and whenever the problem is encountered again, the behavior is again according to the solution. We must prove the refinement, so we do that now. Replace ok ; Substitution Law if x=0 then ok else (x:= x–1. x≥0 ⇒ x′=0) = if x=0 then x′=x else x–1≥0 ⇒ x′=0 use context x=0 to modify the then-part and use context x 0 and x: int to modify the else-part = if x=0 then x≥0 ⇒ x′=0 else x≥0 ⇒ x′=0 Case Idempotence = x≥0 ⇒ x′=0 End of Programs A specification serves as a contract between a client who wants a computer to behave a certain way and a programmer who will program a computer to behave as desired.

The solution quantifier § (“solutions of”, “those”) gives the bunch of solutions of a predicate. Here are the axioms. §v: null· b = null §v: x· b = if 〈v: x→b〉 x then x else null §v: A,B· b = (§v: A· b), (§v: B· b) We have all practiced solving equations, and we are comfortable with “those i in int such that ... ” §i: int· i2 = 4 = –2, 2 Equations are just a special case of boolean expression; we can just as well talk about the solutions of any predicate. 3 Once again, for tradition and convenience, when the solution quantifier is used within a set, we can abbreviate by omitting the quantifier.

Q) ⇐ C⇒P. Q) ∧ C′ ⇐ P. Q) ⇐ C′ ⇐ P. Q⇐C′ P. C∧Q ⇐ P∧C′. Q P. Q ⇐ P∧C′. C⇒Q Precondition Law: C is a sufficient precondition for P to be refined by S if and only if C⇒P is refined by S . Postcondition Law: C′ is a sufficient postcondition for P to be refined by S if and only if C′⇒P is refined by S . 4 Programs A program is a description or specification of computer behavior. A computer executes a program by behaving according to the program, by satisfying the program. People often confuse programs with computer behavior.

Download PDF sample

Rated 4.17 of 5 – based on 21 votes