The foundations of logic