The logic of pragmatics. An experimental investigation with children and adults