- Front Matter
- Front Cover
- Dedication
- Standing Boundary and Copyright Note
- Contents
- Preface — The Architecture Is Making a Claim
- The Reader This Book Assumes
- How the Formal Lenses Work Together
- The NEXUS-1 Architecture Proof Case
- Where This Book Sits in the NEXUS-1 Series
- Part I — The One Object and the One Relation
- Chapter 1 — The Diagram That Cannot Answer
- Chapter 2 — The Transition System as the Only Primitive
- Chapter 3 — Properties Over Runs: Safety and Liveness
- Chapter 4 — Refinement: One Machine Standing In for Another
- Chapter 5 — What This Book Means by “Proof”
- Chapter 6 — A Map of the Six Lenses
- Part II — State Machines, Made Rigorous
- Chapter 7 — States, Transitions, and Forbidden Moves
- Chapter 8 — Aggregates as State Machines
- Chapter 9 — RootCauseCase as a State Machine
- Chapter 10 — Process Managers as State Machines
- Chapter 11 — Observational Equivalence and Bisimulation
- Chapter 12 — From Bisimulation to Refinement
- Part III — Contracts: The Local Lens
- Chapter 13 — Theory Doorway: Preconditions and Postconditions
- Chapter 14 — Commands as Hoare Triples
- Chapter 15 — Application Services as Contract Boundaries
- Chapter 16 — From Contract to Test
- Chapter 17 — Interface Refinement and Versioning
- Part IV — Time and Failure: The Core
- Chapter 18 — Theory Doorway: What Is Temporal Logic?
- Chapter 19 — Safety in Temporal Logic: What Must Never Happen
- Chapter 20 — Liveness and Fairness: What Must Eventually Happen
- Chapter 21 — Theory Doorway: What Is TLA+?
- Chapter 22 — Modelling the Outbox Pattern
- Chapter 23 — Modelling Idempotency
- Chapter 24 — Modelling Eventual Consistency
- Chapter 25 — Modelling Failure and Recovery
- Chapter 26 — Refinement in TLA+
- Part V — Concurrency and Flow
- Chapter 27 — Theory Doorway: What Is a Petri Net?
- Chapter 28 — Reachability, Boundedness, and Liveness
- Chapter 29 — Alarm-to-Root-Cause as a Petri Net
- Chapter 30 — Parallel Reactions to One Event
- Chapter 31 — Deadlock, Waiting, and Compensation
- Chapter 32 — Sagas: Orchestration vs Choreography
- Chapter 33 — Flow Completion vs Failed Flow
- Part VI — Structure and Ownership
- Chapter 34 — Theory Doorway: What Is Relational Logic?
- Chapter 35 — Service Ownership as a Relation
- Chapter 36 — No Service Writes Another’s Private State
- Chapter 37 — Public References vs Private Graphs
- Chapter 38 — Least Privilege as a Relational Invariant
- Chapter 39 — Checking Boundary Violations with Alloy
- Part VII — Meaning Across Boundaries
- Chapter 40 — Theory Doorway: What Is Category Theory?
- Chapter 41 — Bounded Contexts as Worlds of Meaning
- Chapter 42 — Context Maps as Structure-Preserving Mappings
- Chapter 43 — Projections as Structure-Preserving Views
- Chapter 44 — Composition Without Meaning Loss — and the Honest Limit
- Part VIII — Refinement: The Unifying Thread
- Chapter 45 — Decomposition as Joint Refinement
- Chapter 46 — Migration as Refinement
- Chapter 47 — Projections as Refinement Under Staleness
- Chapter 48 — Sagas as Refinement of a Business Transaction
- Chapter 49 — The Refinement Calculus of NEXUS-1
- Part IX — The NEXUS-1 Formal Atlas
- Chapter 50 — The Safety Property Catalogue
- Chapter 51 — The Liveness Property Catalogue
- Chapter 52 — The Invariant Catalogue by Context
- Chapter 53 — The Contract Catalogue
- Chapter 54 — The Consistency Catalogue
- Chapter 55 — The Failure Catalogue
- Chapter 56 — The Ownership Relation Catalogue
- Chapter 57 — The Proof-Oriented Architecture Map
- Chapter 58 — The Refinement Map
- Part X — Honest Boundaries
- Chapter 59 — Model vs Implementation: The Load-Bearing Boundary
- Chapter 60 — Decidability and State Explosion
- Chapter 61 — What Formal Methods Cannot Do
- Chapter 62 — Final Checkpoint: From Flow to Proof
- Back Matter
- Epilogue — The Proof Becomes a Platform
- Sources and Reference Notes
- Glossary
- Mathematical Symbols and Notation
- Index
FROM FLOW TO PROOF
From Flow to Proof turns distributed-system promises into explicit models, properties, counterexamples, and evidence. Explore state machines, contracts, temporal logic, concurrency, ownership, refinement, and honest proof boundaries—with companion artifacts at github.com/gregory82gr/Nexus-1-phase-0.
Minimum price
$219.99
$299.99
You pay
Author earns
About
About the Book
From Flow to Proof is a bridge between advanced software architecture and formal reasoning.
Modern distributed systems make promises that ordinary architecture diagrams cannot fully express. They promise that committed information will not disappear, repeated delivery will not repeat a business effect, temporary inconsistency will not become corrupted truth, ownership boundaries will remain intact, and failures will eventually become either recovery or visible evidence.
These are not merely questions about components, APIs, databases, or message brokers. They are questions about system behavior across time, concurrency, translation, and failure.
This book shows how those architectural promises can be stated explicitly, examined systematically, and supported by evidence.
Using the NEXUS-1 digital twin as a continuous architectural setting, From Flow to Proof explores how complex systems can be understood as stateful models whose transitions, contracts, responsibilities, and failure paths are open to inspection. The purpose is not to turn software architects into academic mathematicians, nor to use formal notation as decoration. The purpose is to give engineers a stronger language for claims that prose, diagrams, and ordinary tests often leave dangerously ambiguous.
The book introduces several complementary ways of examining architecture. State machines make lifecycle and forbidden transitions visible. Contracts clarify what individual operations require and guarantee. Temporal reasoning addresses what must never happen and what must eventually happen. Concurrency models expose parallel behavior, waiting, and possible deadlock. Relational models examine ownership, access, and authority. Meaning-preserving mappings ask whether information remains truthful as it crosses boundaries. Refinement connects these perspectives to a central engineering question:
Can a more detailed implementation safely stand in for the architectural promise made by a simpler specification?
These methods are not presented as disconnected mathematical subjects. They are coordinated around one proof-oriented architectural method and one recurring concern:
What exactly has the system promised, and what evidence justifies believing that the promise survives time, failure, translation, and distribution?
The book remains firmly grounded in software engineering. Formal notation is introduced only after the architectural pressure is visible. Important concepts begin in ordinary language, become explicit models, are connected to realistic distributed-system concerns, and are then challenged through broken cases, counterexamples, or deliberately weakened designs.
The reader is not asked merely to trust a pattern. The reader is asked to understand what the pattern protects, what assumptions it depends on, what evidence supports it, and where its protection ends.
A central discipline of the book is its careful use of the word proof. A checked model is not presented as proof that production code, infrastructure, operators, networks, or the physical world will behave perfectly. Models omit details. Implementations may drift. Tests cover selected executions. Monitoring observes only what has been instrumented.
Formal methods strengthen architectural reasoning, but they do not remove engineering responsibility.
For this reason, From Flow to Proof repeatedly distinguishes model evidence from implementation evidence. It connects specifications to contracts, code, tests, database constraints, execution traces, audit records, and operational observations, while preserving an explicit and honest boundary around every conclusion.
The result is not simply a collection of formulas, notations, and tools. It is a proof-oriented way of thinking about architecture.
By the end of the journey, the reader should be better prepared to ask:
- What states and transitions does this design really permit?
- Which outcomes must never occur?
- Which outcomes must eventually occur?
- What assumptions are hidden inside a reliability claim?
- Who owns each piece of truth?
- Can information cross a boundary without changing its meaning?
- Does the implementation preserve the promise of the model?
- What remains uncertain or unproven?
The objective is not to make architecture sound certain. It is to make architectural confidence more disciplined, reviewable, reproducible, and honest.
Companion Artifacts
The book is supported by practical artifacts available in the NEXUS-1 project repository:
github.com/gregory82gr/Nexus-1-phase-0
Readers can use the repository alongside the book to inspect the technical materials that support its arguments. Depending on the relevant chapter, these materials may include model definitions, executable checks, structured catalogues, code examples, machine-readable records, diagrams, verification inputs, and supporting evidence artifacts.
The repository is not a substitute for the explanations in the book. It is the practical companion to them.
The text explains the architectural pressure, the modelling decision, the property being examined, the assumptions behind it, and the honest boundary of the result. The repository allows the reader to inspect and work with the corresponding artifacts directly.
This combination is important because From Flow to Proof does not ask the reader to accept formal claims only because they appear in print. Where executable or inspectable evidence exists, the reader is encouraged to open it, examine it, modify it, and observe what happens when an assumption, guard, invariant, or relation is removed.
The artifacts also make the book a useful foundation for future automation. Its structured properties, contracts, formal models, counterexamples, catalogues, refinement records, and evidence descriptions can support later work with domain-specific language models and AI-assisted engineering workflows. Such automation must remain governed, evidence-based, and subordinate to deterministic checks and human responsibility.
The intended direction is not artificial authority.
It is artificial assistance with an honest boundary.
Who This Book Is For
This is not an introductory book on programming, databases, or basic software design.
It is written primarily for experienced developers, software architects, technical leads, and engineers working with systems whose behavior extends beyond one process, one database, or one transaction.
The ideal reader may already understand application development, APIs, relational databases, testing, and object-oriented design, but may have little or no previous experience with formal methods. Advanced mathematical knowledge is not assumed. The necessary concepts are introduced gradually and connected to recognizable engineering problems before formal notation is used.
The book is especially relevant for:
- Backend and .NET developers moving toward distributed-system architecture.
- Software architects responsible for reliability, consistency, ownership, and integration boundaries.
- Technical leads reviewing event-driven workflows and microservice decompositions.
- Engineers working with audit-heavy, regulated, safety-adjacent, or high-accountability software.
- Readers who want to understand what formal methods can contribute without pretending they can prove everything.
- Teams exploring model-based verification, continuous architectural evidence, or domain-specific AI assistance.
Readers familiar with Domain-Driven Design, asynchronous messaging, outbox and inbox patterns, sagas, eventual consistency, projections, and independent data ownership will recognize many of the architectural pressures. However, mastery of those topics is not assumed. Where an idea is load-bearing, it is explained or explicitly recalled before being used.
A Word About the Difficulty
This is the most demanding volume in the NEXUS-1 series.
Its difficulty does not come only from mathematical notation. It comes from the need to think about architecture, behavior, time, failure, ownership, concurrency, meaning, and evidence at the same time.
The book deliberately avoids reducing formal methods to a few attractive diagrams or copying tool syntax without explaining the underlying engineering question. It asks the reader to distinguish:
- Safety from liveness.
- Delay from silent loss.
- Temporary inconsistency from corrupted truth.
- Valid abstraction from misleading simplification.
- Model evidence from implementation evidence.
- Confidence from certainty.
That requires patience.
Some chapters are designed to be read slowly. Definitions matter. Assumptions matter. A small change in a property may completely change what has actually been claimed. Readers looking only for quick recipes or a short catalogue of best practices may find the book unusually demanding.
However, the book is designed not to abandon the reader. Important concepts begin with ordinary examples. The same architectural concerns return under different formal lenses. Understanding accumulates instead of restarting with every new notation. Counterexamples are treated as teaching instruments rather than as failures.
The companion repository also gives the reader a practical path beyond the page. Concepts can be connected to concrete artifacts rather than remaining purely theoretical.
Those who complete the journey should gain more than familiarity with particular tools. They should gain a reusable method for turning architectural promises into explicit questions, selecting appropriate evidence, identifying hidden assumptions, exposing counterexamples, and stating conclusions with greater precision.
The book does not promise certainty.
It teaches calibration.
This book is dedicated “… to my parents…”
Author: Grigorios Kyriakos Agathangelidis
Greek name: Γρηγόριος Κυριάκος Αγαθαγγελίδης
Also searchable as: Αγαθαγγελίδης Γρηγόριος, Αγαθαγγελιδης Γρηγοριος, Grigorios Agathangelidis.
Bundle
Bundles that include this book
- Pricing
$399
Minimum priceBought separately$1799.84Suggested price$599
Author
About the Author
Grigorios Agathangelidis is a software architect and engineer with a professional background in both Electrical Engineering and Software Engineering. His work focuses on designing complex systems that remain understandable, auditable, and maintainable as their scale, responsibilities, and operational demands increase.
Rather than treating architecture as a collection of isolated frameworks and technologies, he approaches it as a connected engineering discipline. Domain-Driven Design, C# and .NET, SQL Server, Entity Framework Core, distributed systems, messaging, observability, testing, formal reasoning, and evidence-based design are treated as complementary parts of one architectural method.
He is the creator of NEXUS-1, a browser-based educational digital-twin demonstrator developed to explore complex engineering and software-architecture ideas through one coherent system. The project brings together simulation, instrumentation, alarm management, root-cause analysis, advisory artificial intelligence, reinforcement learning, data architecture, domain modelling, auditability, and distributed-system design. NEXUS-1 is explicitly a Phase-0 educational demonstrator: it is not connected to any real facility, sensor, reactor, or control system and has no operational authority.
Across the NEXUS-1 book series, the same system is examined from several perspectives. Earlier volumes explore the physical model, causal reasoning, interpretable learning, database design, Entity Framework Core, Domain-Driven Design, backend implementation, advanced event flows, and microservice architecture. This continuity allows each new subject to be studied inside an already established world rather than through disconnected examples.
From Flow to Proof extends that journey into formal reasoning. It reflects the author’s interest in making architectural promises more explicit: what a system must never do, what it must eventually do, which context owns each truth, how meaning survives translation, and what evidence supports the claim that an implementation still respects its model.
The book also continues a principle that runs throughout his work: nothing claims to exist that does not. Models are separated from implementations, checked abstractions are not confused with production proof, and every strong conclusion is expected to carry assumptions, evidence, and an honest boundary.
The practical artifacts supporting NEXUS-1 and its companion books are maintained in the public project repository, allowing readers to examine the demonstrator, documentation, models, diagrams, and related technical material alongside the written explanations.
His goal as an author is not simply to explain frameworks, mathematical notation, or architectural patterns. It is to help engineers develop the judgement required to build large systems without losing clarity, accountability, meaning, or intellectual honesty.
Author: Grigorios Kyriakos Agathangelidis
Greek name: Γρηγόριος Κυριάκος Αγαθαγγελίδης
Also searchable as: Αγαθαγγελίδης Γρηγόριος, Αγαθαγγελιδης Γρηγοριος, Grigorios Agathangelidis.
Contents
Table of Contents
Get the free sample chapters
Click the buttons to get the free sample in PDF or EPUB, or read the sample online here
The Leanpub 60 Day 100% Happiness Guarantee
Within 60 days of purchase you can get a 100% refund on any Leanpub purchase, in two clicks.
See full terms...
Earn $8 on a $10 Purchase, and $16 on a $20 Purchase
We pay 80% royalties on purchases of $7.99 or more, and 80% royalties minus a 50 cent flat fee on purchases between $0.99 and $7.98. You earn $8 on a $10 sale, and $16 on a $20 sale. So, if we sell 5000 non-refunded copies of your book for $20, you'll earn $80,000.
(Yes, some authors have already earned much more than that on Leanpub.)
In fact, authors have earned over $15 million writing, publishing and selling on Leanpub.
Learn more about writing on Leanpub
Free Updates. DRM Free.
If you buy a Leanpub book, you get free updates for as long as the author updates the book! Many authors use Leanpub to publish their books in-progress, while they are writing them. All readers get free updates, regardless of when they bought the book or how much they paid (including free).
Most Leanpub books are available in PDF (for computers) and EPUB (for phones, tablets and Kindle). The formats that a book includes are shown at the top right corner of this page.
Finally, Leanpub books don't have any DRM copy-protection nonsense, so you can easily read them on any supported device.
Learn more about Leanpub's ebook formats and where to read them
Write and Publish on Leanpub
You can use Leanpub to easily write, publish and sell in-progress and completed ebooks and online courses!
Leanpub is a powerful platform for serious authors, combining a simple, elegant writing and publishing workflow with a store focused on selling in-progress ebooks.
Leanpub is a magical typewriter for authors: just write in plain text, and to publish your ebook, just click a button. (Or, if you are producing your ebook your own way, you can even upload your own PDF and/or EPUB files and then publish with one click!) It really is that easy.
