Download e-book for iPad: A Practical Theory of Programming by Eric C.R. Hehner

By Eric C.R. Hehner

ISBN-10: 0387941061

ISBN-13: 9780387941066

Figuring out programming and programming languages calls for wisdom of the underlying theoretical version. This booklet explores points of programming which are amenable to mathematical facts. the writer describes a programming conception that's a lot less complicated and extra accomplished than the present theories so far. within the theoretical version, a specification is simply a boolean expression and refinement is simply a standard implication. the writer develops a pragmatic and large approach for writing particular requirements and designing courses whose executions most likely fulfill the requisites. starting with preparatory fabric in good judgment, numbers, units, lists, features and family members, the ebook advances extra into software concept, the guts of the ebook. next chapters might be chosen or passed over in keeping with direction emphasis. The textual content could be helpful 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 tested within the booklet anyplace attainable. No complicated mathematical wisdom or programming language is thought. The e-book comprises quite a few workouts and worked-out ideas for particular routines. Transparency masters and strategies for the remainder workouts can be found from the writer.

Show description

Read or Download A Practical Theory of Programming PDF

Best children's ebooks books

Sri Satya Sai Baba (Spiritual Leaders and Thinkers) - download pdf or read online

A religious chief now operating in India, Sai Baba encourages members to guide entire lives through attaining for his beliefs of affection, peace, nonviolence, and correct behavior.

Download e-book for kindle: Munich and Beyond by Dr. Gabriele

Sightseeing, procuring, eating. greater than 60 million humans from world wide stopover at the capital of Bavaria each year. One cause of the recognition of this dty is the attention-grabbing mix-ture of Bavarian culture and a rare cultural existence plus attention-grabbing procuring amenities. conventional Bavarian surroundings is located on the usual beer gardens.

Additional resources for A Practical Theory of Programming

Sample text

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. They talk about what a program “does”; of course it just sits there on the page or screen; it is the computer that does something.

For x′, y′, ... in S ) ∧ (substitute x′′, y′′, ... for x, y, ... in R ) 37 4 Program Theory Here's an example. In one integer variable x , the specification x′=x ∨ x′=x+1 says that the final value of x is either the same as the initial value or one greater. Let's compose it with itself. x′=x ∨ x′=x+1 . x′=x ∨ x′=x+1 = ∃x′′· (x′′=x ∨ x′′=x+1) ∧ (x′=x′′ ∨ x′=x′′+1) distribute ∧ over ∨ = ∃x′′· x′′=x ∧ x′=x′′ ∨ x′′=x+1 ∧ x′=x′′ ∨ x′′=x ∧ x′=x′′+1 ∨ x′′=x+1 ∧ x′=x′′+1 distribute ∃ over ∨ = (∃x′′· x′′=x ∧ x′=x′′) ∨ (∃x′′· x′′=x+1 ∧ x′=x′′) ∨ (∃x′′· x′′=x ∧ x′=x′′+1) ∨ (∃x′′· x′′=x+1 ∧ x′=x′′+1) One-Point, 4 times = x′=x ∨ x′=x+1 ∨ x′=x+2 If we either leave x alone or add 1 to it, and then again we either leave x alone or add 1 to it, the net result is that we either leave it alone, add 1 to it, or add 2 to it.

It just shows that the Substitution Law applies to ifs. = if y>1 then x:= 2 else x:=y (k) x:= 1. x′>x. x′ = x+1 We can use the Substitution Law on the first two pieces of this dependent composition to obtain = x′>1. x′ = x+1 Now we have to use the axiom for dependent composition to get a further simplification. = ∃x′′, y′′· x′′>1 ∧ x′ = x′′+1 = x′>2 The error we avoided in the first step is to replace x with 1 in the last part of the composition x′ = x+1 . 2 Refinement Two specifications P and Q are equal if and only if each is satisfied whenever the other is.

Download PDF sample

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

by John

Rated 4.88 of 5 – based on 45 votes