The logic of empirical theories