Ask HN: Introductory Logic Text?

4 points by greymalik ↗ HN
I’d like to learn formal logic as a self-guided beginner for the purpose of building a better mathematical foundation (I stopped in high school) and improving my programming.

I was taking a look at Gensler's Introduction to Logic but the reviews suggest that it might be better as a second text than a first. What books can HN recommend instead?

8 comments

[ 0.24 ms ] story [ 28.4 ms ] thread
Logic in Computer Science by Huth and Ryan.
The reviews on that one seem to consistently say it’s not a great first book and is a bit much for an undergraduate. Mathematically I’m effectively at the high school to undergraduate level at best.
I would say this is a great book if you have a bit of CS maturity.

I would start with Logic For Computer Scientists by Uwe Schoening and follow up with Huth & Ryan.

This is the sequence used at Oxford and many German universities.

Schoening's text is short and really friendly, but still rigorous.

Teach Yourself Logic 2020: A Study Guide by Peter Smith is probably your best resource. It isn't a logic book but it explains which ones are good/bad and why. It almost definitely goes past your goals, but the beginner/intermediate sections have a lot of good recommendations.
This is an interesting concept, do you know of any other good “study guide” books ?
Just get the Gensler and see if it works.

You can buy a second hand copy of an older edition for a few dollars.

Maybe you have to read it twice.

So what?

I like The Mathematics of Logic by Richard Kaye. A rather unusual approach apparently intended for college math majors, maybe not for everybody. But I am not a math major and it appealed to me.

https://web.mat.bham.ac.uk/R.W.Kaye/logic (not very helpful, lots of broken links, just look at the book instead)

I also like Logic in Computer Science by Huth and Ryan, cited in another comment here. It is much more comprehensive and has a lot more about logic applications in computer science.

I took a brief look at Gensler's book and it looks interesting!

If you're looking for something good that covers the basics in more detail, I recommend Epp's Discrete Mathematics with Applications. This covers material like truth tables, valid and invalid arguments, quantifiers, etc.

In addition to the treatment of logic, it also has chapters on induction, combinatorics, graphs and trees, analysis of algorithms, finite state automata, etc.

I chose this book when I taught a college course in "math for computer science majors", and it was a great choice overall. It's probably the most beginner-friendly of any book covering this material, and it's extremely organized and well written. Costs an arm and a leg to buy new, so buy a used copy of an older edition.