On the replica approach to spin-glass theory