Logic and foundations