Logic.hs revision e953bea49e7f0e1a43bccf2a66c5e2a2b50848e0
f4505a64a089693012a3f5c3b1f12a82cd7a2a5aKlaus Luettich{-# OPTIONS -fallow-undecidable-instances #-}
c63ebf815c8a874525cf18670ad74847f7fc7b26Christian MaederModule : $Header$
c092fcac4b8f5c524c22ca579189c4487c13edf7Christian MaederCopyright : (c) Till Mossakowski, and Uni Bremen 2002-2003
fefee7e1dee1ee5f0768a03a4abae88d1ca2c3fdRazvan PascanuLicense : similar to LGPL, see HetCATS/LICENSE.txt or LIZENZ.txt
3f69b6948966979163bdfe8331c38833d5d90ecdChristian MaederMaintainer : till@tzi.de
75a6279dbae159d018ef812185416cf6df386c10Till MossakowskiStability : provisional
75a6279dbae159d018ef812185416cf6df386c10Till MossakowskiPortability : non-portable (various -fglasgow-exts extensions)
c092fcac4b8f5c524c22ca579189c4487c13edf7Christian MaederProvides data structures for logics (with symbols). Logics are
dda5ab793f1615c1ba1dcaa97a4346b0878da6b1Christian Maeder a type class with an /identity/ type (usually interpreted
f66fcd981f556c238df7dd6dfa42123745e3b1d2Christian Maeder by a singleton set) which serves to treat logics as
f66fcd981f556c238df7dd6dfa42123745e3b1d2Christian Maeder data. All the functions in the type class take the
da955132262baab309a50fdffe228c9efe68251dCui Jian identity as first argument in order to determine the logic.
dda5ab793f1615c1ba1dcaa97a4346b0878da6b1Christian Maeder For logic (co)morphisms see "Logic.Comorphism"
f66fcd981f556c238df7dd6dfa42123745e3b1d2Christian Maeder This module uses multiparameter type classes
0799b5dc3f06d2640e66e9ab54b8b217348fd719Christian Maeder (<http://haskell.org/ghc/docs/latest/html/users_guide/type-extensions.html#multi-param-type-classes>)
0799b5dc3f06d2640e66e9ab54b8b217348fd719Christian Maeder with functional dependencies (<http://haskell.org/hawiki/FunDeps>)
43b4c41fbb07705c9df321221ab9cb9832460407Christian Maeder for defining an interface for the notion of logic. Multiparameter type
4c8d3c5a9e938633f6147b5a595b9b93bfca99e6Christian Maeder classes are needed because a logic consists of a collection of types,
fbc4f8708092d571a45cb483f37cc6b674da45a7Christian Maeder together with operations on these. Functional dependencies
fbc4f8708092d571a45cb483f37cc6b674da45a7Christian Maeder are needed because no operation will involve all types of
fbc4f8708092d571a45cb483f37cc6b674da45a7Christian Maeder the multiparameter type class; hence we need a method to derive
b10d6cef708b7a659f2d3b367e8e0db0d03ae3f5Till Mossakowski the missing types. We chose an easy way: for each logic, we
c4451dc7da4a15726ba96179aecf046a5df5cae1Christian Maeder introduce a new singleton type that constitutes the identity
3c4e64e0b4361a24275ee8f308fa965ab1e52f2eHeng Jiang of the logic. All other types of the multiparameter type class
fa388aea9cef5f9734fec346159899a74432ce26Christian Maeder depend on this 'identy constituting' type, and all operations take
0799b5dc3f06d2640e66e9ab54b8b217348fd719Christian Maeder the 'identity constituting' type as first arguments. The value
fe4e6766a6e51cca3f8cc9632c25936af147d8b9Christian Maeder of the argument of the 'identity constituting' type is irrelevant
59fddbdd745a05adeaf655b617ab8da947903832Christian Maeder (note that there is only one value of such a type anyway).
dda5ab793f1615c1ba1dcaa97a4346b0878da6b1Christian Maeder J. A. Goguen and R. M. Burstall
f77f29e84b3f6e791c82e61b13fbf76582bedd2fChristian Maeder Institutions: Abstract Model Theory for Specification and
c0c2380bced8159ff0297ece14eba948bd236471Christian Maeder JACM 39, p. 95--146, 1992
da333ffa6336cf59a4071fcddad358c5eafd3e61Sonja Gröning (general notion of logic - model theory only)
6352f3c31da3043783a13be6594aacb2147378baRazvan Pascanu General Logics
fe4e6766a6e51cca3f8cc9632c25936af147d8b9Christian Maeder Logic Colloquium 87, p. 275--329, North Holland, 1989
124c859ba4741d5e36d5d98634886b430b7af093Christian Maeder (general notion of logic - also proof theory;
66a774f13272fde036481edd2298081ab3d04678Razvan Pascanu notion of logic representation, called map there)
fe4e6766a6e51cca3f8cc9632c25936af147d8b9Christian Maeder T. Mossakowski:
923e25bb8c7cf9f2978c7844ad173704482cc3b0Martin Kühl Specification in an arbitrary institution with symbols
923e25bb8c7cf9f2978c7844ad173704482cc3b0Martin Kühl 14th WADT 1999, LNCS 1827, p. 252--270
f66fcd981f556c238df7dd6dfa42123745e3b1d2Christian Maeder (treatment of symbols and raw symbols, see also CASL semantics)
fe4e6766a6e51cca3f8cc9632c25936af147d8b9Christian Maeder T. Mossakowski, B. Klin:
fe4e6766a6e51cca3f8cc9632c25936af147d8b9Christian Maeder Institution Independent Static Analysis for CASL
44e2af9d1df92a39d25ac439c00c338e0ed5652bChristian Maeder 15h WADT 2001, LNCS 2267, p. 221-237, 2002.
a3a7d8b3cdf05c8040c62dbcf9a15dc5042cd721Christian Maeder (what is needed for static anaylsis)
a3a7d8b3cdf05c8040c62dbcf9a15dc5042cd721Christian Maeder S. Autexier and T. Mossakowski
a3a7d8b3cdf05c8040c62dbcf9a15dc5042cd721Christian Maeder Integrating HOLCASL into the Development Graph Manager MAYA
a3a7d8b3cdf05c8040c62dbcf9a15dc5042cd721Christian Maeder FroCoS 2002, to appear
a3a7d8b3cdf05c8040c62dbcf9a15dc5042cd721Christian Maeder (interface to provers)
8955ea64c61a6e8b96b7696021863afd1a75f6daRazvan Pascanu Weak amalgamability
a3a7d8b3cdf05c8040c62dbcf9a15dc5042cd721Christian Maeder raw symbols are now symbols, symbols are now signature symbols
a3a7d8b3cdf05c8040c62dbcf9a15dc5042cd721Christian Maeder provide both signature symbol set and symbol set of a signature
a3a7d8b3cdf05c8040c62dbcf9a15dc5042cd721Christian Maeder introduce coercion safer functions (separately for each type)
fefee7e1dee1ee5f0768a03a4abae88d1ca2c3fdRazvan Pascanuimport qualified Common.Lib.Set as Set
ee1c7c5796832536932d7b06cbfb1ca13f9a0d7bMartin Kühlimport qualified Common.Lib.Map as Map
ee1c7c5796832536932d7b06cbfb1ca13f9a0d7bMartin Kühlimport qualified Data.Graph.Inductive.Tree as Tree(Gr)
c4451dc7da4a15726ba96179aecf046a5df5cae1Christian Maederimport Logic.Prover -- for one half of class Sentences
fe4e6766a6e51cca3f8cc9632c25936af147d8b9Christian Maeder-- for Conversion to ATerms
63719301448519453f66383f4e583d9fd5b89ecbChristian Maederimport Common.ATerm.Lib -- (ShATermConvertible)
a3a7d8b3cdf05c8040c62dbcf9a15dc5042cd721Christian Maeder-- passed to ensures_amalgamability
fe4e6766a6e51cca3f8cc9632c25936af147d8b9Christian Maederimport Taxonomy.MMiSSOntology (MMiSSOntology)
a3a7d8b3cdf05c8040c62dbcf9a15dc5042cd721Christian Maeder-- | shortcut for class constraints
fbc4f8708092d571a45cb483f37cc6b674da45a7Christian Maederclass (Show a, PrettyPrint a, PrintLaTeX a, Typeable a, ShATermConvertible a)
fbc4f8708092d571a45cb483f37cc6b674da45a7Christian Maeder => PrintTypeConv a
a3a7d8b3cdf05c8040c62dbcf9a15dc5042cd721Christian Maeder-- | shortcut for class constraints with equality
a3a7d8b3cdf05c8040c62dbcf9a15dc5042cd721Christian Maederclass (Eq a, PrintTypeConv a) => EqPrintTypeConv a
f77f29e84b3f6e791c82e61b13fbf76582bedd2fChristian Maederinstance (Show a, PrettyPrint a, PrintLaTeX a, Typeable a,
a3a7d8b3cdf05c8040c62dbcf9a15dc5042cd721Christian Maeder ShATermConvertible a) => PrintTypeConv a
a3a7d8b3cdf05c8040c62dbcf9a15dc5042cd721Christian Maederinstance (Eq a, PrintTypeConv a) => EqPrintTypeConv a
a3a7d8b3cdf05c8040c62dbcf9a15dc5042cd721Christian Maedertype EndoMap a = Map.Map a a
a3a7d8b3cdf05c8040c62dbcf9a15dc5042cd721Christian Maeder-- languages, define like "data CASL = CASL deriving Show"
-- i.e. we need equality
sym_of :: lid -> sign -> Set.Set symbol
-- | a dummy function to allow type checking *.inline.hs files
-- sign's: sigma_local, sigma_complete, i.e.
stat_symb_map_items _ _ = fail "Logic.stat_symb_map_items"
weaklyAmalgamableCocone :: lid -> Tree.Gr sign morphism
-> Result (sign, Map.Map Node morphism)
Tree.Gr sign morphism, -- the diagram to be analyzed
Tree.Gr String String) -- the descriptions of nodes and edges
error ("Logic.is_transportable nyi for logic"++language_name l)
lid -> Set.Set symbol -> sign -> Result morphism
tyconAnyLogic = mkTyCon "Logic.Logic.AnyLogic"
namedTc = mkTyCon "Common.AS_Annotation.Named"
setTc = mkTyCon "Common.Lib.Set.Set"
instance Typeable a => Typeable (Set.Set a) where
typeOf s = mkTyConApp setTc [typeOf ((undefined:: Set.Set a -> a) s)]
mapTc = mkTyCon "Common.Lib.Map.Map"
instance (Typeable a, Typeable b) => Typeable (Map.Map a b) where
typeOf m = mkTyConApp mapTc [typeOf ((undefined :: Map.Map a b -> a) m),
typeOf ((undefined :: Map.Map a b -> b) m)]