Leanpub Header

Skip to main content

Program Synthesis & Neurosymbolic Reasoning: A Foundation for General Intelligence

Exploring a New Field of AI Using Racket Scheme examples

Program Synthesis & Neurosymbolic Reasoning: A Foundation for General Intelligence
This book is 100% completeLast updated on 2026-10-12

Minimum price

$19.00

$29.00

You pay

Author earns

$

Also available for 1 book credit with a Reader Membership

PDF
EPUB
WEB
APP
About

About

About the Book

Give a program six noisy measurements of planetary orbits and ask it to explain them. A neural network will fit a curve that holds only where you took samples. The system you build in Chapter 8 of this book returns Kepler's third law, T² = a³, as a line of code that holds for every planet, including ones it never saw. This book is about building systems that return programs instead of predictions: programs short enough to read, exact enough to verify, and general enough to apply to cases outside the training data.

You learn by running working code. Every chapter is a set of complete Racket programs that need no external packages and run in about a second. Each one prints a trace of its own search, so you can watch candidate programs get proposed, tested and rejected. You will build a Flash Fill-style synthesizer that holds 1.2 billion candidate programs after one example and cuts them to 7,056 after a second. You will also build a CEGIS loop that finds the right program from two well-chosen examples, small versions of four real neurosymbolic architectures, and a benchmark harness that measures whether a system generalizes or only memorizes. If you can write a recursive function, you can follow every chapter.

The timing matters. Today's strongest AI systems pair a large language model that proposes answers with a symbolic checker that verifies them. FunSearch found new mathematics this way, AlphaProof reached silver-medal standard at the International Mathematical Olympiad, and on the ARC-AGI-2 benchmark the same LLM scores 31% alone and 54% inside a propose-and-verify loop. This book teaches the search, logic and verification that make that pairing work, and shows you where the learned model fits in. When you finish, you will understand why these systems succeed and be able to build small ones yourself.

Share this book

Author

About the Author

Mark Watson

Mark Watson is a consultant specializing in LLMs, deep learning, machine learning, knowledge graphs, and general artificial intelligence software development. He uses Common Lisp, Clojure, Python, Java, Haskell, and Ruby for development.

He is the author of 20+ published books on Artificial Intelligence, Deep Learning, Java, Ruby, Machine Learning, Common LISP, Clojure, JavaScript, Semantic Web, NLP, C++, Linux, and Scheme. He has 55 US Patents.

Mark's consulting customer list includes: Google, Capital One, Olive AI, CompassLabs, Disney, Sitescout.com, Embed.ly, and Webmind Corporation.

Mark wrote ten traditional published books for McGraw Hill, Springer Verlag, J Wiley, and Morgan Kaufman publishers before adopting the LeanPub self-publishing platform.

The Leanpub Podcast

Podcast

Podcast Episode

Contents

Table of Contents

Preface

Part I: Foundations of Symbolic AI and Program Synthesis

Chapter 1: Introduction to Symbolic Reasoning

  1. Propositional and Predicate Logic
  2. Automated Theorem Proving and Logic Programming
  3. Knowledge Representation and Reasoning
  4. Search, Planning, and Constraint Satisfaction
  5. Shared Utilities
  6. Running the Examples

Chapter 2: The Program Synthesis Problem

  1. Enumerative Search: Bottom-Up
  2. Version Space Algebras
  3. Stochastic and Evolutionary Search
  4. Formal Problem Statement
  5. Running the Examples

Part II: Core Methods in Program Synthesis

Chapter 3: Inductive Synthesis & Programming by Example (PBE)

  1. String Transformations with Whole-String Primitives
  2. Version Spaces
  3. Stochastic and Evolutionary Search
  4. Flash Fill in a Toy DSL
  5. The Flash Fill Algorithm: A Version Space Algebra
  6. Running the Examples
  7. Wrap Up

Chapter 4: Deductive Synthesis & Constraint-Based Methods

  1. Programs from Proofs: Deductive Synthesis
  2. Constraint Solving: SAT and SMT
  3. Counter-Example Guided Inductive Synthesis
  4. Syntax-Guided Synthesis and Sketches
  5. Running the Examples
  6. Interpreting the Results
  7. Wrap Up
  8. Optional Practice Problems

Part III: Neurosymbolic Program Synthesis

Chapter 5: The Neurosymbolic Paradigm

  1. Why Deep Learning Alone is Insufficient
  2. The Synergy of Neural Networks and Symbolic Search
  3. Differentiable Reasoning and Logic
  4. Case Study: Compositional Reasoning
  5. Synthesis with Learned Proposers
  6. Running the Examples
  7. Wrap Up

Chapter 6: Neurosymbolic Architectures & Algorithms

  1. Logic Tensor Networks (LTN)
  2. Logical Neural Networks (LNN)
  3. NeurASP: Integrating Answer Set Programming with Neural Networks
  4. Differentiable Inductive Logic Programming (∂ILP)
  5. Running the Examples
  6. Wrap Up

Part IV: Advanced Topics & Applications

Chapter 7: Generalization & Autonomous Skill Acquisition

  1. Generalizing Beyond the Training Distribution
  2. Compositional Abstractions and Reusable Modules
  3. Test-Time Adaptation and Reasoning
  4. Program Synthesis for Autonomous Skill Acquisition
  5. Running the Examples
  6. Wrap Up

Chapter 8: Program Synthesis for Scientific Discovery

  1. Automated Hypothesis Generation and Testing
  2. Data-Efficient Learning for Scientific Domains
  3. Causal and Temporal Reasoning in Synthesis
  4. Case Study: Equation Discovery — Kepler’s Third Law
  5. From Kepler to FunSearch: Synthesis at Research Scale
  6. Running the Examples
  7. Wrap Up

Part V: The Road Ahead

Chapter 9: Benchmarks, Evaluation, and the Path to AGI

  1. Evaluating General Intelligence: Per-Task Metrics
  2. A Key Benchmark: ARC in Miniature
  3. ARC in Practice: Versions, the ARC Prize, and Real Scores
  4. Compositional Generalization: A SCAN-Style Gap
  5. Generalization-Gap Leaderboard
  6. Running the Examples
  7. Wrap Up

Appendix: Essential Tools & Resources

  1. SMT and SAT Solvers
  2. Synthesis Systems and Languages
  3. Neurosymbolic Frameworks
  4. Program Synthesis from Examples
  5. Scientific Discovery
  6. Benchmarks and Evaluation
  7. Key Surveys and Books
  8. A Suggested Path

Also by the Author

Also by the Author

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.)

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.

Learn more about writing on Leanpub