Logic_Propositional.hs revision a65c6747c9acbbebc93baba7bae94d2e3d8cdafb
96b4cc8ddfdb1e4671c1218a963715d424332d49Ewaryst Schulz{-# LANGUAGE CPP, MultiParamTypeClasses #-}
96b4cc8ddfdb1e4671c1218a963715d424332d49Ewaryst SchulzModule : $Header$
96b4cc8ddfdb1e4671c1218a963715d424332d49Ewaryst SchulzDescription : Instance of class Logic for propositional logic
98890889ffb2e8f6f722b00e265a211f13b5a861Corneliu-Claudiu ProdescuCopyright : (c) Dominik Luecke, Uni Bremen 2007
96b4cc8ddfdb1e4671c1218a963715d424332d49Ewaryst SchulzLicense : GPLv2 or higher, see LICENSE.txt
96b4cc8ddfdb1e4671c1218a963715d424332d49Ewaryst SchulzMaintainer : luecke@informatik.uni-bremen.de
96b4cc8ddfdb1e4671c1218a963715d424332d49Ewaryst SchulzStability : experimental
96b4cc8ddfdb1e4671c1218a963715d424332d49Ewaryst SchulzPortability : non-portable (imports Logic.Logic)
96b4cc8ddfdb1e4671c1218a963715d424332d49Ewaryst SchulzInstance of class Logic for the propositional logic
96b4cc8ddfdb1e4671c1218a963715d424332d49Ewaryst Schulz Also the instances for Syntax and Category.
96b4cc8ddfdb1e4671c1218a963715d424332d49Ewaryst Schulz http://en.wikipedia.org/wiki/Propositional_logic
96b4cc8ddfdb1e4671c1218a963715d424332d49Ewaryst Schulz Till Mossakowski, Joseph Goguen, Razvan Diaconescu, Andrzej Tarlecki.
96b4cc8ddfdb1e4671c1218a963715d424332d49Ewaryst Schulz What is a Logic?.
96b4cc8ddfdb1e4671c1218a963715d424332d49Ewaryst Schulz In Jean-Yves Beziau (Ed.), Logica Universalis, pp. 113-@133. Birkhaeuser.
3d3889e0cefcdce9b3f43c53aaa201943ac2e895Jonathan von Schroedermodule Propositional.Logic_Propositional where
96b4cc8ddfdb1e4671c1218a963715d424332d49Ewaryst Schulzimport Propositional.Sublogic as Sublogic
634880196bffeea4cad99e081f0956886ab77124Ewaryst Schulz#ifdef UNI_PACKAGE
96b4cc8ddfdb1e4671c1218a963715d424332d49Ewaryst Schulzimport qualified Data.Map as Map
96b4cc8ddfdb1e4671c1218a963715d424332d49Ewaryst Schulz-- | Lid for propositional logic
634880196bffeea4cad99e081f0956886ab77124Ewaryst Schulzdata Propositional = Propositional deriving Show
634880196bffeea4cad99e081f0956886ab77124Ewaryst Schulzinstance Language Propositional where
96b4cc8ddfdb1e4671c1218a963715d424332d49Ewaryst Schulz description _ = "Propositional Logic\n"
634880196bffeea4cad99e081f0956886ab77124Ewaryst Schulz ++ "for more information please refer to\n"
3d3889e0cefcdce9b3f43c53aaa201943ac2e895Jonathan von Schroeder ++ "http://en.wikipedia.org/wiki/Propositional_logic"
634880196bffeea4cad99e081f0956886ab77124Ewaryst Schulz-- | Instance of Category for propositional logic
634880196bffeea4cad99e081f0956886ab77124Ewaryst Schulzinstance Category Sign Morphism where
634880196bffeea4cad99e081f0956886ab77124Ewaryst Schulz -- Identity morhpism
634880196bffeea4cad99e081f0956886ab77124Ewaryst Schulz -- Returns the domain of a morphism
3d3889e0cefcdce9b3f43c53aaa201943ac2e895Jonathan von Schroeder -- Returns the codomain of a morphism
634880196bffeea4cad99e081f0956886ab77124Ewaryst Schulz -- check if morphism is inclusion
634880196bffeea4cad99e081f0956886ab77124Ewaryst Schulz isInclusion = Map.null . propMap
634880196bffeea4cad99e081f0956886ab77124Ewaryst Schulz -- tests if the morphism is ok
3d3889e0cefcdce9b3f43c53aaa201943ac2e895Jonathan von Schroeder legal_mor = isLegalMorphism
634880196bffeea4cad99e081f0956886ab77124Ewaryst Schulz -- composition of morphisms
634880196bffeea4cad99e081f0956886ab77124Ewaryst Schulz composeMorphisms = composeMor
634880196bffeea4cad99e081f0956886ab77124Ewaryst Schulz-- | Instance of Sentences for propositional logic
3d3889e0cefcdce9b3f43c53aaa201943ac2e895Jonathan von Schroederinstance Sentences Propositional FORMULA
634880196bffeea4cad99e081f0956886ab77124Ewaryst Schulz Sign Morphism Symbol where
634880196bffeea4cad99e081f0956886ab77124Ewaryst Schulz negation Propositional = Just . negForm nullRange
634880196bffeea4cad99e081f0956886ab77124Ewaryst Schulz -- returns the set of symbols
634880196bffeea4cad99e081f0956886ab77124Ewaryst Schulz sym_of Propositional = singletonList . symOf
2cba38ca53f268f204eb6916ebef0e9543a99e0aEwaryst Schulz -- returns the symbol map
634880196bffeea4cad99e081f0956886ab77124Ewaryst Schulz symmap_of Propositional = getSymbolMap
96b4cc8ddfdb1e4671c1218a963715d424332d49Ewaryst Schulz -- returns the name of a symbol
634880196bffeea4cad99e081f0956886ab77124Ewaryst Schulz sym_name Propositional = getSymbolName
634880196bffeea4cad99e081f0956886ab77124Ewaryst Schulz -- translation of sentences along signature morphism
96b4cc8ddfdb1e4671c1218a963715d424332d49Ewaryst Schulz map_sen Propositional = mapSentence
top_sublogic Propositional = Sublogic.top
matches Propositional = Symbol.matches
top = Sublogic.top