Logic.hs revision d73a6d88ee6df62ad7c7ed9a8f6e25d20a75b801
4b0a4c7dea0f67a233dcc42ce9bb18d36de109aeChristian Maeder{-# OPTIONS -fallow-undecidable-instances #-}
4b0a4c7dea0f67a233dcc42ce9bb18d36de109aeChristian MaederModule : $Header$
75a6279dbae159d018ef812185416cf6df386c10Till MossakowskiDescription : central interface (type class) for logics in Hets
ea03c5d09694b4a966fbd19d46cfa5772648d95fChristian MaederCopyright : (c) Till Mossakowski, and Uni Bremen 2002-2006
4b0a4c7dea0f67a233dcc42ce9bb18d36de109aeChristian MaederLicense : similar to LGPL, see HetCATS/LICENSE.txt or LIZENZ.txt
4b0a4c7dea0f67a233dcc42ce9bb18d36de109aeChristian MaederMaintainer : till@tzi.de
4b0a4c7dea0f67a233dcc42ce9bb18d36de109aeChristian MaederStability : provisional
4b0a4c7dea0f67a233dcc42ce9bb18d36de109aeChristian MaederPortability : non-portable (various -fglasgow-exts extensions)
ea03c5d09694b4a966fbd19d46cfa5772648d95fChristian MaederCentral interface (type class) for logics in Hets
e8ffec0fa3d3061061bdc16e44247b9cf96b050fChristian MaederProvides data structures for logics (with symbols). Logics are
502ed7ed7fecd10b6d0c83cdd48a244ec45e840aChristian Maeder a type class with an /identity/ type (usually interpreted
e8ffec0fa3d3061061bdc16e44247b9cf96b050fChristian Maeder by a singleton set) which serves to treat logics as
dc6b48bb46df8e56da3491c98476e6da0d1d5d1dChristian Maeder data. All the functions in the type class take the
da245da15da78363c896e44ea97a14ab1f83eb50Christian Maeder identity as first argument in order to determine the logic.
53301de22afd7190981b363b57c48df86fcb50f7Christian Maeder For logic (co)morphisms see "Logic.Comorphism"
dc6b48bb46df8e56da3491c98476e6da0d1d5d1dChristian Maeder This module uses multiparameter type classes
c00adad2e9459b422dee09e3a2bddba66b433bb7Christian Maeder (<http://haskell.org/ghc/docs/latest/html/users_guide/type-extensions.html#multi-param-type-classes>)
fd5d3885a092ac0727fa2436cdfc3b248318ebd8Christian Maeder with functional dependencies (<http://haskell.org/hawiki/FunDeps>)
fd5d3885a092ac0727fa2436cdfc3b248318ebd8Christian Maeder for defining an interface for the notion of logic. Multiparameter type
fd5d3885a092ac0727fa2436cdfc3b248318ebd8Christian Maeder classes are needed because a logic consists of a collection of types,
fd5d3885a092ac0727fa2436cdfc3b248318ebd8Christian Maeder together with operations on these. Functional dependencies
c18e9c3c6d5039618f1f2c05526ece84c7794ea3Christian Maeder are needed because no operation will involve all types of
c00adad2e9459b422dee09e3a2bddba66b433bb7Christian Maeder the multiparameter type class; hence we need a method to derive
502ed7ed7fecd10b6d0c83cdd48a244ec45e840aChristian Maeder the missing types. We chose an easy way: for each logic, we
c00adad2e9459b422dee09e3a2bddba66b433bb7Christian Maeder introduce a new singleton type that constitutes the identity
ea03c5d09694b4a966fbd19d46cfa5772648d95fChristian Maeder of the logic. All other types of the multiparameter type class
f71a8dcf94fd9eb3c9800e16dcdc5e5ff74e5c22Christian Maeder depend on this 'identy constituting' type, and all operations take
c00adad2e9459b422dee09e3a2bddba66b433bb7Christian Maeder the 'identity constituting' type as first arguments. The value
ea03c5d09694b4a966fbd19d46cfa5772648d95fChristian Maeder of the argument of the 'identity constituting' type is irrelevant
fd5d3885a092ac0727fa2436cdfc3b248318ebd8Christian Maeder (note that there is only one value of such a type anyway).
fd5d3885a092ac0727fa2436cdfc3b248318ebd8Christian Maeder J. A. Goguen and R. M. Burstall
df638d53c2d5fe5e80b943a58609c8936848ed82Christian Maeder Institutions: Abstract Model Theory for Specification and
23f8d286586ff38a9e73052b2c7c04c62c5c638fChristian Maeder JACM 39, p. 95--146, 1992
23f8d286586ff38a9e73052b2c7c04c62c5c638fChristian Maeder (general notion of logic - model theory only)
23f8d286586ff38a9e73052b2c7c04c62c5c638fChristian Maeder General Logics
cf3232cec840a6945667bdb06f5b47b22243bc8fChristian Maeder Logic Colloquium 87, p. 275--329, North Holland, 1989
836e72a3c413366ba9801726f3b249c7791cb9caChristian Maeder (general notion of logic - also entailment/proof theory;
0f894093b1d435fd222074706d7fdadb9725cfdfChristian Maeder notion of logic representation, called map there)
51281dddda866c0cda9fca22bf6bc4eea7128112Christian Maeder T. Mossakowski:
cf3232cec840a6945667bdb06f5b47b22243bc8fChristian Maeder Specification in an arbitrary institution with symbols
cf3232cec840a6945667bdb06f5b47b22243bc8fChristian Maeder 14th WADT 1999, LNCS 1827, p. 252--270
cf3232cec840a6945667bdb06f5b47b22243bc8fChristian Maeder (treatment of symbols and raw symbols, see also CASL semantics
cf3232cec840a6945667bdb06f5b47b22243bc8fChristian Maeder in the CASL reference manual)
cf3232cec840a6945667bdb06f5b47b22243bc8fChristian Maeder T. Mossakowski, B. Klin:
cf3232cec840a6945667bdb06f5b47b22243bc8fChristian Maeder Institution Independent Static Analysis for CASL
e8a2ca3a7b3e9a19ef03b6b1c0b5d03dbad6463cChristian Maeder 15h WADT 2001, LNCS 2267, p. 221-237, 2002.
e8a2ca3a7b3e9a19ef03b6b1c0b5d03dbad6463cChristian Maeder (what is needed for static anaylsis)
e8a2ca3a7b3e9a19ef03b6b1c0b5d03dbad6463cChristian Maeder S. Autexier and T. Mossakowski
e8a2ca3a7b3e9a19ef03b6b1c0b5d03dbad6463cChristian Maeder Integrating HOLCASL into the Development Graph Manager MAYA
cf3232cec840a6945667bdb06f5b47b22243bc8fChristian Maeder FroCoS 2002, LNCS 2309, p. 2-17, 2002.
fd5d3885a092ac0727fa2436cdfc3b248318ebd8Christian Maeder (interface to provers)
f71a8dcf94fd9eb3c9800e16dcdc5e5ff74e5c22Christian Maeder CoFI (ed.): CASL Reference Manual, LNCS 2960, Springer Verlag, 2004.
7c57322afb6342e5cc8b1fdc96050b707407fc61Christian Maeder (static semantics of CASL structured and architectural specifications)
fd5d3885a092ac0727fa2436cdfc3b248318ebd8Christian Maeder T. Mossakowski
fd5d3885a092ac0727fa2436cdfc3b248318ebd8Christian Maeder Heterogeneous specification and the heterogeneous tool set
fd5d3885a092ac0727fa2436cdfc3b248318ebd8Christian Maeder Habilitation thesis, University of Bremen, 2005
628310b42327ad76ce471caf0dde6563d6fa6307Christian Maeder (the general picture of heterogeneous specification)
31242f7541fd6ef179e4eb5be7522ddf54ae397bChristian Maederimport qualified Common.Lib.Set as Set
76fa667489c5e0868ac68de9f0253ac10f73d0b5Christian Maederimport qualified Common.Lib.Map as Map
e8a2ca3a7b3e9a19ef03b6b1c0b5d03dbad6463cChristian Maederimport Logic.Prover -- for one half of class Sentences
628310b42327ad76ce471caf0dde6563d6fa6307Christian Maederimport Common.ATerm.Lib -- (ShATermConvertible)
ffd01020a4f35f434b912844ad6e0d6918fadffdChristian Maederimport Common.Amalgamate -- passed to ensures_amalgamability
fd5d3885a092ac0727fa2436cdfc3b248318ebd8Christian Maederimport Taxonomy.MMiSSOntology (MMiSSOntology)
c00adad2e9459b422dee09e3a2bddba66b433bb7Christian Maeder-- | Stability of logic implementations
c00adad2e9459b422dee09e3a2bddba66b433bb7Christian Maederdata Stability = Stable | Testing | Unstable | Experimental
502ed7ed7fecd10b6d0c83cdd48a244ec45e840aChristian Maeder deriving (Eq, Show)
ac07a6558423dae7adc488ed9092cd8e9450a29dChristian Maeder-- | shortcut for class constraints
c00adad2e9459b422dee09e3a2bddba66b433bb7Christian Maederclass (Show a, Pretty a, Typeable a, ShATermConvertible a)
ff9a53595208f532c25ac5168f772f48fd80fdb5Christian Maeder => PrintTypeConv a
dc6b48bb46df8e56da3491c98476e6da0d1d5d1dChristian Maeder-- | shortcut for class constraints with equality
b49276c9f50038e0bd499ad49f7bd6444566a834Christian Maederclass (Eq a, PrintTypeConv a) => EqPrintTypeConv a
b49276c9f50038e0bd499ad49f7bd6444566a834Christian Maederinstance (Show a, Pretty a, Typeable a,
c00adad2e9459b422dee09e3a2bddba66b433bb7Christian Maeder ShATermConvertible a) => PrintTypeConv a
dc6b48bb46df8e56da3491c98476e6da0d1d5d1dChristian Maederinstance (Eq a, PrintTypeConv a) => EqPrintTypeConv a
53301de22afd7190981b363b57c48df86fcb50f7Christian Maeder-- | maps from a to a
53301de22afd7190981b363b57c48df86fcb50f7Christian Maedertype EndoMap a = Map.Map a a
53301de22afd7190981b363b57c48df86fcb50f7Christian Maeder{- | the name of a logic.
53301de22afd7190981b363b57c48df86fcb50f7Christian Maeder Define instances like "data CASL = CASL deriving Show"
sym_of :: lid -> sign -> Set.Set symbol
-- | several provers can be provided. See module "Logic.Prover"
-- | a dummy static analysis function to allow type checking *.inline.hs files
weaklyAmalgamableCocone :: lid -> Tree.Gr sign morphism
-> Result (sign, Map.Map Int morphism)
Tree.Gr sign morphism, -- the diagram to be analyzed
Tree.Gr String String) -- the descriptions of nodes and edges
lid -> Set.Set symbol -> sign -> Result morphism
empty_theory lid = Theory (empty_signature lid) Map.empty
tyconAnyLogic = mkTyCon "Logic.Logic.AnyLogic"