{-# OPTIONS -w -O0 #-}
{-# LANGUAGE CPP, StandaloneDeriving, DeriveDataTypeable, DeriveGeneric #-}
{- |
Module      :  VSE/ATC_VSE.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):
'VSE.As.Paramkind'
'VSE.As.Procparam'
'VSE.As.Profile'
'VSE.As.Sigentry'
'VSE.As.Procdecls'
'VSE.As.Ranged'
'VSE.As.PlainProgram'
'VSE.As.VarDecl'
'VSE.As.VSEforms'
'VSE.As.BoxOrDiamond'
'VSE.As.ProcKind'
'VSE.As.Defproc'
'VSE.As.Procs'
-}

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

module VSE.ATC_VSE () where

import ATerm.Lib
import CASL.AS_Basic_CASL
import CASL.ATC_CASL
import CASL.ToDoc
import Common.AS_Annotation
import Common.Doc
import Common.DocUtils
import Common.Id
import Common.Json.Instances
import Common.LibName
import Common.Result
import Common.Utils (number)
import Control.Monad (foldM)
import Data.Aeson(ToJSON, FromJSON)
import Data.Char
import Data.Data
import GHC.Generics(Generic)
import VSE.As
import qualified Data.Map as Map

{-! for VSE.As.Paramkind derive : ShATermConvertible !-}
{-! for VSE.As.Procparam derive : ShATermConvertible !-}
{-! for VSE.As.Profile derive : ShATermConvertible !-}
{-! for VSE.As.Sigentry derive : ShATermConvertible !-}
{-! for VSE.As.Procdecls derive : ShATermConvertible !-}
{-! for VSE.As.Ranged derive : ShATermConvertible !-}
{-! for VSE.As.PlainProgram derive : ShATermConvertible !-}
{-! for VSE.As.VarDecl derive : ShATermConvertible !-}
{-! for VSE.As.VSEforms derive : ShATermConvertible !-}
{-! for VSE.As.BoxOrDiamond derive : ShATermConvertible !-}
{-! for VSE.As.ProcKind derive : ShATermConvertible !-}
{-! for VSE.As.Defproc derive : ShATermConvertible !-}
{-! for VSE.As.Procs derive : ShATermConvertible !-}

{-! for VSE.As.Paramkind derive : Json !-}
{-! for VSE.As.Procparam derive : Json !-}
{-! for VSE.As.Profile derive : Json !-}
{-! for VSE.As.Sigentry derive : Json !-}
{-! for VSE.As.Procdecls derive : Json !-}
{-! for VSE.As.Ranged derive : Json !-}
{-! for VSE.As.PlainProgram derive : Json !-}
{-! for VSE.As.VarDecl derive : Json !-}
{-! for VSE.As.VSEforms derive : Json !-}
{-! for VSE.As.BoxOrDiamond derive : Json !-}
{-! for VSE.As.ProcKind derive : Json !-}
{-! for VSE.As.Defproc derive : Json !-}
{-! for VSE.As.Procs derive : Json !-}

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

deriving instance GHC.Generics.Generic VSE.As.Procs
instance Data.Aeson.ToJSON VSE.As.Procs where
instance Data.Aeson.FromJSON VSE.As.Procs where

deriving instance GHC.Generics.Generic VSE.As.Defproc
instance Data.Aeson.ToJSON VSE.As.Defproc where
instance Data.Aeson.FromJSON VSE.As.Defproc where

deriving instance GHC.Generics.Generic VSE.As.ProcKind
instance Data.Aeson.ToJSON VSE.As.ProcKind where
instance Data.Aeson.FromJSON VSE.As.ProcKind where

deriving instance GHC.Generics.Generic VSE.As.BoxOrDiamond
instance Data.Aeson.ToJSON VSE.As.BoxOrDiamond where
instance Data.Aeson.FromJSON VSE.As.BoxOrDiamond where

deriving instance GHC.Generics.Generic VSE.As.VSEforms
instance Data.Aeson.ToJSON VSE.As.VSEforms where
instance Data.Aeson.FromJSON VSE.As.VSEforms where

deriving instance GHC.Generics.Generic VSE.As.VarDecl
instance Data.Aeson.ToJSON VSE.As.VarDecl where
instance Data.Aeson.FromJSON VSE.As.VarDecl where

deriving instance GHC.Generics.Generic VSE.As.PlainProgram
instance Data.Aeson.ToJSON VSE.As.PlainProgram where
instance Data.Aeson.FromJSON VSE.As.PlainProgram where

deriving instance GHC.Generics.Generic (VSE.As.Ranged a)
instance Data.Aeson.ToJSON a => Data.Aeson.ToJSON (VSE.As.Ranged a) where
instance Data.Aeson.FromJSON a => Data.Aeson.FromJSON (VSE.As.Ranged a) where

deriving instance GHC.Generics.Generic VSE.As.Procdecls
instance Data.Aeson.ToJSON VSE.As.Procdecls where
instance Data.Aeson.FromJSON VSE.As.Procdecls where

deriving instance GHC.Generics.Generic VSE.As.Sigentry
instance Data.Aeson.ToJSON VSE.As.Sigentry where
instance Data.Aeson.FromJSON VSE.As.Sigentry where

deriving instance GHC.Generics.Generic VSE.As.Profile
instance Data.Aeson.ToJSON VSE.As.Profile where
instance Data.Aeson.FromJSON VSE.As.Profile where

deriving instance GHC.Generics.Generic VSE.As.Procparam
instance Data.Aeson.ToJSON VSE.As.Procparam where
instance Data.Aeson.FromJSON VSE.As.Procparam where

deriving instance GHC.Generics.Generic VSE.As.Paramkind
instance Data.Aeson.ToJSON VSE.As.Paramkind where
instance Data.Aeson.FromJSON VSE.As.Paramkind where

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

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

instance ShATermConvertible VSE.As.ProcKind where
  toShATermAux :: ATermTable -> ProcKind -> IO (ATermTable, Int)
toShATermAux att0 :: ATermTable
att0 xv :: ProcKind
xv = case ProcKind
xv of
    Proc -> (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 "Proc" [] []) ATermTable
att0
    Func -> (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 "Func" [] []) ATermTable
att0
  fromShATermAux :: Int -> ATermTable -> (ATermTable, ProcKind)
fromShATermAux ix :: Int
ix att0 :: ATermTable
att0 = case Int -> ATermTable -> ShATerm
getShATerm Int
ix ATermTable
att0 of
    ShAAppl "Proc" [] _ -> (ATermTable
att0, ProcKind
Proc)
    ShAAppl "Func" [] _ -> (ATermTable
att0, ProcKind
Func)
    u :: ShATerm
u -> String -> ShATerm -> (ATermTable, ProcKind)
forall a. String -> ShATerm -> a
fromShATermError "VSE.As.ProcKind" ShATerm
u

instance ShATermConvertible VSE.As.BoxOrDiamond where
  toShATermAux :: ATermTable -> BoxOrDiamond -> IO (ATermTable, Int)
toShATermAux att0 :: ATermTable
att0 xv :: BoxOrDiamond
xv = case BoxOrDiamond
xv of
    Box -> (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 "Box" [] []) ATermTable
att0
    Diamond -> (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 "Diamond" [] []) ATermTable
att0
  fromShATermAux :: Int -> ATermTable -> (ATermTable, BoxOrDiamond)
fromShATermAux ix :: Int
ix att0 :: ATermTable
att0 = case Int -> ATermTable -> ShATerm
getShATerm Int
ix ATermTable
att0 of
    ShAAppl "Box" [] _ -> (ATermTable
att0, BoxOrDiamond
Box)
    ShAAppl "Diamond" [] _ -> (ATermTable
att0, BoxOrDiamond
Diamond)
    u :: ShATerm
u -> String -> ShATerm -> (ATermTable, BoxOrDiamond)
forall a. String -> ShATerm -> a
fromShATermError "VSE.As.BoxOrDiamond" ShATerm
u

instance ShATermConvertible VSE.As.VSEforms where
  toShATermAux :: ATermTable -> VSEforms -> IO (ATermTable, Int)
toShATermAux att0 :: ATermTable
att0 xv :: VSEforms
xv = case VSEforms
xv of
    Dlformula a :: BoxOrDiamond
a b :: Program
b c :: Sentence
c -> do
      (att1 :: ATermTable
att1, a' :: Int
a') <- ATermTable -> BoxOrDiamond -> IO (ATermTable, Int)
forall t.
ShATermConvertible t =>
ATermTable -> t -> IO (ATermTable, Int)
toShATerm' ATermTable
att0 BoxOrDiamond
a
      (att2 :: ATermTable
att2, b' :: Int
b') <- ATermTable -> Program -> IO (ATermTable, Int)
forall t.
ShATermConvertible t =>
ATermTable -> t -> IO (ATermTable, Int)
toShATerm' ATermTable
att1 Program
b
      (att3 :: ATermTable
att3, c' :: Int
c') <- ATermTable -> Sentence -> IO (ATermTable, Int)
forall t.
ShATermConvertible t =>
ATermTable -> t -> IO (ATermTable, Int)
toShATerm' ATermTable
att2 Sentence
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 "Dlformula" [Int
a', Int
b', Int
c'] []) ATermTable
att3
    Defprocs a :: [Defproc]
a -> do
      (att1 :: ATermTable
att1, a' :: Int
a') <- ATermTable -> [Defproc] -> IO (ATermTable, Int)
forall t.
ShATermConvertible t =>
ATermTable -> t -> IO (ATermTable, Int)
toShATerm' ATermTable
att0 [Defproc]
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 "Defprocs" [Int
a'] []) ATermTable
att1
    RestrictedConstraint a :: [Constraint]
a b :: Map Id Id
b c :: Bool
c -> do
      (att1 :: ATermTable
att1, a' :: Int
a') <- ATermTable -> [Constraint] -> IO (ATermTable, Int)
forall t.
ShATermConvertible t =>
ATermTable -> t -> IO (ATermTable, Int)
toShATerm' ATermTable
att0 [Constraint]
a
      (att2 :: ATermTable
att2, b' :: Int
b') <- ATermTable -> Map Id Id -> IO (ATermTable, Int)
forall t.
ShATermConvertible t =>
ATermTable -> t -> IO (ATermTable, Int)
toShATerm' ATermTable
att1 Map Id Id
b
      (att3 :: ATermTable
att3, c' :: Int
c') <- ATermTable -> Bool -> IO (ATermTable, Int)
forall t.
ShATermConvertible t =>
ATermTable -> t -> IO (ATermTable, Int)
toShATerm' ATermTable
att2 Bool
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 "RestrictedConstraint" [Int
a', Int
b',
                                                         Int
c'] []) ATermTable
att3
  fromShATermAux :: Int -> ATermTable -> (ATermTable, VSEforms)
fromShATermAux ix :: Int
ix att0 :: ATermTable
att0 = case Int -> ATermTable -> ShATerm
getShATerm Int
ix ATermTable
att0 of
    ShAAppl "Dlformula" [a :: Int
a, b :: Int
b, c :: Int
c] _ ->
      case Int -> ATermTable -> (ATermTable, BoxOrDiamond)
forall t.
ShATermConvertible t =>
Int -> ATermTable -> (ATermTable, t)
fromShATerm' Int
a ATermTable
att0 of
      { (att1 :: ATermTable
att1, a' :: BoxOrDiamond
a') ->
      case Int -> ATermTable -> (ATermTable, Program)
forall t.
ShATermConvertible t =>
Int -> ATermTable -> (ATermTable, t)
fromShATerm' Int
b ATermTable
att1 of
      { (att2 :: ATermTable
att2, b' :: Program
b') ->
      case Int -> ATermTable -> (ATermTable, Sentence)
forall t.
ShATermConvertible t =>
Int -> ATermTable -> (ATermTable, t)
fromShATerm' Int
c ATermTable
att2 of
      { (att3 :: ATermTable
att3, c' :: Sentence
c') ->
      (ATermTable
att3, BoxOrDiamond -> Program -> Sentence -> VSEforms
Dlformula BoxOrDiamond
a' Program
b' Sentence
c') }}}
    ShAAppl "Defprocs" [a :: Int
a] _ ->
      case Int -> ATermTable -> (ATermTable, [Defproc])
forall t.
ShATermConvertible t =>
Int -> ATermTable -> (ATermTable, t)
fromShATerm' Int
a ATermTable
att0 of
      { (att1 :: ATermTable
att1, a' :: [Defproc]
a') ->
      (ATermTable
att1, [Defproc] -> VSEforms
Defprocs [Defproc]
a') }
    ShAAppl "RestrictedConstraint" [a :: Int
a, b :: Int
b, c :: Int
c] _ ->
      case Int -> ATermTable -> (ATermTable, [Constraint])
forall t.
ShATermConvertible t =>
Int -> ATermTable -> (ATermTable, t)
fromShATerm' Int
a ATermTable
att0 of
      { (att1 :: ATermTable
att1, a' :: [Constraint]
a') ->
      case Int -> ATermTable -> (ATermTable, Map Id Id)
forall t.
ShATermConvertible t =>
Int -> ATermTable -> (ATermTable, t)
fromShATerm' Int
b ATermTable
att1 of
      { (att2 :: ATermTable
att2, b' :: Map Id Id
b') ->
      case Int -> ATermTable -> (ATermTable, Bool)
forall t.
ShATermConvertible t =>
Int -> ATermTable -> (ATermTable, t)
fromShATerm' Int
c ATermTable
att2 of
      { (att3 :: ATermTable
att3, c' :: Bool
c') ->
      (ATermTable
att3, [Constraint] -> Map Id Id -> Bool -> VSEforms
RestrictedConstraint [Constraint]
a' Map Id Id
b' Bool
c') }}}
    u :: ShATerm
u -> String -> ShATerm -> (ATermTable, VSEforms)
forall a. String -> ShATerm -> a
fromShATermError "VSE.As.VSEforms" ShATerm
u

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

instance ShATermConvertible VSE.As.PlainProgram where
  toShATermAux :: ATermTable -> PlainProgram -> IO (ATermTable, Int)
toShATermAux att0 :: ATermTable
att0 xv :: PlainProgram
xv = case PlainProgram
xv of
    Abort -> (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 "Abort" [] []) ATermTable
att0
    Skip -> (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 "Skip" [] []) ATermTable
att0
    Assign a :: VAR
a b :: TERM ()
b -> do
      (att1 :: ATermTable
att1, a' :: Int
a') <- ATermTable -> VAR -> IO (ATermTable, Int)
forall t.
ShATermConvertible t =>
ATermTable -> t -> IO (ATermTable, Int)
toShATerm' ATermTable
att0 VAR
a
      (att2 :: ATermTable
att2, b' :: Int
b') <- ATermTable -> TERM () -> IO (ATermTable, Int)
forall t.
ShATermConvertible t =>
ATermTable -> t -> IO (ATermTable, Int)
toShATerm' ATermTable
att1 TERM ()
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 "Assign" [Int
a', Int
b'] []) ATermTable
att2
    Call a :: FORMULA ()
a -> do
      (att1 :: ATermTable
att1, a' :: Int
a') <- ATermTable -> FORMULA () -> IO (ATermTable, Int)
forall t.
ShATermConvertible t =>
ATermTable -> t -> IO (ATermTable, Int)
toShATerm' ATermTable
att0 FORMULA ()
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 "Call" [Int
a'] []) ATermTable
att1
    Return a :: TERM ()
a -> do
      (att1 :: ATermTable
att1, a' :: Int
a') <- ATermTable -> TERM () -> IO (ATermTable, Int)
forall t.
ShATermConvertible t =>
ATermTable -> t -> IO (ATermTable, Int)
toShATerm' ATermTable
att0 TERM ()
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 "Return" [Int
a'] []) ATermTable
att1
    Block a :: [VAR_DECL]
a b :: Program
b -> do
      (att1 :: ATermTable
att1, a' :: Int
a') <- ATermTable -> [VAR_DECL] -> IO (ATermTable, Int)
forall t.
ShATermConvertible t =>
ATermTable -> t -> IO (ATermTable, Int)
toShATerm' ATermTable
att0 [VAR_DECL]
a
      (att2 :: ATermTable
att2, b' :: Int
b') <- ATermTable -> Program -> IO (ATermTable, Int)
forall t.
ShATermConvertible t =>
ATermTable -> t -> IO (ATermTable, Int)
toShATerm' ATermTable
att1 Program
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 "Block" [Int
a', Int
b'] []) ATermTable
att2
    Seq a :: Program
a b :: Program
b -> do
      (att1 :: ATermTable
att1, a' :: Int
a') <- ATermTable -> Program -> IO (ATermTable, Int)
forall t.
ShATermConvertible t =>
ATermTable -> t -> IO (ATermTable, Int)
toShATerm' ATermTable
att0 Program
a
      (att2 :: ATermTable
att2, b' :: Int
b') <- ATermTable -> Program -> IO (ATermTable, Int)
forall t.
ShATermConvertible t =>
ATermTable -> t -> IO (ATermTable, Int)
toShATerm' ATermTable
att1 Program
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 "Seq" [Int
a', Int
b'] []) ATermTable
att2
    If a :: FORMULA ()
a b :: Program
b c :: Program
c -> do
      (att1 :: ATermTable
att1, a' :: Int
a') <- ATermTable -> FORMULA () -> IO (ATermTable, Int)
forall t.
ShATermConvertible t =>
ATermTable -> t -> IO (ATermTable, Int)
toShATerm' ATermTable
att0 FORMULA ()
a
      (att2 :: ATermTable
att2, b' :: Int
b') <- ATermTable -> Program -> IO (ATermTable, Int)
forall t.
ShATermConvertible t =>
ATermTable -> t -> IO (ATermTable, Int)
toShATerm' ATermTable
att1 Program
b
      (att3 :: ATermTable
att3, c' :: Int
c') <- ATermTable -> Program -> IO (ATermTable, Int)
forall t.
ShATermConvertible t =>
ATermTable -> t -> IO (ATermTable, Int)
toShATerm' ATermTable
att2 Program
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 "If" [Int
a', Int
b', Int
c'] []) ATermTable
att3
    While a :: FORMULA ()
a b :: Program
b -> do
      (att1 :: ATermTable
att1, a' :: Int
a') <- ATermTable -> FORMULA () -> IO (ATermTable, Int)
forall t.
ShATermConvertible t =>
ATermTable -> t -> IO (ATermTable, Int)
toShATerm' ATermTable
att0 FORMULA ()
a
      (att2 :: ATermTable
att2, b' :: Int
b') <- ATermTable -> Program -> IO (ATermTable, Int)
forall t.
ShATermConvertible t =>
ATermTable -> t -> IO (ATermTable, Int)
toShATerm' ATermTable
att1 Program
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 "While" [Int
a', Int
b'] []) ATermTable
att2
  fromShATermAux :: Int -> ATermTable -> (ATermTable, PlainProgram)
fromShATermAux ix :: Int
ix att0 :: ATermTable
att0 = case Int -> ATermTable -> ShATerm
getShATerm Int
ix ATermTable
att0 of
    ShAAppl "Abort" [] _ -> (ATermTable
att0, PlainProgram
Abort)
    ShAAppl "Skip" [] _ -> (ATermTable
att0, PlainProgram
Skip)
    ShAAppl "Assign" [a :: Int
a, b :: Int
b] _ ->
      case Int -> ATermTable -> (ATermTable, VAR)
forall t.
ShATermConvertible t =>
Int -> ATermTable -> (ATermTable, t)
fromShATerm' Int
a ATermTable
att0 of
      { (att1 :: ATermTable
att1, a' :: VAR
a') ->
      case Int -> ATermTable -> (ATermTable, TERM ())
forall t.
ShATermConvertible t =>
Int -> ATermTable -> (ATermTable, t)
fromShATerm' Int
b ATermTable
att1 of
      { (att2 :: ATermTable
att2, b' :: TERM ()
b') ->
      (ATermTable
att2, VAR -> TERM () -> PlainProgram
Assign VAR
a' TERM ()
b') }}
    ShAAppl "Call" [a :: Int
a] _ ->
      case Int -> ATermTable -> (ATermTable, FORMULA ())
forall t.
ShATermConvertible t =>
Int -> ATermTable -> (ATermTable, t)
fromShATerm' Int
a ATermTable
att0 of
      { (att1 :: ATermTable
att1, a' :: FORMULA ()
a') ->
      (ATermTable
att1, FORMULA () -> PlainProgram
Call FORMULA ()
a') }
    ShAAppl "Return" [a :: Int
a] _ ->
      case Int -> ATermTable -> (ATermTable, TERM ())
forall t.
ShATermConvertible t =>
Int -> ATermTable -> (ATermTable, t)
fromShATerm' Int
a ATermTable
att0 of
      { (att1 :: ATermTable
att1, a' :: TERM ()
a') ->
      (ATermTable
att1, TERM () -> PlainProgram
Return TERM ()
a') }
    ShAAppl "Block" [a :: Int
a, b :: Int
b] _ ->
      case Int -> ATermTable -> (ATermTable, [VAR_DECL])
forall t.
ShATermConvertible t =>
Int -> ATermTable -> (ATermTable, t)
fromShATerm' Int
a ATermTable
att0 of
      { (att1 :: ATermTable
att1, a' :: [VAR_DECL]
a') ->
      case Int -> ATermTable -> (ATermTable, Program)
forall t.
ShATermConvertible t =>
Int -> ATermTable -> (ATermTable, t)
fromShATerm' Int
b ATermTable
att1 of
      { (att2 :: ATermTable
att2, b' :: Program
b') ->
      (ATermTable
att2, [VAR_DECL] -> Program -> PlainProgram
Block [VAR_DECL]
a' Program
b') }}
    ShAAppl "Seq" [a :: Int
a, b :: Int
b] _ ->
      case Int -> ATermTable -> (ATermTable, Program)
forall t.
ShATermConvertible t =>
Int -> ATermTable -> (ATermTable, t)
fromShATerm' Int
a ATermTable
att0 of
      { (att1 :: ATermTable
att1, a' :: Program
a') ->
      case Int -> ATermTable -> (ATermTable, Program)
forall t.
ShATermConvertible t =>
Int -> ATermTable -> (ATermTable, t)
fromShATerm' Int
b ATermTable
att1 of
      { (att2 :: ATermTable
att2, b' :: Program
b') ->
      (ATermTable
att2, Program -> Program -> PlainProgram
Seq Program
a' Program
b') }}
    ShAAppl "If" [a :: Int
a, b :: Int
b, c :: Int
c] _ ->
      case Int -> ATermTable -> (ATermTable, FORMULA ())
forall t.
ShATermConvertible t =>
Int -> ATermTable -> (ATermTable, t)
fromShATerm' Int
a ATermTable
att0 of
      { (att1 :: ATermTable
att1, a' :: FORMULA ()
a') ->
      case Int -> ATermTable -> (ATermTable, Program)
forall t.
ShATermConvertible t =>
Int -> ATermTable -> (ATermTable, t)
fromShATerm' Int
b ATermTable
att1 of
      { (att2 :: ATermTable
att2, b' :: Program
b') ->
      case Int -> ATermTable -> (ATermTable, Program)
forall t.
ShATermConvertible t =>
Int -> ATermTable -> (ATermTable, t)
fromShATerm' Int
c ATermTable
att2 of
      { (att3 :: ATermTable
att3, c' :: Program
c') ->
      (ATermTable
att3, FORMULA () -> Program -> Program -> PlainProgram
If FORMULA ()
a' Program
b' Program
c') }}}
    ShAAppl "While" [a :: Int
a, b :: Int
b] _ ->
      case Int -> ATermTable -> (ATermTable, FORMULA ())
forall t.
ShATermConvertible t =>
Int -> ATermTable -> (ATermTable, t)
fromShATerm' Int
a ATermTable
att0 of
      { (att1 :: ATermTable
att1, a' :: FORMULA ()
a') ->
      case Int -> ATermTable -> (ATermTable, Program)
forall t.
ShATermConvertible t =>
Int -> ATermTable -> (ATermTable, t)
fromShATerm' Int
b ATermTable
att1 of
      { (att2 :: ATermTable
att2, b' :: Program
b') ->
      (ATermTable
att2, FORMULA () -> Program -> PlainProgram
While FORMULA ()
a' Program
b') }}
    u :: ShATerm
u -> String -> ShATerm -> (ATermTable, PlainProgram)
forall a. String -> ShATerm -> a
fromShATermError "VSE.As.PlainProgram" ShATerm
u

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

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

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

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

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

instance ShATermConvertible VSE.As.Paramkind where
  toShATermAux :: ATermTable -> Paramkind -> IO (ATermTable, Int)
toShATermAux att0 :: ATermTable
att0 xv :: Paramkind
xv = case Paramkind
xv of
    In -> (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 "In" [] []) ATermTable
att0
    Out -> (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 "Out" [] []) ATermTable
att0
  fromShATermAux :: Int -> ATermTable -> (ATermTable, Paramkind)
fromShATermAux ix :: Int
ix att0 :: ATermTable
att0 = case Int -> ATermTable -> ShATerm
getShATerm Int
ix ATermTable
att0 of
    ShAAppl "In" [] _ -> (ATermTable
att0, Paramkind
In)
    ShAAppl "Out" [] _ -> (ATermTable
att0, Paramkind
Out)
    u :: ShATerm
u -> String -> ShATerm -> (ATermTable, Paramkind)
forall a. String -> ShATerm -> a
fromShATermError "VSE.As.Paramkind" ShATerm
u