A Hierarchical Structure of Type and Mode Analyses of Logic Programs