The idea is called curry-howard Isomorphism that relates languages and logic. The book provides a modern view of the relation,and covers a lot of languages(STLC, polymorphism, lambda cube) and logic(proposition, first-order, high-order).