{-# OPTIONS -w -O0 #-}
{-# LANGUAGE CPP, StandaloneDeriving, DeriveDataTypeable, DeriveGeneric #-}
{- |
Module      :  RelationalScheme/ATC_RelationalScheme.der.hs
Description :  generated ShATermConvertible, Json instances
Copyright   :  (c) DFKI GmbH 2012
License     :  GPLv2 or higher, see LICENSE.txt

Maintainer  :  Christian.Maeder@dfki.de
Stability   :  provisional
Portability :  non-portable(derive Typeable instances)

Automatic derivation of instances via DrIFT-rule ShATermConvertible, Json
  for the type(s):
'RelationalScheme.AS.RSRelType'
'RelationalScheme.AS.RSQualId'
'RelationalScheme.AS.RSRel'
'RelationalScheme.AS.RSRelationships'
'RelationalScheme.AS.RSScheme'
'RelationalScheme.Sign.RSDatatype'
'RelationalScheme.Sign.RSSymbol'
'RelationalScheme.Sign.RSSymbolKind'
'RelationalScheme.Sign.RSColumn'
'RelationalScheme.Sign.RSTable'
'RelationalScheme.Sign.RSTables'
'RelationalScheme.Sign.RSTMap'
'RelationalScheme.Sign.RSMorphism'
-}

{-
Generated by 'genRules' (automatic rule generation for DrIFT). Don't touch!!
  dependency files:
RelationalScheme/AS.hs
RelationalScheme/Sign.hs
-}

module RelationalScheme.ATC_RelationalScheme () where

import ATC.GlobalAnnotations
import ATerm.Lib
import Common.AS_Annotation
import Common.Doc
import Common.DocUtils
import Common.Id
import Common.Json.Instances
import Common.Result
import Common.Utils
import Data.Aeson(ToJSON, FromJSON)
import Data.Data
import GHC.Generics(Generic)
import RelationalScheme.AS
import RelationalScheme.Keywords
import RelationalScheme.Sign
import qualified Control.Monad.Fail as Fail
import qualified Data.Map as Map
import qualified Data.Set as Set

{-! for RelationalScheme.AS.RSRelType derive : ShATermConvertible !-}
{-! for RelationalScheme.AS.RSQualId derive : ShATermConvertible !-}
{-! for RelationalScheme.AS.RSRel derive : ShATermConvertible !-}
{-! for RelationalScheme.AS.RSRelationships derive : ShATermConvertible !-}
{-! for RelationalScheme.AS.RSScheme derive : ShATermConvertible !-}
{-! for RelationalScheme.Sign.RSDatatype derive : ShATermConvertible !-}
{-! for RelationalScheme.Sign.RSSymbol derive : ShATermConvertible !-}
{-! for RelationalScheme.Sign.RSSymbolKind derive : ShATermConvertible !-}
{-! for RelationalScheme.Sign.RSColumn derive : ShATermConvertible !-}
{-! for RelationalScheme.Sign.RSTable derive : ShATermConvertible !-}
{-! for RelationalScheme.Sign.RSTables derive : ShATermConvertible !-}
{-! for RelationalScheme.Sign.RSTMap derive : ShATermConvertible !-}
{-! for RelationalScheme.Sign.RSMorphism derive : ShATermConvertible !-}

{-! for RelationalScheme.AS.RSRelType derive : Json !-}
{-! for RelationalScheme.AS.RSQualId derive : Json !-}
{-! for RelationalScheme.AS.RSRel derive : Json !-}
{-! for RelationalScheme.AS.RSRelationships derive : Json !-}
{-! for RelationalScheme.AS.RSScheme derive : Json !-}
{-! for RelationalScheme.Sign.RSDatatype derive : Json !-}
{-! for RelationalScheme.Sign.RSSymbol derive : Json !-}
{-! for RelationalScheme.Sign.RSSymbolKind derive : Json !-}
{-! for RelationalScheme.Sign.RSColumn derive : Json !-}
{-! for RelationalScheme.Sign.RSTable derive : Json !-}
{-! for RelationalScheme.Sign.RSTables derive : Json !-}
{-! for RelationalScheme.Sign.RSTMap derive : Json !-}
{-! for RelationalScheme.Sign.RSMorphism derive : Json !-}

-- Generated by DrIFT, look but don't touch!

instance ShATermConvertible RelationalScheme.AS.RSRelType where
  toShATermAux :: ATermTable -> RSRelType -> IO (ATermTable, Int)
toShATermAux att0 :: ATermTable
att0 xv :: RSRelType
xv = case RSRelType
xv of
    RSone_to_one -> (ATermTable, Int) -> IO (ATermTable, Int)
forall (m :: * -> *) a. Monad m => a -> m a
return ((ATermTable, Int) -> IO (ATermTable, Int))
-> (ATermTable, Int) -> IO (ATermTable, Int)
forall a b. (a -> b) -> a -> b
$ ShATerm -> ATermTable -> (ATermTable, Int)
addATerm (String -> [Int] -> [Int] -> ShATerm
ShAAppl "RSone_to_one" [] []) ATermTable
att0
    RSone_to_many -> (ATermTable, Int) -> IO (ATermTable, Int)
forall (m :: * -> *) a. Monad m => a -> m a
return ((ATermTable, Int) -> IO (ATermTable, Int))
-> (ATermTable, Int) -> IO (ATermTable, Int)
forall a b. (a -> b) -> a -> b
$ ShATerm -> ATermTable -> (ATermTable, Int)
addATerm (String -> [Int] -> [Int] -> ShATerm
ShAAppl "RSone_to_many" [] []) ATermTable
att0
    RSmany_to_one -> (ATermTable, Int) -> IO (ATermTable, Int)
forall (m :: * -> *) a. Monad m => a -> m a
return ((ATermTable, Int) -> IO (ATermTable, Int))
-> (ATermTable, Int) -> IO (ATermTable, Int)
forall a b. (a -> b) -> a -> b
$ ShATerm -> ATermTable -> (ATermTable, Int)
addATerm (String -> [Int] -> [Int] -> ShATerm
ShAAppl "RSmany_to_one" [] []) ATermTable
att0
    RSmany_to_many -> (ATermTable, Int) -> IO (ATermTable, Int)
forall (m :: * -> *) a. Monad m => a -> m a
return ((ATermTable, Int) -> IO (ATermTable, Int))
-> (ATermTable, Int) -> IO (ATermTable, Int)
forall a b. (a -> b) -> a -> b
$ ShATerm -> ATermTable -> (ATermTable, Int)
addATerm (String -> [Int] -> [Int] -> ShATerm
ShAAppl "RSmany_to_many" [] []) ATermTable
att0
  fromShATermAux :: Int -> ATermTable -> (ATermTable, RSRelType)
fromShATermAux ix :: Int
ix att0 :: ATermTable
att0 = case Int -> ATermTable -> ShATerm
getShATerm Int
ix ATermTable
att0 of
    ShAAppl "RSone_to_one" [] _ -> (ATermTable
att0, RSRelType
RSone_to_one)
    ShAAppl "RSone_to_many" [] _ -> (ATermTable
att0, RSRelType
RSone_to_many)
    ShAAppl "RSmany_to_one" [] _ -> (ATermTable
att0, RSRelType
RSmany_to_one)
    ShAAppl "RSmany_to_many" [] _ -> (ATermTable
att0, RSRelType
RSmany_to_many)
    u :: ShATerm
u -> String -> ShATerm -> (ATermTable, RSRelType)
forall a. String -> ShATerm -> a
fromShATermError "RelationalScheme.AS.RSRelType" ShATerm
u

instance ShATermConvertible RelationalScheme.AS.RSQualId where
  toShATermAux :: ATermTable -> RSQualId -> IO (ATermTable, Int)
toShATermAux att0 :: ATermTable
att0 xv :: RSQualId
xv = case RSQualId
xv of
    RSQualId a :: Id
a b :: Id
b c :: Range
c -> do
      (att1 :: ATermTable
att1, a' :: Int
a') <- ATermTable -> Id -> IO (ATermTable, Int)
forall t.
ShATermConvertible t =>
ATermTable -> t -> IO (ATermTable, Int)
toShATerm' ATermTable
att0 Id
a
      (att2 :: ATermTable
att2, b' :: Int
b') <- ATermTable -> Id -> IO (ATermTable, Int)
forall t.
ShATermConvertible t =>
ATermTable -> t -> IO (ATermTable, Int)
toShATerm' ATermTable
att1 Id
b
      (att3 :: ATermTable
att3, c' :: Int
c') <- ATermTable -> Range -> IO (ATermTable, Int)
forall t.
ShATermConvertible t =>
ATermTable -> t -> IO (ATermTable, Int)
toShATerm' ATermTable
att2 Range
c
      (ATermTable, Int) -> IO (ATermTable, Int)
forall (m :: * -> *) a. Monad m => a -> m a
return ((ATermTable, Int) -> IO (ATermTable, Int))
-> (ATermTable, Int) -> IO (ATermTable, Int)
forall a b. (a -> b) -> a -> b
$ ShATerm -> ATermTable -> (ATermTable, Int)
addATerm (String -> [Int] -> [Int] -> ShATerm
ShAAppl "RSQualId" [Int
a', Int
b', Int
c'] []) ATermTable
att3
  fromShATermAux :: Int -> ATermTable -> (ATermTable, RSQualId)
fromShATermAux ix :: Int
ix att0 :: ATermTable
att0 = case Int -> ATermTable -> ShATerm
getShATerm Int
ix ATermTable
att0 of
    ShAAppl "RSQualId" [a :: Int
a, b :: Int
b, c :: Int
c] _ ->
      case Int -> ATermTable -> (ATermTable, Id)
forall t.
ShATermConvertible t =>
Int -> ATermTable -> (ATermTable, t)
fromShATerm' Int
a ATermTable
att0 of
      { (att1 :: ATermTable
att1, a' :: Id
a') ->
      case Int -> ATermTable -> (ATermTable, Id)
forall t.
ShATermConvertible t =>
Int -> ATermTable -> (ATermTable, t)
fromShATerm' Int
b ATermTable
att1 of
      { (att2 :: ATermTable
att2, b' :: Id
b') ->
      case Int -> ATermTable -> (ATermTable, Range)
forall t.
ShATermConvertible t =>
Int -> ATermTable -> (ATermTable, t)
fromShATerm' Int
c ATermTable
att2 of
      { (att3 :: ATermTable
att3, c' :: Range
c') ->
      (ATermTable
att3, Id -> Id -> Range -> RSQualId
RSQualId Id
a' Id
b' Range
c') }}}
    u :: ShATerm
u -> String -> ShATerm -> (ATermTable, RSQualId)
forall a. String -> ShATerm -> a
fromShATermError "RelationalScheme.AS.RSQualId" ShATerm
u

instance ShATermConvertible RelationalScheme.AS.RSRel where
  toShATermAux :: ATermTable -> RSRel -> IO (ATermTable, Int)
toShATermAux att0 :: ATermTable
att0 xv :: RSRel
xv = case RSRel
xv of
    RSRel a :: [RSQualId]
a b :: [RSQualId]
b c :: RSRelType
c d :: Range
d -> do
      (att1 :: ATermTable
att1, a' :: Int
a') <- ATermTable -> [RSQualId] -> IO (ATermTable, Int)
forall t.
ShATermConvertible t =>
ATermTable -> t -> IO (ATermTable, Int)
toShATerm' ATermTable
att0 [RSQualId]
a
      (att2 :: ATermTable
att2, b' :: Int
b') <- ATermTable -> [RSQualId] -> IO (ATermTable, Int)
forall t.
ShATermConvertible t =>
ATermTable -> t -> IO (ATermTable, Int)
toShATerm' ATermTable
att1 [RSQualId]
b
      (att3 :: ATermTable
att3, c' :: Int
c') <- ATermTable -> RSRelType -> IO (ATermTable, Int)
forall t.
ShATermConvertible t =>
ATermTable -> t -> IO (ATermTable, Int)
toShATerm' ATermTable
att2 RSRelType
c
      (att4 :: ATermTable
att4, d' :: Int
d') <- ATermTable -> Range -> IO (ATermTable, Int)
forall t.
ShATermConvertible t =>
ATermTable -> t -> IO (ATermTable, Int)
toShATerm' ATermTable
att3 Range
d
      (ATermTable, Int) -> IO (ATermTable, Int)
forall (m :: * -> *) a. Monad m => a -> m a
return ((ATermTable, Int) -> IO (ATermTable, Int))
-> (ATermTable, Int) -> IO (ATermTable, Int)
forall a b. (a -> b) -> a -> b
$ ShATerm -> ATermTable -> (ATermTable, Int)
addATerm (String -> [Int] -> [Int] -> ShATerm
ShAAppl "RSRel" [Int
a', Int
b', Int
c', Int
d'] []) ATermTable
att4
  fromShATermAux :: Int -> ATermTable -> (ATermTable, RSRel)
fromShATermAux ix :: Int
ix att0 :: ATermTable
att0 = case Int -> ATermTable -> ShATerm
getShATerm Int
ix ATermTable
att0 of
    ShAAppl "RSRel" [a :: Int
a, b :: Int
b, c :: Int
c, d :: Int
d] _ ->
      case Int -> ATermTable -> (ATermTable, [RSQualId])
forall t.
ShATermConvertible t =>
Int -> ATermTable -> (ATermTable, t)
fromShATerm' Int
a ATermTable
att0 of
      { (att1 :: ATermTable
att1, a' :: [RSQualId]
a') ->
      case Int -> ATermTable -> (ATermTable, [RSQualId])
forall t.
ShATermConvertible t =>
Int -> ATermTable -> (ATermTable, t)
fromShATerm' Int
b ATermTable
att1 of
      { (att2 :: ATermTable
att2, b' :: [RSQualId]
b') ->
      case Int -> ATermTable -> (ATermTable, RSRelType)
forall t.
ShATermConvertible t =>
Int -> ATermTable -> (ATermTable, t)
fromShATerm' Int
c ATermTable
att2 of
      { (att3 :: ATermTable
att3, c' :: RSRelType
c') ->
      case Int -> ATermTable -> (ATermTable, Range)
forall t.
ShATermConvertible t =>
Int -> ATermTable -> (ATermTable, t)
fromShATerm' Int
d ATermTable
att3 of
      { (att4 :: ATermTable
att4, d' :: Range
d') ->
      (ATermTable
att4, [RSQualId] -> [RSQualId] -> RSRelType -> Range -> RSRel
RSRel [RSQualId]
a' [RSQualId]
b' RSRelType
c' Range
d') }}}}
    u :: ShATerm
u -> String -> ShATerm -> (ATermTable, RSRel)
forall a. String -> ShATerm -> a
fromShATermError "RelationalScheme.AS.RSRel" ShATerm
u

instance ShATermConvertible RelationalScheme.AS.RSRelationships where
  toShATermAux :: ATermTable -> RSRelationships -> IO (ATermTable, Int)
toShATermAux att0 :: ATermTable
att0 xv :: RSRelationships
xv = case RSRelationships
xv of
    RSRelationships a :: [Annoted RSRel]
a b :: Range
b -> do
      (att1 :: ATermTable
att1, a' :: Int
a') <- ATermTable -> [Annoted RSRel] -> IO (ATermTable, Int)
forall t.
ShATermConvertible t =>
ATermTable -> t -> IO (ATermTable, Int)
toShATerm' ATermTable
att0 [Annoted RSRel]
a
      (att2 :: ATermTable
att2, b' :: Int
b') <- ATermTable -> Range -> IO (ATermTable, Int)
forall t.
ShATermConvertible t =>
ATermTable -> t -> IO (ATermTable, Int)
toShATerm' ATermTable
att1 Range
b
      (ATermTable, Int) -> IO (ATermTable, Int)
forall (m :: * -> *) a. Monad m => a -> m a
return ((ATermTable, Int) -> IO (ATermTable, Int))
-> (ATermTable, Int) -> IO (ATermTable, Int)
forall a b. (a -> b) -> a -> b
$ ShATerm -> ATermTable -> (ATermTable, Int)
addATerm (String -> [Int] -> [Int] -> ShATerm
ShAAppl "RSRelationships" [Int
a', Int
b'] []) ATermTable
att2
  fromShATermAux :: Int -> ATermTable -> (ATermTable, RSRelationships)
fromShATermAux ix :: Int
ix att0 :: ATermTable
att0 = case Int -> ATermTable -> ShATerm
getShATerm Int
ix ATermTable
att0 of
    ShAAppl "RSRelationships" [a :: Int
a, b :: Int
b] _ ->
      case Int -> ATermTable -> (ATermTable, [Annoted RSRel])
forall t.
ShATermConvertible t =>
Int -> ATermTable -> (ATermTable, t)
fromShATerm' Int
a ATermTable
att0 of
      { (att1 :: ATermTable
att1, a' :: [Annoted RSRel]
a') ->
      case Int -> ATermTable -> (ATermTable, Range)
forall t.
ShATermConvertible t =>
Int -> ATermTable -> (ATermTable, t)
fromShATerm' Int
b ATermTable
att1 of
      { (att2 :: ATermTable
att2, b' :: Range
b') ->
      (ATermTable
att2, [Annoted RSRel] -> Range -> RSRelationships
RSRelationships [Annoted RSRel]
a' Range
b') }}
    u :: ShATerm
u -> String -> ShATerm -> (ATermTable, RSRelationships)
forall a. String -> ShATerm -> a
fromShATermError "RelationalScheme.AS.RSRelationships" ShATerm
u

instance ShATermConvertible RelationalScheme.AS.RSScheme where
  toShATermAux :: ATermTable -> RSScheme -> IO (ATermTable, Int)
toShATermAux att0 :: ATermTable
att0 xv :: RSScheme
xv = case RSScheme
xv of
    RSScheme a :: RSTables
a b :: RSRelationships
b c :: Range
c -> do
      (att1 :: ATermTable
att1, a' :: Int
a') <- ATermTable -> RSTables -> IO (ATermTable, Int)
forall t.
ShATermConvertible t =>
ATermTable -> t -> IO (ATermTable, Int)
toShATerm' ATermTable
att0 RSTables
a
      (att2 :: ATermTable
att2, b' :: Int
b') <- ATermTable -> RSRelationships -> IO (ATermTable, Int)
forall t.
ShATermConvertible t =>
ATermTable -> t -> IO (ATermTable, Int)
toShATerm' ATermTable
att1 RSRelationships
b
      (att3 :: ATermTable
att3, c' :: Int
c') <- ATermTable -> Range -> IO (ATermTable, Int)
forall t.
ShATermConvertible t =>
ATermTable -> t -> IO (ATermTable, Int)
toShATerm' ATermTable
att2 Range
c
      (ATermTable, Int) -> IO (ATermTable, Int)
forall (m :: * -> *) a. Monad m => a -> m a
return ((ATermTable, Int) -> IO (ATermTable, Int))
-> (ATermTable, Int) -> IO (ATermTable, Int)
forall a b. (a -> b) -> a -> b
$ ShATerm -> ATermTable -> (ATermTable, Int)
addATerm (String -> [Int] -> [Int] -> ShATerm
ShAAppl "RSScheme" [Int
a', Int
b', Int
c'] []) ATermTable
att3
  fromShATermAux :: Int -> ATermTable -> (ATermTable, RSScheme)
fromShATermAux ix :: Int
ix att0 :: ATermTable
att0 = case Int -> ATermTable -> ShATerm
getShATerm Int
ix ATermTable
att0 of
    ShAAppl "RSScheme" [a :: Int
a, b :: Int
b, c :: Int
c] _ ->
      case Int -> ATermTable -> (ATermTable, RSTables)
forall t.
ShATermConvertible t =>
Int -> ATermTable -> (ATermTable, t)
fromShATerm' Int
a ATermTable
att0 of
      { (att1 :: ATermTable
att1, a' :: RSTables
a') ->
      case Int -> ATermTable -> (ATermTable, RSRelationships)
forall t.
ShATermConvertible t =>
Int -> ATermTable -> (ATermTable, t)
fromShATerm' Int
b ATermTable
att1 of
      { (att2 :: ATermTable
att2, b' :: RSRelationships
b') ->
      case Int -> ATermTable -> (ATermTable, Range)
forall t.
ShATermConvertible t =>
Int -> ATermTable -> (ATermTable, t)
fromShATerm' Int
c ATermTable
att2 of
      { (att3 :: ATermTable
att3, c' :: Range
c') ->
      (ATermTable
att3, RSTables -> RSRelationships -> Range -> RSScheme
RSScheme RSTables
a' RSRelationships
b' Range
c') }}}
    u :: ShATerm
u -> String -> ShATerm -> (ATermTable, RSScheme)
forall a. String -> ShATerm -> a
fromShATermError "RelationalScheme.AS.RSScheme" ShATerm
u

deriving instance GHC.Generics.Generic RelationalScheme.AS.RSRelType
instance Data.Aeson.ToJSON RelationalScheme.AS.RSRelType where
instance Data.Aeson.FromJSON RelationalScheme.AS.RSRelType where

deriving instance GHC.Generics.Generic RelationalScheme.AS.RSQualId
instance Data.Aeson.ToJSON RelationalScheme.AS.RSQualId where
instance Data.Aeson.FromJSON RelationalScheme.AS.RSQualId where

deriving instance GHC.Generics.Generic RelationalScheme.AS.RSRel
instance Data.Aeson.ToJSON RelationalScheme.AS.RSRel where
instance Data.Aeson.FromJSON RelationalScheme.AS.RSRel where

deriving instance GHC.Generics.Generic RelationalScheme.AS.RSRelationships
instance Data.Aeson.ToJSON RelationalScheme.AS.RSRelationships where
instance Data.Aeson.FromJSON RelationalScheme.AS.RSRelationships where

deriving instance GHC.Generics.Generic RelationalScheme.AS.RSScheme
instance Data.Aeson.ToJSON RelationalScheme.AS.RSScheme where
instance Data.Aeson.FromJSON RelationalScheme.AS.RSScheme where

instance ShATermConvertible RelationalScheme.Sign.RSDatatype where
  toShATermAux :: ATermTable -> RSDatatype -> IO (ATermTable, Int)
toShATermAux att0 :: ATermTable
att0 xv :: RSDatatype
xv = case RSDatatype
xv of
    RSboolean -> (ATermTable, Int) -> IO (ATermTable, Int)
forall (m :: * -> *) a. Monad m => a -> m a
return ((ATermTable, Int) -> IO (ATermTable, Int))
-> (ATermTable, Int) -> IO (ATermTable, Int)
forall a b. (a -> b) -> a -> b
$ ShATerm -> ATermTable -> (ATermTable, Int)
addATerm (String -> [Int] -> [Int] -> ShATerm
ShAAppl "RSboolean" [] []) ATermTable
att0
    RSbinary -> (ATermTable, Int) -> IO (ATermTable, Int)
forall (m :: * -> *) a. Monad m => a -> m a
return ((ATermTable, Int) -> IO (ATermTable, Int))
-> (ATermTable, Int) -> IO (ATermTable, Int)
forall a b. (a -> b) -> a -> b
$ ShATerm -> ATermTable -> (ATermTable, Int)
addATerm (String -> [Int] -> [Int] -> ShATerm
ShAAppl "RSbinary" [] []) ATermTable
att0
    RSdate -> (ATermTable, Int) -> IO (ATermTable, Int)
forall (m :: * -> *) a. Monad m => a -> m a
return ((ATermTable, Int) -> IO (ATermTable, Int))
-> (ATermTable, Int) -> IO (ATermTable, Int)
forall a b. (a -> b) -> a -> b
$ ShATerm -> ATermTable -> (ATermTable, Int)
addATerm (String -> [Int] -> [Int] -> ShATerm
ShAAppl "RSdate" [] []) ATermTable
att0
    RSdatetime -> (ATermTable, Int) -> IO (ATermTable, Int)
forall (m :: * -> *) a. Monad m => a -> m a
return ((ATermTable, Int) -> IO (ATermTable, Int))
-> (ATermTable, Int) -> IO (ATermTable, Int)
forall a b. (a -> b) -> a -> b
$ ShATerm -> ATermTable -> (ATermTable, Int)
addATerm (String -> [Int] -> [Int] -> ShATerm
ShAAppl "RSdatetime" [] []) ATermTable
att0
    RSdecimal -> (ATermTable, Int) -> IO (ATermTable, Int)
forall (m :: * -> *) a. Monad m => a -> m a
return ((ATermTable, Int) -> IO (ATermTable, Int))
-> (ATermTable, Int) -> IO (ATermTable, Int)
forall a b. (a -> b) -> a -> b
$ ShATerm -> ATermTable -> (ATermTable, Int)
addATerm (String -> [Int] -> [Int] -> ShATerm
ShAAppl "RSdecimal" [] []) ATermTable
att0
    RSfloat -> (ATermTable, Int) -> IO (ATermTable, Int)
forall (m :: * -> *) a. Monad m => a -> m a
return ((ATermTable, Int) -> IO (ATermTable, Int))
-> (ATermTable, Int) -> IO (ATermTable, Int)
forall a b. (a -> b) -> a -> b
$ ShATerm -> ATermTable -> (ATermTable, Int)
addATerm (String -> [Int] -> [Int] -> ShATerm
ShAAppl "RSfloat" [] []) ATermTable
att0
    RSinteger -> (ATermTable, Int) -> IO (ATermTable, Int)
forall (m :: * -> *) a. Monad m => a -> m a
return ((ATermTable, Int) -> IO (ATermTable, Int))
-> (ATermTable, Int) -> IO (ATermTable, Int)
forall a b. (a -> b) -> a -> b
$ ShATerm -> ATermTable -> (ATermTable, Int)
addATerm (String -> [Int] -> [Int] -> ShATerm
ShAAppl "RSinteger" [] []) ATermTable
att0
    RSstring -> (ATermTable, Int) -> IO (ATermTable, Int)
forall (m :: * -> *) a. Monad m => a -> m a
return ((ATermTable, Int) -> IO (ATermTable, Int))
-> (ATermTable, Int) -> IO (ATermTable, Int)
forall a b. (a -> b) -> a -> b
$ ShATerm -> ATermTable -> (ATermTable, Int)
addATerm (String -> [Int] -> [Int] -> ShATerm
ShAAppl "RSstring" [] []) ATermTable
att0
    RStext -> (ATermTable, Int) -> IO (ATermTable, Int)
forall (m :: * -> *) a. Monad m => a -> m a
return ((ATermTable, Int) -> IO (ATermTable, Int))
-> (ATermTable, Int) -> IO (ATermTable, Int)
forall a b. (a -> b) -> a -> b
$ ShATerm -> ATermTable -> (ATermTable, Int)
addATerm (String -> [Int] -> [Int] -> ShATerm
ShAAppl "RStext" [] []) ATermTable
att0
    RStime -> (ATermTable, Int) -> IO (ATermTable, Int)
forall (m :: * -> *) a. Monad m => a -> m a
return ((ATermTable, Int) -> IO (ATermTable, Int))
-> (ATermTable, Int) -> IO (ATermTable, Int)
forall a b. (a -> b) -> a -> b
$ ShATerm -> ATermTable -> (ATermTable, Int)
addATerm (String -> [Int] -> [Int] -> ShATerm
ShAAppl "RStime" [] []) ATermTable
att0
    RStimestamp -> (ATermTable, Int) -> IO (ATermTable, Int)
forall (m :: * -> *) a. Monad m => a -> m a
return ((ATermTable, Int) -> IO (ATermTable, Int))
-> (ATermTable, Int) -> IO (ATermTable, Int)
forall a b. (a -> b) -> a -> b
$ ShATerm -> ATermTable -> (ATermTable, Int)
addATerm (String -> [Int] -> [Int] -> ShATerm
ShAAppl "RStimestamp" [] []) ATermTable
att0
    RSdouble -> (ATermTable, Int) -> IO (ATermTable, Int)
forall (m :: * -> *) a. Monad m => a -> m a
return ((ATermTable, Int) -> IO (ATermTable, Int))
-> (ATermTable, Int) -> IO (ATermTable, Int)
forall a b. (a -> b) -> a -> b
$ ShATerm -> ATermTable -> (ATermTable, Int)
addATerm (String -> [Int] -> [Int] -> ShATerm
ShAAppl "RSdouble" [] []) ATermTable
att0
    RSnonPosInteger -> (ATermTable, Int) -> IO (ATermTable, Int)
forall (m :: * -> *) a. Monad m => a -> m a
return ((ATermTable, Int) -> IO (ATermTable, Int))
-> (ATermTable, Int) -> IO (ATermTable, Int)
forall a b. (a -> b) -> a -> b
$ ShATerm -> ATermTable -> (ATermTable, Int)
addATerm (String -> [Int] -> [Int] -> ShATerm
ShAAppl "RSnonPosInteger" [] []) ATermTable
att0
    RSnonNegInteger -> (ATermTable, Int) -> IO (ATermTable, Int)
forall (m :: * -> *) a. Monad m => a -> m a
return ((ATermTable, Int) -> IO (ATermTable, Int))
-> (ATermTable, Int) -> IO (ATermTable, Int)
forall a b. (a -> b) -> a -> b
$ ShATerm -> ATermTable -> (ATermTable, Int)
addATerm (String -> [Int] -> [Int] -> ShATerm
ShAAppl "RSnonNegInteger" [] []) ATermTable
att0
    RSlong -> (ATermTable, Int) -> IO (ATermTable, Int)
forall (m :: * -> *) a. Monad m => a -> m a
return ((ATermTable, Int) -> IO (ATermTable, Int))
-> (ATermTable, Int) -> IO (ATermTable, Int)
forall a b. (a -> b) -> a -> b
$ ShATerm -> ATermTable -> (ATermTable, Int)
addATerm (String -> [Int] -> [Int] -> ShATerm
ShAAppl "RSlong" [] []) ATermTable
att0
    RSPointer -> (ATermTable, Int) -> IO (ATermTable, Int)
forall (m :: * -> *) a. Monad m => a -> m a
return ((ATermTable, Int) -> IO (ATermTable, Int))
-> (ATermTable, Int) -> IO (ATermTable, Int)
forall a b. (a -> b) -> a -> b
$ ShATerm -> ATermTable -> (ATermTable, Int)
addATerm (String -> [Int] -> [Int] -> ShATerm
ShAAppl "RSPointer" [] []) ATermTable
att0
  fromShATermAux :: Int -> ATermTable -> (ATermTable, RSDatatype)
fromShATermAux ix :: Int
ix att0 :: ATermTable
att0 = case Int -> ATermTable -> ShATerm
getShATerm Int
ix ATermTable
att0 of
    ShAAppl "RSboolean" [] _ -> (ATermTable
att0, RSDatatype
RSboolean)
    ShAAppl "RSbinary" [] _ -> (ATermTable
att0, RSDatatype
RSbinary)
    ShAAppl "RSdate" [] _ -> (ATermTable
att0, RSDatatype
RSdate)
    ShAAppl "RSdatetime" [] _ -> (ATermTable
att0, RSDatatype
RSdatetime)
    ShAAppl "RSdecimal" [] _ -> (ATermTable
att0, RSDatatype
RSdecimal)
    ShAAppl "RSfloat" [] _ -> (ATermTable
att0, RSDatatype
RSfloat)
    ShAAppl "RSinteger" [] _ -> (ATermTable
att0, RSDatatype
RSinteger)
    ShAAppl "RSstring" [] _ -> (ATermTable
att0, RSDatatype
RSstring)
    ShAAppl "RStext" [] _ -> (ATermTable
att0, RSDatatype
RStext)
    ShAAppl "RStime" [] _ -> (ATermTable
att0, RSDatatype
RStime)
    ShAAppl "RStimestamp" [] _ -> (ATermTable
att0, RSDatatype
RStimestamp)
    ShAAppl "RSdouble" [] _ -> (ATermTable
att0, RSDatatype
RSdouble)
    ShAAppl "RSnonPosInteger" [] _ -> (ATermTable
att0, RSDatatype
RSnonPosInteger)
    ShAAppl "RSnonNegInteger" [] _ -> (ATermTable
att0, RSDatatype
RSnonNegInteger)
    ShAAppl "RSlong" [] _ -> (ATermTable
att0, RSDatatype
RSlong)
    ShAAppl "RSPointer" [] _ -> (ATermTable
att0, RSDatatype
RSPointer)
    u :: ShATerm
u -> String -> ShATerm -> (ATermTable, RSDatatype)
forall a. String -> ShATerm -> a
fromShATermError "RelationalScheme.Sign.RSDatatype" ShATerm
u

instance ShATermConvertible RelationalScheme.Sign.RSSymbol where
  toShATermAux :: ATermTable -> RSSymbol -> IO (ATermTable, Int)
toShATermAux att0 :: ATermTable
att0 xv :: RSSymbol
xv = case RSSymbol
xv of
    STable a :: Id
a -> do
      (att1 :: ATermTable
att1, a' :: Int
a') <- ATermTable -> Id -> IO (ATermTable, Int)
forall t.
ShATermConvertible t =>
ATermTable -> t -> IO (ATermTable, Int)
toShATerm' ATermTable
att0 Id
a
      (ATermTable, Int) -> IO (ATermTable, Int)
forall (m :: * -> *) a. Monad m => a -> m a
return ((ATermTable, Int) -> IO (ATermTable, Int))
-> (ATermTable, Int) -> IO (ATermTable, Int)
forall a b. (a -> b) -> a -> b
$ ShATerm -> ATermTable -> (ATermTable, Int)
addATerm (String -> [Int] -> [Int] -> ShATerm
ShAAppl "STable" [Int
a'] []) ATermTable
att1
    SColumn a :: Id
a b :: Id
b c :: RSDatatype
c d :: RSIsKey
d -> do
      (att1 :: ATermTable
att1, a' :: Int
a') <- ATermTable -> Id -> IO (ATermTable, Int)
forall t.
ShATermConvertible t =>
ATermTable -> t -> IO (ATermTable, Int)
toShATerm' ATermTable
att0 Id
a
      (att2 :: ATermTable
att2, b' :: Int
b') <- ATermTable -> Id -> IO (ATermTable, Int)
forall t.
ShATermConvertible t =>
ATermTable -> t -> IO (ATermTable, Int)
toShATerm' ATermTable
att1 Id
b
      (att3 :: ATermTable
att3, c' :: Int
c') <- ATermTable -> RSDatatype -> IO (ATermTable, Int)
forall t.
ShATermConvertible t =>
ATermTable -> t -> IO (ATermTable, Int)
toShATerm' ATermTable
att2 RSDatatype
c
      (att4 :: ATermTable
att4, d' :: Int
d') <- ATermTable -> RSIsKey -> IO (ATermTable, Int)
forall t.
ShATermConvertible t =>
ATermTable -> t -> IO (ATermTable, Int)
toShATerm' ATermTable
att3 RSIsKey
d
      (ATermTable, Int) -> IO (ATermTable, Int)
forall (m :: * -> *) a. Monad m => a -> m a
return ((ATermTable, Int) -> IO (ATermTable, Int))
-> (ATermTable, Int) -> IO (ATermTable, Int)
forall a b. (a -> b) -> a -> b
$ ShATerm -> ATermTable -> (ATermTable, Int)
addATerm (String -> [Int] -> [Int] -> ShATerm
ShAAppl "SColumn" [Int
a', Int
b', Int
c', Int
d'] []) ATermTable
att4
  fromShATermAux :: Int -> ATermTable -> (ATermTable, RSSymbol)
fromShATermAux ix :: Int
ix att0 :: ATermTable
att0 = case Int -> ATermTable -> ShATerm
getShATerm Int
ix ATermTable
att0 of
    ShAAppl "STable" [a :: Int
a] _ ->
      case Int -> ATermTable -> (ATermTable, Id)
forall t.
ShATermConvertible t =>
Int -> ATermTable -> (ATermTable, t)
fromShATerm' Int
a ATermTable
att0 of
      { (att1 :: ATermTable
att1, a' :: Id
a') ->
      (ATermTable
att1, Id -> RSSymbol
STable Id
a') }
    ShAAppl "SColumn" [a :: Int
a, b :: Int
b, c :: Int
c, d :: Int
d] _ ->
      case Int -> ATermTable -> (ATermTable, Id)
forall t.
ShATermConvertible t =>
Int -> ATermTable -> (ATermTable, t)
fromShATerm' Int
a ATermTable
att0 of
      { (att1 :: ATermTable
att1, a' :: Id
a') ->
      case Int -> ATermTable -> (ATermTable, Id)
forall t.
ShATermConvertible t =>
Int -> ATermTable -> (ATermTable, t)
fromShATerm' Int
b ATermTable
att1 of
      { (att2 :: ATermTable
att2, b' :: Id
b') ->
      case Int -> ATermTable -> (ATermTable, RSDatatype)
forall t.
ShATermConvertible t =>
Int -> ATermTable -> (ATermTable, t)
fromShATerm' Int
c ATermTable
att2 of
      { (att3 :: ATermTable
att3, c' :: RSDatatype
c') ->
      case Int -> ATermTable -> (ATermTable, RSIsKey)
forall t.
ShATermConvertible t =>
Int -> ATermTable -> (ATermTable, t)
fromShATerm' Int
d ATermTable
att3 of
      { (att4 :: ATermTable
att4, d' :: RSIsKey
d') ->
      (ATermTable
att4, Id -> Id -> RSDatatype -> RSIsKey -> RSSymbol
SColumn Id
a' Id
b' RSDatatype
c' RSIsKey
d') }}}}
    u :: ShATerm
u -> String -> ShATerm -> (ATermTable, RSSymbol)
forall a. String -> ShATerm -> a
fromShATermError "RelationalScheme.Sign.RSSymbol" ShATerm
u

instance ShATermConvertible RelationalScheme.Sign.RSSymbolKind where
  toShATermAux :: ATermTable -> RSSymbolKind -> IO (ATermTable, Int)
toShATermAux att0 :: ATermTable
att0 xv :: RSSymbolKind
xv = case RSSymbolKind
xv of
    STableK -> (ATermTable, Int) -> IO (ATermTable, Int)
forall (m :: * -> *) a. Monad m => a -> m a
return ((ATermTable, Int) -> IO (ATermTable, Int))
-> (ATermTable, Int) -> IO (ATermTable, Int)
forall a b. (a -> b) -> a -> b
$ ShATerm -> ATermTable -> (ATermTable, Int)
addATerm (String -> [Int] -> [Int] -> ShATerm
ShAAppl "STableK" [] []) ATermTable
att0
    SColumnK -> (ATermTable, Int) -> IO (ATermTable, Int)
forall (m :: * -> *) a. Monad m => a -> m a
return ((ATermTable, Int) -> IO (ATermTable, Int))
-> (ATermTable, Int) -> IO (ATermTable, Int)
forall a b. (a -> b) -> a -> b
$ ShATerm -> ATermTable -> (ATermTable, Int)
addATerm (String -> [Int] -> [Int] -> ShATerm
ShAAppl "SColumnK" [] []) ATermTable
att0
  fromShATermAux :: Int -> ATermTable -> (ATermTable, RSSymbolKind)
fromShATermAux ix :: Int
ix att0 :: ATermTable
att0 = case Int -> ATermTable -> ShATerm
getShATerm Int
ix ATermTable
att0 of
    ShAAppl "STableK" [] _ -> (ATermTable
att0, RSSymbolKind
STableK)
    ShAAppl "SColumnK" [] _ -> (ATermTable
att0, RSSymbolKind
SColumnK)
    u :: ShATerm
u -> String -> ShATerm -> (ATermTable, RSSymbolKind)
forall a. String -> ShATerm -> a
fromShATermError "RelationalScheme.Sign.RSSymbolKind" ShATerm
u

instance ShATermConvertible RelationalScheme.Sign.RSColumn where
  toShATermAux :: ATermTable -> RSColumn -> IO (ATermTable, Int)
toShATermAux att0 :: ATermTable
att0 xv :: RSColumn
xv = case RSColumn
xv of
    RSColumn a :: Id
a b :: RSDatatype
b c :: RSIsKey
c -> do
      (att1 :: ATermTable
att1, a' :: Int
a') <- ATermTable -> Id -> IO (ATermTable, Int)
forall t.
ShATermConvertible t =>
ATermTable -> t -> IO (ATermTable, Int)
toShATerm' ATermTable
att0 Id
a
      (att2 :: ATermTable
att2, b' :: Int
b') <- ATermTable -> RSDatatype -> IO (ATermTable, Int)
forall t.
ShATermConvertible t =>
ATermTable -> t -> IO (ATermTable, Int)
toShATerm' ATermTable
att1 RSDatatype
b
      (att3 :: ATermTable
att3, c' :: Int
c') <- ATermTable -> RSIsKey -> IO (ATermTable, Int)
forall t.
ShATermConvertible t =>
ATermTable -> t -> IO (ATermTable, Int)
toShATerm' ATermTable
att2 RSIsKey
c
      (ATermTable, Int) -> IO (ATermTable, Int)
forall (m :: * -> *) a. Monad m => a -> m a
return ((ATermTable, Int) -> IO (ATermTable, Int))
-> (ATermTable, Int) -> IO (ATermTable, Int)
forall a b. (a -> b) -> a -> b
$ ShATerm -> ATermTable -> (ATermTable, Int)
addATerm (String -> [Int] -> [Int] -> ShATerm
ShAAppl "RSColumn" [Int
a', Int
b', Int
c'] []) ATermTable
att3
  fromShATermAux :: Int -> ATermTable -> (ATermTable, RSColumn)
fromShATermAux ix :: Int
ix att0 :: ATermTable
att0 = case Int -> ATermTable -> ShATerm
getShATerm Int
ix ATermTable
att0 of
    ShAAppl "RSColumn" [a :: Int
a, b :: Int
b, c :: Int
c] _ ->
      case Int -> ATermTable -> (ATermTable, Id)
forall t.
ShATermConvertible t =>
Int -> ATermTable -> (ATermTable, t)
fromShATerm' Int
a ATermTable
att0 of
      { (att1 :: ATermTable
att1, a' :: Id
a') ->
      case Int -> ATermTable -> (ATermTable, RSDatatype)
forall t.
ShATermConvertible t =>
Int -> ATermTable -> (ATermTable, t)
fromShATerm' Int
b ATermTable
att1 of
      { (att2 :: ATermTable
att2, b' :: RSDatatype
b') ->
      case Int -> ATermTable -> (ATermTable, RSIsKey)
forall t.
ShATermConvertible t =>
Int -> ATermTable -> (ATermTable, t)
fromShATerm' Int
c ATermTable
att2 of
      { (att3 :: ATermTable
att3, c' :: RSIsKey
c') ->
      (ATermTable
att3, Id -> RSDatatype -> RSIsKey -> RSColumn
RSColumn Id
a' RSDatatype
b' RSIsKey
c') }}}
    u :: ShATerm
u -> String -> ShATerm -> (ATermTable, RSColumn)
forall a. String -> ShATerm -> a
fromShATermError "RelationalScheme.Sign.RSColumn" ShATerm
u

instance ShATermConvertible RelationalScheme.Sign.RSTable where
  toShATermAux :: ATermTable -> RSTable -> IO (ATermTable, Int)
toShATermAux att0 :: ATermTable
att0 xv :: RSTable
xv = case RSTable
xv of
    RSTable a :: Id
a b :: [RSColumn]
b c :: [Annotation]
c d :: Set (Id, RSDatatype)
d -> do
      (att1 :: ATermTable
att1, a' :: Int
a') <- ATermTable -> Id -> IO (ATermTable, Int)
forall t.
ShATermConvertible t =>
ATermTable -> t -> IO (ATermTable, Int)
toShATerm' ATermTable
att0 Id
a
      (att2 :: ATermTable
att2, b' :: Int
b') <- ATermTable -> [RSColumn] -> IO (ATermTable, Int)
forall t.
ShATermConvertible t =>
ATermTable -> t -> IO (ATermTable, Int)
toShATerm' ATermTable
att1 [RSColumn]
b
      (att3 :: ATermTable
att3, c' :: Int
c') <- ATermTable -> [Annotation] -> IO (ATermTable, Int)
forall t.
ShATermConvertible t =>
ATermTable -> t -> IO (ATermTable, Int)
toShATerm' ATermTable
att2 [Annotation]
c
      (att4 :: ATermTable
att4, d' :: Int
d') <- ATermTable -> Set (Id, RSDatatype) -> IO (ATermTable, Int)
forall t.
ShATermConvertible t =>
ATermTable -> t -> IO (ATermTable, Int)
toShATerm' ATermTable
att3 Set (Id, RSDatatype)
d
      (ATermTable, Int) -> IO (ATermTable, Int)
forall (m :: * -> *) a. Monad m => a -> m a
return ((ATermTable, Int) -> IO (ATermTable, Int))
-> (ATermTable, Int) -> IO (ATermTable, Int)
forall a b. (a -> b) -> a -> b
$ ShATerm -> ATermTable -> (ATermTable, Int)
addATerm (String -> [Int] -> [Int] -> ShATerm
ShAAppl "RSTable" [Int
a', Int
b', Int
c', Int
d'] []) ATermTable
att4
  fromShATermAux :: Int -> ATermTable -> (ATermTable, RSTable)
fromShATermAux ix :: Int
ix att0 :: ATermTable
att0 = case Int -> ATermTable -> ShATerm
getShATerm Int
ix ATermTable
att0 of
    ShAAppl "RSTable" [a :: Int
a, b :: Int
b, c :: Int
c, d :: Int
d] _ ->
      case Int -> ATermTable -> (ATermTable, Id)
forall t.
ShATermConvertible t =>
Int -> ATermTable -> (ATermTable, t)
fromShATerm' Int
a ATermTable
att0 of
      { (att1 :: ATermTable
att1, a' :: Id
a') ->
      case Int -> ATermTable -> (ATermTable, [RSColumn])
forall t.
ShATermConvertible t =>
Int -> ATermTable -> (ATermTable, t)
fromShATerm' Int
b ATermTable
att1 of
      { (att2 :: ATermTable
att2, b' :: [RSColumn]
b') ->
      case Int -> ATermTable -> (ATermTable, [Annotation])
forall t.
ShATermConvertible t =>
Int -> ATermTable -> (ATermTable, t)
fromShATerm' Int
c ATermTable
att2 of
      { (att3 :: ATermTable
att3, c' :: [Annotation]
c') ->
      case Int -> ATermTable -> (ATermTable, Set (Id, RSDatatype))
forall t.
ShATermConvertible t =>
Int -> ATermTable -> (ATermTable, t)
fromShATerm' Int
d ATermTable
att3 of
      { (att4 :: ATermTable
att4, d' :: Set (Id, RSDatatype)
d') ->
      (ATermTable
att4, Id -> [RSColumn] -> [Annotation] -> Set (Id, RSDatatype) -> RSTable
RSTable Id
a' [RSColumn]
b' [Annotation]
c' Set (Id, RSDatatype)
d') }}}}
    u :: ShATerm
u -> String -> ShATerm -> (ATermTable, RSTable)
forall a. String -> ShATerm -> a
fromShATermError "RelationalScheme.Sign.RSTable" ShATerm
u

instance ShATermConvertible RelationalScheme.Sign.RSTables where
  toShATermAux :: ATermTable -> RSTables -> IO (ATermTable, Int)
toShATermAux att0 :: ATermTable
att0 xv :: RSTables
xv = case RSTables
xv of
    RSTables a :: Set RSTable
a -> do
      (att1 :: ATermTable
att1, a' :: Int
a') <- ATermTable -> Set RSTable -> IO (ATermTable, Int)
forall t.
ShATermConvertible t =>
ATermTable -> t -> IO (ATermTable, Int)
toShATerm' ATermTable
att0 Set RSTable
a
      (ATermTable, Int) -> IO (ATermTable, Int)
forall (m :: * -> *) a. Monad m => a -> m a
return ((ATermTable, Int) -> IO (ATermTable, Int))
-> (ATermTable, Int) -> IO (ATermTable, Int)
forall a b. (a -> b) -> a -> b
$ ShATerm -> ATermTable -> (ATermTable, Int)
addATerm (String -> [Int] -> [Int] -> ShATerm
ShAAppl "RSTables" [Int
a'] []) ATermTable
att1
  fromShATermAux :: Int -> ATermTable -> (ATermTable, RSTables)
fromShATermAux ix :: Int
ix att0 :: ATermTable
att0 = case Int -> ATermTable -> ShATerm
getShATerm Int
ix ATermTable
att0 of
    ShAAppl "RSTables" [a :: Int
a] _ ->
      case Int -> ATermTable -> (ATermTable, Set RSTable)
forall t.
ShATermConvertible t =>
Int -> ATermTable -> (ATermTable, t)
fromShATerm' Int
a ATermTable
att0 of
      { (att1 :: ATermTable
att1, a' :: Set RSTable
a') ->
      (ATermTable
att1, Set RSTable -> RSTables
RSTables Set RSTable
a') }
    u :: ShATerm
u -> String -> ShATerm -> (ATermTable, RSTables)
forall a. String -> ShATerm -> a
fromShATermError "RelationalScheme.Sign.RSTables" ShATerm
u

instance ShATermConvertible RelationalScheme.Sign.RSTMap where
  toShATermAux :: ATermTable -> RSTMap -> IO (ATermTable, Int)
toShATermAux att0 :: ATermTable
att0 xv :: RSTMap
xv = case RSTMap
xv of
    RSTMap a :: Map Id Id
a -> do
      (att1 :: ATermTable
att1, a' :: Int
a') <- ATermTable -> Map Id Id -> IO (ATermTable, Int)
forall t.
ShATermConvertible t =>
ATermTable -> t -> IO (ATermTable, Int)
toShATerm' ATermTable
att0 Map Id Id
a
      (ATermTable, Int) -> IO (ATermTable, Int)
forall (m :: * -> *) a. Monad m => a -> m a
return ((ATermTable, Int) -> IO (ATermTable, Int))
-> (ATermTable, Int) -> IO (ATermTable, Int)
forall a b. (a -> b) -> a -> b
$ ShATerm -> ATermTable -> (ATermTable, Int)
addATerm (String -> [Int] -> [Int] -> ShATerm
ShAAppl "RSTMap" [Int
a'] []) ATermTable
att1
  fromShATermAux :: Int -> ATermTable -> (ATermTable, RSTMap)
fromShATermAux ix :: Int
ix att0 :: ATermTable
att0 = case Int -> ATermTable -> ShATerm
getShATerm Int
ix ATermTable
att0 of
    ShAAppl "RSTMap" [a :: Int
a] _ ->
      case Int -> ATermTable -> (ATermTable, Map Id Id)
forall t.
ShATermConvertible t =>
Int -> ATermTable -> (ATermTable, t)
fromShATerm' Int
a ATermTable
att0 of
      { (att1 :: ATermTable
att1, a' :: Map Id Id
a') ->
      (ATermTable
att1, Map Id Id -> RSTMap
RSTMap Map Id Id
a') }
    u :: ShATerm
u -> String -> ShATerm -> (ATermTable, RSTMap)
forall a. String -> ShATerm -> a
fromShATermError "RelationalScheme.Sign.RSTMap" ShATerm
u

instance ShATermConvertible RelationalScheme.Sign.RSMorphism where
  toShATermAux :: ATermTable -> RSMorphism -> IO (ATermTable, Int)
toShATermAux att0 :: ATermTable
att0 xv :: RSMorphism
xv = case RSMorphism
xv of
    RSMorphism a :: RSTables
a b :: RSTables
b c :: Map Id Id
c d :: Map Id RSTMap
d -> do
      (att1 :: ATermTable
att1, a' :: Int
a') <- ATermTable -> RSTables -> IO (ATermTable, Int)
forall t.
ShATermConvertible t =>
ATermTable -> t -> IO (ATermTable, Int)
toShATerm' ATermTable
att0 RSTables
a
      (att2 :: ATermTable
att2, b' :: Int
b') <- ATermTable -> RSTables -> IO (ATermTable, Int)
forall t.
ShATermConvertible t =>
ATermTable -> t -> IO (ATermTable, Int)
toShATerm' ATermTable
att1 RSTables
b
      (att3 :: ATermTable
att3, c' :: Int
c') <- ATermTable -> Map Id Id -> IO (ATermTable, Int)
forall t.
ShATermConvertible t =>
ATermTable -> t -> IO (ATermTable, Int)
toShATerm' ATermTable
att2 Map Id Id
c
      (att4 :: ATermTable
att4, d' :: Int
d') <- ATermTable -> Map Id RSTMap -> IO (ATermTable, Int)
forall t.
ShATermConvertible t =>
ATermTable -> t -> IO (ATermTable, Int)
toShATerm' ATermTable
att3 Map Id RSTMap
d
      (ATermTable, Int) -> IO (ATermTable, Int)
forall (m :: * -> *) a. Monad m => a -> m a
return ((ATermTable, Int) -> IO (ATermTable, Int))
-> (ATermTable, Int) -> IO (ATermTable, Int)
forall a b. (a -> b) -> a -> b
$ ShATerm -> ATermTable -> (ATermTable, Int)
addATerm (String -> [Int] -> [Int] -> ShATerm
ShAAppl "RSMorphism" [Int
a', Int
b', Int
c', Int
d'] []) ATermTable
att4
  fromShATermAux :: Int -> ATermTable -> (ATermTable, RSMorphism)
fromShATermAux ix :: Int
ix att0 :: ATermTable
att0 = case Int -> ATermTable -> ShATerm
getShATerm Int
ix ATermTable
att0 of
    ShAAppl "RSMorphism" [a :: Int
a, b :: Int
b, c :: Int
c, d :: Int
d] _ ->
      case Int -> ATermTable -> (ATermTable, RSTables)
forall t.
ShATermConvertible t =>
Int -> ATermTable -> (ATermTable, t)
fromShATerm' Int
a ATermTable
att0 of
      { (att1 :: ATermTable
att1, a' :: RSTables
a') ->
      case Int -> ATermTable -> (ATermTable, RSTables)
forall t.
ShATermConvertible t =>
Int -> ATermTable -> (ATermTable, t)
fromShATerm' Int
b ATermTable
att1 of
      { (att2 :: ATermTable
att2, b' :: RSTables
b') ->
      case Int -> ATermTable -> (ATermTable, Map Id Id)
forall t.
ShATermConvertible t =>
Int -> ATermTable -> (ATermTable, t)
fromShATerm' Int
c ATermTable
att2 of
      { (att3 :: ATermTable
att3, c' :: Map Id Id
c') ->
      case Int -> ATermTable -> (ATermTable, Map Id RSTMap)
forall t.
ShATermConvertible t =>
Int -> ATermTable -> (ATermTable, t)
fromShATerm' Int
d ATermTable
att3 of
      { (att4 :: ATermTable
att4, d' :: Map Id RSTMap
d') ->
      (ATermTable
att4, RSTables -> RSTables -> Map Id Id -> Map Id RSTMap -> RSMorphism
RSMorphism RSTables
a' RSTables
b' Map Id Id
c' Map Id RSTMap
d') }}}}
    u :: ShATerm
u -> String -> ShATerm -> (ATermTable, RSMorphism)
forall a. String -> ShATerm -> a
fromShATermError "RelationalScheme.Sign.RSMorphism" ShATerm
u

deriving instance GHC.Generics.Generic RelationalScheme.Sign.RSDatatype
instance Data.Aeson.ToJSON RelationalScheme.Sign.RSDatatype where
instance Data.Aeson.FromJSON RelationalScheme.Sign.RSDatatype where

deriving instance GHC.Generics.Generic RelationalScheme.Sign.RSSymbol
instance Data.Aeson.ToJSON RelationalScheme.Sign.RSSymbol where
instance Data.Aeson.FromJSON RelationalScheme.Sign.RSSymbol where

deriving instance GHC.Generics.Generic RelationalScheme.Sign.RSSymbolKind
instance Data.Aeson.ToJSON RelationalScheme.Sign.RSSymbolKind where
instance Data.Aeson.FromJSON RelationalScheme.Sign.RSSymbolKind where

deriving instance GHC.Generics.Generic RelationalScheme.Sign.RSColumn
instance Data.Aeson.ToJSON RelationalScheme.Sign.RSColumn where
instance Data.Aeson.FromJSON RelationalScheme.Sign.RSColumn where

deriving instance GHC.Generics.Generic RelationalScheme.Sign.RSTable
instance Data.Aeson.ToJSON RelationalScheme.Sign.RSTable where
instance Data.Aeson.FromJSON RelationalScheme.Sign.RSTable where

deriving instance GHC.Generics.Generic RelationalScheme.Sign.RSTables
instance Data.Aeson.ToJSON RelationalScheme.Sign.RSTables where
instance Data.Aeson.FromJSON RelationalScheme.Sign.RSTables where

deriving instance GHC.Generics.Generic RelationalScheme.Sign.RSTMap
instance Data.Aeson.ToJSON RelationalScheme.Sign.RSTMap where
instance Data.Aeson.FromJSON RelationalScheme.Sign.RSTMap where

deriving instance GHC.Generics.Generic RelationalScheme.Sign.RSMorphism
instance Data.Aeson.ToJSON RelationalScheme.Sign.RSMorphism where
instance Data.Aeson.FromJSON RelationalScheme.Sign.RSMorphism where