This could use review.  Here I state relationships between coretypes as to which we should feel comfortable turning into others.  We find lowest common dshapes (see below) using a toposort.