A family walking with a soldier.
The barber cuts a man's hair.
A family walking with a soldier is not the same as a barber cutting one man's hair.
A family isn't a barber, and even if it was, the barber could not cut his hair while walking.
A family with the soldier is different from the barber and the man.