Comorphism.hs revision 19298cbfd6ee2abd904f3181af7760b965b822c3
e071fb22ea9923a2a4ff41184d80ca46b55ee932Till MossakowskiModule : $Header$
a79fe3aad8743ea57e473ea5f66a723244cb9c0eMarkus RoggenbachCopyright : (c) Till Mossakowski, Uni Bremen 2002-2004
97018cf5fa25b494adffd7e9b4e87320dae6bf47Christian MaederLicence : similar to LGPL, see HetCATS/LICENCE.txt or LIZENZ.txt
b4fbc96e05117839ca409f5f20f97b3ac872d1edTill MossakowskiMaintainer : hets@tzi.de
a79fe3aad8743ea57e473ea5f66a723244cb9c0eMarkus RoggenbachStability : provisional
a79fe3aad8743ea57e473ea5f66a723244cb9c0eMarkus RoggenbachPortability : non-portable (via Logic)
f3a94a197960e548ecd6520bb768cb0d547457bbChristian Maeder Provides data structures for institution comorphisms.
8267b99c0d7a187abe6f87ad50530dc08f5d1cdcAndy Gimblett These are just collections of
a79fe3aad8743ea57e473ea5f66a723244cb9c0eMarkus Roggenbach functions between (some of) the types of logics.
a79fe3aad8743ea57e473ea5f66a723244cb9c0eMarkus Roggenbach{- References: see Logic.hs
929190acb9f2b2f5857dce841c5a389710895515Andy Gimblett Weak amalgamability, also for comorphisms
a79fe3aad8743ea57e473ea5f66a723244cb9c0eMarkus Roggenbach comorphism modifications
a79fe3aad8743ea57e473ea5f66a723244cb9c0eMarkus Roggenbach comorphisms out of sublogic relationships
ad270004874ce1d0697fb30d7309f180553bb315Christian Maeder restrictions of comorphisms to sublogics
fbb2d28086a1860850f661fbf4af531322bac405Christian Maeder morphisms and other translations via spans
929190acb9f2b2f5857dce841c5a389710895515Andy Gimblettclass (Language cid,
a79fe3aad8743ea57e473ea5f66a723244cb9c0eMarkus Roggenbach Logic lid1 sublogics1
a79fe3aad8743ea57e473ea5f66a723244cb9c0eMarkus Roggenbach basic_spec1 sentence1 symb_items1 symb_map_items1
61051521e4d82769a47f23aecb5fb477de47d534Andy Gimblett sign1 morphism1 symbol1 raw_symbol1 proof_tree1,
1c7c4d95775a8ad5f7373e5cf0bad86f8301c56cAndy Gimblett Logic lid2 sublogics2
1c7c4d95775a8ad5f7373e5cf0bad86f8301c56cAndy Gimblett basic_spec2 sentence2 symb_items2 symb_map_items2
a79fe3aad8743ea57e473ea5f66a723244cb9c0eMarkus Roggenbach sign2 morphism2 symbol2 raw_symbol2 proof_tree2) =>
e99df192a380bfa91e3261c911751bb034c09a17Till Mossakowski Comorphism cid
da955132262baab309a50fdffe228c9efe68251dCui Jian lid1 sublogics1 basic_spec1 sentence1 symb_items1 symb_map_items1
1c7c4d95775a8ad5f7373e5cf0bad86f8301c56cAndy Gimblett sign1 morphism1 symbol1 raw_symbol1 proof_tree1
1c7c4d95775a8ad5f7373e5cf0bad86f8301c56cAndy Gimblett lid2 sublogics2 basic_spec2 sentence2 symb_items2 symb_map_items2
e99df192a380bfa91e3261c911751bb034c09a17Till Mossakowski sign2 morphism2 symbol2 raw_symbol2 proof_tree2
e99df192a380bfa91e3261c911751bb034c09a17Till Mossakowski | cid -> lid1, cid -> lid2
1c7c4d95775a8ad5f7373e5cf0bad86f8301c56cAndy Gimblett -- source and target logic and sublogic
1c7c4d95775a8ad5f7373e5cf0bad86f8301c56cAndy Gimblett -- the source sublogic is the maximal one for which the comorphism works
eca4db63ed0bdbd93b62678feea6e3eb80aa47bbChristian Maeder -- the target sublogic is the resulting one
1df33829303cbf924aa018ac5ce9a28e69c17d22Till Mossakowski sourceLogic :: cid -> lid1
1df33829303cbf924aa018ac5ce9a28e69c17d22Till Mossakowski sourceSublogic :: cid -> sublogics1
1df33829303cbf924aa018ac5ce9a28e69c17d22Till Mossakowski targetLogic :: cid -> lid2
1df33829303cbf924aa018ac5ce9a28e69c17d22Till Mossakowski targetSublogic :: cid -> sublogics2
03136b84a0c70d877e227444f0875e209506b9e4Christian Maeder -- finer information of target sublogics corresponding to source sublogics
03136b84a0c70d877e227444f0875e209506b9e4Christian Maeder mapSublogic :: cid -> sublogics1 -> sublogics2
03136b84a0c70d877e227444f0875e209506b9e4Christian Maeder -- default implementation
03136b84a0c70d877e227444f0875e209506b9e4Christian Maeder mapSublogic cid _ = targetSublogic cid
b3dca469a9e267d6d71acfdeca7bf284d0581dc7Till Mossakowski -- the translation functions are partial
a79fe3aad8743ea57e473ea5f66a723244cb9c0eMarkus Roggenbach -- because the target may be a sublanguage
b3dca469a9e267d6d71acfdeca7bf284d0581dc7Till Mossakowski -- map_basic_spec :: cid -> basic_spec1 -> Result basic_spec2
03136b84a0c70d877e227444f0875e209506b9e4Christian Maeder -- cover theoroidal comorphisms as well
03136b84a0c70d877e227444f0875e209506b9e4Christian Maeder map_theory :: cid -> (sign1,[Named sentence1])
03136b84a0c70d877e227444f0875e209506b9e4Christian Maeder -> Result (sign2,[Named sentence2])
03136b84a0c70d877e227444f0875e209506b9e4Christian Maeder map_morphism :: cid -> morphism1 -> Result morphism2
1df33829303cbf924aa018ac5ce9a28e69c17d22Till Mossakowski map_sentence :: cid -> sign1 -> sentence1 -> Result sentence2
b3dca469a9e267d6d71acfdeca7bf284d0581dc7Till Mossakowski -- also covers semi-comorphisms
fbb2d28086a1860850f661fbf4af531322bac405Christian Maeder -- with no sentence translation
fbb2d28086a1860850f661fbf4af531322bac405Christian Maeder -- - but these are spans!
fbb2d28086a1860850f661fbf4af531322bac405Christian Maeder map_symbol :: cid -> symbol1 -> Set symbol2
fbb2d28086a1860850f661fbf4af531322bac405Christian Maeder constituents :: cid -> [String]
idComorphismTc = mkTyCon "Logic.Comorphism.IdComorphism"
tyconCompComorphism = mkTyCon "Logic.Comorphism.CompComorphism"