Algebra and logic