getSpecDef :: LIB_ITEM -> [SPEC]
getSpecDef li = case li of
  Spec_defn _ _ as _ -> [item as]
  View_defn _ _ (View_type s1 s2 _) _ _ -> [item s1, item s2]
  Entail_defn _ (Entail_type s1 s2 _) _ -> getOms s1 ++ getOms s2
  Equiv_defn _ (Equiv_type s1 s2 _) as _ ->
    getOms s1 ++ getOms s2 ++ getOms as
  Align_defn _ _ (View_type s1 s2 _) _ _ _ -> [item s1, item s2]
  Module_defn _ (Module_type s1 s2 _) _ _ -> [item s1, item s2]
  _ -> []
getSpecDef :: LIB_ITEM -> [SPEC]
getSpecDef li = case li of
  Spec_defn _ _ as _ -> [item as]
  View_defn _ _ (View_type s1 s2 _) _ _ -> [item s1, item s2]
  Entail_defn _ (Entail_type s1 s2 _) _ -> getOms s1 ++ getOms s2
  Equiv_defn _ (Equiv_type s1 s2 _) as _ ->
    getOms s1 ++ getOms s2 ++ getOms as
  Align_defn _ _ (View_type s1 s2 _) _ _ _ -> [item s1, item s2]
  Module_defn _ (Module_type s1 s2 _) _ _ -> [item s1, item s2]
  _ -> []
getSpecDef li = case li of
  Spec_defn _ _ as _ -> [item as]
  View_defn _ _ (View_type s1 s2 _) _ _ -> [item s1, item s2]
  Entail_defn _ (Entail_type s1 s2 _) _ -> getOms s1 ++ getOms s2
  Equiv_defn _ (Equiv_type s1 s2 _) as _ ->
    getOms s1 ++ getOms s2 ++ getOms as
  Align_defn _ _ (View_type s1 s2 _) _ _ _ -> [item s1, item s2]
  Module_defn _ (Module_type s1 s2 _) _ _ -> [item s1, item s2]
  _ -> []