Type-based data structure verification