Changeset 11843

Show
Ignore:
Timestamp:
29.06.2009 18:01:38 (9 months ago)
Author:
maeder
Message:

added logic maude

Location:
trunk
Files:
4 modified

Legend:

Unmodified
Added
Removed
  • trunk/Comorphisms/LogicList.hs

    r11675 r11843  
    6262import DFOL.Logic_DFOL 
    6363import OMDoc.Logic_OMDoc () 
     64import Maude.Logic_Maude 
    6465#endif 
    6566#ifndef NOOWLLOGIC 
     
    8990  , Logic Temporal 
    9091  , Logic DFOL 
     92  , Logic Maude 
    9193#endif 
    9294#ifndef NOOWLLOGIC 
  • trunk/Maude/AS_Maude.hs

    r11842 r11843  
    1 {- 
    2   Ref. 
    3   http://maude.cs.uiuc.edu/ 
     1{-# OPTIONS -XDeriveDataTypeable #-} 
     2{- | 
     3Module      :  $Header$ 
     4Description :  abstract maude syntax 
     5Copyright   :  (c) DFKI GmbH 2009 
     6License     :  similar to LGPL, see HetCATS/LICENSE.txt or LIZENZ.txt 
     7 
     8Maintainer  :  ariesco@fdi.ucm.es 
     9Stability   :  experimental 
     10Portability :  portable 
     11 
     12The abstract syntax of maude. Basic specs are a list of statements excluding 
     13imports. Sentences are equations, membership axioms, and rules. Sort, subsort 
     14and operations should be converted to signature. 
     15 
     16Because maude parses and typechecks an input string in one go, basic specs for 
     17the logic instance are just a wrapped string that is created by a simple 
     18parser. 
    419-} 
    520 
    621module Maude.AS_Maude where 
    7    
    8 import qualified Common.Id as Id 
    9    
     22 
     23import Common.ATerm.Lib 
     24import Common.Doc 
     25import Common.DocUtils 
     26import Common.Id 
     27import Data.Typeable 
     28 
    1029data Spec = Spec ModId [Parameter] [Statement] 
    1130          deriving (Show, Read) 
     
    2847              | OpRenaming2 OpId [Type] Type ToPartRenaming 
    2948              deriving (Show, Read) 
     49 
     50newtype MaudeText = MaudeText String deriving (Show, Typeable) 
     51 
     52instance Pretty MaudeText where 
     53  pretty (MaudeText s) = text s 
     54 
     55instance 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 
    3065 
    3166data Statement = ImportStmnt Import 
     
    80115          | Memo 
    81116          | Prec Int 
    82           | Gather [Id.Token] 
    83           | Format [Id.Token] 
     117          | Gather [Token] 
     118          | Format [Token] 
    84119          | Ctor 
    85120          | Config 
     
    90125          deriving (Show, Read) 
    91126 
    92 data StmntAttr = Label Id.Token 
     127data StmntAttr = Label Token 
    93128               | Metadata String 
    94129               | Owise 
    95130               | Nonexec 
    96                | Print [Id.Token] 
     131               | Print [Token] 
    97132               deriving (Show, Read) 
    98133 
    99 data Term = Const Id.Token Type 
    100           | Var Id.Token Type 
    101           | Apply Id.Token [Term] 
     134data Term = Const Token Type 
     135          | Var Token Type 
     136          | Apply Token [Term] 
    102137          deriving (Show, Read) 
    103138 
     
    106141          deriving (Show, Read) 
    107142 
    108 newtype Sort = SortId Id.Token 
     143newtype Sort = SortId Token 
    109144             deriving (Show, Read) 
    110145 
    111 newtype Kind = KindId Id.Token 
     146newtype Kind = KindId Token 
    112147             deriving (Show, Read) 
    113148 
    114 newtype ParamId = ParamId Id.Token 
     149newtype ParamId = ParamId Token 
    115150                deriving (Show, Read) 
    116151 
    117 newtype ModId = ModId Id.Token 
     152newtype ModId = ModId Token 
    118153              deriving (Show, Read) 
    119154 
    120 newtype LabelId = LabelId Id.Token 
     155newtype LabelId = LabelId Token 
    121156                deriving (Show, Read) 
    122157 
    123 newtype OpId = OpId Id.Token 
     158newtype OpId = OpId Token 
    124159             deriving (Show, Read) 
  • trunk/Maude/Logic_Maude.hs

    r11759 r11843  
    99Portability :  non-portable (imports Logic.Logic) 
    1010 
    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   ... 
     11Instance of class Logic for Maude. See <http://maude.cs.uiuc.edu/> 
    1912-} 
    2013 
     
    2316import Logic.Logic 
    2417 
     18import Maude.AS_Maude (MaudeText) 
    2519import Maude.Sign     (Sign) 
    2620import Maude.Morphism (Morphism) 
     
    7771-- | Instance of Syntax for Maude 
    7872-- TODO: Implement real instance of Syntax for Maude 
    79 instance Syntax Maude () () () where 
     73instance Syntax Maude MaudeText () () where 
    8074    -- parse_basic_spec 
    8175    -- parse_symb_items 
     
    8478-- | Instance of StaticAnalysis for Maude 
    8579-- TODO: Implement real instance of StaticAnalysis for Maude 
    86 instance StaticAnalysis Maude () Sentence () () Sign Morphism Symbol Symbol where 
     80instance StaticAnalysis Maude MaudeText Sentence () () Sign Morphism Symbol 
     81    Symbol where 
    8782    -- static analysis -- 
    8883    -- basic_analysis 
     
    116111-- | Instance of Logic for Maude 
    117112-- TODO: Implement real instance of Logic for Maude 
    118 instance Logic Maude () () Sentence () () Sign Morphism Symbol Symbol () where 
     113instance Logic Maude () MaudeText Sentence () () Sign Morphism Symbol Symbol 
     114    () where 
    119115    stability Maude = Experimental 
    120116    -- data_logic 
  • trunk/Maude/Meta/Qid.hs

    r11759 r11843  
    2323-- A Quoted Identifier 
    2424newtype Qid = Qid { qid :: Id.Id } 
    25     deriving (Show, Eq, Ord, Typeable, Pretty) 
     25    deriving (Show, Eq, Ord, Typeable, Pretty, Id.GetRange) 
    2626 
    2727-- TODO: Replace dummy implementation for ShATermConvertible Qid.