Changeset 11843
- Timestamp:
- 29.06.2009 18:01:38 (9 months ago)
- Location:
- trunk
- Files:
-
- 4 modified
-
Comorphisms/LogicList.hs (modified) (2 diffs)
-
Maude/AS_Maude.hs (modified) (5 diffs)
-
Maude/Logic_Maude.hs (modified) (5 diffs)
-
Maude/Meta/Qid.hs (modified) (1 diff)
Legend:
- Unmodified
- Added
- Removed
-
trunk/Comorphisms/LogicList.hs
r11675 r11843 62 62 import DFOL.Logic_DFOL 63 63 import OMDoc.Logic_OMDoc () 64 import Maude.Logic_Maude 64 65 #endif 65 66 #ifndef NOOWLLOGIC … … 89 90 , Logic Temporal 90 91 , Logic DFOL 92 , Logic Maude 91 93 #endif 92 94 #ifndef NOOWLLOGIC -
trunk/Maude/AS_Maude.hs
r11842 r11843 1 {- 2 Ref. 3 http://maude.cs.uiuc.edu/ 1 {-# OPTIONS -XDeriveDataTypeable #-} 2 {- | 3 Module : $Header$ 4 Description : abstract maude syntax 5 Copyright : (c) DFKI GmbH 2009 6 License : similar to LGPL, see HetCATS/LICENSE.txt or LIZENZ.txt 7 8 Maintainer : ariesco@fdi.ucm.es 9 Stability : experimental 10 Portability : portable 11 12 The abstract syntax of maude. Basic specs are a list of statements excluding 13 imports. Sentences are equations, membership axioms, and rules. Sort, subsort 14 and operations should be converted to signature. 15 16 Because maude parses and typechecks an input string in one go, basic specs for 17 the logic instance are just a wrapped string that is created by a simple 18 parser. 4 19 -} 5 20 6 21 module Maude.AS_Maude where 7 8 import qualified Common.Id as Id 9 22 23 import Common.ATerm.Lib 24 import Common.Doc 25 import Common.DocUtils 26 import Common.Id 27 import Data.Typeable 28 10 29 data Spec = Spec ModId [Parameter] [Statement] 11 30 deriving (Show, Read) … … 28 47 | OpRenaming2 OpId [Type] Type ToPartRenaming 29 48 deriving (Show, Read) 49 50 newtype MaudeText = MaudeText String deriving (Show, Typeable) 51 52 instance Pretty MaudeText where 53 pretty (MaudeText s) = text s 54 55 instance ShATermConvertible MaudeText where 56 toShATermAux att0 (MaudeText a) = do 57 (att1, a') <- toShATerm' att0 a 58 return $ addATerm (ShAAppl "MaudeText" [a'] []) att1 59 fromShATermAux ix att0 = 60 case getShATerm ix att0 of 61 ShAAppl "MaudeText" [a] _ -> 62 case fromShATerm' a att0 of { (att1, a') -> 63 (att1, MaudeText a') } 64 u -> fromShATermError "MaudeText" u 30 65 31 66 data Statement = ImportStmnt Import … … 80 115 | Memo 81 116 | Prec Int 82 | Gather [ Id.Token]83 | Format [ Id.Token]117 | Gather [Token] 118 | Format [Token] 84 119 | Ctor 85 120 | Config … … 90 125 deriving (Show, Read) 91 126 92 data StmntAttr = Label Id.Token127 data StmntAttr = Label Token 93 128 | Metadata String 94 129 | Owise 95 130 | Nonexec 96 | Print [ Id.Token]131 | Print [Token] 97 132 deriving (Show, Read) 98 133 99 data Term = Const Id.Token Type100 | Var Id.Token Type101 | Apply Id.Token [Term]134 data Term = Const Token Type 135 | Var Token Type 136 | Apply Token [Term] 102 137 deriving (Show, Read) 103 138 … … 106 141 deriving (Show, Read) 107 142 108 newtype Sort = SortId Id.Token143 newtype Sort = SortId Token 109 144 deriving (Show, Read) 110 145 111 newtype Kind = KindId Id.Token146 newtype Kind = KindId Token 112 147 deriving (Show, Read) 113 148 114 newtype ParamId = ParamId Id.Token149 newtype ParamId = ParamId Token 115 150 deriving (Show, Read) 116 151 117 newtype ModId = ModId Id.Token152 newtype ModId = ModId Token 118 153 deriving (Show, Read) 119 154 120 newtype LabelId = LabelId Id.Token155 newtype LabelId = LabelId Token 121 156 deriving (Show, Read) 122 157 123 newtype OpId = OpId Id.Token158 newtype OpId = OpId Token 124 159 deriving (Show, Read) -
trunk/Maude/Logic_Maude.hs
r11759 r11843 9 9 Portability : non-portable (imports Logic.Logic) 10 10 11 Instance of class Logic for Maude. 12 Also instances of Syntax and Category. 13 ... sometime in the future, that is. 14 -} 15 {- 16 Ref. 17 18 ... 11 Instance of class Logic for Maude. See <http://maude.cs.uiuc.edu/> 19 12 -} 20 13 … … 23 16 import Logic.Logic 24 17 18 import Maude.AS_Maude (MaudeText) 25 19 import Maude.Sign (Sign) 26 20 import Maude.Morphism (Morphism) … … 77 71 -- | Instance of Syntax for Maude 78 72 -- TODO: Implement real instance of Syntax for Maude 79 instance Syntax Maude ()() () where73 instance Syntax Maude MaudeText () () where 80 74 -- parse_basic_spec 81 75 -- parse_symb_items … … 84 78 -- | Instance of StaticAnalysis for Maude 85 79 -- TODO: Implement real instance of StaticAnalysis for Maude 86 instance StaticAnalysis Maude () Sentence () () Sign Morphism Symbol Symbol where 80 instance StaticAnalysis Maude MaudeText Sentence () () Sign Morphism Symbol 81 Symbol where 87 82 -- static analysis -- 88 83 -- basic_analysis … … 116 111 -- | Instance of Logic for Maude 117 112 -- TODO: Implement real instance of Logic for Maude 118 instance Logic Maude () () Sentence () () Sign Morphism Symbol Symbol () where 113 instance Logic Maude () MaudeText Sentence () () Sign Morphism Symbol Symbol 114 () where 119 115 stability Maude = Experimental 120 116 -- data_logic -
trunk/Maude/Meta/Qid.hs
r11759 r11843 23 23 -- A Quoted Identifier 24 24 newtype Qid = Qid { qid :: Id.Id } 25 deriving (Show, Eq, Ord, Typeable, Pretty )25 deriving (Show, Eq, Ord, Typeable, Pretty, Id.GetRange) 26 26 27 27 -- TODO: Replace dummy implementation for ShATermConvertible Qid.