Dedekind and Hilbert on the foundations of the deductive sciences