LogicStructured.hs revision be35c71576ae303352ee31d43418f4f2dacd6137
9ebbce450fb242e1a346f9f89367d8c46fcb2ec8Andy Gimblett------------------------------------------------------------------------------
9ebbce450fb242e1a346f9f89367d8c46fcb2ec8Andy Gimblett-- Authors: Pascal Schmidt
9ebbce450fb242e1a346f9f89367d8c46fcb2ec8Andy Gimblett------------------------------------------------------------------------------
9ebbce450fb242e1a346f9f89367d8c46fcb2ec8Andy Gimblett Anpassung f�r logic_code
9ebbce450fb242e1a346f9f89367d8c46fcb2ec8Andy Gimblettmodule LogicStructured ( -- AS_Structured.SPEC -> Maybe G_Sublogics
9ebbce450fb242e1a346f9f89367d8c46fcb2ec8Andy Gimblett min_sublogic_spec,
34a4c8c6f861104cdc198282f30fae36cf3858adAndy Gimblett -- AS_Library.LIB_DEFN -> Maybe G_Sublogics
2cf5a456da8bb3a2bbb695414d8304426e3bd277Andy Gimblett min_sublogic_lib
b6499fa6826cfdc288dc841be705aab6e4cc6c95Andy Gimblettimport AS_Structured
b6499fa6826cfdc288dc841be705aab6e4cc6c95Andy Gimblettimport AS_Architecture
b6499fa6826cfdc288dc841be705aab6e4cc6c95Andy Gimblettimport qualified AS_Library
b6499fa6826cfdc288dc841be705aab6e4cc6c95Andy Gimblettimport AS_Annotation
b6499fa6826cfdc288dc841be705aab6e4cc6c95Andy Gimblettimport Grothendieck
b6499fa6826cfdc288dc841be705aab6e4cc6c95Andy Gimbletttop_logics :: Maybe G_sublogics -> Maybe G_sublogics -> Maybe G_sublogics
2cf5a456da8bb3a2bbb695414d8304426e3bd277Andy Gimbletttop_logics Nothing _ = Nothing
34a4c8c6f861104cdc198282f30fae36cf3858adAndy Gimbletttop_logics _ Nothing = Nothing
34a4c8c6f861104cdc198282f30fae36cf3858adAndy Gimbletttop_logics (Just (G_sublogics a (al::sublogics))) (Just (G_sublogics b bl)) =
34a4c8c6f861104cdc198282f30fae36cf3858adAndy Gimblett if ((language_name a)==(language_name b)) then
2cf5a456da8bb3a2bbb695414d8304426e3bd277Andy Gimblett case coerce a b bl::Maybe sublogics of
34a4c8c6f861104cdc198282f30fae36cf3858adAndy Gimblett Just bl1 -> Just (G_sublogics a (meet al bl1))
34a4c8c6f861104cdc198282f30fae36cf3858adAndy Gimblett Nothing -> Nothing
34a4c8c6f861104cdc198282f30fae36cf3858adAndy Gimblett-- dummy version of above function
34a4c8c6f861104cdc198282f30fae36cf3858adAndy Gimbletttop_logics :: Maybe G_sublogics -> Maybe G_sublogics -> Maybe G_sublogics
34a4c8c6f861104cdc198282f30fae36cf3858adAndy Gimbletttop_logics Nothing _ = Nothing
fe9b4842ac7b63bc2a5042ae829759e2874acd05Andy Gimbletttop_logics _ Nothing = Nothing
fe9b4842ac7b63bc2a5042ae829759e2874acd05Andy Gimbletttop_logics (Just a) (Just b) = Just a
34a4c8c6f861104cdc198282f30fae36cf3858adAndy Gimblettmap_logics :: [Maybe G_sublogics] -> Maybe G_sublogics
34a4c8c6f861104cdc198282f30fae36cf3858adAndy Gimblettmap_logics [] = Nothing
34a4c8c6f861104cdc198282f30fae36cf3858adAndy Gimblettmap_logics (h:t) = foldr top_logics h t
34a4c8c6f861104cdc198282f30fae36cf3858adAndy Gimblett-- functions on datatypes from AS_Structured
34a4c8c6f861104cdc198282f30fae36cf3858adAndy Gimblettsl_spec :: SPEC -> Maybe G_sublogics
34a4c8c6f861104cdc198282f30fae36cf3858adAndy Gimblettsl_spec (Basic_spec (G_basic_spec i b)) =
34a4c8c6f861104cdc198282f30fae36cf3858adAndy Gimblett Just (G_sublogics i (min_sublogic_basic_spec i b))
34a4c8c6f861104cdc198282f30fae36cf3858adAndy Gimblettsl_spec (Translation s r) = top_logics (sl_spec $ item s) (sl_renaming r)
34a4c8c6f861104cdc198282f30fae36cf3858adAndy Gimblettsl_spec (Reduction s r) = top_logics (sl_spec $ item s) (sl_restriction r)
34a4c8c6f861104cdc198282f30fae36cf3858adAndy Gimblettsl_spec (Union l _) = map_logics $ map sl_spec $ map item l
34a4c8c6f861104cdc198282f30fae36cf3858adAndy Gimblettsl_spec (Extension l _) = map_logics $ map sl_spec $ map item l
34a4c8c6f861104cdc198282f30fae36cf3858adAndy Gimblettsl_spec (Free_spec s _) = sl_spec $ item s
b6499fa6826cfdc288dc841be705aab6e4cc6c95Andy Gimblettsl_spec (Local_spec a b _) = top_logics (sl_spec $ item a)
b6499fa6826cfdc288dc841be705aab6e4cc6c95Andy Gimblett (sl_spec $ item b)
b6499fa6826cfdc288dc841be705aab6e4cc6c95Andy Gimblettsl_spec (Group s _) = sl_spec $ item s
b6499fa6826cfdc288dc841be705aab6e4cc6c95Andy Gimblettsl_spec (Spec_inst _ l) = map_logics $ map sl_fit_arg $ map item l
b6499fa6826cfdc288dc841be705aab6e4cc6c95Andy Gimblettsl_spec (Qualified_spec _ s _) = sl_spec $ item s
34a4c8c6f861104cdc198282f30fae36cf3858adAndy Gimblettsl_renaming :: RENAMING -> Maybe G_sublogics
34a4c8c6f861104cdc198282f30fae36cf3858adAndy Gimblettsl_renaming (Renaming l _) = map_logics $ map sl_g_mapping l
34a4c8c6f861104cdc198282f30fae36cf3858adAndy Gimblettsl_restriction :: RESTRICTION -> Maybe G_sublogics
34a4c8c6f861104cdc198282f30fae36cf3858adAndy Gimblettsl_restriction (Hidden l _) = map_logics $ map sl_g_hiding l
34a4c8c6f861104cdc198282f30fae36cf3858adAndy Gimblettsl_restriction (Revealed l _) = sl_g_symb_map_items_list l
34a4c8c6f861104cdc198282f30fae36cf3858adAndy Gimblettsl_g_mapping :: G_mapping -> Maybe G_sublogics
34a4c8c6f861104cdc198282f30fae36cf3858adAndy Gimblettsl_g_mapping (G_symb_map l) = sl_g_symb_map_items_list l
b6499fa6826cfdc288dc841be705aab6e4cc6c95Andy Gimblettsl_g_mapping (G_logic_translation c) = sl_logic_code c
b6499fa6826cfdc288dc841be705aab6e4cc6c95Andy Gimblettsl_g_hiding :: G_hiding -> Maybe G_sublogics
b6499fa6826cfdc288dc841be705aab6e4cc6c95Andy Gimblettsl_g_hiding (G_symb_list l) = sl_g_symb_items_list l
2cf5a456da8bb3a2bbb695414d8304426e3bd277Andy Gimblettsl_g_hiding (G_logic_projection c) = sl_logic_code c
9ebbce450fb242e1a346f9f89367d8c46fcb2ec8Andy Gimblett-- is this how Logic_code should go into the sublogics calculation,
9ebbce450fb242e1a346f9f89367d8c46fcb2ec8Andy Gimblett-- the target logic taking precedence if given, then the encoding
4690e532c5ebfbf9d71880a5c912ce09ab1fa2feAndy Gimblett-- if it is given (gives more precise logic than source logic because it
4690e532c5ebfbf9d71880a5c912ce09ab1fa2feAndy Gimblett-- also knows the sublogic involved), then source logic with least
4690e532c5ebfbf9d71880a5c912ce09ab1fa2feAndy Gimblett-- precedence?
34a4c8c6f861104cdc198282f30fae36cf3858adAndy Gimblettsl_logic_code :: Logic_code -> Maybe G_sublogics
34a4c8c6f861104cdc198282f30fae36cf3858adAndy Gimblettsl_logic_code (Logic_code t n m _) =
9ebbce450fb242e1a346f9f89367d8c46fcb2ec8Andy Gimblett if (isJust m) then
9ebbce450fb242e1a346f9f89367d8c46fcb2ec8Andy Gimblett sl_logic_name $ fromJust m
9ebbce450fb242e1a346f9f89367d8c46fcb2ec8Andy Gimblett if (isJust t) then
9ebbce450fb242e1a346f9f89367d8c46fcb2ec8Andy Gimblett sl_encoding $ fromJust t
b5301fa0ef9e88a488e5cfe8c395a05c2f6884d3Andy Gimblett if (isJust n) then
b5301fa0ef9e88a488e5cfe8c395a05c2f6884d3Andy Gimblett sl_logic_name $ fromJust n
fe9b4842ac7b63bc2a5042ae829759e2874acd05Andy Gimblett-- is the encoding really a sublogic name?
fe9b4842ac7b63bc2a5042ae829759e2874acd05Andy Gimblettsl_encoding :: Token -> Maybe G_sublogics
b6499fa6826cfdc288dc841be705aab6e4cc6c95Andy Gimblettsl_encoding x = logic_from_sublogic_name $ tokStr x
b6499fa6826cfdc288dc841be705aab6e4cc6c95Andy Gimblett-- is Logic_name t1 (maybe t2) meant as t1 being a language_name
b6499fa6826cfdc288dc841be705aab6e4cc6c95Andy Gimblett-- and t2 being a sublogic_name?
b6499fa6826cfdc288dc841be705aab6e4cc6c95Andy Gimblettsl_logic_name :: Logic_name -> Maybe G_sublogics
34a4c8c6f861104cdc198282f30fae36cf3858adAndy Gimblettsl_logic_name (Logic_name t Nothing) = logic_from_name $ tokStr t
34a4c8c6f861104cdc198282f30fae36cf3858adAndy Gimblettsl_logic_name (Logic_name t (Just e)) = sl_encoding e
34a4c8c6f861104cdc198282f30fae36cf3858adAndy Gimblett-- if I get this right, these function would have to iterate over
9890f5274aa35d7b8c073cd5bbc3c4028b18dc7dAndy Gimblett-- all instances of Logic and check whether the given encoding
34a4c8c6f861104cdc198282f30fae36cf3858adAndy Gimblett-- string is a member of all_sublogics of the Logic, then run some
34a4c8c6f861104cdc198282f30fae36cf3858adAndy Gimblett-- function turning that sublogic name back into a sublogic type?
34a4c8c6f861104cdc198282f30fae36cf3858adAndy Gimblett-- That would make these: (logic_from_name, logic_from_sublogic_name)
34a4c8c6f861104cdc198282f30fae36cf3858adAndy Gimblett-- And then, how do we iterate over all members of a class?
34a4c8c6f861104cdc198282f30fae36cf3858adAndy Gimblett-- Otherwise, to avoid these somewhat ugly (Maybe type) functions,
34a4c8c6f861104cdc198282f30fae36cf3858adAndy Gimblett-- Logic_code/name would have to use something like
34a4c8c6f861104cdc198282f30fae36cf3858adAndy Gimblett-- Logic_code (Maybe sublogics) (Maybe id) (Maybe id) [Pos]
34a4c8c6f861104cdc198282f30fae36cf3858adAndy Gimblett-- Logic_name id (Maybe sublogics)
34a4c8c6f861104cdc198282f30fae36cf3858adAndy Gimblett-- one of the functions needed for string to logic conversion
34a4c8c6f861104cdc198282f30fae36cf3858adAndy Gimblett-- should return (id,sub) with
ae6d8241c2ce8132a6e22d9f854edb612c2f637dAndy Gimblett-- id = which logic it is
ae6d8241c2ce8132a6e22d9f854edb612c2f637dAndy Gimblett-- sub = top sublogic for the logic
b6499fa6826cfdc288dc841be705aab6e4cc6c95Andy Gimblettlogic_from_name :: String -> Maybe G_sublogics
ae6d8241c2ce8132a6e22d9f854edb612c2f637dAndy Gimblettlogic_from_name s = Nothing
ae6d8241c2ce8132a6e22d9f854edb612c2f637dAndy Gimblett-- another needed function
ae6d8241c2ce8132a6e22d9f854edb612c2f637dAndy Gimblett-- should return (id,sub) with
ae6d8241c2ce8132a6e22d9f854edb612c2f637dAndy Gimblett-- sub = sublogic to be found identifical in name to string
b5301fa0ef9e88a488e5cfe8c395a05c2f6884d3Andy Gimblett-- id = logic in which this sublogic resides
b6499fa6826cfdc288dc841be705aab6e4cc6c95Andy Gimblettlogic_from_sublogic_name :: String -> Maybe G_sublogics
b6499fa6826cfdc288dc841be705aab6e4cc6c95Andy Gimblettlogic_from_sublogic_name s = Nothing
b5301fa0ef9e88a488e5cfe8c395a05c2f6884d3Andy Gimblettsl_g_symb_items_list :: G_symb_items_list -> Maybe G_sublogics
b5301fa0ef9e88a488e5cfe8c395a05c2f6884d3Andy Gimblettsl_g_symb_items_list (G_symb_items_list i l) =
b5301fa0ef9e88a488e5cfe8c395a05c2f6884d3Andy Gimblett Just (G_sublogics i (foldr meet top ((map (min_sublogic_symb_items i)) l)))
b6499fa6826cfdc288dc841be705aab6e4cc6c95Andy Gimblettsl_g_symb_map_items_list :: G_symb_map_items_list -> Maybe G_sublogics
b5301fa0ef9e88a488e5cfe8c395a05c2f6884d3Andy Gimblettsl_g_symb_map_items_list (G_symb_map_items_list i l) =
d40dd10adffcf341489a1310092fcc99de75f225Andy Gimblett (G_sublogics i (foldr meet top ((map (min_sublogic_symb_map_items i)) l)))
b6499fa6826cfdc288dc841be705aab6e4cc6c95Andy Gimblettsl_spec_defn :: SPEC_DEFN -> Maybe G_sublogics
b34e5090387d45b3a35f88eaa23477a83d2a2962Andy Gimblettsl_spec_defn (Spec_defn _ g s _) = top_logics (sl_genericity g)
9890f5274aa35d7b8c073cd5bbc3c4028b18dc7dAndy Gimblett (sl_spec $ item s)
fe9b4842ac7b63bc2a5042ae829759e2874acd05Andy Gimblettsl_genericity :: GENERICITY -> Maybe G_sublogics
b6499fa6826cfdc288dc841be705aab6e4cc6c95Andy Gimblettsl_genericity (Genericity p i _) = top_logics (sl_params p) (sl_imported i)
b6499fa6826cfdc288dc841be705aab6e4cc6c95Andy Gimblettsl_params :: PARAMS -> Maybe G_sublogics
9890f5274aa35d7b8c073cd5bbc3c4028b18dc7dAndy Gimblettsl_params (Params l) = map_logics $ map sl_spec $ map item l
b6499fa6826cfdc288dc841be705aab6e4cc6c95Andy Gimblettsl_imported :: IMPORTED -> Maybe G_sublogics
b6499fa6826cfdc288dc841be705aab6e4cc6c95Andy Gimblettsl_imported (Imported l) = map_logics $ map sl_spec $ map item l
b6499fa6826cfdc288dc841be705aab6e4cc6c95Andy Gimblettsl_fit_arg :: FIT_ARG -> Maybe G_sublogics
b6499fa6826cfdc288dc841be705aab6e4cc6c95Andy Gimblettsl_fit_arg (Fit_spec s l _) = top_logics (sl_spec $ item s)
9890f5274aa35d7b8c073cd5bbc3c4028b18dc7dAndy Gimblett (sl_g_symb_map_items_list l)
b6499fa6826cfdc288dc841be705aab6e4cc6c95Andy Gimblettsl_fit_arg (Fit_view _ l _ _) = map_logics $ map sl_fit_arg $ map item l
b6499fa6826cfdc288dc841be705aab6e4cc6c95Andy Gimblettsl_view_defn :: VIEW_DEFN -> Maybe G_sublogics
b6499fa6826cfdc288dc841be705aab6e4cc6c95Andy Gimblettsl_view_defn (View_defn _ g t l _) =
9890f5274aa35d7b8c073cd5bbc3c4028b18dc7dAndy Gimblett map_logics ([sl_genericity g,sl_view_type t] ++ ((map sl_g_mapping) l))
b6499fa6826cfdc288dc841be705aab6e4cc6c95Andy Gimblettsl_view_type :: VIEW_TYPE -> Maybe G_sublogics
9890f5274aa35d7b8c073cd5bbc3c4028b18dc7dAndy Gimblettsl_view_type (View_type a b _) = top_logics (sl_spec $ item a)
fe9b4842ac7b63bc2a5042ae829759e2874acd05Andy Gimblett (sl_spec $ item b)
b6499fa6826cfdc288dc841be705aab6e4cc6c95Andy Gimblett-- functions on datatypes from AS_Library
b6499fa6826cfdc288dc841be705aab6e4cc6c95Andy Gimblettsl_lib_defn :: AS_Library.LIB_DEFN -> Maybe G_sublogics
9890f5274aa35d7b8c073cd5bbc3c4028b18dc7dAndy Gimblettsl_lib_defn (AS_Library.Lib_defn _ l _ _) =
9890f5274aa35d7b8c073cd5bbc3c4028b18dc7dAndy Gimblett map_logics $ map sl_lib_item $ map item l
9890f5274aa35d7b8c073cd5bbc3c4028b18dc7dAndy Gimblett-- Download_items, how can we know the logic of imported stuff?
b6499fa6826cfdc288dc841be705aab6e4cc6c95Andy Gimblettsl_lib_item :: AS_Library.LIB_ITEM -> Maybe G_sublogics
b6499fa6826cfdc288dc841be705aab6e4cc6c95Andy Gimblettsl_lib_item (AS_Library.Spec_defn _ g s _) =
9890f5274aa35d7b8c073cd5bbc3c4028b18dc7dAndy Gimblett top_logics (sl_genericity g) (sl_spec $ item s)
b6499fa6826cfdc288dc841be705aab6e4cc6c95Andy Gimblettsl_lib_item (AS_Library.View_defn _ g t l _) =
b6499fa6826cfdc288dc841be705aab6e4cc6c95Andy Gimblett map_logics ((sl_genericity g):(sl_view_type t):((map sl_g_mapping) l))
9890f5274aa35d7b8c073cd5bbc3c4028b18dc7dAndy Gimblettsl_lib_item (AS_Library.Arch_spec_defn _ s _) = sl_arch_spec $ item s
9890f5274aa35d7b8c073cd5bbc3c4028b18dc7dAndy Gimblettsl_lib_item (AS_Library.Unit_spec_defn _ s _) = sl_unit_spec s
b6499fa6826cfdc288dc841be705aab6e4cc6c95Andy Gimblettsl_lib_item (AS_Library.Download_items _ l _) = Nothing
b6499fa6826cfdc288dc841be705aab6e4cc6c95Andy Gimblettsl_lib_item (AS_Library.Logic n _) = sl_logic_name n
9890f5274aa35d7b8c073cd5bbc3c4028b18dc7dAndy Gimblett-- functions on types from AS_Architecture
9890f5274aa35d7b8c073cd5bbc3c4028b18dc7dAndy Gimblettsl_arch_spec_defn :: ARCH_SPEC_DEFN -> Maybe G_sublogics
9890f5274aa35d7b8c073cd5bbc3c4028b18dc7dAndy Gimblettsl_arch_spec_defn (Arch_spec_defn _ s _) = sl_arch_spec $ item s
b6499fa6826cfdc288dc841be705aab6e4cc6c95Andy Gimblett-- how to handle Arch_spec_name which doesn't have info?
9890f5274aa35d7b8c073cd5bbc3c4028b18dc7dAndy Gimblettsl_arch_spec :: ARCH_SPEC -> Maybe G_sublogics
9890f5274aa35d7b8c073cd5bbc3c4028b18dc7dAndy Gimblettsl_arch_spec (Basic_arch_spec l e _) = map_logics
9890f5274aa35d7b8c073cd5bbc3c4028b18dc7dAndy Gimblett ((sl_unit_expression $ item e):(map sl_unit_decl_defn $ map item l))
9890f5274aa35d7b8c073cd5bbc3c4028b18dc7dAndy Gimblettsl_arch_spec (Arch_spec_name _) = Nothing
9890f5274aa35d7b8c073cd5bbc3c4028b18dc7dAndy Gimblettsl_arch_spec (Group_arch_spec s _) = sl_arch_spec $ item s
b6499fa6826cfdc288dc841be705aab6e4cc6c95Andy Gimblettsl_unit_decl_defn :: UNIT_DECL_DEFN -> Maybe G_sublogics
b6499fa6826cfdc288dc841be705aab6e4cc6c95Andy Gimblettsl_unit_decl_defn (Unit_decl _ s l _) =
b6499fa6826cfdc288dc841be705aab6e4cc6c95Andy Gimblett map_logics ((sl_unit_spec s):(map sl_unit_term $ map item l))
4690e532c5ebfbf9d71880a5c912ce09ab1fa2feAndy Gimblettsl_unit_decl_defn (Unit_defn _ e _) = sl_unit_expression e
4690e532c5ebfbf9d71880a5c912ce09ab1fa2feAndy Gimblettsl_unit_spec_defn :: UNIT_SPEC_DEFN -> Maybe G_sublogics
4690e532c5ebfbf9d71880a5c912ce09ab1fa2feAndy Gimblettsl_unit_spec_defn (Unit_spec_defn _ s _) = sl_unit_spec s
4690e532c5ebfbf9d71880a5c912ce09ab1fa2feAndy Gimblett-- how to handle Spec_name which doesn't have info?
4690e532c5ebfbf9d71880a5c912ce09ab1fa2feAndy Gimblettsl_unit_spec :: UNIT_SPEC -> Maybe G_sublogics
4690e532c5ebfbf9d71880a5c912ce09ab1fa2feAndy Gimblettsl_unit_spec (Unit_type l s _) =
ae6d8241c2ce8132a6e22d9f854edb612c2f637dAndy Gimblett map_logics ((sl_spec $ item s):(map sl_spec $ map item l))
ae6d8241c2ce8132a6e22d9f854edb612c2f637dAndy Gimblettsl_unit_spec (Spec_name _) = Nothing
ae6d8241c2ce8132a6e22d9f854edb612c2f637dAndy Gimblettsl_unit_spec (Arch_unit_spec s _) = sl_arch_spec $ item s
ae6d8241c2ce8132a6e22d9f854edb612c2f637dAndy Gimblettsl_unit_spec (Closed_unit_spec s _) = sl_unit_spec s
4690e532c5ebfbf9d71880a5c912ce09ab1fa2feAndy Gimblettsl_unit_expression :: UNIT_EXPRESSION -> Maybe G_sublogics
4690e532c5ebfbf9d71880a5c912ce09ab1fa2feAndy Gimblettsl_unit_expression (Unit_expression l t _) =
4690e532c5ebfbf9d71880a5c912ce09ab1fa2feAndy Gimblett map_logics ((sl_unit_term $ item t):(map sl_unit_binding l))
4690e532c5ebfbf9d71880a5c912ce09ab1fa2feAndy Gimblettsl_unit_binding :: UNIT_BINDING -> Maybe G_sublogics
4690e532c5ebfbf9d71880a5c912ce09ab1fa2feAndy Gimblettsl_unit_binding (Unit_binding _ s _) = sl_unit_spec s
4690e532c5ebfbf9d71880a5c912ce09ab1fa2feAndy Gimblettsl_unit_term :: UNIT_TERM -> Maybe G_sublogics
4690e532c5ebfbf9d71880a5c912ce09ab1fa2feAndy Gimblettsl_unit_term (Unit_reduction t r) =
4690e532c5ebfbf9d71880a5c912ce09ab1fa2feAndy Gimblett top_logics (sl_unit_term $ item t) (sl_restriction r)
4690e532c5ebfbf9d71880a5c912ce09ab1fa2feAndy Gimblettsl_unit_term (Unit_translation t r) =
4690e532c5ebfbf9d71880a5c912ce09ab1fa2feAndy Gimblett top_logics (sl_unit_term $ item t) (sl_renaming r)
4690e532c5ebfbf9d71880a5c912ce09ab1fa2feAndy Gimblettsl_unit_term (Amalgamation l _) = map_logics $ map sl_unit_term $ map item l
4690e532c5ebfbf9d71880a5c912ce09ab1fa2feAndy Gimblettsl_unit_term (Local_unit l t _) =
4690e532c5ebfbf9d71880a5c912ce09ab1fa2feAndy Gimblett map_logics ((sl_unit_term $ item t):(map sl_unit_decl_defn $ map item l))
4690e532c5ebfbf9d71880a5c912ce09ab1fa2feAndy Gimblettsl_unit_term (Unit_appl _ l _) = map_logics $ map sl_fit_arg_unit l
4690e532c5ebfbf9d71880a5c912ce09ab1fa2feAndy Gimblettsl_unit_term (Group_unit_term t _) = sl_unit_term $ item t
4690e532c5ebfbf9d71880a5c912ce09ab1fa2feAndy Gimblettsl_fit_arg_unit :: FIT_ARG_UNIT -> Maybe G_sublogics
4690e532c5ebfbf9d71880a5c912ce09ab1fa2feAndy Gimblettsl_fit_arg_unit (Fit_arg_unit t l _) =
4690e532c5ebfbf9d71880a5c912ce09ab1fa2feAndy Gimblett top_logics (sl_unit_term $ item t) (sl_g_symb_map_items_list l)
4690e532c5ebfbf9d71880a5c912ce09ab1fa2feAndy Gimblett-- top level stuff for this module
4690e532c5ebfbf9d71880a5c912ce09ab1fa2feAndy Gimblettmin_sublogic_spec = sl_spec
4690e532c5ebfbf9d71880a5c912ce09ab1fa2feAndy Gimblettmin_sublogic_lib = sl_lib_defn