Logic-Based Therapy and Consultation: Theory and Applications