module CspCASLProver.Consts
( alphabetS
, alphabetType
, binEq_PreAlphabet
, classOp
, classS
, convertChannelString
, convertFQProcessName2String
, convertSort2String
, cspFThyS
, eq_PreAlphabetS
, eq_PreAlphabetV
, equivTypeClassS
, eventS
, eventType
, flatS
, flatOp
, preAlphabetQuotType
, preAlphabetS
, preAlphabetSimS
, preAlphabetType
, projFlatS
, projFlatOp
, lemmasCCProverDecompositionThmsS
, lemmasCCProverInjectivityThmsS
, lemmasEmbInjAxS
, lemmasIdentityAxS
, lemmasNotDefBotAxS
, lemmasTotalityAxS
, lemmasTransAxS
, mkChooseFunName
, mkChooseFunOp
, mkCompareWithFunName
, mkPreAlphabetConstructor
, mkPreAlphabetConstructorOp
, mkProcNameConstructor
, mkSortBarAbsString
, mkSortBarAbsOp
, mkSortBarRepOp
, mkSortBarString
, mkSortBarType
, mkSortFlatString
, mkThyNameAlphabet
, mkThyNameDataEnc
, mkThyNameIntThms
, mkThyNamePreAlphabet
, procMapS
, procMapType
, procNameType
, quotEqualityS
, quotientThyS
, reflexivityTheoremS
, symmetryTheoremS
, transitivityS
) where
import CASL.AS_Basic_CASL (SORT)
import CspCASL.AS_CspCASL_Process (CHANNEL_NAME, FQ_PROCESS_NAME (..))
import Isabelle.IsaConsts (binVNameAppl, conDouble, mkFunType, termAppl)
import Isabelle.IsaSign (BaseSig (..), Term, Typ (..), VName (..))
import Isabelle.Translate (showIsaTypeT, transString)
alphabetS :: String
alphabetS :: String
alphabetS = "Alphabet"
alphabetType :: Typ
alphabetType :: Typ
alphabetType = Type :: String -> Sort -> [Typ] -> Typ
Type {typeId :: String
typeId = String
alphabetS,
typeSort :: Sort
typeSort = [],
typeArgs :: [Typ]
typeArgs = []}
barExtS :: String
barExtS :: String
barExtS = "_Bar"
binEq_PreAlphabet :: Term -> Term -> Term
binEq_PreAlphabet :: Term -> Term -> Term
binEq_PreAlphabet = VName -> Term -> Term -> Term
binVNameAppl VName
eq_PreAlphabetV
cCProverProcType :: Typ
cCProverProcType :: Typ
cCProverProcType = Type :: String -> Sort -> [Typ] -> Typ
Type {typeId :: String
typeId = String
procS,
typeSort :: Sort
typeSort = [],
typeArgs :: [Typ]
typeArgs = [Typ
procNameType, Typ
eventType]}
classOp :: Term -> Term
classOp :: Term -> Term
classOp = Term -> Term -> Term
termAppl (String -> Term
conDouble String
classS)
classS :: String
classS :: String
classS = "class"
convertChannelString :: CHANNEL_NAME -> String
convertChannelString :: CHANNEL_NAME -> String
convertChannelString = CHANNEL_NAME -> String
forall a. Show a => a -> String
show
convertSort2String :: SORT -> String
convertSort2String :: CHANNEL_NAME -> String
convertSort2String s :: CHANNEL_NAME
s = String -> String
transString (String -> String) -> String -> String
forall a b. (a -> b) -> a -> b
$ CHANNEL_NAME -> BaseSig -> String
showIsaTypeT CHANNEL_NAME
s BaseSig
Main_thy
convertFQProcessName2String :: FQ_PROCESS_NAME -> String
convertFQProcessName2String :: FQ_PROCESS_NAME -> String
convertFQProcessName2String fqPn :: FQ_PROCESS_NAME
fqPn =
case FQ_PROCESS_NAME
fqPn of
PROCESS_NAME _ ->
String -> String
forall a. HasCallStack => String -> a
error "CspCASLProver.Consts.convertFQProcessName2String:\
\ Tried to convert non fully qualified process name to string."
FQ_PROCESS_NAME pn :: CHANNEL_NAME
pn _ -> CHANNEL_NAME -> String
forall a. Show a => a -> String
show CHANNEL_NAME
pn
cspFThyS :: String
cspFThyS :: String
cspFThyS = "CSP_F"
eq_PreAlphabetS :: String
eq_PreAlphabetS :: String
eq_PreAlphabetS = "eq_PreAlphabet"
eq_PreAlphabetV :: VName
eq_PreAlphabetV :: VName
eq_PreAlphabetV = String -> Maybe AltSyntax -> VName
VName String
eq_PreAlphabetS Maybe AltSyntax
forall a. Maybe a
Nothing
equivTypeClassS :: String
equivTypeClassS :: String
equivTypeClassS = "equiv"
eventS :: String
eventS :: String
eventS = "Event"
eventType :: Typ
eventType :: Typ
eventType = Type :: String -> Sort -> [Typ] -> Typ
Type {typeId :: String
typeId = String
eventS,
typeSort :: Sort
typeSort = [],
typeArgs :: [Typ]
typeArgs = []}
flatS :: String
flatS :: String
flatS = "Flat"
flatOp :: Term -> Term
flatOp :: Term -> Term
flatOp = Term -> Term -> Term
termAppl (String -> Term
conDouble String
flatS)
lemmasCCProverDecompositionThmsS :: String
lemmasCCProverDecompositionThmsS :: String
lemmasCCProverDecompositionThmsS = "ccproverDecompositionAxs"
lemmasCCProverInjectivityThmsS :: String
lemmasCCProverInjectivityThmsS :: String
lemmasCCProverInjectivityThmsS = "ccproverInjectivityThms"
lemmasEmbInjAxS :: String
lemmasEmbInjAxS :: String
lemmasEmbInjAxS = "allGaEmbInjAx"
lemmasIdentityAxS :: String
lemmasIdentityAxS :: String
lemmasIdentityAxS = "allGaIdentityAx"
lemmasNotDefBotAxS :: String
lemmasNotDefBotAxS :: String
lemmasNotDefBotAxS = "allGaNotDefBotAx"
lemmasTotalityAxS :: String
lemmasTotalityAxS :: String
lemmasTotalityAxS = "allGaTotAx"
lemmasTransAxS :: String
lemmasTransAxS :: String
lemmasTransAxS = "allGaTransAx"
mkChooseFunName :: SORT -> String
mkChooseFunName :: CHANNEL_NAME -> String
mkChooseFunName sort :: CHANNEL_NAME
sort = "choose_" String -> String -> String
forall a. [a] -> [a] -> [a]
++ CHANNEL_NAME -> String
mkPreAlphabetConstructor CHANNEL_NAME
sort
mkChooseFunOp :: SORT -> Term -> Term
mkChooseFunOp :: CHANNEL_NAME -> Term -> Term
mkChooseFunOp s :: CHANNEL_NAME
s = Term -> Term -> Term
termAppl (String -> Term
conDouble (CHANNEL_NAME -> String
mkChooseFunName CHANNEL_NAME
s))
mkCompareWithFunName :: SORT -> String
mkCompareWithFunName :: CHANNEL_NAME -> String
mkCompareWithFunName sort :: CHANNEL_NAME
sort = "compare_with_" String -> String -> String
forall a. [a] -> [a] -> [a]
++ CHANNEL_NAME -> String
mkPreAlphabetConstructor CHANNEL_NAME
sort
mkPreAlphabetConstructor :: SORT -> String
mkPreAlphabetConstructor :: CHANNEL_NAME -> String
mkPreAlphabetConstructor sort :: CHANNEL_NAME
sort = "C_" String -> String -> String
forall a. [a] -> [a] -> [a]
++ CHANNEL_NAME -> String
convertSort2String CHANNEL_NAME
sort
mkPreAlphabetConstructorOp :: SORT -> Term -> Term
mkPreAlphabetConstructorOp :: CHANNEL_NAME -> Term -> Term
mkPreAlphabetConstructorOp s :: CHANNEL_NAME
s = Term -> Term -> Term
termAppl (String -> Term
conDouble (CHANNEL_NAME -> String
mkPreAlphabetConstructor CHANNEL_NAME
s))
mkProcNameConstructor :: FQ_PROCESS_NAME -> String
mkProcNameConstructor :: FQ_PROCESS_NAME -> String
mkProcNameConstructor fqPn :: FQ_PROCESS_NAME
fqPn = case FQ_PROCESS_NAME
fqPn of
PROCESS_NAME _ ->
String -> String
forall a. HasCallStack => String -> a
error "CspCASLProver.Consts.mkProcNameConstructor:\
\ Tried to make a non fully qualified process name as a\
\ constructor (string)."
FQ_PROCESS_NAME pn :: CHANNEL_NAME
pn _ -> CHANNEL_NAME -> String
forall a. Show a => a -> String
show CHANNEL_NAME
pn
mkSortBarString :: SORT -> String
mkSortBarString :: CHANNEL_NAME -> String
mkSortBarString s :: CHANNEL_NAME
s = CHANNEL_NAME -> String
convertSort2String CHANNEL_NAME
s String -> String -> String
forall a. [a] -> [a] -> [a]
++ String
barExtS
mkSortBarType :: SORT -> Typ
mkSortBarType :: CHANNEL_NAME -> Typ
mkSortBarType sort :: CHANNEL_NAME
sort = Type :: String -> Sort -> [Typ] -> Typ
Type {typeId :: String
typeId = CHANNEL_NAME -> String
mkSortBarString CHANNEL_NAME
sort,
typeSort :: Sort
typeSort = [],
typeArgs :: [Typ]
typeArgs = []}
mkSortBarAbsString :: SORT -> String
mkSortBarAbsString :: CHANNEL_NAME -> String
mkSortBarAbsString s :: CHANNEL_NAME
s = "Abs_" String -> String -> String
forall a. [a] -> [a] -> [a]
++ CHANNEL_NAME -> String
convertSort2String CHANNEL_NAME
s String -> String -> String
forall a. [a] -> [a] -> [a]
++ String
barExtS
mkSortBarAbsOp :: SORT -> Term -> Term
mkSortBarAbsOp :: CHANNEL_NAME -> Term -> Term
mkSortBarAbsOp s :: CHANNEL_NAME
s = Term -> Term -> Term
termAppl (String -> Term
conDouble (CHANNEL_NAME -> String
mkSortBarAbsString CHANNEL_NAME
s))
mkSortBarRepString :: SORT -> String
mkSortBarRepString :: CHANNEL_NAME -> String
mkSortBarRepString s :: CHANNEL_NAME
s = "Rep_" String -> String -> String
forall a. [a] -> [a] -> [a]
++ CHANNEL_NAME -> String
convertSort2String CHANNEL_NAME
s String -> String -> String
forall a. [a] -> [a] -> [a]
++ String
barExtS
mkSortBarRepOp :: SORT -> Term -> Term
mkSortBarRepOp :: CHANNEL_NAME -> Term -> Term
mkSortBarRepOp s :: CHANNEL_NAME
s = Term -> Term -> Term
termAppl (String -> Term
conDouble (CHANNEL_NAME -> String
mkSortBarRepString CHANNEL_NAME
s))
mkSortFlatString :: SORT -> String
mkSortFlatString :: CHANNEL_NAME -> String
mkSortFlatString s :: CHANNEL_NAME
s = CHANNEL_NAME -> String
convertSort2String CHANNEL_NAME
s String -> String -> String
forall a. [a] -> [a] -> [a]
++ "_" String -> String -> String
forall a. [a] -> [a] -> [a]
++ String
flatS
mkThyNameAlphabet :: String -> String
mkThyNameAlphabet :: String -> String
mkThyNameAlphabet thName :: String
thName = String
thName String -> String -> String
forall a. [a] -> [a] -> [a]
++ "_alphabet"
mkThyNameDataEnc :: String -> String
mkThyNameDataEnc :: String -> String
mkThyNameDataEnc thName :: String
thName = String
thName String -> String -> String
forall a. [a] -> [a] -> [a]
++ "_dataenc"
mkThyNamePreAlphabet :: String -> String
mkThyNamePreAlphabet :: String -> String
mkThyNamePreAlphabet thName :: String
thName = String
thName String -> String -> String
forall a. [a] -> [a] -> [a]
++ "_prealphabet"
mkThyNameIntThms :: String -> String
mkThyNameIntThms :: String -> String
mkThyNameIntThms thName :: String
thName = String
thName String -> String -> String
forall a. [a] -> [a] -> [a]
++ "_integrationThms"
preAlphabetQuotType :: Typ
preAlphabetQuotType :: Typ
preAlphabetQuotType = Type :: String -> Sort -> [Typ] -> Typ
Type {typeId :: String
typeId = String
quotS,
typeSort :: Sort
typeSort = [],
typeArgs :: [Typ]
typeArgs = [Typ
preAlphabetType]}
preAlphabetS :: String
preAlphabetS :: String
preAlphabetS = "PreAlphabet"
preAlphabetSimS :: String
preAlphabetSimS :: String
preAlphabetSimS = "preAlphabet_sim"
preAlphabetType :: Typ
preAlphabetType :: Typ
preAlphabetType = Type :: String -> Sort -> [Typ] -> Typ
Type {typeId :: String
typeId = String
preAlphabetS,
typeSort :: Sort
typeSort = [],
typeArgs :: [Typ]
typeArgs = []}
procMapS :: String
procMapS :: String
procMapS = "ProcMap"
procMapType :: Typ
procMapType :: Typ
procMapType = Typ -> Typ -> Typ
mkFunType Typ
procNameType Typ
cCProverProcType
procNameS :: String
procNameS :: String
procNameS = "ProcName"
procNameType :: Typ
procNameType :: Typ
procNameType = Type :: String -> Sort -> [Typ] -> Typ
Type {typeId :: String
typeId = String
procNameS,
typeSort :: Sort
typeSort = [],
typeArgs :: [Typ]
typeArgs = []}
procS :: String
procS :: String
procS = "proc"
projFlatS :: String
projFlatS :: String
projFlatS = "projFlat"
projFlatOp :: Term -> Term
projFlatOp :: Term -> Term
projFlatOp = Term -> Term -> Term
termAppl (String -> Term
conDouble String
projFlatS)
quotS :: String
quotS :: String
quotS = "quot"
quotEqualityS :: String
quotEqualityS :: String
quotEqualityS = "quot_equality"
quotientThyS :: String
quotientThyS :: String
quotientThyS = "Quotient_Type"
reflexivityTheoremS :: String
reflexivityTheoremS :: String
reflexivityTheoremS = "eq_refl"
symmetryTheoremS :: String
symmetryTheoremS :: String
symmetryTheoremS = "eq_symm"
transitivityS :: String
transitivityS :: String
transitivityS = "eq_trans"