, convertFQProcessName2String
, lemmasCCProverDecompositionThmsS
, lemmasCCProverInjectivityThmsS
, mkPreAlphabetConstructor
, mkPreAlphabetConstructorOp
-- | Name for the CspCASLProver's Alphabet
-- | Type for the CspCASLProver's Alphabet
alphabetType = Type {typeId = alphabetS,
-- | String for the name extension of CspCASLProver's bar types
{- | Isabelle fucntion to compare eqaulity of two elements of the
binEq_PreAlphabet :: Term -> Term -> Term
binEq_PreAlphabet = binVNameAppl eq_PreAlphabetV
-- | Type for (ProcName,Alpahbet) proc
cCProverProcType = Type {typeId = procS,
typeArgs = [procNameType, eventType]}
-- | Isabelle operation for the class operation
classOp = termAppl (conDouble classS)
-- | String for the class operation
{- | Function that takes a channel name produces the
CspCASLProver's constructor for that channel. -}
convertChannelString :: CHANNEL_NAME -> String
convertChannelString = show
-- | Convert a SORT to a string
convertSort2String :: SORT -> String
convertSort2String s = transString $ showIsaTypeT s Main_thy
-- | Convert a process name to a string
convertFQProcessName2String :: FQ_PROCESS_NAME -> String
convertFQProcessName2String fqPn =
\ Tried to convert non fully qualified process name to string."
FQ_PROCESS_NAME pn _ -> show pn
-- | Theory file name for CSP_F of CSP-Prover
{- | String of the name of the function to compare eqaulity of two
elements of the PreAlphabet. -}
eq_PreAlphabetS :: String
eq_PreAlphabetS = "eq_PreAlphabet"
{- | VName of the name of the function to compare eqaulity of two
elements of the PreAlphabet. -}
eq_PreAlphabetV = VName eq_PreAlphabetS Nothing
{- | String for the name of the axiomatic type class of equivalence
equivTypeClassS :: String
equivTypeClassS = "equiv"
-- | String of the name of CspCASLProver's Event datatype.
-- | Type for the CspCASLProver's Event datatype
eventType = Type {typeId = eventS,
{- | String of the name of constructor for a plain event without a channel,
effectivly this is the channel whos name is Flat. Also used for the names
-- | Function that takes a Term and adds a flat around it
flatOp = termAppl (conDouble flatS)
{- |Name for the lemma which is the collection of our decomposition axioms that
lemmasCCProverDecompositionThmsS :: String
lemmasCCProverDecompositionThmsS = "ccproverDecompositionAxs"
{- |Name for the lemma which is the collection of our injectivity axioms that we
lemmasCCProverInjectivityThmsS :: String
lemmasCCProverInjectivityThmsS = "ccproverInjectivityThms"
-- | Name for the lemma which is the collection of embedding injectivity axioms.
lemmasEmbInjAxS :: String
lemmasEmbInjAxS = "allGaEmbInjAx"
-- | Name for the lemma which is the collection of identity axioms.
lemmasIdentityAxS :: String
lemmasIdentityAxS = "allGaIdentityAx"
-- | Name for the lemma which is the collection of not defined bottom axioms.
lemmasNotDefBotAxS :: String
lemmasNotDefBotAxS = "allGaNotDefBotAx"
-- | Name for the lemma which is the collection of totality axioms.
lemmasTotalityAxS :: String
lemmasTotalityAxS = "allGaTotAx"
-- | Name for the lemma which is the collection of transitivity axioms.
lemmasTransAxS = "allGaTransAx"
{- | Function that takes a sort and outputs the function name for the
corresponing choose function -}
mkChooseFunName :: SORT -> String
mkChooseFunName sort = "choose_" ++ mkPreAlphabetConstructor sort
{- | Function that takes a sort and outputs the Isabelle function for the
corresponing choose function -}
mkChooseFunOp :: SORT -> Term -> Term
mkChooseFunOp s = termAppl (conDouble (mkChooseFunName s))
{- | Function that takes a sort and outputs the function name for the
corresponing compare_with function -}
mkCompareWithFunName :: SORT -> String
mkCompareWithFunName sort = "compare_with_" ++ mkPreAlphabetConstructor sort
{- | Function that returns the constructor of PreAlphabet for a given
mkPreAlphabetConstructor :: SORT -> String
mkPreAlphabetConstructor sort = "C_" ++ convertSort2String sort
{- | Function that returns the (Isabelle function for the) constructor of
PreAlphabet for a given sort -}
mkPreAlphabetConstructorOp :: SORT -> Term -> Term
mkPreAlphabetConstructorOp s = termAppl (conDouble (mkPreAlphabetConstructor s))
{- | Given a process name this fucntion returns a unique constructor for that
process name. This is a helper functin when buildign the process name data
mkProcNameConstructor :: FQ_PROCESS_NAME -> String
mkProcNameConstructor fqPn = case fqPn of
\ Tried to make a non fully qualified process name as a\
FQ_PROCESS_NAME pn _ -> show pn
{- | Converts a sort in to the corresponding bar sort represented as a
mkSortBarString :: SORT -> String
mkSortBarString s = convertSort2String s ++ barExtS
-- | Converts a sort in to the corresponding bar sort type
mkSortBarType :: SORT -> Typ
mkSortBarType sort = Type {typeId = mkSortBarString sort,
{- | Given a sort this function produces the function name (string) of the built
in Isabelle fucntion that corresponds to the abstraction function of the
mkSortBarAbsString :: SORT -> String
mkSortBarAbsString s = "Abs_" ++ convertSort2String s ++ barExtS
{- | Given a sort this function produces the a function on the abstract syntax
of Isabelle that represents the built in Isabelle fucntion that corresponds
to the abstraction function of the type sort_bar. -}
mkSortBarAbsOp :: SORT -> Term -> Term
mkSortBarAbsOp s = termAppl (conDouble (mkSortBarAbsString s))
{- | Given a sort this function produces the function name (string) of the built
in Isabelle fucntion that corresponds to the representation function of the
mkSortBarRepString :: SORT -> String
mkSortBarRepString s = "Rep_" ++ convertSort2String s ++ barExtS
{- | Given a sort this function produces the a function on the abstract syntax
of Isabelle that represents the built in Isabelle fucntion that corresponds
to the representation function of the type sort_bar. -}
mkSortBarRepOp :: SORT -> Term -> Term
mkSortBarRepOp s = termAppl (conDouble (mkSortBarRepString s))
{- | Converts asort in to the corresponding flat type for that sort represented
as a string. This is used in the construction of the channels and is linked
mkSortFlatString :: SORT -> String
mkSortFlatString s = convertSort2String s ++ "_" ++ flatS
{- | Created a name for the theory file which stores the alphabet
construction for CspCASLProver. -}
mkThyNameAlphabet :: String -> String
mkThyNameAlphabet thName = thName ++ "_alphabet"
{- | Created a name for the theory file which stores the data encoding
mkThyNameDataEnc :: String -> String
mkThyNameDataEnc thName = thName ++ "_dataenc"
{- | Created a name for the theory file which stores the Alphabet
construction and instances code for CspCASLProver. -}
mkThyNamePreAlphabet :: String -> String
mkThyNamePreAlphabet thName = thName ++ "_prealphabet"
{- | Created a name for the theory file which stores the Integration
Theorems for CspCASLProver. -}
mkThyNameIntThms :: String -> String
mkThyNameIntThms thName = thName ++ "_integrationThms"
-- | Type for CspCASLProver's preAlphabet quot
preAlphabetQuotType :: Typ
preAlphabetQuotType = Type {typeId = quotS,
typeArgs = [preAlphabetType]}
-- | Name for CspCASLProver's PreAlphabet
preAlphabetS = "PreAlphabet"
preAlphabetSimS :: String
preAlphabetSimS = "preAlphabet_sim"
-- | Type for CspCASLProver's PreAlphabet
preAlphabetType = Type {typeId = preAlphabetS,
{- | Name for CspCASLProver's function for mapping process names to
{- | Type for CspCASLProver's function for mapping process names to
procMapType = mkFunType procNameType cCProverProcType
-- | Name for CspCASLProver's datatype of process names
-- | Type for CspCASLProver's datatype of process names
procNameType = Type {typeId = procNameS,
-- | Name for CspProver's ('pn, 'a) proc type
{- | Name of CspCASLProver's function for projecting a Flat Event back to the
-- | Apply the CspCASLProvers projFlat function to an isabelle term
projFlatOp :: Term -> Term
projFlatOp = termAppl (conDouble projFlatS)
-- | Name for IsabelleHOL quot type
quotEqualityS = "quot_equality"
quotientThyS = "Quotient_Type"
reflexivityTheoremS :: String
reflexivityTheoremS = "eq_refl"
symmetryTheoremS :: String
symmetryTheoremS = "eq_symm"
transitivityS = "eq_trans"