{-# OPTIONS -w -O0 #-}
{-# LANGUAGE CPP, StandaloneDeriving, DeriveDataTypeable, DeriveGeneric #-}
{- |
Module      :  Modal/ATC_Modal.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):
'Modal.AS_Modal.M_BASIC_ITEM'
'Modal.AS_Modal.RIGOR'
'Modal.AS_Modal.M_SIG_ITEM'
'Modal.AS_Modal.MODALITY'
'Modal.AS_Modal.M_FORMULA'
'Modal.ModalSign.ModalSign'
-}

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

module Modal.ATC_Modal () where

import ATerm.Lib
import CASL.AS_Basic_CASL
import CASL.ATC_CASL
import CASL.Sign
import Common.AS_Annotation
import Common.Id
import Common.Json.Instances
import Data.Aeson(ToJSON, FromJSON)
import Data.Data
import GHC.Generics(Generic)
import Modal.AS_Modal
import Modal.ModalSign
import qualified Common.Lib.MapSet as MapSet
import qualified Data.List as List
import qualified Data.Map as Map

{-! for Modal.AS_Modal.M_BASIC_ITEM derive : ShATermConvertible !-}
{-! for Modal.AS_Modal.RIGOR derive : ShATermConvertible !-}
{-! for Modal.AS_Modal.M_SIG_ITEM derive : ShATermConvertible !-}
{-! for Modal.AS_Modal.MODALITY derive : ShATermConvertible !-}
{-! for Modal.AS_Modal.M_FORMULA derive : ShATermConvertible !-}
{-! for Modal.ModalSign.ModalSign derive : ShATermConvertible !-}

{-! for Modal.AS_Modal.M_BASIC_ITEM derive : Json !-}
{-! for Modal.AS_Modal.RIGOR derive : Json !-}
{-! for Modal.AS_Modal.M_SIG_ITEM derive : Json !-}
{-! for Modal.AS_Modal.MODALITY derive : Json !-}
{-! for Modal.AS_Modal.M_FORMULA derive : Json !-}
{-! for Modal.ModalSign.ModalSign derive : Json !-}

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

instance ShATermConvertible Modal.AS_Modal.M_BASIC_ITEM where
  toShATermAux :: ATermTable -> M_BASIC_ITEM -> IO (ATermTable, Int)
toShATermAux att0 :: ATermTable
att0 xv :: M_BASIC_ITEM
xv = case M_BASIC_ITEM
xv of
    Simple_mod_decl a :: [Annoted SIMPLE_ID]
a b :: [AnModFORM]
b c :: Range
c -> do
      (att1 :: ATermTable
att1, a' :: Int
a') <- ATermTable -> [Annoted SIMPLE_ID] -> IO (ATermTable, Int)
forall t.
ShATermConvertible t =>
ATermTable -> t -> IO (ATermTable, Int)
toShATerm' ATermTable
att0 [Annoted SIMPLE_ID]
a
      (att2 :: ATermTable
att2, b' :: Int
b') <- ATermTable -> [AnModFORM] -> IO (ATermTable, Int)
forall t.
ShATermConvertible t =>
ATermTable -> t -> IO (ATermTable, Int)
toShATerm' ATermTable
att1 [AnModFORM]
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 "Simple_mod_decl" [Int
a', Int
b', Int
c'] []) ATermTable
att3
    Term_mod_decl a :: [Annoted SORT]
a b :: [AnModFORM]
b c :: Range
c -> do
      (att1 :: ATermTable
att1, a' :: Int
a') <- ATermTable -> [Annoted SORT] -> IO (ATermTable, Int)
forall t.
ShATermConvertible t =>
ATermTable -> t -> IO (ATermTable, Int)
toShATerm' ATermTable
att0 [Annoted SORT]
a
      (att2 :: ATermTable
att2, b' :: Int
b') <- ATermTable -> [AnModFORM] -> IO (ATermTable, Int)
forall t.
ShATermConvertible t =>
ATermTable -> t -> IO (ATermTable, Int)
toShATerm' ATermTable
att1 [AnModFORM]
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 "Term_mod_decl" [Int
a', Int
b', Int
c'] []) ATermTable
att3
  fromShATermAux :: Int -> ATermTable -> (ATermTable, M_BASIC_ITEM)
fromShATermAux ix :: Int
ix att0 :: ATermTable
att0 = case Int -> ATermTable -> ShATerm
getShATerm Int
ix ATermTable
att0 of
    ShAAppl "Simple_mod_decl" [a :: Int
a, b :: Int
b, c :: Int
c] _ ->
      case Int -> ATermTable -> (ATermTable, [Annoted SIMPLE_ID])
forall t.
ShATermConvertible t =>
Int -> ATermTable -> (ATermTable, t)
fromShATerm' Int
a ATermTable
att0 of
      { (att1 :: ATermTable
att1, a' :: [Annoted SIMPLE_ID]
a') ->
      case Int -> ATermTable -> (ATermTable, [AnModFORM])
forall t.
ShATermConvertible t =>
Int -> ATermTable -> (ATermTable, t)
fromShATerm' Int
b ATermTable
att1 of
      { (att2 :: ATermTable
att2, b' :: [AnModFORM]
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, [Annoted SIMPLE_ID] -> [AnModFORM] -> Range -> M_BASIC_ITEM
Simple_mod_decl [Annoted SIMPLE_ID]
a' [AnModFORM]
b' Range
c') }}}
    ShAAppl "Term_mod_decl" [a :: Int
a, b :: Int
b, c :: Int
c] _ ->
      case Int -> ATermTable -> (ATermTable, [Annoted SORT])
forall t.
ShATermConvertible t =>
Int -> ATermTable -> (ATermTable, t)
fromShATerm' Int
a ATermTable
att0 of
      { (att1 :: ATermTable
att1, a' :: [Annoted SORT]
a') ->
      case Int -> ATermTable -> (ATermTable, [AnModFORM])
forall t.
ShATermConvertible t =>
Int -> ATermTable -> (ATermTable, t)
fromShATerm' Int
b ATermTable
att1 of
      { (att2 :: ATermTable
att2, b' :: [AnModFORM]
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, [Annoted SORT] -> [AnModFORM] -> Range -> M_BASIC_ITEM
Term_mod_decl [Annoted SORT]
a' [AnModFORM]
b' Range
c') }}}
    u :: ShATerm
u -> String -> ShATerm -> (ATermTable, M_BASIC_ITEM)
forall a. String -> ShATerm -> a
fromShATermError "Modal.AS_Modal.M_BASIC_ITEM" ShATerm
u

instance ShATermConvertible Modal.AS_Modal.RIGOR where
  toShATermAux :: ATermTable -> RIGOR -> IO (ATermTable, Int)
toShATermAux att0 :: ATermTable
att0 xv :: RIGOR
xv = case RIGOR
xv of
    Rigid -> (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 "Rigid" [] []) ATermTable
att0
    Flexible -> (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 "Flexible" [] []) ATermTable
att0
  fromShATermAux :: Int -> ATermTable -> (ATermTable, RIGOR)
fromShATermAux ix :: Int
ix att0 :: ATermTable
att0 = case Int -> ATermTable -> ShATerm
getShATerm Int
ix ATermTable
att0 of
    ShAAppl "Rigid" [] _ -> (ATermTable
att0, RIGOR
Rigid)
    ShAAppl "Flexible" [] _ -> (ATermTable
att0, RIGOR
Flexible)
    u :: ShATerm
u -> String -> ShATerm -> (ATermTable, RIGOR)
forall a. String -> ShATerm -> a
fromShATermError "Modal.AS_Modal.RIGOR" ShATerm
u

instance ShATermConvertible Modal.AS_Modal.M_SIG_ITEM where
  toShATermAux :: ATermTable -> M_SIG_ITEM -> IO (ATermTable, Int)
toShATermAux att0 :: ATermTable
att0 xv :: M_SIG_ITEM
xv = case M_SIG_ITEM
xv of
    Rigid_op_items a :: RIGOR
a b :: [Annoted (OP_ITEM M_FORMULA)]
b c :: Range
c -> do
      (att1 :: ATermTable
att1, a' :: Int
a') <- ATermTable -> RIGOR -> IO (ATermTable, Int)
forall t.
ShATermConvertible t =>
ATermTable -> t -> IO (ATermTable, Int)
toShATerm' ATermTable
att0 RIGOR
a
      (att2 :: ATermTable
att2, b' :: Int
b') <- ATermTable -> [Annoted (OP_ITEM M_FORMULA)] -> IO (ATermTable, Int)
forall t.
ShATermConvertible t =>
ATermTable -> t -> IO (ATermTable, Int)
toShATerm' ATermTable
att1 [Annoted (OP_ITEM M_FORMULA)]
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 "Rigid_op_items" [Int
a', Int
b', Int
c'] []) ATermTable
att3
    Rigid_pred_items a :: RIGOR
a b :: [Annoted (PRED_ITEM M_FORMULA)]
b c :: Range
c -> do
      (att1 :: ATermTable
att1, a' :: Int
a') <- ATermTable -> RIGOR -> IO (ATermTable, Int)
forall t.
ShATermConvertible t =>
ATermTable -> t -> IO (ATermTable, Int)
toShATerm' ATermTable
att0 RIGOR
a
      (att2 :: ATermTable
att2, b' :: Int
b') <- ATermTable
-> [Annoted (PRED_ITEM M_FORMULA)] -> IO (ATermTable, Int)
forall t.
ShATermConvertible t =>
ATermTable -> t -> IO (ATermTable, Int)
toShATerm' ATermTable
att1 [Annoted (PRED_ITEM M_FORMULA)]
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 "Rigid_pred_items" [Int
a', Int
b', Int
c'] []) ATermTable
att3
  fromShATermAux :: Int -> ATermTable -> (ATermTable, M_SIG_ITEM)
fromShATermAux ix :: Int
ix att0 :: ATermTable
att0 = case Int -> ATermTable -> ShATerm
getShATerm Int
ix ATermTable
att0 of
    ShAAppl "Rigid_op_items" [a :: Int
a, b :: Int
b, c :: Int
c] _ ->
      case Int -> ATermTable -> (ATermTable, RIGOR)
forall t.
ShATermConvertible t =>
Int -> ATermTable -> (ATermTable, t)
fromShATerm' Int
a ATermTable
att0 of
      { (att1 :: ATermTable
att1, a' :: RIGOR
a') ->
      case Int -> ATermTable -> (ATermTable, [Annoted (OP_ITEM M_FORMULA)])
forall t.
ShATermConvertible t =>
Int -> ATermTable -> (ATermTable, t)
fromShATerm' Int
b ATermTable
att1 of
      { (att2 :: ATermTable
att2, b' :: [Annoted (OP_ITEM M_FORMULA)]
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, RIGOR -> [Annoted (OP_ITEM M_FORMULA)] -> Range -> M_SIG_ITEM
Rigid_op_items RIGOR
a' [Annoted (OP_ITEM M_FORMULA)]
b' Range
c') }}}
    ShAAppl "Rigid_pred_items" [a :: Int
a, b :: Int
b, c :: Int
c] _ ->
      case Int -> ATermTable -> (ATermTable, RIGOR)
forall t.
ShATermConvertible t =>
Int -> ATermTable -> (ATermTable, t)
fromShATerm' Int
a ATermTable
att0 of
      { (att1 :: ATermTable
att1, a' :: RIGOR
a') ->
      case Int -> ATermTable -> (ATermTable, [Annoted (PRED_ITEM M_FORMULA)])
forall t.
ShATermConvertible t =>
Int -> ATermTable -> (ATermTable, t)
fromShATerm' Int
b ATermTable
att1 of
      { (att2 :: ATermTable
att2, b' :: [Annoted (PRED_ITEM M_FORMULA)]
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, RIGOR -> [Annoted (PRED_ITEM M_FORMULA)] -> Range -> M_SIG_ITEM
Rigid_pred_items RIGOR
a' [Annoted (PRED_ITEM M_FORMULA)]
b' Range
c') }}}
    u :: ShATerm
u -> String -> ShATerm -> (ATermTable, M_SIG_ITEM)
forall a. String -> ShATerm -> a
fromShATermError "Modal.AS_Modal.M_SIG_ITEM" ShATerm
u

instance ShATermConvertible Modal.AS_Modal.MODALITY where
  toShATermAux :: ATermTable -> MODALITY -> IO (ATermTable, Int)
toShATermAux att0 :: ATermTable
att0 xv :: MODALITY
xv = case MODALITY
xv of
    Simple_mod a :: SIMPLE_ID
a -> do
      (att1 :: ATermTable
att1, a' :: Int
a') <- ATermTable -> SIMPLE_ID -> IO (ATermTable, Int)
forall t.
ShATermConvertible t =>
ATermTable -> t -> IO (ATermTable, Int)
toShATerm' ATermTable
att0 SIMPLE_ID
a
      (ATermTable, Int) -> IO (ATermTable, Int)
forall (m :: * -> *) a. Monad m => a -> m a
return ((ATermTable, Int) -> IO (ATermTable, Int))
-> (ATermTable, Int) -> IO (ATermTable, Int)
forall a b. (a -> b) -> a -> b
$ ShATerm -> ATermTable -> (ATermTable, Int)
addATerm (String -> [Int] -> [Int] -> ShATerm
ShAAppl "Simple_mod" [Int
a'] []) ATermTable
att1
    Term_mod a :: TERM M_FORMULA
a -> do
      (att1 :: ATermTable
att1, a' :: Int
a') <- ATermTable -> TERM M_FORMULA -> IO (ATermTable, Int)
forall t.
ShATermConvertible t =>
ATermTable -> t -> IO (ATermTable, Int)
toShATerm' ATermTable
att0 TERM M_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 "Term_mod" [Int
a'] []) ATermTable
att1
  fromShATermAux :: Int -> ATermTable -> (ATermTable, MODALITY)
fromShATermAux ix :: Int
ix att0 :: ATermTable
att0 = case Int -> ATermTable -> ShATerm
getShATerm Int
ix ATermTable
att0 of
    ShAAppl "Simple_mod" [a :: Int
a] _ ->
      case Int -> ATermTable -> (ATermTable, SIMPLE_ID)
forall t.
ShATermConvertible t =>
Int -> ATermTable -> (ATermTable, t)
fromShATerm' Int
a ATermTable
att0 of
      { (att1 :: ATermTable
att1, a' :: SIMPLE_ID
a') ->
      (ATermTable
att1, SIMPLE_ID -> MODALITY
Simple_mod SIMPLE_ID
a') }
    ShAAppl "Term_mod" [a :: Int
a] _ ->
      case Int -> ATermTable -> (ATermTable, TERM M_FORMULA)
forall t.
ShATermConvertible t =>
Int -> ATermTable -> (ATermTable, t)
fromShATerm' Int
a ATermTable
att0 of
      { (att1 :: ATermTable
att1, a' :: TERM M_FORMULA
a') ->
      (ATermTable
att1, TERM M_FORMULA -> MODALITY
Term_mod TERM M_FORMULA
a') }
    u :: ShATerm
u -> String -> ShATerm -> (ATermTable, MODALITY)
forall a. String -> ShATerm -> a
fromShATermError "Modal.AS_Modal.MODALITY" ShATerm
u

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

deriving instance GHC.Generics.Generic Modal.AS_Modal.M_BASIC_ITEM
instance Data.Aeson.ToJSON Modal.AS_Modal.M_BASIC_ITEM where
instance Data.Aeson.FromJSON Modal.AS_Modal.M_BASIC_ITEM where

deriving instance GHC.Generics.Generic Modal.AS_Modal.RIGOR
instance Data.Aeson.ToJSON Modal.AS_Modal.RIGOR where
instance Data.Aeson.FromJSON Modal.AS_Modal.RIGOR where

deriving instance GHC.Generics.Generic Modal.AS_Modal.M_SIG_ITEM
instance Data.Aeson.ToJSON Modal.AS_Modal.M_SIG_ITEM where
instance Data.Aeson.FromJSON Modal.AS_Modal.M_SIG_ITEM where

deriving instance GHC.Generics.Generic Modal.AS_Modal.MODALITY
instance Data.Aeson.ToJSON Modal.AS_Modal.MODALITY where
instance Data.Aeson.FromJSON Modal.AS_Modal.MODALITY where

deriving instance GHC.Generics.Generic Modal.AS_Modal.M_FORMULA
instance Data.Aeson.ToJSON Modal.AS_Modal.M_FORMULA where
instance Data.Aeson.FromJSON Modal.AS_Modal.M_FORMULA where

deriving instance GHC.Generics.Generic Modal.ModalSign.ModalSign
instance Data.Aeson.ToJSON Modal.ModalSign.ModalSign where
instance Data.Aeson.FromJSON Modal.ModalSign.ModalSign where

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