Logic_DMU.hs revision e16b3696b2c173aac14200321868ed81b8f7dc69
4654dbb45f8a4aea7aa5fed6be22c9efff19bfcaChristian Maeder{-# LANGUAGE MultiParamTypeClasses, FlexibleInstances, DeriveDataTypeable
4654dbb45f8a4aea7aa5fed6be22c9efff19bfcaChristian Maeder , GeneralizedNewtypeDeriving #-}
4654dbb45f8a4aea7aa5fed6be22c9efff19bfcaChristian Maeder{- |
4654dbb45f8a4aea7aa5fed6be22c9efff19bfcaChristian MaederModule : $Header$
4654dbb45f8a4aea7aa5fed6be22c9efff19bfcaChristian MaederDescription : Instance of class Logic for DMU
4654dbb45f8a4aea7aa5fed6be22c9efff19bfcaChristian MaederCopyright : (c) Christian Maeder DFKI, Uni Bremen 2009
4654dbb45f8a4aea7aa5fed6be22c9efff19bfcaChristian MaederLicense : GPLv2 or higher, see LICENSE.txt
4654dbb45f8a4aea7aa5fed6be22c9efff19bfcaChristian Maeder
4654dbb45f8a4aea7aa5fed6be22c9efff19bfcaChristian MaederMaintainer : Christian.Maeder@dfki.de
4654dbb45f8a4aea7aa5fed6be22c9efff19bfcaChristian MaederStability : provisional
4654dbb45f8a4aea7aa5fed6be22c9efff19bfcaChristian MaederPortability : non-portable (imports Logic.Logic)
4654dbb45f8a4aea7aa5fed6be22c9efff19bfcaChristian Maeder
4654dbb45f8a4aea7aa5fed6be22c9efff19bfcaChristian Maederdummy instance of class Logic for DMU
4654dbb45f8a4aea7aa5fed6be22c9efff19bfcaChristian Maeder
4654dbb45f8a4aea7aa5fed6be22c9efff19bfcaChristian Maeder-}
4654dbb45f8a4aea7aa5fed6be22c9efff19bfcaChristian Maeder
4654dbb45f8a4aea7aa5fed6be22c9efff19bfcaChristian Maedermodule DMU.Logic_DMU where
4654dbb45f8a4aea7aa5fed6be22c9efff19bfcaChristian Maeder
4654dbb45f8a4aea7aa5fed6be22c9efff19bfcaChristian Maederimport Logic.Logic
4654dbb45f8a4aea7aa5fed6be22c9efff19bfcaChristian Maeder
4654dbb45f8a4aea7aa5fed6be22c9efff19bfcaChristian Maederimport Common.DefaultMorphism
4654dbb45f8a4aea7aa5fed6be22c9efff19bfcaChristian Maederimport Common.Doc
4654dbb45f8a4aea7aa5fed6be22c9efff19bfcaChristian Maederimport Common.DocUtils
4654dbb45f8a4aea7aa5fed6be22c9efff19bfcaChristian Maederimport Common.ExtSign
4654dbb45f8a4aea7aa5fed6be22c9efff19bfcaChristian Maederimport Common.Id
4654dbb45f8a4aea7aa5fed6be22c9efff19bfcaChristian Maederimport Common.Utils
4654dbb45f8a4aea7aa5fed6be22c9efff19bfcaChristian Maeder
4654dbb45f8a4aea7aa5fed6be22c9efff19bfcaChristian Maederimport ATerm.Lib
4654dbb45f8a4aea7aa5fed6be22c9efff19bfcaChristian Maeder
f56e4fe56fdf66d711e5fafaa71c2587dd9a066fChristian Maederimport Text.ParserCombinators.Parsec
import Data.List
import Data.Monoid
import qualified Data.Map as Map
import qualified Data.Set as Set
import Data.Typeable
data DMU = DMU deriving Show
instance Language DMU where
description _ = "wrap Catia output"
newtype Text = Text { fromText :: String }
deriving (Show, Eq, Ord, GetRange, Typeable, ShATermConvertible)
instance Pretty Text where
pretty (Text s) = text s
-- use generic Category instance from Logic.Logic
instance Monoid Text where
mempty = Text ""
mappend (Text l1) (Text l2) = Text
. unlines $ lines l1 ++ lines l2
instance Syntax DMU Text () () where
parse_basic_spec DMU = Just $ fmap Text $ many1 anyChar
instance Sentences DMU () Text (DefaultMorphism Text) () where
map_sen DMU _ = return
sym_of DMU _ = [Set.singleton ()]
symmap_of DMU _ = Map.empty
sym_name DMU _ = genName "DMU"
instance StaticAnalysis DMU Text () () () Text (DefaultMorphism Text) () ()
where
basic_analysis DMU = Just $ \ (s, _, _) ->
return (s, mkExtSign s, [])
empty_signature DMU = Text ""
is_subsig DMU (Text s1) (Text s2) = isInfixOf (trim s1) s2
instance Logic DMU () Text () () () Text (DefaultMorphism Text) () () ()