This book describes some basic principles that allow developers of computer programs (computer scientists, software engineers, programmers) to clearly think about the artifacts they deal with in their daily work: data types, programming languages, programs written in these languages that compute wanted outputs from given inputs, and programs that describe continuously executing systems.
The core message is that clear thinking about programs can be expressed in a single, universal language, the formal language of logic. Apart from its universal elegance and expressiveness, this “logical” approach to the formal modeling of, and reasoning about, computer programs has another advantage: due to advances in computational logic (automated theorem proving, satisfiability solving, model checking), nowadays much of this process can be supported by software.
This book therefore accompanies its theoretical elaborations by practical demonstrations of various systems and tools that are based on or make use of the presented logical underpinnings.
AI Reading Assistant
Whole-book reading guide from stratified index samples; jump to passages in the text
Tip the Site
Support this siteYour recognition and a small knowledge-service contribution help keep this technical work open source.Scan the WeChat Pay or Alipay code below. Logged-in and guest visitors can both tip.
WeChat Pay
Alipay
Open WeChat or Alipay and scan. No login required.
AI guide
# Thinking Programs: Logical Modeling and Reasoning About Languages, Data, Computations, and Executions (2nd ed.)
## 【One-Line Pitch】
A rigorous, logic-first tour of how to formally model and reason about the artifacts programmers work with daily—data types, programming languages, programs, and concurrent systems—using first-order logic as the universal language, with practical tool demonstrations throughout. Ideal for computer science students, software engineers, and anyone who wants to move beyond hand-waving about program correctness into precise, machine-checkable thinking.
## 【Book Arc】
- **Opening (~0%–9%)**: The book opens with the core thesis—clear thinking about programs requires a suitable mental framework, and the formal language of logic is that framework. It positions logic as the "lingua franca" for modeling, specifying, and reasoning about software artifacts, and previews the two-part structure: foundations first, then applications.
- **Early (~17%–30%)**: The preface to the second edition explains what changed from the first edition (typography, corrections, new software appendices) and emphasizes why the topic remains urgent: with AI-generated code on the rise, humans still need to evaluate correctness—and logic remains the primary tool for that. The revised preface then lays out the book's three core goals: modeling (giving syntax precise meaning), specifying (constraining behavior), and reasoning (proving constraints hold).
- **Middle (~35%–48%)**: Part I establishes the foundations. Chapter 1 introduces the fundamental triad—grammars, type systems, and semantics functions—plus structural induction. Chapters 2–5 then elaborate: first-order logic (syntax and semantics), the sequent calculus for proof construction, building models/theories, and recursion (inductive and coinductive definitions via fixed-point theory). The author advises studying Chapter 1 carefully but allows skipping ahead.
- **Middle (~48%–57%)**: Part II applies the foundations to real programming artifacts. Chapter 6 covers abstract data types—specifying them with logical axioms, distinguishing generated/free vs. cogenerated/cofree models, and composing specifications. Chapter 7 gives programming languages formal semantics via denotational (functional and relational) and operational approaches, proving their equivalence and modeling translation to machine language plus procedures.
- **Late (~57% onward)**: The book culminates in verification and concurrency. Chapter 8 presents the Hoare calculus, Dijkstra's predicate transformers, and a relational calculus for program verification, with heavy emphasis on the pragmatics of loop invariants and termination measures. Chapter 9 extends the command language to concurrent and distributed systems, giving semantics via labeled transition systems and extending first-order logic for specifying system properties.
## 【Key Takeaways】
- **Logic is the universal language for program thinking** (Early): The book's central claim is that first-order logic can uniformly express modeling, specification, and reasoning about all programming artifacts—from data types to concurrent systems. This matters because it gives practitioners one consistent mental framework instead of ad-hoc reasoning.
- **Syntax gets meaning through a three-part recipe** (Middle): Any formal language can be defined by a grammar (structure), a type system (well-formedness), and a semantics function (mapping phrases to mathematical objects). This denotational-semantics approach is applied uniformly throughout the book, starting with logic itself.
- **First-order logic is the "lingua franca"** (Middle): The book deliberately focuses on classical first-order predicate logic rather than exotic variants, because it's the common currency of formal modeling and reasoning tools today. Understanding its syntax, semantics, and proof theory is the prerequisite for everything that follows.
- **Proofs are constructed, not just discovered** (Middle): The sequent calculus is presented as a formal framework for proof construction—a systematic, rule-based approach that can be mechanized. This bridges the gap between "intuitive" mathematical proof and what automated theorem provers actually do.
- **Recursion needs fixed-point theory** (Middle): Inductive and coinductive definitions of functions and relations are given a rigorous semantics via fixed-point theory. This is foundational for understanding both recursive data types and infinite behaviors in concurrent systems.
- **Program verification is a calculus, not a mystery** (Late): The Hoare calculus and Dijkstra's predicate transformers turn program correctness into a formal game: you derive proof obligations from code and specifications. The practical bottleneck is human creativity—devising loop invariants and termination measures—not the logic itself.
- **Concurrency demands new semantics** (Late): Concurrent and distributed systems get their meaning via labeled transition systems, with properties specified by extending first-order logic (e.g., with temporal operators). This is where the book's unified approach pays off: the same logical toolkit scales from simple commands to reactive systems.
## 【Reading Tips】
- **Study Chapter 1 carefully; skim Chapters 2–5 on first pass**: The author explicitly says the foundations can be consulted on demand. If you're here for program verification and concurrency, get the grammar/type/semantics triad down, then jump to Part II and return to logic details as needed.
- **Don't skip the software appendices**: Each chapter ends with practical tool demonstrations (SLANG for language prototyping, RISCAL for model checking and proof-based reasoning, TLA+ for system analysis). These ground the theory in working systems—especially valuable if you want to actually use these techniques.
- **Expect a mathematical reading experience**: This is not a casual programming book. The prose is dense with formal notation, and the author assumes comfort with mathematical abstraction. Read with paper and pencil; work through the definitions and proofs rather than skimming.
- **For verification pragmatics, focus on Chapter 8's examples**: The chapter explicitly includes several concrete verification examples showing how to devise loop invariants and termination measures. These are the transferable skills—the calculi themselves are mechanical once you have the right annotations.
- **The second edition updates matter**: If you've read the first edition, the new material includes SLANG for language semantics, RISCTP for automated theorem proving, and an internal LTL model checker in RISCAL. These are the "time-dependent" parts worth revisiting.
## 【Coverage Limits】
The excerpts cover the book's structure, motivation, and chapter-level content in detail, but do not include actual technical content from the chapters (definitions, proofs, examples, or tool demonstrations). Specific figures, formal systems, and worked examples are not covered here.
##
Page 3
tion” provides a platform devoted to reflect this evolution. In addition to reporting on developments in the field, the focus of the series also includes app...
and comprehensive way. I wish the book a wide distribution. Given the outstanding didactic qualification of Wolfgang Schreiner, I am sure that the book will...
nd, i.e., a language to appropriately express this thinking. The core message that we want to convey is that clear thinking about programs can be expressed i...
quent calculus as a formal framework for proof construction. Chapter 4 “Building Models” describes how with the language of logic models of reality (theories...
systems (models) to more concrete systems (implementations). xiv Revised Preface to the First Edition Altogether these chapters thus present the syntax and s...
olic” or “mathematical”) logic occurred at much later times. The roots of logic in the “Western” world (there have been alternative “Eastern” traditions in I...
Support this siteYour recognition and a small knowledge-service contribution help keep this technical work open source.
Scan the WeChat Pay or Alipay code below. Logged-in and guest visitors can both tip.
WeChat PayAlipay
Open WeChat or Alipay and scan. No login required.
Add Tag
Enter tag name (max 50 characters)
Share E-Book
Thinking Programs Logical Modeling and Reasoning About Languages, Data, Computations, and Executions, 2nd ed. (Wolfgang Schreiner)(Z-Library)
Scan QR code with your phone to access
Copy the link or scan the QR code to access this e-book on your phone
Share E-Book via Email
Please enter email address
Donation Statistics
¥.00
Total Donations
0
Donation Count
Thinking Programs Logical Modeling and Reasoning About Languages, Data, Computations, and Executions, 2nd ed. (Wolfgang Schreiner)(Z-Library)
Find Your Favorite Books
Only registered users can comment after logging in. Comments need to be reviewed by administrators before being displayed
Loading comments...
Reply to Comment
Edit Comment