Logic_Haskell.hs revision 84933d742dc5bcf760653b5d1784e00cee342032
03532fb1cbb7e8c1d5cf2e93aa3719f926631cabStephen Gallagher{- |
03532fb1cbb7e8c1d5cf2e93aa3719f926631cabStephen GallagherModule : $Header$
03532fb1cbb7e8c1d5cf2e93aa3719f926631cabStephen GallagherDescription : Instance of class Logic for the Haskell logic
294e9a5521d327c5cdc49beeb9cb9e703b3134f1Jan ZelenyCopyright : (c) Christian Maeder, Sonja Groening, Uni Bremen 2002-2004
03532fb1cbb7e8c1d5cf2e93aa3719f926631cabStephen GallagherLicense : similar to LGPL, see HetCATS/LICENSE.txt or LIZENZ.txt
a679f0167b646cffdae86546ed77e105576991b0Pavel Březina
8a05fd320a44636d120a18eb7e9956c7b35b3138Jakub HrozekMaintainer : Christian.Maeder@dfki.de
ba4a81e933deebb416603369b447ead6ebaa040dJakub HrozekStability : provisional
60cab26b12df9a2153823972cde0c38ca86e01b9Yassir ElleyPortability : non-portable(Logic)
ff4b603cc14ea6ea15caaf89a03e927920124af4Yassir Elley
03532fb1cbb7e8c1d5cf2e93aa3719f926631cabStephen GallagherHere is the place where the classes 'Category', 'Syntax',
f6cd1236c27817b97db002094b76648d92b55f82Jan Zeleny 'StaticAnalysis', 'Sentences', and 'Logic' are instantiated for
03532fb1cbb7e8c1d5cf2e93aa3719f926631cabStephen Gallagher Haskell.
03532fb1cbb7e8c1d5cf2e93aa3719f926631cabStephen Gallagher
03532fb1cbb7e8c1d5cf2e93aa3719f926631cabStephen Gallagher Some method implementations for 'StaticAnalysis' and 'Sentences'
03532fb1cbb7e8c1d5cf2e93aa3719f926631cabStephen Gallagher are still missing.
03532fb1cbb7e8c1d5cf2e93aa3719f926631cabStephen Gallagher-}
03532fb1cbb7e8c1d5cf2e93aa3719f926631cabStephen Gallagher
03532fb1cbb7e8c1d5cf2e93aa3719f926631cabStephen Gallaghermodule Haskell.Logic_Haskell
03532fb1cbb7e8c1d5cf2e93aa3719f926631cabStephen Gallagher ( Haskell(..)
03532fb1cbb7e8c1d5cf2e93aa3719f926631cabStephen Gallagher , HaskellMorphism
03532fb1cbb7e8c1d5cf2e93aa3719f926631cabStephen Gallagher , SYMB_ITEMS
03532fb1cbb7e8c1d5cf2e93aa3719f926631cabStephen Gallagher , SYMB_MAP_ITEMS
03532fb1cbb7e8c1d5cf2e93aa3719f926631cabStephen Gallagher , Haskell_Sublogics
03532fb1cbb7e8c1d5cf2e93aa3719f926631cabStephen Gallagher , Symbol
03532fb1cbb7e8c1d5cf2e93aa3719f926631cabStephen Gallagher , RawSymbol
03532fb1cbb7e8c1d5cf2e93aa3719f926631cabStephen Gallagher ) where
03532fb1cbb7e8c1d5cf2e93aa3719f926631cabStephen Gallagher
03532fb1cbb7e8c1d5cf2e93aa3719f926631cabStephen Gallagherimport Common.AS_Annotation
03532fb1cbb7e8c1d5cf2e93aa3719f926631cabStephen Gallagherimport Common.DefaultMorphism
03532fb1cbb7e8c1d5cf2e93aa3719f926631cabStephen Gallagher
07b7b76d7cd494cbd26263503ba2732c21819941Jan Zelenyimport Haskell.TiPropATC()
03532fb1cbb7e8c1d5cf2e93aa3719f926631cabStephen Gallagherimport Haskell.HatParser
03532fb1cbb7e8c1d5cf2e93aa3719f926631cabStephen Gallagherimport Haskell.HatAna
03532fb1cbb7e8c1d5cf2e93aa3719f926631cabStephen Gallagherimport Common.Doc
14452cd066b51e32ca0ebad6c45ae909a1debe57Jakub Hrozekimport Common.DocUtils
03532fb1cbb7e8c1d5cf2e93aa3719f926631cabStephen Gallagher
03532fb1cbb7e8c1d5cf2e93aa3719f926631cabStephen Gallagherimport Logic.Logic
03532fb1cbb7e8c1d5cf2e93aa3719f926631cabStephen Gallagher
03532fb1cbb7e8c1d5cf2e93aa3719f926631cabStephen Gallagher-- a dummy datatype for the LogicGraph and for identifying the right
03532fb1cbb7e8c1d5cf2e93aa3719f926631cabStephen Gallagher-- instances
03532fb1cbb7e8c1d5cf2e93aa3719f926631cabStephen Gallagher
03532fb1cbb7e8c1d5cf2e93aa3719f926631cabStephen Gallagherdata Haskell = Haskell deriving (Show)
03532fb1cbb7e8c1d5cf2e93aa3719f926631cabStephen Gallagherinstance Language Haskell where
03532fb1cbb7e8c1d5cf2e93aa3719f926631cabStephen Gallagher description _ =
03532fb1cbb7e8c1d5cf2e93aa3719f926631cabStephen Gallagher "Haskell - a purely functional programming language,\
03532fb1cbb7e8c1d5cf2e93aa3719f926631cabStephen Gallagher \ featuring static typing, higher-order functions, polymorphism,\
03532fb1cbb7e8c1d5cf2e93aa3719f926631cabStephen Gallagher \ type classes and monadic effects.\
03532fb1cbb7e8c1d5cf2e93aa3719f926631cabStephen Gallagher \ See http://www.haskell.org. This version is based on Programatica,\
03532fb1cbb7e8c1d5cf2e93aa3719f926631cabStephen Gallagher \ see http://www.cse.ogi.edu/PacSoft/projects/programatica/"
03532fb1cbb7e8c1d5cf2e93aa3719f926631cabStephen Gallagher
03532fb1cbb7e8c1d5cf2e93aa3719f926631cabStephen Gallaghertype HaskellMorphism = DefaultMorphism Sign
03532fb1cbb7e8c1d5cf2e93aa3719f926631cabStephen Gallagher
03532fb1cbb7e8c1d5cf2e93aa3719f926631cabStephen Gallagher-- abstract syntax, parsing (and printing)
03532fb1cbb7e8c1d5cf2e93aa3719f926631cabStephen Gallagher
03532fb1cbb7e8c1d5cf2e93aa3719f926631cabStephen Gallaghertype SYMB_ITEMS = ()
03532fb1cbb7e8c1d5cf2e93aa3719f926631cabStephen Gallaghertype SYMB_MAP_ITEMS = ()
03532fb1cbb7e8c1d5cf2e93aa3719f926631cabStephen Gallagher
d2969c6b23c722445bd699c830adb7601ba1cdc6Sumit Boseinstance Syntax Haskell HsDecls
03532fb1cbb7e8c1d5cf2e93aa3719f926631cabStephen Gallagher SYMB_ITEMS SYMB_MAP_ITEMS
03532fb1cbb7e8c1d5cf2e93aa3719f926631cabStephen Gallagher where
03532fb1cbb7e8c1d5cf2e93aa3719f926631cabStephen Gallagher parse_basic_spec Haskell = Just hatParser
03532fb1cbb7e8c1d5cf2e93aa3719f926631cabStephen Gallagher parse_symb_items Haskell = Nothing
03532fb1cbb7e8c1d5cf2e93aa3719f926631cabStephen Gallagher parse_symb_map_items Haskell = Nothing
03532fb1cbb7e8c1d5cf2e93aa3719f926631cabStephen Gallagher
03532fb1cbb7e8c1d5cf2e93aa3719f926631cabStephen Gallaghertype Haskell_Sublogics = ()
03532fb1cbb7e8c1d5cf2e93aa3719f926631cabStephen Gallagher
03532fb1cbb7e8c1d5cf2e93aa3719f926631cabStephen Gallaghertype Symbol = ()
03532fb1cbb7e8c1d5cf2e93aa3719f926631cabStephen Gallaghertype RawSymbol = ()
03532fb1cbb7e8c1d5cf2e93aa3719f926631cabStephen Gallagher
03532fb1cbb7e8c1d5cf2e93aa3719f926631cabStephen Gallagherinstance Sentences Haskell (TiDecl PNT) Sign HaskellMorphism Symbol where
03532fb1cbb7e8c1d5cf2e93aa3719f926631cabStephen Gallagher map_sen Haskell _m s = return s
03532fb1cbb7e8c1d5cf2e93aa3719f926631cabStephen Gallagher print_named Haskell sen =
03532fb1cbb7e8c1d5cf2e93aa3719f926631cabStephen Gallagher pretty (sentence sen) <>
03532fb1cbb7e8c1d5cf2e93aa3719f926631cabStephen Gallagher case senAttr sen of
03532fb1cbb7e8c1d5cf2e93aa3719f926631cabStephen Gallagher [] -> empty
03532fb1cbb7e8c1d5cf2e93aa3719f926631cabStephen Gallagher lab -> space <> text "{-" <+> text lab <+> text "-}"
03532fb1cbb7e8c1d5cf2e93aa3719f926631cabStephen Gallagher
03532fb1cbb7e8c1d5cf2e93aa3719f926631cabStephen Gallagherinstance StaticAnalysis Haskell HsDecls
03532fb1cbb7e8c1d5cf2e93aa3719f926631cabStephen Gallagher (TiDecl PNT)
03532fb1cbb7e8c1d5cf2e93aa3719f926631cabStephen Gallagher SYMB_ITEMS SYMB_MAP_ITEMS
03532fb1cbb7e8c1d5cf2e93aa3719f926631cabStephen Gallagher Sign
03532fb1cbb7e8c1d5cf2e93aa3719f926631cabStephen Gallagher HaskellMorphism
03532fb1cbb7e8c1d5cf2e93aa3719f926631cabStephen Gallagher Symbol RawSymbol where
03532fb1cbb7e8c1d5cf2e93aa3719f926631cabStephen Gallagher basic_analysis Haskell = Just hatAna
03532fb1cbb7e8c1d5cf2e93aa3719f926631cabStephen Gallagher empty_signature Haskell = emptySign
03532fb1cbb7e8c1d5cf2e93aa3719f926631cabStephen Gallagher signature_union Haskell s = return . addSign s
03532fb1cbb7e8c1d5cf2e93aa3719f926631cabStephen Gallagher final_union Haskell = signature_union Haskell
03532fb1cbb7e8c1d5cf2e93aa3719f926631cabStephen Gallagher inclusion Haskell = defaultInclusion isSubSign
03532fb1cbb7e8c1d5cf2e93aa3719f926631cabStephen Gallagher
03532fb1cbb7e8c1d5cf2e93aa3719f926631cabStephen Gallagherinstance Logic Haskell Haskell_Sublogics
03532fb1cbb7e8c1d5cf2e93aa3719f926631cabStephen Gallagher HsDecls (TiDecl PNT) SYMB_ITEMS SYMB_MAP_ITEMS
03532fb1cbb7e8c1d5cf2e93aa3719f926631cabStephen Gallagher Sign
03532fb1cbb7e8c1d5cf2e93aa3719f926631cabStephen Gallagher HaskellMorphism
022456e93c9b175ce3774afe524e3926f41ba80fSumit Bose Symbol RawSymbol ()
03532fb1cbb7e8c1d5cf2e93aa3719f926631cabStephen Gallagher