Foundations of Problem-Solving