Sloshing of a two-layer liquid with free surface: Hamiltonian formulation of the problem and laboratory experiments