Logic is not programming...this is coming from a mathematician. I am specifically interested in computational problems. That doesn't make me right by default, but feel my reasons do.
What most engineers and hopefully computer scientists are exposed to in terms of math is more or less not what I consider math. Most working mathematicians do not 'do' anything resembling calculus, or diff eq, or what have you. What we do is derive theorem X and prove. That is what math is...an exercise in logic.
I would say that where computer science uses logic is in its fundamentals such as the theory of computation, but you could also argue that that is math.
Nobody I know that writes any code, actually sits down and tries to do a tree diagram, or actually prove their code does what they claim. Maybe there is a world of coders I don't know about?
Does anybody ever write in their comments:
Premises X, Y, and Z
Claim: If X, Y and Z are true, then function do_stuff(var x, var y, var z) will return whatever.
proof: Suppose X, Y and Z are true.
lots of words...
conclusion...
No! Nobody does that with code.
But that is what logic is. It is a formal method that makes our thoughts and ideas clear and explicit and allows for no unchecked inferential steps. If coders did this, there should in principle be no mistakes in any program. But that is not really a practical way to write code.
http://en.wikipedia.org/wiki/Logic
In philosophy, Logic (from the Greek λογική logikē[1] is the formal systematic study of the principles of valid inference and correct reasoning. Logic is used in most intellectual activities, but is studied primarily in the disciplines of philosophy, mathematics, semantics, and computer science.