On a categorical and logical model of data structures