# Logic for Programmers Update

I spent the early week recovering and the later week working on Logic for Programmers ([init] [update]) because I have a self-imposed deadline of mid-July, backed up by a $1000 toxx clause. Here's where I currently am:

1: The book is now 14k words. About 4k are "basics", covering propositional logic, predicate logic, and set theory. Another 1500 words or so are things like the introduction, appendixes, and preliminary exercises. The rest is "techniques". I'm hoping for 20k words for the pre-alpha first draft.

(I shared an early version of the "basics" on my patreon.)

2: Based on some feedback from Saul Pwanson, I've organized each "technique" as a three parter: first a common programming situation, then how logic applies, then something cool that knowing logic enables. For example, testing → specifications of functions → property testing. The other techniques are

- Functional correctness → contracts
- Data invariants → stronger database constraints
- Case coverage → decision tables
- Conditionals → simplifying conditionals

The last "technique" is an overview of tools that you need some knowledge of logic to start using in the first place: constraint solving, logic programming, formal verification, formal specification. I'm trying to decide if-and-how to cover Z3 and SAT solving, **or if there's anything else I'm missing.**

2.5: Two techniques I haven't written about but think could be good material: state invariants, modeling requirements. Not sure about the best approaches to either. **I'm also looking for other possible applications of logic in general.** The key is that it can't just be something that logic helps you appreciate, logic has to help you do it *better*.

3: Beyond adding those new sections, I want to have more details of technique, more examples, and some exercises. I don't know the right proportion of them yet.

I wrote a special exercise directive: for html, it puts the solution in a dropdown, while for pdfs it puts it in the back of the book. I really like how Sphinx supports these kinds of extensions, though I wish the ecosystem was a little more robust (or the docs better).

4: I think that when the alpha version is out in July, the book is about 40% done. This is because I suspect that reader feedback will lead to a lot of revisions and improvements to the content, as well as ideas for new technique chapters. After that's incorporated, it's 80% done, and that's when I'll figure out nice typesetting and a good cover image.

5: There's now a leanpub page. I wanted to figure out the logistics of distribution early. Please do not buy it yet.

Have a great weekend!

*If you're reading this on the web, you can subscribe here. Updates are once a week. My main website is here.*