{-# OPTIONS -w -O0 #-}
{-# LANGUAGE CPP, StandaloneDeriving, DeriveDataTypeable, DeriveGeneric #-}
{- |
Module      :  QVTR/ATC_QVTR.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):
'QVTR.As.Transformation'
'QVTR.As.Key'
'QVTR.As.PropKey'
'QVTR.As.Relation'
'QVTR.As.RelVar'
'QVTR.As.PrimitiveDomain'
'QVTR.As.Domain'
'QVTR.As.ObjectTemplate'
'QVTR.As.PropertyTemplate'
'QVTR.As.WhenWhere'
'QVTR.As.RelInvok'
'QVTR.As.OCL'
'QVTR.As.STRING'
'QVTR.Sign.RuleDef'
'QVTR.Sign.Sign'
'QVTR.Sign.Sen'
'QVTR.Sign.RelationSen'
'QVTR.Sign.Pattern'
-}

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

module QVTR.ATC_QVTR () where

import ATerm.Lib
import CSMOF.ATC_CSMOF
import CSMOF.Print ()
import Common.ATerm.ConvInstances
import Common.Doc
import Common.DocUtils
import Common.Id
import Common.Json.ConvInstances
import Common.Json.Instances
import Data.Aeson(ToJSON, FromJSON)
import Data.Data
import GHC.Generics(Generic)
import QVTR.As
import QVTR.Print ()
import QVTR.Sign
import qualified CSMOF.As as CSMOF
import qualified CSMOF.Sign as CSMOF
import qualified Data.Map as Map

{-! for QVTR.As.Transformation derive : ShATermConvertible !-}
{-! for QVTR.As.Key derive : ShATermConvertible !-}
{-! for QVTR.As.PropKey derive : ShATermConvertible !-}
{-! for QVTR.As.Relation derive : ShATermConvertible !-}
{-! for QVTR.As.RelVar derive : ShATermConvertible !-}
{-! for QVTR.As.PrimitiveDomain derive : ShATermConvertible !-}
{-! for QVTR.As.Domain derive : ShATermConvertible !-}
{-! for QVTR.As.ObjectTemplate derive : ShATermConvertible !-}
{-! for QVTR.As.PropertyTemplate derive : ShATermConvertible !-}
{-! for QVTR.As.WhenWhere derive : ShATermConvertible !-}
{-! for QVTR.As.RelInvok derive : ShATermConvertible !-}
{-! for QVTR.As.OCL derive : ShATermConvertible !-}
{-! for QVTR.As.STRING derive : ShATermConvertible !-}
{-! for QVTR.Sign.RuleDef derive : ShATermConvertible !-}
{-! for QVTR.Sign.Sign derive : ShATermConvertible !-}
{-! for QVTR.Sign.Sen derive : ShATermConvertible !-}
{-! for QVTR.Sign.RelationSen derive : ShATermConvertible !-}
{-! for QVTR.Sign.Pattern derive : ShATermConvertible !-}

{-! for QVTR.As.Transformation derive : Json !-}
{-! for QVTR.As.Key derive : Json !-}
{-! for QVTR.As.PropKey derive : Json !-}
{-! for QVTR.As.Relation derive : Json !-}
{-! for QVTR.As.RelVar derive : Json !-}
{-! for QVTR.As.PrimitiveDomain derive : Json !-}
{-! for QVTR.As.Domain derive : Json !-}
{-! for QVTR.As.ObjectTemplate derive : Json !-}
{-! for QVTR.As.PropertyTemplate derive : Json !-}
{-! for QVTR.As.WhenWhere derive : Json !-}
{-! for QVTR.As.RelInvok derive : Json !-}
{-! for QVTR.As.OCL derive : Json !-}
{-! for QVTR.As.STRING derive : Json !-}
{-! for QVTR.Sign.RuleDef derive : Json !-}
{-! for QVTR.Sign.Sign derive : Json !-}
{-! for QVTR.Sign.Sen derive : Json !-}
{-! for QVTR.Sign.RelationSen derive : Json !-}
{-! for QVTR.Sign.Pattern derive : Json !-}

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

instance ShATermConvertible QVTR.As.Transformation where
  toShATermAux :: ATermTable -> Transformation -> IO (ATermTable, Int)
toShATermAux att0 :: ATermTable
att0 xv :: Transformation
xv = case Transformation
xv of
    Transformation a :: String
a b :: (String, String, Metamodel)
b c :: (String, String, Metamodel)
c d :: [Key]
d e :: [Relation]
e -> do
      (att1 :: ATermTable
att1, a' :: Int
a') <- ATermTable -> String -> IO (ATermTable, Int)
forall t.
ShATermConvertible t =>
ATermTable -> t -> IO (ATermTable, Int)
toShATerm' ATermTable
att0 String
a
      (att2 :: ATermTable
att2, b' :: Int
b') <- ATermTable -> (String, String, Metamodel) -> IO (ATermTable, Int)
forall t.
ShATermConvertible t =>
ATermTable -> t -> IO (ATermTable, Int)
toShATerm' ATermTable
att1 (String, String, Metamodel)
b
      (att3 :: ATermTable
att3, c' :: Int
c') <- ATermTable -> (String, String, Metamodel) -> IO (ATermTable, Int)
forall t.
ShATermConvertible t =>
ATermTable -> t -> IO (ATermTable, Int)
toShATerm' ATermTable
att2 (String, String, Metamodel)
c
      (att4 :: ATermTable
att4, d' :: Int
d') <- ATermTable -> [Key] -> IO (ATermTable, Int)
forall t.
ShATermConvertible t =>
ATermTable -> t -> IO (ATermTable, Int)
toShATerm' ATermTable
att3 [Key]
d
      (att5 :: ATermTable
att5, e' :: Int
e') <- ATermTable -> [Relation] -> IO (ATermTable, Int)
forall t.
ShATermConvertible t =>
ATermTable -> t -> IO (ATermTable, Int)
toShATerm' ATermTable
att4 [Relation]
e
      (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 "Transformation" [Int
a', Int
b', Int
c', Int
d',
                                                   Int
e'] []) ATermTable
att5
  fromShATermAux :: Int -> ATermTable -> (ATermTable, Transformation)
fromShATermAux ix :: Int
ix att0 :: ATermTable
att0 = case Int -> ATermTable -> ShATerm
getShATerm Int
ix ATermTable
att0 of
    ShAAppl "Transformation" [a :: Int
a, b :: Int
b, c :: Int
c, d :: Int
d, e :: Int
e] _ ->
      case Int -> ATermTable -> (ATermTable, String)
forall t.
ShATermConvertible t =>
Int -> ATermTable -> (ATermTable, t)
fromShATerm' Int
a ATermTable
att0 of
      { (att1 :: ATermTable
att1, a' :: String
a') ->
      case Int -> ATermTable -> (ATermTable, (String, String, Metamodel))
forall t.
ShATermConvertible t =>
Int -> ATermTable -> (ATermTable, t)
fromShATerm' Int
b ATermTable
att1 of
      { (att2 :: ATermTable
att2, b' :: (String, String, Metamodel)
b') ->
      case Int -> ATermTable -> (ATermTable, (String, String, Metamodel))
forall t.
ShATermConvertible t =>
Int -> ATermTable -> (ATermTable, t)
fromShATerm' Int
c ATermTable
att2 of
      { (att3 :: ATermTable
att3, c' :: (String, String, Metamodel)
c') ->
      case Int -> ATermTable -> (ATermTable, [Key])
forall t.
ShATermConvertible t =>
Int -> ATermTable -> (ATermTable, t)
fromShATerm' Int
d ATermTable
att3 of
      { (att4 :: ATermTable
att4, d' :: [Key]
d') ->
      case Int -> ATermTable -> (ATermTable, [Relation])
forall t.
ShATermConvertible t =>
Int -> ATermTable -> (ATermTable, t)
fromShATerm' Int
e ATermTable
att4 of
      { (att5 :: ATermTable
att5, e' :: [Relation]
e') ->
      (ATermTable
att5, String
-> (String, String, Metamodel)
-> (String, String, Metamodel)
-> [Key]
-> [Relation]
-> Transformation
Transformation String
a' (String, String, Metamodel)
b' (String, String, Metamodel)
c' [Key]
d' [Relation]
e') }}}}}
    u :: ShATerm
u -> String -> ShATerm -> (ATermTable, Transformation)
forall a. String -> ShATerm -> a
fromShATermError "QVTR.As.Transformation" ShATerm
u

instance ShATermConvertible QVTR.As.Key where
  toShATermAux :: ATermTable -> Key -> IO (ATermTable, Int)
toShATermAux att0 :: ATermTable
att0 xv :: Key
xv = case Key
xv of
    Key a :: String
a b :: String
b c :: [PropKey]
c -> do
      (att1 :: ATermTable
att1, a' :: Int
a') <- ATermTable -> String -> IO (ATermTable, Int)
forall t.
ShATermConvertible t =>
ATermTable -> t -> IO (ATermTable, Int)
toShATerm' ATermTable
att0 String
a
      (att2 :: ATermTable
att2, b' :: Int
b') <- ATermTable -> String -> IO (ATermTable, Int)
forall t.
ShATermConvertible t =>
ATermTable -> t -> IO (ATermTable, Int)
toShATerm' ATermTable
att1 String
b
      (att3 :: ATermTable
att3, c' :: Int
c') <- ATermTable -> [PropKey] -> IO (ATermTable, Int)
forall t.
ShATermConvertible t =>
ATermTable -> t -> IO (ATermTable, Int)
toShATerm' ATermTable
att2 [PropKey]
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 "Key" [Int
a', Int
b', Int
c'] []) ATermTable
att3
  fromShATermAux :: Int -> ATermTable -> (ATermTable, Key)
fromShATermAux ix :: Int
ix att0 :: ATermTable
att0 = case Int -> ATermTable -> ShATerm
getShATerm Int
ix ATermTable
att0 of
    ShAAppl "Key" [a :: Int
a, b :: Int
b, c :: Int
c] _ ->
      case Int -> ATermTable -> (ATermTable, String)
forall t.
ShATermConvertible t =>
Int -> ATermTable -> (ATermTable, t)
fromShATerm' Int
a ATermTable
att0 of
      { (att1 :: ATermTable
att1, a' :: String
a') ->
      case Int -> ATermTable -> (ATermTable, String)
forall t.
ShATermConvertible t =>
Int -> ATermTable -> (ATermTable, t)
fromShATerm' Int
b ATermTable
att1 of
      { (att2 :: ATermTable
att2, b' :: String
b') ->
      case Int -> ATermTable -> (ATermTable, [PropKey])
forall t.
ShATermConvertible t =>
Int -> ATermTable -> (ATermTable, t)
fromShATerm' Int
c ATermTable
att2 of
      { (att3 :: ATermTable
att3, c' :: [PropKey]
c') ->
      (ATermTable
att3, String -> String -> [PropKey] -> Key
Key String
a' String
b' [PropKey]
c') }}}
    u :: ShATerm
u -> String -> ShATerm -> (ATermTable, Key)
forall a. String -> ShATerm -> a
fromShATermError "QVTR.As.Key" ShATerm
u

instance ShATermConvertible QVTR.As.PropKey where
  toShATermAux :: ATermTable -> PropKey -> IO (ATermTable, Int)
toShATermAux att0 :: ATermTable
att0 xv :: PropKey
xv = case PropKey
xv of
    SimpleProp a :: String
a -> do
      (att1 :: ATermTable
att1, a' :: Int
a') <- ATermTable -> String -> IO (ATermTable, Int)
forall t.
ShATermConvertible t =>
ATermTable -> t -> IO (ATermTable, Int)
toShATerm' ATermTable
att0 String
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 "SimpleProp" [Int
a'] []) ATermTable
att1
    OppositeProp a :: String
a b :: String
b -> do
      (att1 :: ATermTable
att1, a' :: Int
a') <- ATermTable -> String -> IO (ATermTable, Int)
forall t.
ShATermConvertible t =>
ATermTable -> t -> IO (ATermTable, Int)
toShATerm' ATermTable
att0 String
a
      (att2 :: ATermTable
att2, b' :: Int
b') <- ATermTable -> String -> IO (ATermTable, Int)
forall t.
ShATermConvertible t =>
ATermTable -> t -> IO (ATermTable, Int)
toShATerm' ATermTable
att1 String
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 "OppositeProp" [Int
a', Int
b'] []) ATermTable
att2
  fromShATermAux :: Int -> ATermTable -> (ATermTable, PropKey)
fromShATermAux ix :: Int
ix att0 :: ATermTable
att0 = case Int -> ATermTable -> ShATerm
getShATerm Int
ix ATermTable
att0 of
    ShAAppl "SimpleProp" [a :: Int
a] _ ->
      case Int -> ATermTable -> (ATermTable, String)
forall t.
ShATermConvertible t =>
Int -> ATermTable -> (ATermTable, t)
fromShATerm' Int
a ATermTable
att0 of
      { (att1 :: ATermTable
att1, a' :: String
a') ->
      (ATermTable
att1, String -> PropKey
SimpleProp String
a') }
    ShAAppl "OppositeProp" [a :: Int
a, b :: Int
b] _ ->
      case Int -> ATermTable -> (ATermTable, String)
forall t.
ShATermConvertible t =>
Int -> ATermTable -> (ATermTable, t)
fromShATerm' Int
a ATermTable
att0 of
      { (att1 :: ATermTable
att1, a' :: String
a') ->
      case Int -> ATermTable -> (ATermTable, String)
forall t.
ShATermConvertible t =>
Int -> ATermTable -> (ATermTable, t)
fromShATerm' Int
b ATermTable
att1 of
      { (att2 :: ATermTable
att2, b' :: String
b') ->
      (ATermTable
att2, String -> String -> PropKey
OppositeProp String
a' String
b') }}
    u :: ShATerm
u -> String -> ShATerm -> (ATermTable, PropKey)
forall a. String -> ShATerm -> a
fromShATermError "QVTR.As.PropKey" ShATerm
u

instance ShATermConvertible QVTR.As.Relation where
  toShATermAux :: ATermTable -> Relation -> IO (ATermTable, Int)
toShATermAux att0 :: ATermTable
att0 xv :: Relation
xv = case Relation
xv of
    Relation a :: Bool
a b :: String
b c :: [RelVar]
c d :: [PrimitiveDomain]
d e :: Domain
e f :: Domain
f g :: Maybe WhenWhere
g h :: Maybe WhenWhere
h -> do
      (att1 :: ATermTable
att1, a' :: Int
a') <- ATermTable -> Bool -> IO (ATermTable, Int)
forall t.
ShATermConvertible t =>
ATermTable -> t -> IO (ATermTable, Int)
toShATerm' ATermTable
att0 Bool
a
      (att2 :: ATermTable
att2, b' :: Int
b') <- ATermTable -> String -> IO (ATermTable, Int)
forall t.
ShATermConvertible t =>
ATermTable -> t -> IO (ATermTable, Int)
toShATerm' ATermTable
att1 String
b
      (att3 :: ATermTable
att3, c' :: Int
c') <- ATermTable -> [RelVar] -> IO (ATermTable, Int)
forall t.
ShATermConvertible t =>
ATermTable -> t -> IO (ATermTable, Int)
toShATerm' ATermTable
att2 [RelVar]
c
      (att4 :: ATermTable
att4, d' :: Int
d') <- ATermTable -> [PrimitiveDomain] -> IO (ATermTable, Int)
forall t.
ShATermConvertible t =>
ATermTable -> t -> IO (ATermTable, Int)
toShATerm' ATermTable
att3 [PrimitiveDomain]
d
      (att5 :: ATermTable
att5, e' :: Int
e') <- ATermTable -> Domain -> IO (ATermTable, Int)
forall t.
ShATermConvertible t =>
ATermTable -> t -> IO (ATermTable, Int)
toShATerm' ATermTable
att4 Domain
e
      (att6 :: ATermTable
att6, f' :: Int
f') <- ATermTable -> Domain -> IO (ATermTable, Int)
forall t.
ShATermConvertible t =>
ATermTable -> t -> IO (ATermTable, Int)
toShATerm' ATermTable
att5 Domain
f
      (att7 :: ATermTable
att7, g' :: Int
g') <- ATermTable -> Maybe WhenWhere -> IO (ATermTable, Int)
forall t.
ShATermConvertible t =>
ATermTable -> t -> IO (ATermTable, Int)
toShATerm' ATermTable
att6 Maybe WhenWhere
g
      (att8 :: ATermTable
att8, h' :: Int
h') <- ATermTable -> Maybe WhenWhere -> IO (ATermTable, Int)
forall t.
ShATermConvertible t =>
ATermTable -> t -> IO (ATermTable, Int)
toShATerm' ATermTable
att7 Maybe WhenWhere
h
      (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 "Relation" [Int
a', Int
b', Int
c', Int
d', Int
e', Int
f', Int
g',
                                             Int
h'] []) ATermTable
att8
  fromShATermAux :: Int -> ATermTable -> (ATermTable, Relation)
fromShATermAux ix :: Int
ix att0 :: ATermTable
att0 = case Int -> ATermTable -> ShATerm
getShATerm Int
ix ATermTable
att0 of
    ShAAppl "Relation" [a :: Int
a, b :: Int
b, c :: Int
c, d :: Int
d, e :: Int
e, f :: Int
f, g :: Int
g, h :: Int
h] _ ->
      case Int -> ATermTable -> (ATermTable, Bool)
forall t.
ShATermConvertible t =>
Int -> ATermTable -> (ATermTable, t)
fromShATerm' Int
a ATermTable
att0 of
      { (att1 :: ATermTable
att1, a' :: Bool
a') ->
      case Int -> ATermTable -> (ATermTable, String)
forall t.
ShATermConvertible t =>
Int -> ATermTable -> (ATermTable, t)
fromShATerm' Int
b ATermTable
att1 of
      { (att2 :: ATermTable
att2, b' :: String
b') ->
      case Int -> ATermTable -> (ATermTable, [RelVar])
forall t.
ShATermConvertible t =>
Int -> ATermTable -> (ATermTable, t)
fromShATerm' Int
c ATermTable
att2 of
      { (att3 :: ATermTable
att3, c' :: [RelVar]
c') ->
      case Int -> ATermTable -> (ATermTable, [PrimitiveDomain])
forall t.
ShATermConvertible t =>
Int -> ATermTable -> (ATermTable, t)
fromShATerm' Int
d ATermTable
att3 of
      { (att4 :: ATermTable
att4, d' :: [PrimitiveDomain]
d') ->
      case Int -> ATermTable -> (ATermTable, Domain)
forall t.
ShATermConvertible t =>
Int -> ATermTable -> (ATermTable, t)
fromShATerm' Int
e ATermTable
att4 of
      { (att5 :: ATermTable
att5, e' :: Domain
e') ->
      case Int -> ATermTable -> (ATermTable, Domain)
forall t.
ShATermConvertible t =>
Int -> ATermTable -> (ATermTable, t)
fromShATerm' Int
f ATermTable
att5 of
      { (att6 :: ATermTable
att6, f' :: Domain
f') ->
      case Int -> ATermTable -> (ATermTable, Maybe WhenWhere)
forall t.
ShATermConvertible t =>
Int -> ATermTable -> (ATermTable, t)
fromShATerm' Int
g ATermTable
att6 of
      { (att7 :: ATermTable
att7, g' :: Maybe WhenWhere
g') ->
      case Int -> ATermTable -> (ATermTable, Maybe WhenWhere)
forall t.
ShATermConvertible t =>
Int -> ATermTable -> (ATermTable, t)
fromShATerm' Int
h ATermTable
att7 of
      { (att8 :: ATermTable
att8, h' :: Maybe WhenWhere
h') ->
      (ATermTable
att8, Bool
-> String
-> [RelVar]
-> [PrimitiveDomain]
-> Domain
-> Domain
-> Maybe WhenWhere
-> Maybe WhenWhere
-> Relation
Relation Bool
a' String
b' [RelVar]
c' [PrimitiveDomain]
d' Domain
e' Domain
f' Maybe WhenWhere
g' Maybe WhenWhere
h') }}}}}}}}
    u :: ShATerm
u -> String -> ShATerm -> (ATermTable, Relation)
forall a. String -> ShATerm -> a
fromShATermError "QVTR.As.Relation" ShATerm
u

instance ShATermConvertible QVTR.As.RelVar where
  toShATermAux :: ATermTable -> RelVar -> IO (ATermTable, Int)
toShATermAux att0 :: ATermTable
att0 xv :: RelVar
xv = case RelVar
xv of
    RelVar a :: String
a b :: String
b -> do
      (att1 :: ATermTable
att1, a' :: Int
a') <- ATermTable -> String -> IO (ATermTable, Int)
forall t.
ShATermConvertible t =>
ATermTable -> t -> IO (ATermTable, Int)
toShATerm' ATermTable
att0 String
a
      (att2 :: ATermTable
att2, b' :: Int
b') <- ATermTable -> String -> IO (ATermTable, Int)
forall t.
ShATermConvertible t =>
ATermTable -> t -> IO (ATermTable, Int)
toShATerm' ATermTable
att1 String
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 "RelVar" [Int
a', Int
b'] []) ATermTable
att2
  fromShATermAux :: Int -> ATermTable -> (ATermTable, RelVar)
fromShATermAux ix :: Int
ix att0 :: ATermTable
att0 = case Int -> ATermTable -> ShATerm
getShATerm Int
ix ATermTable
att0 of
    ShAAppl "RelVar" [a :: Int
a, b :: Int
b] _ ->
      case Int -> ATermTable -> (ATermTable, String)
forall t.
ShATermConvertible t =>
Int -> ATermTable -> (ATermTable, t)
fromShATerm' Int
a ATermTable
att0 of
      { (att1 :: ATermTable
att1, a' :: String
a') ->
      case Int -> ATermTable -> (ATermTable, String)
forall t.
ShATermConvertible t =>
Int -> ATermTable -> (ATermTable, t)
fromShATerm' Int
b ATermTable
att1 of
      { (att2 :: ATermTable
att2, b' :: String
b') ->
      (ATermTable
att2, String -> String -> RelVar
RelVar String
a' String
b') }}
    u :: ShATerm
u -> String -> ShATerm -> (ATermTable, RelVar)
forall a. String -> ShATerm -> a
fromShATermError "QVTR.As.RelVar" ShATerm
u

instance ShATermConvertible QVTR.As.PrimitiveDomain where
  toShATermAux :: ATermTable -> PrimitiveDomain -> IO (ATermTable, Int)
toShATermAux att0 :: ATermTable
att0 xv :: PrimitiveDomain
xv = case PrimitiveDomain
xv of
    PrimitiveDomain a :: String
a b :: String
b -> do
      (att1 :: ATermTable
att1, a' :: Int
a') <- ATermTable -> String -> IO (ATermTable, Int)
forall t.
ShATermConvertible t =>
ATermTable -> t -> IO (ATermTable, Int)
toShATerm' ATermTable
att0 String
a
      (att2 :: ATermTable
att2, b' :: Int
b') <- ATermTable -> String -> IO (ATermTable, Int)
forall t.
ShATermConvertible t =>
ATermTable -> t -> IO (ATermTable, Int)
toShATerm' ATermTable
att1 String
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 "PrimitiveDomain" [Int
a', Int
b'] []) ATermTable
att2
  fromShATermAux :: Int -> ATermTable -> (ATermTable, PrimitiveDomain)
fromShATermAux ix :: Int
ix att0 :: ATermTable
att0 = case Int -> ATermTable -> ShATerm
getShATerm Int
ix ATermTable
att0 of
    ShAAppl "PrimitiveDomain" [a :: Int
a, b :: Int
b] _ ->
      case Int -> ATermTable -> (ATermTable, String)
forall t.
ShATermConvertible t =>
Int -> ATermTable -> (ATermTable, t)
fromShATerm' Int
a ATermTable
att0 of
      { (att1 :: ATermTable
att1, a' :: String
a') ->
      case Int -> ATermTable -> (ATermTable, String)
forall t.
ShATermConvertible t =>
Int -> ATermTable -> (ATermTable, t)
fromShATerm' Int
b ATermTable
att1 of
      { (att2 :: ATermTable
att2, b' :: String
b') ->
      (ATermTable
att2, String -> String -> PrimitiveDomain
PrimitiveDomain String
a' String
b') }}
    u :: ShATerm
u -> String -> ShATerm -> (ATermTable, PrimitiveDomain)
forall a. String -> ShATerm -> a
fromShATermError "QVTR.As.PrimitiveDomain" ShATerm
u

instance ShATermConvertible QVTR.As.Domain where
  toShATermAux :: ATermTable -> Domain -> IO (ATermTable, Int)
toShATermAux att0 :: ATermTable
att0 xv :: Domain
xv = case Domain
xv of
    Domain a :: String
a b :: ObjectTemplate
b -> do
      (att1 :: ATermTable
att1, a' :: Int
a') <- ATermTable -> String -> IO (ATermTable, Int)
forall t.
ShATermConvertible t =>
ATermTable -> t -> IO (ATermTable, Int)
toShATerm' ATermTable
att0 String
a
      (att2 :: ATermTable
att2, b' :: Int
b') <- ATermTable -> ObjectTemplate -> IO (ATermTable, Int)
forall t.
ShATermConvertible t =>
ATermTable -> t -> IO (ATermTable, Int)
toShATerm' ATermTable
att1 ObjectTemplate
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 "Domain" [Int
a', Int
b'] []) ATermTable
att2
  fromShATermAux :: Int -> ATermTable -> (ATermTable, Domain)
fromShATermAux ix :: Int
ix att0 :: ATermTable
att0 = case Int -> ATermTable -> ShATerm
getShATerm Int
ix ATermTable
att0 of
    ShAAppl "Domain" [a :: Int
a, b :: Int
b] _ ->
      case Int -> ATermTable -> (ATermTable, String)
forall t.
ShATermConvertible t =>
Int -> ATermTable -> (ATermTable, t)
fromShATerm' Int
a ATermTable
att0 of
      { (att1 :: ATermTable
att1, a' :: String
a') ->
      case Int -> ATermTable -> (ATermTable, ObjectTemplate)
forall t.
ShATermConvertible t =>
Int -> ATermTable -> (ATermTable, t)
fromShATerm' Int
b ATermTable
att1 of
      { (att2 :: ATermTable
att2, b' :: ObjectTemplate
b') ->
      (ATermTable
att2, String -> ObjectTemplate -> Domain
Domain String
a' ObjectTemplate
b') }}
    u :: ShATerm
u -> String -> ShATerm -> (ATermTable, Domain)
forall a. String -> ShATerm -> a
fromShATermError "QVTR.As.Domain" ShATerm
u

instance ShATermConvertible QVTR.As.ObjectTemplate where
  toShATermAux :: ATermTable -> ObjectTemplate -> IO (ATermTable, Int)
toShATermAux att0 :: ATermTable
att0 xv :: ObjectTemplate
xv = case ObjectTemplate
xv of
    ObjectTemplate a :: String
a b :: String
b c :: String
c d :: [PropertyTemplate]
d -> do
      (att1 :: ATermTable
att1, a' :: Int
a') <- ATermTable -> String -> IO (ATermTable, Int)
forall t.
ShATermConvertible t =>
ATermTable -> t -> IO (ATermTable, Int)
toShATerm' ATermTable
att0 String
a
      (att2 :: ATermTable
att2, b' :: Int
b') <- ATermTable -> String -> IO (ATermTable, Int)
forall t.
ShATermConvertible t =>
ATermTable -> t -> IO (ATermTable, Int)
toShATerm' ATermTable
att1 String
b
      (att3 :: ATermTable
att3, c' :: Int
c') <- ATermTable -> String -> IO (ATermTable, Int)
forall t.
ShATermConvertible t =>
ATermTable -> t -> IO (ATermTable, Int)
toShATerm' ATermTable
att2 String
c
      (att4 :: ATermTable
att4, d' :: Int
d') <- ATermTable -> [PropertyTemplate] -> IO (ATermTable, Int)
forall t.
ShATermConvertible t =>
ATermTable -> t -> IO (ATermTable, Int)
toShATerm' ATermTable
att3 [PropertyTemplate]
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 "ObjectTemplate" [Int
a', Int
b', Int
c',
                                                   Int
d'] []) ATermTable
att4
  fromShATermAux :: Int -> ATermTable -> (ATermTable, ObjectTemplate)
fromShATermAux ix :: Int
ix att0 :: ATermTable
att0 = case Int -> ATermTable -> ShATerm
getShATerm Int
ix ATermTable
att0 of
    ShAAppl "ObjectTemplate" [a :: Int
a, b :: Int
b, c :: Int
c, d :: Int
d] _ ->
      case Int -> ATermTable -> (ATermTable, String)
forall t.
ShATermConvertible t =>
Int -> ATermTable -> (ATermTable, t)
fromShATerm' Int
a ATermTable
att0 of
      { (att1 :: ATermTable
att1, a' :: String
a') ->
      case Int -> ATermTable -> (ATermTable, String)
forall t.
ShATermConvertible t =>
Int -> ATermTable -> (ATermTable, t)
fromShATerm' Int
b ATermTable
att1 of
      { (att2 :: ATermTable
att2, b' :: String
b') ->
      case Int -> ATermTable -> (ATermTable, String)
forall t.
ShATermConvertible t =>
Int -> ATermTable -> (ATermTable, t)
fromShATerm' Int
c ATermTable
att2 of
      { (att3 :: ATermTable
att3, c' :: String
c') ->
      case Int -> ATermTable -> (ATermTable, [PropertyTemplate])
forall t.
ShATermConvertible t =>
Int -> ATermTable -> (ATermTable, t)
fromShATerm' Int
d ATermTable
att3 of
      { (att4 :: ATermTable
att4, d' :: [PropertyTemplate]
d') ->
      (ATermTable
att4, String -> String -> String -> [PropertyTemplate] -> ObjectTemplate
ObjectTemplate String
a' String
b' String
c' [PropertyTemplate]
d') }}}}
    u :: ShATerm
u -> String -> ShATerm -> (ATermTable, ObjectTemplate)
forall a. String -> ShATerm -> a
fromShATermError "QVTR.As.ObjectTemplate" ShATerm
u

instance ShATermConvertible QVTR.As.PropertyTemplate where
  toShATermAux :: ATermTable -> PropertyTemplate -> IO (ATermTable, Int)
toShATermAux att0 :: ATermTable
att0 xv :: PropertyTemplate
xv = case PropertyTemplate
xv of
    PropertyTemplate a :: String
a b :: Maybe OCL
b c :: Maybe ObjectTemplate
c -> do
      (att1 :: ATermTable
att1, a' :: Int
a') <- ATermTable -> String -> IO (ATermTable, Int)
forall t.
ShATermConvertible t =>
ATermTable -> t -> IO (ATermTable, Int)
toShATerm' ATermTable
att0 String
a
      (att2 :: ATermTable
att2, b' :: Int
b') <- ATermTable -> Maybe OCL -> IO (ATermTable, Int)
forall t.
ShATermConvertible t =>
ATermTable -> t -> IO (ATermTable, Int)
toShATerm' ATermTable
att1 Maybe OCL
b
      (att3 :: ATermTable
att3, c' :: Int
c') <- ATermTable -> Maybe ObjectTemplate -> IO (ATermTable, Int)
forall t.
ShATermConvertible t =>
ATermTable -> t -> IO (ATermTable, Int)
toShATerm' ATermTable
att2 Maybe ObjectTemplate
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 "PropertyTemplate" [Int
a', Int
b', Int
c'] []) ATermTable
att3
  fromShATermAux :: Int -> ATermTable -> (ATermTable, PropertyTemplate)
fromShATermAux ix :: Int
ix att0 :: ATermTable
att0 = case Int -> ATermTable -> ShATerm
getShATerm Int
ix ATermTable
att0 of
    ShAAppl "PropertyTemplate" [a :: Int
a, b :: Int
b, c :: Int
c] _ ->
      case Int -> ATermTable -> (ATermTable, String)
forall t.
ShATermConvertible t =>
Int -> ATermTable -> (ATermTable, t)
fromShATerm' Int
a ATermTable
att0 of
      { (att1 :: ATermTable
att1, a' :: String
a') ->
      case Int -> ATermTable -> (ATermTable, Maybe OCL)
forall t.
ShATermConvertible t =>
Int -> ATermTable -> (ATermTable, t)
fromShATerm' Int
b ATermTable
att1 of
      { (att2 :: ATermTable
att2, b' :: Maybe OCL
b') ->
      case Int -> ATermTable -> (ATermTable, Maybe ObjectTemplate)
forall t.
ShATermConvertible t =>
Int -> ATermTable -> (ATermTable, t)
fromShATerm' Int
c ATermTable
att2 of
      { (att3 :: ATermTable
att3, c' :: Maybe ObjectTemplate
c') ->
      (ATermTable
att3, String -> Maybe OCL -> Maybe ObjectTemplate -> PropertyTemplate
PropertyTemplate String
a' Maybe OCL
b' Maybe ObjectTemplate
c') }}}
    u :: ShATerm
u -> String -> ShATerm -> (ATermTable, PropertyTemplate)
forall a. String -> ShATerm -> a
fromShATermError "QVTR.As.PropertyTemplate" ShATerm
u

instance ShATermConvertible QVTR.As.WhenWhere where
  toShATermAux :: ATermTable -> WhenWhere -> IO (ATermTable, Int)
toShATermAux att0 :: ATermTable
att0 xv :: WhenWhere
xv = case WhenWhere
xv of
    WhenWhere a :: [RelInvok]
a b :: [OCL]
b -> do
      (att1 :: ATermTable
att1, a' :: Int
a') <- ATermTable -> [RelInvok] -> IO (ATermTable, Int)
forall t.
ShATermConvertible t =>
ATermTable -> t -> IO (ATermTable, Int)
toShATerm' ATermTable
att0 [RelInvok]
a
      (att2 :: ATermTable
att2, b' :: Int
b') <- ATermTable -> [OCL] -> IO (ATermTable, Int)
forall t.
ShATermConvertible t =>
ATermTable -> t -> IO (ATermTable, Int)
toShATerm' ATermTable
att1 [OCL]
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 "WhenWhere" [Int
a', Int
b'] []) ATermTable
att2
  fromShATermAux :: Int -> ATermTable -> (ATermTable, WhenWhere)
fromShATermAux ix :: Int
ix att0 :: ATermTable
att0 = case Int -> ATermTable -> ShATerm
getShATerm Int
ix ATermTable
att0 of
    ShAAppl "WhenWhere" [a :: Int
a, b :: Int
b] _ ->
      case Int -> ATermTable -> (ATermTable, [RelInvok])
forall t.
ShATermConvertible t =>
Int -> ATermTable -> (ATermTable, t)
fromShATerm' Int
a ATermTable
att0 of
      { (att1 :: ATermTable
att1, a' :: [RelInvok]
a') ->
      case Int -> ATermTable -> (ATermTable, [OCL])
forall t.
ShATermConvertible t =>
Int -> ATermTable -> (ATermTable, t)
fromShATerm' Int
b ATermTable
att1 of
      { (att2 :: ATermTable
att2, b' :: [OCL]
b') ->
      (ATermTable
att2, [RelInvok] -> [OCL] -> WhenWhere
WhenWhere [RelInvok]
a' [OCL]
b') }}
    u :: ShATerm
u -> String -> ShATerm -> (ATermTable, WhenWhere)
forall a. String -> ShATerm -> a
fromShATermError "QVTR.As.WhenWhere" ShATerm
u

instance ShATermConvertible QVTR.As.RelInvok where
  toShATermAux :: ATermTable -> RelInvok -> IO (ATermTable, Int)
toShATermAux att0 :: ATermTable
att0 xv :: RelInvok
xv = case RelInvok
xv of
    RelInvok a :: String
a b :: [String]
b -> do
      (att1 :: ATermTable
att1, a' :: Int
a') <- ATermTable -> String -> IO (ATermTable, Int)
forall t.
ShATermConvertible t =>
ATermTable -> t -> IO (ATermTable, Int)
toShATerm' ATermTable
att0 String
a
      (att2 :: ATermTable
att2, b' :: Int
b') <- ATermTable -> [String] -> IO (ATermTable, Int)
forall t.
ShATermConvertible t =>
ATermTable -> t -> IO (ATermTable, Int)
toShATerm' ATermTable
att1 [String]
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 "RelInvok" [Int
a', Int
b'] []) ATermTable
att2
  fromShATermAux :: Int -> ATermTable -> (ATermTable, RelInvok)
fromShATermAux ix :: Int
ix att0 :: ATermTable
att0 = case Int -> ATermTable -> ShATerm
getShATerm Int
ix ATermTable
att0 of
    ShAAppl "RelInvok" [a :: Int
a, b :: Int
b] _ ->
      case Int -> ATermTable -> (ATermTable, String)
forall t.
ShATermConvertible t =>
Int -> ATermTable -> (ATermTable, t)
fromShATerm' Int
a ATermTable
att0 of
      { (att1 :: ATermTable
att1, a' :: String
a') ->
      case Int -> ATermTable -> (ATermTable, [String])
forall t.
ShATermConvertible t =>
Int -> ATermTable -> (ATermTable, t)
fromShATerm' Int
b ATermTable
att1 of
      { (att2 :: ATermTable
att2, b' :: [String]
b') ->
      (ATermTable
att2, String -> [String] -> RelInvok
RelInvok String
a' [String]
b') }}
    u :: ShATerm
u -> String -> ShATerm -> (ATermTable, RelInvok)
forall a. String -> ShATerm -> a
fromShATermError "QVTR.As.RelInvok" ShATerm
u

instance ShATermConvertible QVTR.As.OCL where
  toShATermAux :: ATermTable -> OCL -> IO (ATermTable, Int)
toShATermAux att0 :: ATermTable
att0 xv :: OCL
xv = case OCL
xv of
    Paren a :: OCL
a -> do
      (att1 :: ATermTable
att1, a' :: Int
a') <- ATermTable -> OCL -> IO (ATermTable, Int)
forall t.
ShATermConvertible t =>
ATermTable -> t -> IO (ATermTable, Int)
toShATerm' ATermTable
att0 OCL
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 "Paren" [Int
a'] []) ATermTable
att1
    StringExp a :: STRING
a -> do
      (att1 :: ATermTable
att1, a' :: Int
a') <- ATermTable -> STRING -> IO (ATermTable, Int)
forall t.
ShATermConvertible t =>
ATermTable -> t -> IO (ATermTable, Int)
toShATerm' ATermTable
att0 STRING
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 "StringExp" [Int
a'] []) ATermTable
att1
    BExp a :: Bool
a -> do
      (att1 :: ATermTable
att1, a' :: Int
a') <- ATermTable -> Bool -> IO (ATermTable, Int)
forall t.
ShATermConvertible t =>
ATermTable -> t -> IO (ATermTable, Int)
toShATerm' ATermTable
att0 Bool
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 "BExp" [Int
a'] []) ATermTable
att1
    NotB a :: OCL
a -> do
      (att1 :: ATermTable
att1, a' :: Int
a') <- ATermTable -> OCL -> IO (ATermTable, Int)
forall t.
ShATermConvertible t =>
ATermTable -> t -> IO (ATermTable, Int)
toShATerm' ATermTable
att0 OCL
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 "NotB" [Int
a'] []) ATermTable
att1
    AndB a :: OCL
a b :: OCL
b -> do
      (att1 :: ATermTable
att1, a' :: Int
a') <- ATermTable -> OCL -> IO (ATermTable, Int)
forall t.
ShATermConvertible t =>
ATermTable -> t -> IO (ATermTable, Int)
toShATerm' ATermTable
att0 OCL
a
      (att2 :: ATermTable
att2, b' :: Int
b') <- ATermTable -> OCL -> IO (ATermTable, Int)
forall t.
ShATermConvertible t =>
ATermTable -> t -> IO (ATermTable, Int)
toShATerm' ATermTable
att1 OCL
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 "AndB" [Int
a', Int
b'] []) ATermTable
att2
    OrB a :: OCL
a b :: OCL
b -> do
      (att1 :: ATermTable
att1, a' :: Int
a') <- ATermTable -> OCL -> IO (ATermTable, Int)
forall t.
ShATermConvertible t =>
ATermTable -> t -> IO (ATermTable, Int)
toShATerm' ATermTable
att0 OCL
a
      (att2 :: ATermTable
att2, b' :: Int
b') <- ATermTable -> OCL -> IO (ATermTable, Int)
forall t.
ShATermConvertible t =>
ATermTable -> t -> IO (ATermTable, Int)
toShATerm' ATermTable
att1 OCL
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 "OrB" [Int
a', Int
b'] []) ATermTable
att2
    Equal a :: STRING
a b :: STRING
b -> do
      (att1 :: ATermTable
att1, a' :: Int
a') <- ATermTable -> STRING -> IO (ATermTable, Int)
forall t.
ShATermConvertible t =>
ATermTable -> t -> IO (ATermTable, Int)
toShATerm' ATermTable
att0 STRING
a
      (att2 :: ATermTable
att2, b' :: Int
b') <- ATermTable -> STRING -> IO (ATermTable, Int)
forall t.
ShATermConvertible t =>
ATermTable -> t -> IO (ATermTable, Int)
toShATerm' ATermTable
att1 STRING
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 "Equal" [Int
a', Int
b'] []) ATermTable
att2
  fromShATermAux :: Int -> ATermTable -> (ATermTable, OCL)
fromShATermAux ix :: Int
ix att0 :: ATermTable
att0 = case Int -> ATermTable -> ShATerm
getShATerm Int
ix ATermTable
att0 of
    ShAAppl "Paren" [a :: Int
a] _ ->
      case Int -> ATermTable -> (ATermTable, OCL)
forall t.
ShATermConvertible t =>
Int -> ATermTable -> (ATermTable, t)
fromShATerm' Int
a ATermTable
att0 of
      { (att1 :: ATermTable
att1, a' :: OCL
a') ->
      (ATermTable
att1, OCL -> OCL
Paren OCL
a') }
    ShAAppl "StringExp" [a :: Int
a] _ ->
      case Int -> ATermTable -> (ATermTable, STRING)
forall t.
ShATermConvertible t =>
Int -> ATermTable -> (ATermTable, t)
fromShATerm' Int
a ATermTable
att0 of
      { (att1 :: ATermTable
att1, a' :: STRING
a') ->
      (ATermTable
att1, STRING -> OCL
StringExp STRING
a') }
    ShAAppl "BExp" [a :: Int
a] _ ->
      case Int -> ATermTable -> (ATermTable, Bool)
forall t.
ShATermConvertible t =>
Int -> ATermTable -> (ATermTable, t)
fromShATerm' Int
a ATermTable
att0 of
      { (att1 :: ATermTable
att1, a' :: Bool
a') ->
      (ATermTable
att1, Bool -> OCL
BExp Bool
a') }
    ShAAppl "NotB" [a :: Int
a] _ ->
      case Int -> ATermTable -> (ATermTable, OCL)
forall t.
ShATermConvertible t =>
Int -> ATermTable -> (ATermTable, t)
fromShATerm' Int
a ATermTable
att0 of
      { (att1 :: ATermTable
att1, a' :: OCL
a') ->
      (ATermTable
att1, OCL -> OCL
NotB OCL
a') }
    ShAAppl "AndB" [a :: Int
a, b :: Int
b] _ ->
      case Int -> ATermTable -> (ATermTable, OCL)
forall t.
ShATermConvertible t =>
Int -> ATermTable -> (ATermTable, t)
fromShATerm' Int
a ATermTable
att0 of
      { (att1 :: ATermTable
att1, a' :: OCL
a') ->
      case Int -> ATermTable -> (ATermTable, OCL)
forall t.
ShATermConvertible t =>
Int -> ATermTable -> (ATermTable, t)
fromShATerm' Int
b ATermTable
att1 of
      { (att2 :: ATermTable
att2, b' :: OCL
b') ->
      (ATermTable
att2, OCL -> OCL -> OCL
AndB OCL
a' OCL
b') }}
    ShAAppl "OrB" [a :: Int
a, b :: Int
b] _ ->
      case Int -> ATermTable -> (ATermTable, OCL)
forall t.
ShATermConvertible t =>
Int -> ATermTable -> (ATermTable, t)
fromShATerm' Int
a ATermTable
att0 of
      { (att1 :: ATermTable
att1, a' :: OCL
a') ->
      case Int -> ATermTable -> (ATermTable, OCL)
forall t.
ShATermConvertible t =>
Int -> ATermTable -> (ATermTable, t)
fromShATerm' Int
b ATermTable
att1 of
      { (att2 :: ATermTable
att2, b' :: OCL
b') ->
      (ATermTable
att2, OCL -> OCL -> OCL
OrB OCL
a' OCL
b') }}
    ShAAppl "Equal" [a :: Int
a, b :: Int
b] _ ->
      case Int -> ATermTable -> (ATermTable, STRING)
forall t.
ShATermConvertible t =>
Int -> ATermTable -> (ATermTable, t)
fromShATerm' Int
a ATermTable
att0 of
      { (att1 :: ATermTable
att1, a' :: STRING
a') ->
      case Int -> ATermTable -> (ATermTable, STRING)
forall t.
ShATermConvertible t =>
Int -> ATermTable -> (ATermTable, t)
fromShATerm' Int
b ATermTable
att1 of
      { (att2 :: ATermTable
att2, b' :: STRING
b') ->
      (ATermTable
att2, STRING -> STRING -> OCL
Equal STRING
a' STRING
b') }}
    u :: ShATerm
u -> String -> ShATerm -> (ATermTable, OCL)
forall a. String -> ShATerm -> a
fromShATermError "QVTR.As.OCL" ShATerm
u

instance ShATermConvertible QVTR.As.STRING where
  toShATermAux :: ATermTable -> STRING -> IO (ATermTable, Int)
toShATermAux att0 :: ATermTable
att0 xv :: STRING
xv = case STRING
xv of
    Str a :: String
a -> do
      (att1 :: ATermTable
att1, a' :: Int
a') <- ATermTable -> String -> IO (ATermTable, Int)
forall t.
ShATermConvertible t =>
ATermTable -> t -> IO (ATermTable, Int)
toShATerm' ATermTable
att0 String
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 "Str" [Int
a'] []) ATermTable
att1
    ConcatExp a :: STRING
a b :: STRING
b -> do
      (att1 :: ATermTable
att1, a' :: Int
a') <- ATermTable -> STRING -> IO (ATermTable, Int)
forall t.
ShATermConvertible t =>
ATermTable -> t -> IO (ATermTable, Int)
toShATerm' ATermTable
att0 STRING
a
      (att2 :: ATermTable
att2, b' :: Int
b') <- ATermTable -> STRING -> IO (ATermTable, Int)
forall t.
ShATermConvertible t =>
ATermTable -> t -> IO (ATermTable, Int)
toShATerm' ATermTable
att1 STRING
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 "ConcatExp" [Int
a', Int
b'] []) ATermTable
att2
    VarExp a :: String
a -> do
      (att1 :: ATermTable
att1, a' :: Int
a') <- ATermTable -> String -> IO (ATermTable, Int)
forall t.
ShATermConvertible t =>
ATermTable -> t -> IO (ATermTable, Int)
toShATerm' ATermTable
att0 String
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 "VarExp" [Int
a'] []) ATermTable
att1
  fromShATermAux :: Int -> ATermTable -> (ATermTable, STRING)
fromShATermAux ix :: Int
ix att0 :: ATermTable
att0 = case Int -> ATermTable -> ShATerm
getShATerm Int
ix ATermTable
att0 of
    ShAAppl "Str" [a :: Int
a] _ ->
      case Int -> ATermTable -> (ATermTable, String)
forall t.
ShATermConvertible t =>
Int -> ATermTable -> (ATermTable, t)
fromShATerm' Int
a ATermTable
att0 of
      { (att1 :: ATermTable
att1, a' :: String
a') ->
      (ATermTable
att1, String -> STRING
Str String
a') }
    ShAAppl "ConcatExp" [a :: Int
a, b :: Int
b] _ ->
      case Int -> ATermTable -> (ATermTable, STRING)
forall t.
ShATermConvertible t =>
Int -> ATermTable -> (ATermTable, t)
fromShATerm' Int
a ATermTable
att0 of
      { (att1 :: ATermTable
att1, a' :: STRING
a') ->
      case Int -> ATermTable -> (ATermTable, STRING)
forall t.
ShATermConvertible t =>
Int -> ATermTable -> (ATermTable, t)
fromShATerm' Int
b ATermTable
att1 of
      { (att2 :: ATermTable
att2, b' :: STRING
b') ->
      (ATermTable
att2, STRING -> STRING -> STRING
ConcatExp STRING
a' STRING
b') }}
    ShAAppl "VarExp" [a :: Int
a] _ ->
      case Int -> ATermTable -> (ATermTable, String)
forall t.
ShATermConvertible t =>
Int -> ATermTable -> (ATermTable, t)
fromShATerm' Int
a ATermTable
att0 of
      { (att1 :: ATermTable
att1, a' :: String
a') ->
      (ATermTable
att1, String -> STRING
VarExp String
a') }
    u :: ShATerm
u -> String -> ShATerm -> (ATermTable, STRING)
forall a. String -> ShATerm -> a
fromShATermError "QVTR.As.STRING" ShATerm
u

deriving instance GHC.Generics.Generic QVTR.As.Transformation
instance Data.Aeson.ToJSON QVTR.As.Transformation where
instance Data.Aeson.FromJSON QVTR.As.Transformation where

deriving instance GHC.Generics.Generic QVTR.As.Key
instance Data.Aeson.ToJSON QVTR.As.Key where
instance Data.Aeson.FromJSON QVTR.As.Key where

deriving instance GHC.Generics.Generic QVTR.As.PropKey
instance Data.Aeson.ToJSON QVTR.As.PropKey where
instance Data.Aeson.FromJSON QVTR.As.PropKey where

deriving instance GHC.Generics.Generic QVTR.As.Relation
instance Data.Aeson.ToJSON QVTR.As.Relation where
instance Data.Aeson.FromJSON QVTR.As.Relation where

deriving instance GHC.Generics.Generic QVTR.As.RelVar
instance Data.Aeson.ToJSON QVTR.As.RelVar where
instance Data.Aeson.FromJSON QVTR.As.RelVar where

deriving instance GHC.Generics.Generic QVTR.As.PrimitiveDomain
instance Data.Aeson.ToJSON QVTR.As.PrimitiveDomain where
instance Data.Aeson.FromJSON QVTR.As.PrimitiveDomain where

deriving instance GHC.Generics.Generic QVTR.As.Domain
instance Data.Aeson.ToJSON QVTR.As.Domain where
instance Data.Aeson.FromJSON QVTR.As.Domain where

deriving instance GHC.Generics.Generic QVTR.As.ObjectTemplate
instance Data.Aeson.ToJSON QVTR.As.ObjectTemplate where
instance Data.Aeson.FromJSON QVTR.As.ObjectTemplate where

deriving instance GHC.Generics.Generic QVTR.As.PropertyTemplate
instance Data.Aeson.ToJSON QVTR.As.PropertyTemplate where
instance Data.Aeson.FromJSON QVTR.As.PropertyTemplate where

deriving instance GHC.Generics.Generic QVTR.As.WhenWhere
instance Data.Aeson.ToJSON QVTR.As.WhenWhere where
instance Data.Aeson.FromJSON QVTR.As.WhenWhere where

deriving instance GHC.Generics.Generic QVTR.As.RelInvok
instance Data.Aeson.ToJSON QVTR.As.RelInvok where
instance Data.Aeson.FromJSON QVTR.As.RelInvok where

deriving instance GHC.Generics.Generic QVTR.As.OCL
instance Data.Aeson.ToJSON QVTR.As.OCL where
instance Data.Aeson.FromJSON QVTR.As.OCL where

deriving instance GHC.Generics.Generic QVTR.As.STRING
instance Data.Aeson.ToJSON QVTR.As.STRING where
instance Data.Aeson.FromJSON QVTR.As.STRING where

instance ShATermConvertible QVTR.Sign.RuleDef where
  toShATermAux :: ATermTable -> RuleDef -> IO (ATermTable, Int)
toShATermAux att0 :: ATermTable
att0 xv :: RuleDef
xv = case RuleDef
xv of
    RuleDef a :: String
a b :: Bool
b c :: [TypeClass]
c -> do
      (att1 :: ATermTable
att1, a' :: Int
a') <- ATermTable -> String -> IO (ATermTable, Int)
forall t.
ShATermConvertible t =>
ATermTable -> t -> IO (ATermTable, Int)
toShATerm' ATermTable
att0 String
a
      (att2 :: ATermTable
att2, b' :: Int
b') <- ATermTable -> Bool -> IO (ATermTable, Int)
forall t.
ShATermConvertible t =>
ATermTable -> t -> IO (ATermTable, Int)
toShATerm' ATermTable
att1 Bool
b
      (att3 :: ATermTable
att3, c' :: Int
c') <- ATermTable -> [TypeClass] -> IO (ATermTable, Int)
forall t.
ShATermConvertible t =>
ATermTable -> t -> IO (ATermTable, Int)
toShATerm' ATermTable
att2 [TypeClass]
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 "RuleDef" [Int
a', Int
b', Int
c'] []) ATermTable
att3
  fromShATermAux :: Int -> ATermTable -> (ATermTable, RuleDef)
fromShATermAux ix :: Int
ix att0 :: ATermTable
att0 = case Int -> ATermTable -> ShATerm
getShATerm Int
ix ATermTable
att0 of
    ShAAppl "RuleDef" [a :: Int
a, b :: Int
b, c :: Int
c] _ ->
      case Int -> ATermTable -> (ATermTable, String)
forall t.
ShATermConvertible t =>
Int -> ATermTable -> (ATermTable, t)
fromShATerm' Int
a ATermTable
att0 of
      { (att1 :: ATermTable
att1, a' :: String
a') ->
      case Int -> ATermTable -> (ATermTable, Bool)
forall t.
ShATermConvertible t =>
Int -> ATermTable -> (ATermTable, t)
fromShATerm' Int
b ATermTable
att1 of
      { (att2 :: ATermTable
att2, b' :: Bool
b') ->
      case Int -> ATermTable -> (ATermTable, [TypeClass])
forall t.
ShATermConvertible t =>
Int -> ATermTable -> (ATermTable, t)
fromShATerm' Int
c ATermTable
att2 of
      { (att3 :: ATermTable
att3, c' :: [TypeClass]
c') ->
      (ATermTable
att3, String -> Bool -> [TypeClass] -> RuleDef
RuleDef String
a' Bool
b' [TypeClass]
c') }}}
    u :: ShATerm
u -> String -> ShATerm -> (ATermTable, RuleDef)
forall a. String -> ShATerm -> a
fromShATermError "QVTR.Sign.RuleDef" ShATerm
u

instance ShATermConvertible QVTR.Sign.Sign where
  toShATermAux :: ATermTable -> Sign -> IO (ATermTable, Int)
toShATermAux att0 :: ATermTable
att0 xv :: Sign
xv = case Sign
xv of
    Sign a :: Sign
a b :: Sign
b c :: Map String RuleDef
c d :: Map String RuleDef
d e :: [(String, String)]
e -> do
      (att1 :: ATermTable
att1, a' :: Int
a') <- ATermTable -> Sign -> IO (ATermTable, Int)
forall t.
ShATermConvertible t =>
ATermTable -> t -> IO (ATermTable, Int)
toShATerm' ATermTable
att0 Sign
a
      (att2 :: ATermTable
att2, b' :: Int
b') <- ATermTable -> Sign -> IO (ATermTable, Int)
forall t.
ShATermConvertible t =>
ATermTable -> t -> IO (ATermTable, Int)
toShATerm' ATermTable
att1 Sign
b
      (att3 :: ATermTable
att3, c' :: Int
c') <- ATermTable -> Map String RuleDef -> IO (ATermTable, Int)
forall t.
ShATermConvertible t =>
ATermTable -> t -> IO (ATermTable, Int)
toShATerm' ATermTable
att2 Map String RuleDef
c
      (att4 :: ATermTable
att4, d' :: Int
d') <- ATermTable -> Map String RuleDef -> IO (ATermTable, Int)
forall t.
ShATermConvertible t =>
ATermTable -> t -> IO (ATermTable, Int)
toShATerm' ATermTable
att3 Map String RuleDef
d
      (att5 :: ATermTable
att5, e' :: Int
e') <- ATermTable -> [(String, String)] -> IO (ATermTable, Int)
forall t.
ShATermConvertible t =>
ATermTable -> t -> IO (ATermTable, Int)
toShATerm' ATermTable
att4 [(String, String)]
e
      (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 "Sign" [Int
a', Int
b', Int
c', Int
d', Int
e'] []) ATermTable
att5
  fromShATermAux :: Int -> ATermTable -> (ATermTable, Sign)
fromShATermAux ix :: Int
ix att0 :: ATermTable
att0 = case Int -> ATermTable -> ShATerm
getShATerm Int
ix ATermTable
att0 of
    ShAAppl "Sign" [a :: Int
a, b :: Int
b, c :: Int
c, d :: Int
d, e :: Int
e] _ ->
      case Int -> ATermTable -> (ATermTable, Sign)
forall t.
ShATermConvertible t =>
Int -> ATermTable -> (ATermTable, t)
fromShATerm' Int
a ATermTable
att0 of
      { (att1 :: ATermTable
att1, a' :: Sign
a') ->
      case Int -> ATermTable -> (ATermTable, Sign)
forall t.
ShATermConvertible t =>
Int -> ATermTable -> (ATermTable, t)
fromShATerm' Int
b ATermTable
att1 of
      { (att2 :: ATermTable
att2, b' :: Sign
b') ->
      case Int -> ATermTable -> (ATermTable, Map String RuleDef)
forall t.
ShATermConvertible t =>
Int -> ATermTable -> (ATermTable, t)
fromShATerm' Int
c ATermTable
att2 of
      { (att3 :: ATermTable
att3, c' :: Map String RuleDef
c') ->
      case Int -> ATermTable -> (ATermTable, Map String RuleDef)
forall t.
ShATermConvertible t =>
Int -> ATermTable -> (ATermTable, t)
fromShATerm' Int
d ATermTable
att3 of
      { (att4 :: ATermTable
att4, d' :: Map String RuleDef
d') ->
      case Int -> ATermTable -> (ATermTable, [(String, String)])
forall t.
ShATermConvertible t =>
Int -> ATermTable -> (ATermTable, t)
fromShATerm' Int
e ATermTable
att4 of
      { (att5 :: ATermTable
att5, e' :: [(String, String)]
e') ->
      (ATermTable
att5, Sign
-> Sign
-> Map String RuleDef
-> Map String RuleDef
-> [(String, String)]
-> Sign
Sign Sign
a' Sign
b' Map String RuleDef
c' Map String RuleDef
d' [(String, String)]
e') }}}}}
    u :: ShATerm
u -> String -> ShATerm -> (ATermTable, Sign)
forall a. String -> ShATerm -> a
fromShATermError "QVTR.Sign.Sign" ShATerm
u

instance ShATermConvertible QVTR.Sign.Sen where
  toShATermAux :: ATermTable -> Sen -> IO (ATermTable, Int)
toShATermAux att0 :: ATermTable
att0 xv :: Sen
xv = case Sen
xv of
    KeyConstr a :: Key
a -> do
      (att1 :: ATermTable
att1, a' :: Int
a') <- ATermTable -> Key -> IO (ATermTable, Int)
forall t.
ShATermConvertible t =>
ATermTable -> t -> IO (ATermTable, Int)
toShATerm' ATermTable
att0 Key
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 "KeyConstr" [Int
a'] []) ATermTable
att1
    QVTSen a :: RelationSen
a -> do
      (att1 :: ATermTable
att1, a' :: Int
a') <- ATermTable -> RelationSen -> IO (ATermTable, Int)
forall t.
ShATermConvertible t =>
ATermTable -> t -> IO (ATermTable, Int)
toShATerm' ATermTable
att0 RelationSen
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 "QVTSen" [Int
a'] []) ATermTable
att1
  fromShATermAux :: Int -> ATermTable -> (ATermTable, Sen)
fromShATermAux ix :: Int
ix att0 :: ATermTable
att0 = case Int -> ATermTable -> ShATerm
getShATerm Int
ix ATermTable
att0 of
    ShAAppl "KeyConstr" [a :: Int
a] _ ->
      case Int -> ATermTable -> (ATermTable, Key)
forall t.
ShATermConvertible t =>
Int -> ATermTable -> (ATermTable, t)
fromShATerm' Int
a ATermTable
att0 of
      { (att1 :: ATermTable
att1, a' :: Key
a') ->
      (ATermTable
att1, Key -> Sen
KeyConstr Key
a') }
    ShAAppl "QVTSen" [a :: Int
a] _ ->
      case Int -> ATermTable -> (ATermTable, RelationSen)
forall t.
ShATermConvertible t =>
Int -> ATermTable -> (ATermTable, t)
fromShATerm' Int
a ATermTable
att0 of
      { (att1 :: ATermTable
att1, a' :: RelationSen
a') ->
      (ATermTable
att1, RelationSen -> Sen
QVTSen RelationSen
a') }
    u :: ShATerm
u -> String -> ShATerm -> (ATermTable, Sen)
forall a. String -> ShATerm -> a
fromShATermError "QVTR.Sign.Sen" ShATerm
u

instance ShATermConvertible QVTR.Sign.RelationSen where
  toShATermAux :: ATermTable -> RelationSen -> IO (ATermTable, Int)
toShATermAux att0 :: ATermTable
att0 xv :: RelationSen
xv = case RelationSen
xv of
    RelationSen a :: RuleDef
a b :: [RelVar]
b c :: [RelVar]
c d :: Pattern
d e :: Pattern
e f :: Maybe WhenWhere
f g :: Maybe WhenWhere
g -> do
      (att1 :: ATermTable
att1, a' :: Int
a') <- ATermTable -> RuleDef -> IO (ATermTable, Int)
forall t.
ShATermConvertible t =>
ATermTable -> t -> IO (ATermTable, Int)
toShATerm' ATermTable
att0 RuleDef
a
      (att2 :: ATermTable
att2, b' :: Int
b') <- ATermTable -> [RelVar] -> IO (ATermTable, Int)
forall t.
ShATermConvertible t =>
ATermTable -> t -> IO (ATermTable, Int)
toShATerm' ATermTable
att1 [RelVar]
b
      (att3 :: ATermTable
att3, c' :: Int
c') <- ATermTable -> [RelVar] -> IO (ATermTable, Int)
forall t.
ShATermConvertible t =>
ATermTable -> t -> IO (ATermTable, Int)
toShATerm' ATermTable
att2 [RelVar]
c
      (att4 :: ATermTable
att4, d' :: Int
d') <- ATermTable -> Pattern -> IO (ATermTable, Int)
forall t.
ShATermConvertible t =>
ATermTable -> t -> IO (ATermTable, Int)
toShATerm' ATermTable
att3 Pattern
d
      (att5 :: ATermTable
att5, e' :: Int
e') <- ATermTable -> Pattern -> IO (ATermTable, Int)
forall t.
ShATermConvertible t =>
ATermTable -> t -> IO (ATermTable, Int)
toShATerm' ATermTable
att4 Pattern
e
      (att6 :: ATermTable
att6, f' :: Int
f') <- ATermTable -> Maybe WhenWhere -> IO (ATermTable, Int)
forall t.
ShATermConvertible t =>
ATermTable -> t -> IO (ATermTable, Int)
toShATerm' ATermTable
att5 Maybe WhenWhere
f
      (att7 :: ATermTable
att7, g' :: Int
g') <- ATermTable -> Maybe WhenWhere -> IO (ATermTable, Int)
forall t.
ShATermConvertible t =>
ATermTable -> t -> IO (ATermTable, Int)
toShATerm' ATermTable
att6 Maybe WhenWhere
g
      (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 "RelationSen" [Int
a', Int
b', Int
c', Int
d', Int
e', Int
f',
                                                Int
g'] []) ATermTable
att7
  fromShATermAux :: Int -> ATermTable -> (ATermTable, RelationSen)
fromShATermAux ix :: Int
ix att0 :: ATermTable
att0 = case Int -> ATermTable -> ShATerm
getShATerm Int
ix ATermTable
att0 of
    ShAAppl "RelationSen" [a :: Int
a, b :: Int
b, c :: Int
c, d :: Int
d, e :: Int
e, f :: Int
f, g :: Int
g] _ ->
      case Int -> ATermTable -> (ATermTable, RuleDef)
forall t.
ShATermConvertible t =>
Int -> ATermTable -> (ATermTable, t)
fromShATerm' Int
a ATermTable
att0 of
      { (att1 :: ATermTable
att1, a' :: RuleDef
a') ->
      case Int -> ATermTable -> (ATermTable, [RelVar])
forall t.
ShATermConvertible t =>
Int -> ATermTable -> (ATermTable, t)
fromShATerm' Int
b ATermTable
att1 of
      { (att2 :: ATermTable
att2, b' :: [RelVar]
b') ->
      case Int -> ATermTable -> (ATermTable, [RelVar])
forall t.
ShATermConvertible t =>
Int -> ATermTable -> (ATermTable, t)
fromShATerm' Int
c ATermTable
att2 of
      { (att3 :: ATermTable
att3, c' :: [RelVar]
c') ->
      case Int -> ATermTable -> (ATermTable, Pattern)
forall t.
ShATermConvertible t =>
Int -> ATermTable -> (ATermTable, t)
fromShATerm' Int
d ATermTable
att3 of
      { (att4 :: ATermTable
att4, d' :: Pattern
d') ->
      case Int -> ATermTable -> (ATermTable, Pattern)
forall t.
ShATermConvertible t =>
Int -> ATermTable -> (ATermTable, t)
fromShATerm' Int
e ATermTable
att4 of
      { (att5 :: ATermTable
att5, e' :: Pattern
e') ->
      case Int -> ATermTable -> (ATermTable, Maybe WhenWhere)
forall t.
ShATermConvertible t =>
Int -> ATermTable -> (ATermTable, t)
fromShATerm' Int
f ATermTable
att5 of
      { (att6 :: ATermTable
att6, f' :: Maybe WhenWhere
f') ->
      case Int -> ATermTable -> (ATermTable, Maybe WhenWhere)
forall t.
ShATermConvertible t =>
Int -> ATermTable -> (ATermTable, t)
fromShATerm' Int
g ATermTable
att6 of
      { (att7 :: ATermTable
att7, g' :: Maybe WhenWhere
g') ->
      (ATermTable
att7, RuleDef
-> [RelVar]
-> [RelVar]
-> Pattern
-> Pattern
-> Maybe WhenWhere
-> Maybe WhenWhere
-> RelationSen
RelationSen RuleDef
a' [RelVar]
b' [RelVar]
c' Pattern
d' Pattern
e' Maybe WhenWhere
f' Maybe WhenWhere
g') }}}}}}}
    u :: ShATerm
u -> String -> ShATerm -> (ATermTable, RelationSen)
forall a. String -> ShATerm -> a
fromShATermError "QVTR.Sign.RelationSen" ShATerm
u

instance ShATermConvertible QVTR.Sign.Pattern where
  toShATermAux :: ATermTable -> Pattern -> IO (ATermTable, Int)
toShATermAux att0 :: ATermTable
att0 xv :: Pattern
xv = case Pattern
xv of
    Pattern a :: [RelVar]
a b :: [(PropertyT, RelVar, RelVar)]
b c :: [(String, String, OCL)]
c -> do
      (att1 :: ATermTable
att1, a' :: Int
a') <- ATermTable -> [RelVar] -> IO (ATermTable, Int)
forall t.
ShATermConvertible t =>
ATermTable -> t -> IO (ATermTable, Int)
toShATerm' ATermTable
att0 [RelVar]
a
      (att2 :: ATermTable
att2, b' :: Int
b') <- ATermTable -> [(PropertyT, RelVar, RelVar)] -> IO (ATermTable, Int)
forall t.
ShATermConvertible t =>
ATermTable -> t -> IO (ATermTable, Int)
toShATerm' ATermTable
att1 [(PropertyT, RelVar, RelVar)]
b
      (att3 :: ATermTable
att3, c' :: Int
c') <- ATermTable -> [(String, String, OCL)] -> IO (ATermTable, Int)
forall t.
ShATermConvertible t =>
ATermTable -> t -> IO (ATermTable, Int)
toShATerm' ATermTable
att2 [(String, String, OCL)]
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 "Pattern" [Int
a', Int
b', Int
c'] []) ATermTable
att3
  fromShATermAux :: Int -> ATermTable -> (ATermTable, Pattern)
fromShATermAux ix :: Int
ix att0 :: ATermTable
att0 = case Int -> ATermTable -> ShATerm
getShATerm Int
ix ATermTable
att0 of
    ShAAppl "Pattern" [a :: Int
a, b :: Int
b, c :: Int
c] _ ->
      case Int -> ATermTable -> (ATermTable, [RelVar])
forall t.
ShATermConvertible t =>
Int -> ATermTable -> (ATermTable, t)
fromShATerm' Int
a ATermTable
att0 of
      { (att1 :: ATermTable
att1, a' :: [RelVar]
a') ->
      case Int -> ATermTable -> (ATermTable, [(PropertyT, RelVar, RelVar)])
forall t.
ShATermConvertible t =>
Int -> ATermTable -> (ATermTable, t)
fromShATerm' Int
b ATermTable
att1 of
      { (att2 :: ATermTable
att2, b' :: [(PropertyT, RelVar, RelVar)]
b') ->
      case Int -> ATermTable -> (ATermTable, [(String, String, OCL)])
forall t.
ShATermConvertible t =>
Int -> ATermTable -> (ATermTable, t)
fromShATerm' Int
c ATermTable
att2 of
      { (att3 :: ATermTable
att3, c' :: [(String, String, OCL)]
c') ->
      (ATermTable
att3, [RelVar]
-> [(PropertyT, RelVar, RelVar)]
-> [(String, String, OCL)]
-> Pattern
Pattern [RelVar]
a' [(PropertyT, RelVar, RelVar)]
b' [(String, String, OCL)]
c') }}}
    u :: ShATerm
u -> String -> ShATerm -> (ATermTable, Pattern)
forall a. String -> ShATerm -> a
fromShATermError "QVTR.Sign.Pattern" ShATerm
u

deriving instance GHC.Generics.Generic QVTR.Sign.RuleDef
instance Data.Aeson.ToJSON QVTR.Sign.RuleDef where
instance Data.Aeson.FromJSON QVTR.Sign.RuleDef where

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

deriving instance GHC.Generics.Generic QVTR.Sign.Sen
instance Data.Aeson.ToJSON QVTR.Sign.Sen where
instance Data.Aeson.FromJSON QVTR.Sign.Sen where

deriving instance GHC.Generics.Generic QVTR.Sign.RelationSen
instance Data.Aeson.ToJSON QVTR.Sign.RelationSen where
instance Data.Aeson.FromJSON QVTR.Sign.RelationSen where

deriving instance GHC.Generics.Generic QVTR.Sign.Pattern
instance Data.Aeson.ToJSON QVTR.Sign.Pattern where
instance Data.Aeson.FromJSON QVTR.Sign.Pattern where