Changeset 12792
- Timestamp:
- 06.11.2009 14:50:45 (2 weeks ago)
- Location:
- trunk
- Files:
-
- 6 modified
-
CspCASLProver/Consts.hs (modified) (10 diffs)
-
CspCASLProver/CspCASLProver.hs (modified) (1 diff)
-
CspCASLProver/CspProverConsts.hs (modified) (3 diffs)
-
CspCASLProver/TransProcesses.hs (modified) (15 diffs)
-
CspCASLProver/Utils.hs (modified) (11 diffs)
-
Isabelle/IsaConsts.hs (modified) (4 diffs)
Legend:
- Unmodified
- Added
- Removed
-
trunk/CspCASLProver/Consts.hs
r11854 r12792 20 20 , classOp 21 21 , classS 22 , convertChannelString 22 23 , convertProcessName2String 23 24 , convertSort2String … … 30 31 , eventType 31 32 , flatS 33 , flatOp 32 34 , preAlphabetQuotType 33 35 , preAlphabetS … … 35 37 , preAlphabetType 36 38 , projFlatS 39 , projFlatOp 37 40 , mkChooseFunName 38 41 , mkChooseFunOp 39 42 , mkCompareWithFunName 40 , mkEventChannelConstructor41 43 , mkPreAlphabetConstructor 42 44 , mkPreAlphabetConstructorOp 43 45 , mkProcNameConstructor 46 , mkSortBarAbsString 44 47 , mkSortBarAbsOp 45 48 , mkSortBarRepOp 46 49 , mkSortBarString 47 50 , mkSortBarType 48 , mkSortDataSetString49 51 , mkSortFlatString 50 52 , mkThyNameAlphabet … … 101 103 classS = "class" 102 104 105 -- | Function that takes a channel name produces the 106 -- CspCASLProver's constructor for that channel. 107 convertChannelString :: CHANNEL_NAME -> String 108 convertChannelString = show 109 103 110 -- | Convert a SORT to a string 104 111 convertSort2String :: SORT -> String … … 112 119 cspFThyS :: String 113 120 cspFThyS = "CSP_F" 114 115 -- | The string to use for the names of the data set types. See the channel116 -- construction and the event data type.117 dataSetS :: String118 dataSetS = "DataSet"119 121 120 122 -- | String of the name of the function to compare eqaulity of two … … 154 156 flatS = "Flat" 155 157 158 -- | Function that takes a Term and adds a flat around it 159 flatOp :: Term -> Term 160 flatOp = termAppl (conDouble flatS) 161 156 162 -- | Function that takes a sort and outputs the function name for the 157 163 -- corresponing choose function … … 168 174 mkCompareWithFunName :: SORT -> String 169 175 mkCompareWithFunName sort = ("compare_with_" ++ (mkPreAlphabetConstructor sort)) 170 171 -- | Function that takes a channel name and a target sort and produces the172 -- CspCASLProver's constructor for that channel with that target sort.173 mkEventChannelConstructor :: CHANNEL_NAME -> SORT -> String174 mkEventChannelConstructor c s = (show c) ++ "_" ++ (convertSort2String s)175 176 176 177 -- | Function that returns the constructor of PreAlphabet for a given … … 199 200 mkSortBarType sort = Type {typeId = (mkSortBarString sort), typeSort = [], typeArgs =[]} 200 201 201 -- | Converts a sort in to the corresponding Data Set type for that sort 202 -- represented as a string. This is used in the construction of the channels and 203 -- is linked with the type event. 204 mkSortDataSetString :: SORT -> String 205 mkSortDataSetString s = (convertSort2String s) ++ "_" ++ dataSetS 202 -- | Given a sort this function produces the function name (string) of the built 203 -- in Isabelle fucntion that corresponds to the abstraction function of the 204 -- type that sort_bar. 205 mkSortBarAbsString :: SORT -> String 206 mkSortBarAbsString s = "Abs_" ++ convertSort2String s ++ barExtS 207 208 -- | Given a sort this function produces the a function on the abstract syntax 209 -- of Isabelle that represents the built in Isabelle fucntion that corresponds 210 -- to the abstraction function of the type sort_bar. 211 mkSortBarAbsOp :: SORT -> Term -> Term 212 mkSortBarAbsOp s = termAppl (conDouble (mkSortBarAbsString s)) 213 214 -- | Given a sort this function produces the function name (string) of the built 215 -- in Isabelle fucntion that corresponds to the representation function of the 216 -- type sort_bar. 217 mkSortBarRepString :: SORT -> String 218 mkSortBarRepString s = "Rep_" ++ convertSort2String s ++ barExtS 219 220 -- | Given a sort this function produces the a function on the abstract syntax 221 -- of Isabelle that represents the built in Isabelle fucntion that corresponds 222 -- to the representation function of the type sort_bar. 223 mkSortBarRepOp :: SORT -> Term -> Term 224 mkSortBarRepOp s = termAppl (conDouble (mkSortBarRepString s)) 206 225 207 226 -- | Converts asort in to the corresponding flat type for that sort represented … … 211 230 mkSortFlatString s = (convertSort2String s) ++ "_" ++ flatS 212 231 213 -- | Given a sort this function produces the function name (string) of the built214 -- in Isabelle fucntion that corresponds to the abstraction function of the215 -- type that sort_bar.216 mkSortBarAbsString :: SORT -> String217 mkSortBarAbsString s = "Abs_" ++ convertSort2String s ++ barExtS218 219 -- | Given a sort this function produces the a function on the abstract syntax220 -- of Isabelle that represents the built in Isabelle fucntion that corresponds221 -- to the abstraction function of the type sort_bar.222 mkSortBarAbsOp :: SORT -> Term -> Term223 mkSortBarAbsOp s = termAppl (conDouble (mkSortBarAbsString s))224 225 -- | Given a sort this function produces the function name (string) of the built226 -- in Isabelle fucntion that corresponds to the representation function of the227 -- type sort_bar.228 mkSortBarRepString :: SORT -> String229 mkSortBarRepString s = "Rep_" ++ convertSort2String s ++ barExtS230 231 -- | Given a sort this function produces the a function on the abstract syntax232 -- of Isabelle that represents the built in Isabelle fucntion that corresponds233 -- to the representation function of the type sort_bar.234 mkSortBarRepOp :: SORT -> Term -> Term235 mkSortBarRepOp s = termAppl (conDouble (mkSortBarRepString s))236 237 232 -- | Created a name for the theory file which stores the alphabet 238 233 -- construction for CspCASLProver. … … 303 298 projFlatS = "projFlat" 304 299 300 -- | Apply the CspCASLProvers projFlat function to an isabelle term 301 projFlatOp :: Term -> Term 302 projFlatOp = termAppl (conDouble projFlatS) 303 305 304 -- | Name for IsabelleHOL quot type 306 305 quotS :: String -
trunk/CspCASLProver/CspCASLProver.hs
r12661 r12792 201 201 -- Start with our empty isabelle theory and add the 202 202 -- processes the the process refinement theorems. 203 (isaSign, isaSens) = addProcMap ccNnamedSens c aslSign pcfolSign cfolSign203 (isaSign, isaSens) = addProcMap ccNnamedSens ccSign pcfolSign cfolSign 204 204 $ addProcNameDatatype cspSign 205 $ addDataSetTypes sortList206 205 $ addFlatTypes sortList 207 206 $ addProjFlatFun -
trunk/CspCASLProver/CspProverConsts.hs
r11854 r12792 34 34 , cspProver_conditionalOp 35 35 , cspProver_chan_nondeterministic_sendOp 36 , cspProver_chan_sendOp 37 , cspProver_chan_recOp 36 38 ) where 37 39 … … 212 214 cspProver_chan_nondeterministic_sendAltArgOpPrio = 80 213 215 216 -- | Channel send operator symbols 217 cspProver_chan_sendS :: String 218 cspProver_chan_sendS = "Send_prefix" 219 cspProver_chan_sendAltS :: String 220 cspProver_chan_sendAltS = "(_ ! _ -> _)" 221 cspProver_chan_sendAltArgPrios :: [Int] 222 cspProver_chan_sendAltArgPrios = [900,1000,80] 223 cspProver_chan_sendAltArgOpPrio :: Int 224 cspProver_chan_sendAltArgOpPrio = 80 225 226 -- | Channel receive operator symbols 227 cspProver_chan_recS :: String 228 cspProver_chan_recS = "Rec_prefix" 229 cspProver_chan_recAltS :: String 230 cspProver_chan_recAltS = "(_ ? _ : _ -> _)" 231 cspProver_chan_recAltArgPrios :: [Int] 232 cspProver_chan_recAltArgPrios = [900,900,1000,80] 233 cspProver_chan_recAltArgOpPrio :: Int 234 cspProver_chan_recAltArgOpPrio = 80 235 214 236 -- Isabelle Terms representing the operations for CspProver 215 237 … … 354 376 cspProver_chan_nondeterministic_sendAltArgOpPrio 355 377 356 378 -- | Channel send operator 379 cspProver_chan_sendOp :: Term -> Term -> Term -> Term 380 cspProver_chan_sendOp = 381 makeTriCspProverOp cspProver_chan_sendS 382 cspProver_chan_sendAltS 383 cspProver_chan_sendAltArgPrios 384 cspProver_chan_sendAltArgOpPrio 385 386 -- | Channel receive operator 387 cspProver_chan_recOp :: Term -> Term -> Term -> Term -> Term 388 cspProver_chan_recOp = 389 makeQuadCspProverOp cspProver_chan_recS 390 cspProver_chan_recAltS 391 cspProver_chan_recAltArgPrios 392 cspProver_chan_recAltArgOpPrio 357 393 358 394 -- | Create an Isabelle Term representing a (Unary) CspProver operator -
trunk/CspCASLProver/TransProcesses.hs
r11854 r12792 15 15 module CspCASLProver.TransProcesses 16 16 ( transProcess 17 , VarSource(..) 17 18 )where 18 19 … … 29 30 30 31 import CspCASL.AS_CspCASL_Process 31 import CspCASL.SignCSP (FQProcVarList) 32 import CspCASL.SignCSP (CspCASLSign, CspSign(..), 33 ccSig2CASLSign, ccSig2CspSign, ProcProfile(..)) 32 34 33 35 import CspCASLProver.Consts … … 35 37 36 38 import qualified Data.Set as Set 39 import qualified Data.Map as Map 37 40 38 41 import Isabelle.IsaSign 39 42 import Isabelle.IsaConsts 43 44 45 46 -- | The origin of a variable 47 data VarSource 48 -- | indicates that the variable originated from a prefix choice operator. 49 = PrefixChoice 50 -- | indicates that the variable originated from a channel nondeterministic 51 -- send or channel receive where the sort is the declared sort of the 52 -- channel. 53 | ChanSendOrRec CASL_AS_Basic_CASL.SORT 54 -- | indicates that the variable originated from global parameter to the 55 -- process. 56 | GlobalParameter 57 58 -- | The target of the sort translation 59 data SortTarget 60 -- | Indicates the translated sort will be used as a normal communication 61 -- e.g., as a prefix choice or event set. 62 = NormalComm 63 -- | Indicates that the sort will be used as a communication set with a 64 -- channel of certain declared sort. 65 | ChanComm CASL_AS_Basic_CASL.SORT 66 67 -- | The taraget of the term translation 68 data TermTarget 69 -- | Indicates the term will be used in the term prefix operator 70 = TermPrefix 71 -- | Indicates that the term will be used either as a parameter (where sort 72 -- | is declared sort of the parameter) or as a channel communication (where 73 -- | the sort is the declared sort of the channel). 74 | ChanSendOrParam CASL_AS_Basic_CASL.SORT 75 76 -- | Variable source map, which maps variables to the source of the variable. 77 type VSM = Map.Map CASL_AS_Basic_CASL.VAR VarSource 40 78 41 79 -- | Translate a Process into CspProver (Isabelle). We need the data part (CASL … … 44 82 -- need the PCFOL and CFOL signature of the data part after translation to 45 83 -- PCFOL and CFOL to pass along to the term and formula translations. 46 transProcess :: C ASL_Sign.Sign () ()-> CASL_Sign.Sign () () ->47 CASL_Sign.Sign () () -> FQProcVarList-> PROCESS -> Term48 transProcess c aslSign pcfolSign cfolSign globalVarspr =84 transProcess :: CspCASLSign -> CASL_Sign.Sign () () -> 85 CASL_Sign.Sign () () -> VSM -> PROCESS -> Term 86 transProcess ccSign pcfolSign cfolSign vsm pr = 49 87 let -- Make translations with all the signatures filled in 50 transFormula' = transFormula pcfolSign cfolSign globalVars 51 transProcess' = transProcess caslSign pcfolSign cfolSign globalVars 52 -- Union all the event sets together in Isabelle using the Isabelle 53 -- binary union operator 54 union esList = foldr1 binUnion esList 88 transFormula' = transFormula pcfolSign cfolSign 89 transProcess' = 90 transProcess ccSign pcfolSign cfolSign 91 cspSign = ccSig2CspSign ccSign 92 caslSign = ccSig2CASLSign ccSign 93 getProcParamSort procName index = 94 let procMap = procSet $ cspSign 95 paramSortList = case Map.lookup procName procMap of 96 Nothing -> error "CspCASLProver.TransProcesses.transProcess: Process name not found in process map." 97 Just pp -> case pp of 98 ProcProfile sorts _ -> sorts 99 in paramSortList !! index 55 100 in case pr of 56 101 -- precedence 0 … … 58 103 Stop _ -> cspProver_stopOp 59 104 Div _ -> cspProver_divOp 60 Run es _ -> App (cspProver_runOp) (head (transEventSet es)) NotCont 61 Chaos es _ -> App (cspProver_chaosOp) (head (transEventSet es)) NotCont 105 -- Run -> App (cspProver_runOp) (head (transEventSet es)) NotCont 106 Run _ _ -> conDouble "RunNotSupportedYet" 107 -- Chaos -> App (cspProver_chaosOp) (head (transEventSet es)) NotCont 108 Chaos _ _ -> conDouble "ChaosNotSupportedYet" 62 109 NamedProcess pn fqParams _ -> 63 110 let -- Make a process name term 64 111 pnTerm = conDouble $ convertProcessName2String pn 65 -- Translate an argument(a term) as normal but make sure 66 -- we land in the bar types and not in the alphabet 67 transParam t = transTerm False caslSign pcfolSign cfolSign 68 globalVars t 69 -- Create a list of translated parameters 70 paramTerms = map transParam fqParams 112 -- Translate an argument(a term), t is the sort of the declared 113 -- parameter (the sort of the variable may be a subsort of the 114 -- declared sort, so we must use the declared sort). 115 transParam (term, declaredSortIndex) = 116 let termTar = ChanSendOrParam $ 117 getProcParamSort pn declaredSortIndex 118 in transCASLTerm caslSign pcfolSign cfolSign 119 vsm termTar term 120 -- Create a list of translated parameters, we number the 121 -- parameters from zero 122 paramTerms = map transParam $ zip fqParams [0..] 71 123 in if (null fqParams) 72 124 -- If there are no parameters we just get the process name term … … 77 129 -- precedence 1 78 130 ConditionalProcess fqFormula p q _ -> 79 cspProver_conditionalOp (transFormula' fqFormula) (transProcess' p) 80 (transProcess' q) 131 cspProver_conditionalOp (transFormula' vsm fqFormula) 132 (transProcess' vsm p) 133 (transProcess' vsm q) 81 134 -- precedence 2 82 Hiding p es _ ->83 cspProver_hidingOp (transProcess' p) (union (transEventSet es))84 RenamingProcess p re _ ->85 cspProver_renamingOp (transProcess' p) (transRenaming re)135 Hiding _ _ _ -> conDouble "HidingNotSupportedYet" 136 -- cspProver_hidingOp (transProcess' p) (union (transEventSet es)) 137 RenamingProcess _ _ _ -> conDouble "RenamingNotSupportedYet" 138 -- cspProver_renamingOp (transProcess' p) (transRenaming re) 86 139 -- precedence 3 87 140 Sequential p q _ -> 88 cspProver_sequenceOp (transProcess' p) (transProcess'q)141 cspProver_sequenceOp (transProcess' vsm p) (transProcess' vsm q) 89 142 PrefixProcess ev p _ -> 90 143 -- All prefix events are dealt with inside the translation of events. 91 transEvent c aslSign pcfolSign cfolSign globalVarsev p144 transEvent ccSign pcfolSign cfolSign vsm ev p 92 145 -- precedence 4 93 146 InternalChoice p q _ -> 94 cspProver_internal_choiceOp (transProcess' p) (transProcess' q) 147 cspProver_internal_choiceOp (transProcess' vsm p) 148 (transProcess' vsm q) 95 149 ExternalChoice p q _ -> 96 cspProver_external_choiceOp (transProcess' p) (transProcess' q) 150 cspProver_external_choiceOp (transProcess' vsm p) 151 (transProcess' vsm q) 97 152 -- precedence 5 98 153 Interleaving p q _ -> 99 cspProver_interleavingOp (transProcess' p) (transProcess' q) 154 cspProver_interleavingOp (transProcess' vsm p) 155 (transProcess' vsm q) 100 156 SynchronousParallel p q _ -> 101 cspProver_synchronousOp (transProcess' p) (transProcess' q) 157 cspProver_synchronousOp (transProcess' vsm p) 158 (transProcess' vsm q) 102 159 GeneralisedParallel p es q _ -> 103 cspProver_general_parallelOp (transProcess' p)104 ( union (transEventSet es))105 (transProcess' q)160 cspProver_general_parallelOp (transProcess' vsm p) 161 (transEventSet es) 162 (transProcess' vsm q) 106 163 107 164 AlphabetisedParallel p les res q _ -> 108 cspProver_alphabetised_parallelOp (transProcess' p)109 ( union (transEventSet les))110 ( union (transEventSet res))111 (transProcess' q)165 cspProver_alphabetised_parallelOp (transProcess' vsm p) 166 (transEventSet les) 167 (transEventSet res) 168 (transProcess' vsm q) 112 169 -- Just forget the fully qualified data i.e. the constituent 113 170 -- communication alphabet. Translate as normal. 114 171 FQProcess p _ _ -> 115 transProcess' p 116 117 -- | Translate a fully qualified EventSet into a list Isabelle term. Event Sets 118 -- are treated differently in different CSP operators, so its up to the 119 -- calling function to do somehting useful with the returned list. 120 transEventSet :: EVENT_SET -> [Term] 172 transProcess' vsm p 173 174 -- | Translate a fully qualified EventSet into a list Isabelle term. 175 transEventSet :: EVENT_SET -> Term 121 176 transEventSet evs = 122 177 case evs of 123 EventSet _ _ -> error "CspCASLProver.TransProcesses.transEventSet: Expected a FQEventSet not a non-FQEventSet"; 124 FQEventSet comms _ -> map transCommType comms 178 EventSet _ _ -> 179 error "CspCASLProver.TransProcesses.transEventSet: Expected a FQEventSet not a non-FQEventSet"; 180 FQEventSet comms _ -> 181 -- This list will not be empty otherwise, if it was empty the static 182 -- analysis would have failed. 183 foldr1 binUnion (map transCommType comms) 125 184 126 185 -- | Translate a fully qualified CommType into an Isabelle term. … … 128 187 transCommType comm = 129 188 case comm of 130 CommTypeSort sort -> conDouble $ mkSortBarStringsort189 CommTypeSort sort -> transSort NormalComm sort 131 190 CommTypeChan typedChanName -> 132 191 case typedChanName of 133 TypedChanName _ _ -> 134 error "CspCASLProver.TransProcesses.transCommType: Typed channel name translation not implemented" 192 TypedChanName cn _ -> rangeOp (conDouble $ convertChannelString cn) 135 193 136 194 -- | Translate a process event into CspProver (Isabelle). We need to know the 137 -- data pat (CASL signature) inorder to use the same translation for CASL 138 -- terms as the data encoding into Isabelle did. We also need the global 139 -- variables so we can treat local and global variables different. We need the 140 -- PCFOL and CFOL signature of the data part after translation to PCFOL and 141 -- CFOL to pass along to the term and formula translations. 142 transEvent :: CASL_Sign.Sign () () -> CASL_Sign.Sign () () -> 143 CASL_Sign.Sign () () -> FQProcVarList -> 195 -- data part (CASL signature) in order to use the same translation for CASL 196 -- terms as the data encoding into Isabelle did. We need the Csp signature for 197 -- getting the declared channel sorts. We need the PCFOL and CFOL signature of 198 -- the data part after translation to PCFOL and CFOL to pass along to the term 199 -- and formula translations. We need the vsm to pass it on to the term 200 -- translation. 201 transEvent :: CspCASLSign -> CASL_Sign.Sign () () -> 202 CASL_Sign.Sign () () -> VSM -> 144 203 EVENT -> PROCESS -> Term 145 transEvent c aslSign pcfolSign cfolSign globalVarsevent p =204 transEvent ccSign pcfolSign cfolSign vsm event p = 146 205 let -- Make translation with all the signatures filled in 147 transProcess' = transProcess caslSign pcfolSign cfolSign globalVars 206 transProcess' = transProcess ccSign pcfolSign cfolSign 207 chanMap = chans $ ccSig2CspSign ccSign 208 caslSign = ccSig2CASLSign ccSign 209 transCASLTerm' = transCASLTerm caslSign pcfolSign cfolSign 148 210 in case event of 149 211 -- To use the fully qualified data we need to know what the underlying … … 152 214 case ev of 153 215 TermEvent _ _ -> 154 -- Translate the term and make sure we do land in the 155 -- alphabet and not in the bar types 156 cspProver_action_prefixOp(transTerm True 157 caslSign pcfolSign cfolSign globalVars 158 fqTerm) 159 (transProcess' p) 216 -- Translate the term for use in the term prefix operator 217 cspProver_action_prefixOp (transCASLTerm' vsm TermPrefix fqTerm) 218 (transProcess' vsm p) 160 219 InternalPrefixChoice v s _ -> 161 -- Use the non fully qualified data instead of the fully220 -- Use the non fully qualified data instead of the fully 162 221 -- qualified data as it is easier in this case as the variable 163 222 -- is not really a variable of that sort. Here the variable and 164 -- sort are sep erate operands of the CSPProver operator.223 -- sort are separate operands of the CSPProver operator. 165 224 cspProver_internal_prefix_choiceOp 166 (transVar v) (transSort s True) (transProcess' p) 225 (transVar v) (transSort NormalComm s) 226 (transProcess' 227 (Map.insert v PrefixChoice vsm) p) 167 228 ExternalPrefixChoice v s _ -> 168 -- Use the non fully qualified data instead of the fully229 -- Use the non fully qualified data instead of the fully 169 230 -- qualified data as it is easier in this case as the variable 170 231 -- is not really a variable of that sort. Here the variable and 171 -- sort are sep erate operands of the CSPProver operator.232 -- sort are separate operands of the CSPProver operator. 172 233 cspProver_external_prefix_choiceOp 173 (transVar v) (transSort s True) 174 (transProcess' p) 175 ChanSend _ _ _ -> conDouble "ChanSendNotYetDone" 234 (transVar v) (transSort NormalComm s) 235 (transProcess' 236 (Map.insert v PrefixChoice vsm) p) 237 ChanSend _ _ _ -> 238 -- We do not use the non fully qualified term or channel name. 239 -- Instead we use the fully qualified term (fqTerm) and the 240 -- fully qualified channel (mfqc) 241 case mfqc of 242 Nothing -> error "CspCASLProver.TransProcesses.transEvent: Missing fully qualified channel data" 243 Just (chanName, chanSort) -> 244 -- CspProver's channel send Op 245 cspProver_chan_sendOp 246 -- Name of channel 247 (transChanName chanName) 248 -- Term to send 249 (transCASLTerm' vsm (ChanSendOrParam chanSort) fqTerm) 250 -- The translated version of the rest of the process 251 (transProcess' vsm p) 252 176 253 ChanNonDetSend _ var varSort _ -> 177 254 -- We do not use the fully qualified variable (fqTerm) instead … … 179 256 case mfqc of 180 257 Nothing -> error "CspCASLProver.TransProcesses.transEvent: Missing fully qualified channel data" 181 Just (chanName, chanSort) -> 182 -- CspProvers channel non-deterministic channel send Op 183 cspProver_chan_nondeterministic_sendOp 184 -- The channel made of the name and the target sort of the 185 -- channel 186 (transChanName chanName chanSort) 187 -- The translate variable 258 -- Notice we do not use the derived channel's 259 -- sort(second of Just) as this can be a sub type 260 -- of the declared channel sort, which is what we 261 -- need. 262 Just (chanName, _) -> 263 let declaredChanSort = case Map.lookup chanName chanMap of 264 Nothing -> error "CspCASLProver.TransProcesses.transEvent: Channel name not in channel map" 265 Just s -> s 266 -- CspProvers non-deterministic channel send Op 267 in cspProver_chan_nondeterministic_sendOp 268 -- The channel name 269 (transChanName chanName) 270 -- The translated variable 188 271 (transVar var) 189 272 -- The translate sort (channel version) of the set to 190 -- receive from 191 (transSort varSort False) 273 -- receive from. Note that the sort in the mfqc is the 274 -- sort of the variable as specified, we want here the 275 -- declaration sort of the channel. 276 (transSort (ChanComm declaredChanSort) varSort) 192 277 -- The translated version of the rest of the process 193 (transProcess' p) 194 195 ChanRecv _ _ _ _ -> conDouble "ChanRecvNotYetDone" 278 (transProcess' (Map.insert var 279 (ChanSendOrRec declaredChanSort) vsm) p) 280 281 ChanRecv _ var varSort _ -> 282 -- We do not use the fully qualified variable (fqTerm) instead 283 -- we use the non fully qualified variable (var, varSort). 284 case mfqc of 285 Nothing -> error "CspCASLProver.TransProcesses.transEvent: Missing fully qualified channel data" 286 -- Notice we do not use the derived channel's sort(second of 287 -- Just) as this can be a sub type of the declared channel 288 -- sort, which is what we need. 289 Just (chanName, _) -> 290 let declaredChanSort = case Map.lookup chanName chanMap of 291 Nothing -> error "CspCASLProver.TransProcesses.transEvent: Channel name not in channel map" 292 Just s -> s 293 -- CspProvers channel receive Op 294 in cspProver_chan_recOp 295 -- The channel name 296 (transChanName chanName) 297 -- The translated variable 298 (transVar var) 299 -- The translate sort (channel version) of the set to 300 -- receive from. Note that the sort in the mfqc is the 301 -- sort of the variable as specified, we want here the 302 -- declaration sort of the channel. 303 (transSort (ChanComm declaredChanSort) varSort) 304 -- The translated version of the rest of the process 305 (transProcess' (Map.insert var 306 (ChanSendOrRec declaredChanSort) vsm) p) 307 196 308 FQEvent _ _ _ _ -> error "CspCASLProver.TransProcesses.transEvent: A FQEvent should not contain a non-FQEvent"; 197 309 _ -> error "CspCASLProver.TransProcesses.transEvent: Expected a FQEvent not a non-FQEvent"; … … 203 315 transVar v = conDouble $ tokStr v 204 316 205 -- | Translate a sort into CspProver (Isabelle). If toFlat = true then the 206 -- result will be the corresponding flat type for a given sort else it will be 207 -- the data set type for the given sort i.e. toFlat = true for normal 208 -- communication, toFlat = false for channel communications 209 transSort :: CASL_AS_Basic_CASL.SORT -> Bool -> Term 210 transSort sort toFlat = if toFlat 211 then conDouble $ mkSortFlatString sort 212 else conDouble $ mkSortDataSetString sort 213 214 transChanName :: CHANNEL_NAME -> CASL_AS_Basic_CASL.SORT -> Term 215 transChanName chanName sort = 216 conDouble $ mkEventChannelConstructor chanName sort 217 218 transRenaming :: RENAMING -> Term 219 transRenaming _ = conDouble "RenamingNotDoneYet" 317 -- | Translate a sort into CspProver (Isabelle) depending on the target of the 318 -- | sort. 319 transSort :: SortTarget -> CASL_AS_Basic_CASL.SORT -> Term 320 transSort target s = 321 let sBar = conDouble $ mkSortBarString s 322 in case target of 323 NormalComm -> binImageOp (conDouble flatS) $ sBar 324 ChanComm t -> binImageOp 325 (conDouble $ mkSortBarAbsString t) sBar 326 327 -- | Translated the channel name to Isabelle code. 328 transChanName :: CHANNEL_NAME -> Term 329 transChanName chanName = 330 conDouble $ convertChannelString chanName 331 332 -- transRenaming :: RENAMING -> Term 333 -- transRenaming _ = conDouble "RenamingNotDoneYet" 220 334 221 335 ------------------------------------------------------------------------- … … 225 339 -- | Produce a record that is used to translate CASL terms and formulae to 226 340 -- Isabelle Terms. This record is the same as the CFOL2IsabelleHOL.transRecord 227 -- but deals with variables by adding various functions around them depending 228 -- on if the variable is global or local. 229 cspCaslTransRecord :: CASL_Sign.Sign f e -> FQProcVarList -> Set.Set String -> 341 -- but deals with variables by applying a case on the origin of the 342 -- variable. The Isabelle terms produced when this record is used are always 343 -- of basic types i.e., can be used as parameters for function in the data 344 -- encoding. 345 cspCaslTransRecord :: CASL_Sign.Sign f e -> Set.Set String -> 230 346 CFOL2IsabelleHOL.FormulaTranslator f e -> 231 Set.Set String -> Record f Term Term232 cspCaslTransRecord caslSign globalVars tyToks trForm strs=347 Set.Set String -> VSM -> Record f Term Term 348 cspCaslTransRecord caslSign tyToks trForm strs vsm = 233 349 -- We use the existing record for translation but change its 234 350 -- function in the case of a qualified variable. If we have a 235 -- variable then translate the variable but wrap it in the351 -- variable then we must make a translate the variable but wrap it in the 236 352 -- correct choose function for it's sort. 237 353 (CFOL2IsabelleHOL.transRecord caslSign tyToks trForm strs) 238 { foldQual_var = \ _ v s r->354 { foldQual_var = \ _ v s _ -> 239 355 let v' = mkFree $ CFOL2IsabelleHOL.transVar strs v 240 in -- If the variable is a global variable then add the241 -- representation function before the choose function.242 if ((CASL_AS_Basic_CASL.Qual_var v s r) `elem` globalVars)243 then244 -- Global variable245 mkChooseFunOp s $ mkSortBarRepOp s $v'246 else247 -- Local variable248 mkChooseFunOp s $v'356 in case (Map.lookup v vsm) of 357 Nothing -> 358 error $ "CspCASLProver.TransProcesses.cspCaslTransRecord: Variable not found in vsm:" ++ show v 359 Just varSource -> 360 case varSource of 361 PrefixChoice -> mkChooseFunOp s $ projFlatOp v' 362 ChanSendOrRec declaredChanSort -> 363 mkChooseFunOp s $ mkSortBarRepOp declaredChanSort v' 364 GlobalParameter -> mkChooseFunOp s $ mkSortBarRepOp s v' 249 365 } 250 366 251 -- | Translate a process term in to Isabelle HOL. The first parameter252 -- decides if we should land in the alphabet or in a bar type. Both253 -- of these are related by Abstraction and Representation fucntions254 -- in Isabelle. The second parameter is he global variables of the255 -- process. The third parameter is the data part (CASL signature)256 -- for translating the translation of terms.257 trans Term :: Bool ->CASL_Sign.Sign () () -> CASL_Sign.Sign () () ->258 CASL_Sign.Sign () () -> FQProcVarList ->259 CASL_AS_Basic_CASL.TERM () -> Term260 trans Term toAlphabet caslSign pcfolSign cfolSign globalVarscaslTerm =261 let strs = CFOL2IsabelleHOL.getAssumpsToks caslSign in262 case caslTerm of263 -- if the term is just a variable then we need to check if its264 -- global and if we land in the alphabet or not. Each case has265 -- different behaviour.266 CASL_AS_Basic_CASL.Qual_var v s r->267 let v' = mkFree $ CFOL2IsabelleHOL.transVar strs v268 in269 -- Check if the variable is a global variabe270 if ((CASL_AS_Basic_CASL.Qual_var v s r) `elem` globalVars)271 then272 -- Its a global Variable273 -- Check if we are to land in the alphabet or now274 if (toAlphabet)275 then276 -- Land in the Alphabet277 (mkSortBarRepOp s)v'278 else279 -- Land in the Bar Types280 v' -- Its already in the Bar Ype as its global281 else282 -- Its a local Variable283 -- Check if we are to land in the alphabet or now284 if (toAlphabet)285 then286 -- Land in the Alphabet287 v' -- Its already in the alphabet as its local288 else289 -- Land in the Bar Types290 (mkSortBarAbsOp s) v'291 292 -- otherwise (not a variable) we add a classOp and constructor293 -- around it and translate the arguments with the transCaslTermWithoutWrap294 -- translator that adds a chooseOp, representation and295 -- abstraction fucntiosn where needed.296 _ -> let sort = CASL_Sign.sortOfTerm caslTerm297 -- Make a haskell function that will apply the constructor around298 --an Isabelle term.299 constructor = mkPreAlphabetConstructorOp sort300 -- Build the translation of the term wrapped in the constructor301 --wrapped in the class operation.302 isaCaslTerm = classOp $ constructor $303 transCaslTermWithoutWrappcfolSign cfolSign304 globalVarscaslTerm305 in if (toAlphabet)306 thenisaCaslTerm307 else (mkSortBarAbsOp sort) isaCaslTerm367 -- | Translate a CASL term into an Isabelle term. The result of this function 368 -- | depends on the term target. a target of TermPrefix indicates we must land 369 -- | in the alphabet and have a flat constructor wrapped around the 370 -- | translation. A ChanSendOrParam indicates that the translated term will be 371 -- | used in a channel send operator or as a parameter to a named process. The 372 -- | translation also changes depending on the source of the variables used. 373 transCASLTerm :: CASL_Sign.Sign () () -> CASL_Sign.Sign () () -> 374 CASL_Sign.Sign () () -> VSM -> TermTarget -> 375 CASL_AS_Basic_CASL.TERM () -> Term 376 transCASLTerm caslSign pcfolSign cfolSign vsm termTarget caslTerm = 377 let strs = CFOL2IsabelleHOL.getAssumpsToks caslSign 378 -- We make a case on the type of term, then on the term target, then if we 379 -- have a variable we make a case on the source of the variable 380 in case caslTerm of 381 -- Variable 382 CASL_AS_Basic_CASL.Qual_var v s _ -> 383 let v' = mkFree $ CFOL2IsabelleHOL.transVar strs v 384 in case termTarget of 385 TermPrefix -> 386 case (Map.lookup v vsm) of 387 Nothing -> error $ "CspCASLProver.TransProcesses.transTerm: Variable not found in vsm:" ++ show v 388 Just varSource -> 389 case varSource of 390 PrefixChoice -> v' -- the variable is already ok 391 ChanSendOrRec declaredChanSort -> 392 flatOp $ mkSortBarRepOp declaredChanSort v' 393 GlobalParameter -> flatOp $ mkSortBarRepOp s v' 394 ChanSendOrParam t -> 395 case Map.lookup v vsm of 396 Nothing -> error $ "CspCASLProver.TransProcesses.transTerm: Variable not found in vsm:" ++ show v 397 Just varSource -> 398 case varSource of 399 PrefixChoice -> 400 mkSortBarAbsOp t $ projFlatOp v' 401 ChanSendOrRec declaredChanSort -> 402 if declaredChanSort == t 403 then v' 404 else mkSortBarAbsOp t $ 405 mkSortBarRepOp declaredChanSort v' 406 GlobalParameter -> 407 if s == t 408 then v' 409 else mkSortBarAbsOp t $ 410 mkSortBarRepOp s v' 411 -- Other (not a variable) 412 _ -> let sort = CASL_Sign.sortOfTerm caslTerm 413 -- Make a Haskell function that will apply the constructor 414 -- around an Isabelle term. 415 constructor = mkPreAlphabetConstructorOp sort 416 -- Build the translation of the term wrapped in the 417 -- constructor wrapped in the class operation. 418 isaCaslTerm = classOp $ constructor $ 419 transCaslTermComputation pcfolSign cfolSign 420 vsm caslTerm 421 in case termTarget of 422 TermPrefix -> flatOp isaCaslTerm 423 ChanSendOrParam t -> (mkSortBarAbsOp t) isaCaslTerm 308 424 309 425 -- | Translate a CASL Term to an Isabelle Term using the exact translation as is 310 426 -- done in the comorphism composition 311 -- CASL2PCFOL;defaultCASL2SubCFOL;CFOL2IsabelleHOL. With one exception, If we 312 -- are translating a variable then we must first add the correct choose 313 -- function around it to change it from an equivalence class to value of the 314 -- underlying sort. Also if we are translating a variable and the variable is 315 -- a global process variable then we must first apply Isabelle's 316 -- representation function to the variable. This function will always return a 317 -- term that is in the basic Sorts. i.e. to make it part of the alphabet it 318 -- will need to be wrapped up in a class operation with the necessary 319 -- constructor. We need the PCFOL and CFOL signature of the data part after 427 -- CASL2PCFOL;defaultCASL2SubCFOL;CFOL2IsabelleHOL with out customised 428 -- variable translation (see cspCaslTransRecord for where that customisation 429 -- is define). The resulting Isabelle term of this function will be of the 430 -- underlying sort types, thus can be used as parameters of CASL functions in 431 -- the data part. We need the PCFOL and CFOL signature of the data part after 320 432 -- translation to CFOL to translate the formula. 321 transCaslTerm WithoutWrap:: CASL_Sign.Sign () () -> CASL_Sign.Sign () () ->322 FQProcVarList-> CASL_AS_Basic_CASL.TERM () -> Term323 transCaslTerm WithoutWrap pcfolSign cfolSign globalVarsterm =324 let -- Function to remove subsorting - from comorphism CAS 2PCFOL433 transCaslTermComputation :: CASL_Sign.Sign () () -> CASL_Sign.Sign () () -> 434 VSM -> CASL_AS_Basic_CASL.TERM () -> Term 435 transCaslTermComputation pcfolSign cfolSign vsm term = 436 let -- Function to remove subsorting - from comorphism CASL2PCFOL 325 437 rmSub = CASL2PCFOL.t2Term 326 438 -- Remove subsorting from the term 327 439 termNoSub = rmSub term 328 -- Function to remove partiality - from comorphism CAS 2SubPCFOL440 -- Function to remove partiality - from comorphism CASL2SubPCFOL 329 441 -- This needs to match the translation CASL2SubCFOL.defaultCASL2SubCFOL 330 442 b = True -- We want unique bottom elements per sort … … 335 447 rmPartial = CASL_Simplify.simplifyTerm id . 336 448 CASL2SubCFOL.codeTerm b bsrts 337 -- Function to tran alate to Isabelle - from comorphism CFOL2IsabelleHOL449 -- Function to translate to Isabelle - from comorphism CFOL2IsabelleHOL 338 450 -- We need the CFOL signature to translate the terms properly 339 451 tyToks = CFOL2IsabelleHOL.typeToks cfolSign … … 341 453 strs = CFOL2IsabelleHOL.getAssumpsToks cfolSign 342 454 toIsabelle = foldTerm $ cspCaslTransRecord cfolSign 343 globalVars tyToks trForm strs455 tyToks trForm strs vsm 344 456 --CFOL2IsabelleHOL.transFORMULA cfolSign tyToks trForm strs 345 457 in toIsabelle $ rmPartial $ termNoSub … … 347 459 -- | Translate a fully qualified CASL formula into an Isabelle Term using the 348 460 -- exact translation as is done in the comorphism composition 349 -- CASL2PCFOL;defaultCASL2SubCFOL;CFOL2IsabelleHOL with one exception. The 350 -- exception is that a variable must have a choose function wrapped around it 351 -- and possible also a representation function (if it is a global 352 -- variable). We need the PCFOL and CFOL signature of the data part after 353 -- translation to CFOL to translate the formula. 354 transFormula :: CASL_Sign.Sign () () -> CASL_Sign.Sign () () -> FQProcVarList -> 461 -- CASL2PCFOL;defaultCASL2SubCFOL;CFOL2IsabelleHOL except translate CASL terms 462 -- using the CASL term translation for computation, where the terms will be 463 -- translated such that they are of the underlying sort types and thus can be 464 -- used as operands to the formula operators. 465 transFormula :: CASL_Sign.Sign () () -> CASL_Sign.Sign () () -> VSM -> 355 466 CASL_AS_Basic_CASL.FORMULA () -> Term 356 transFormula pcfolSign cfolSign globalVarsformula =467 transFormula pcfolSign cfolSign vsm formula = 357 468 let -- Function to remove subsorting - from comorphism CAS2PCFOL 358 469 rmSub = CASL2PCFOL.f2Formula … … 369 480 CASL2SubCFOL.codeFormula b bsrts 370 481 -- Function to tranalate to Isabelle - from comorphism CFOL2IsabelleHOL 371 -- We need the CFOL signature to translate the formula sproperly482 -- We need the CFOL signature to translate the formula properly 372 483 tyToks = CFOL2IsabelleHOL.typeToks cfolSign 373 484 trForm = CFOL2IsabelleHOL.formTrCASL 374 485 strs = CFOL2IsabelleHOL.getAssumpsToks cfolSign 375 486 toIsabelle = foldFormula $ cspCaslTransRecord cfolSign 376 globalVars tyToks trForm strs487 tyToks trForm strs vsm 377 488 --CFOL2IsabelleHOL.transFORMULA cfolSign tyToks trForm strs 378 489 in toIsabelle $ rmPartial $ formulaNoSub -
trunk/CspCASLProver/Utils.hs
r12763 r12792 21 21 , addAllCompareWithFun 22 22 , addAllIntegrationTheorems 23 , addDataSetTypes24 23 , addEqFun 25 24 , addEventDataType … … 33 32 ) where 34 33 35 import CASL.AS_Basic_CASL (SORT, OpKind(..) )34 import CASL.AS_Basic_CASL (SORT, OpKind(..), TERM(..)) 36 35 import qualified CASL.Fold as CASL_Fold 37 36 import qualified CASL.Sign as CASLSign … … 48 47 49 48 import CspCASL.AS_CspCASL_Process (PROCESS_NAME) 50 import CspCASL.SignCSP (C hanNameMap, CspSign(..), ProcProfile(..),51 CspCASLSen(..), isProcessEq)49 import CspCASL.SignCSP (CspCASLSign, ccSig2CASLSign, ChanNameMap, CspSign(..), 50 ProcProfile(..), CspCASLSen(..), isProcessEq) 52 51 53 52 import CspCASLProver.Consts 54 53 import CspCASLProver.IsabelleUtils 55 import CspCASLProver.TransProcesses (transProcess )54 import CspCASLProver.TransProcesses (transProcess, VarSource(..)) 56 55 57 56 import qualified Data.List as List … … 134 133 lhs = termAppl lhs_a lhs_b 135 134 lhs_a = termAppl (conDouble funName) x 136 lhs_b = termAppl (conDouble (sort'Constructor)) y135 lhs_b = termAppl (conDouble sort'Constructor) y 137 136 sort'SuperSet =CASLSign.supersortsOf sort' caslSign 138 137 commonSuperList = Set.toList (Set.intersection … … 142 141 -- If there are no tests then the rhs=false else 143 142 -- combine all tests using binConj 144 rhs = if (null allTests)143 rhs = if null allTests 145 144 then false 146 145 else foldr1 binConj allTests … … 152 151 -- Test 4 = test equality at: super sorts vs super sorts 153 152 allTests = concat [test1, test2, test3, test4] 154 test1 = if (sort == sort')then [binEq x y] else []153 test1 = if sort == sort' then [binEq x y] else [] 155 154 test2 = if (Set.member sort sort'SuperSet) 156 155 then [binEq x (mkInjection sort' sort y)] … … 559 558 560 559 -- | Add the Event datatype (built from a list of channels and the subsort 561 -- relation) to an Isabelle theory. BUG560 -- relation) to an Isabelle theory. 562 561 addEventDataType :: Rel.Rel SORT -> ChanNameMap -> IsaTheory -> IsaTheory 563 562 addEventDataType sortRel chanNameMap isaTh = … … 566 565 in updateDomainTab eventDomainEntry isaTh 567 566 568 -- | Make a Domain Entry for the Event from a list of sorts. BUG567 -- | Make a Domain Entry for the Event from a list of sorts. 569 568 mkEventDE :: Rel.Rel SORT -> ChanNameMap -> DomainEntry 570 mkEventDE sortRelchanNameMap =569 mkEventDE _ chanNameMap = 571 570 let flat = (mkVName flatS, [alphabetType]) 572 -- Make a constuctor type pair for a channel with a target sort 573 mkCon (c, s) = (mkVName (mkEventChannelConstructor c s), 574 [mkSortBarType s]) 575 -- Make pairs of channel and sorts, where the sorts are all the possible 576 -- predecessors of the sort of the channel. 577 mkChanSortPairs (cn,sort) = 578 -- get all predecessors including s 579 let subSorts = Set.insert sort (Rel.predecessors sortRel sort) 580 mkPair s = (cn,s) 581 in Set.toList $ Set.map mkPair subSorts 571 -- Make a constuctor type for a channel with a target sort 572 mkChanCon (c, s) = (mkVName (convertChannelString c), 573 [mkSortBarType s]) 574 -- Make pairs of channel and sorts, where we only build the declared 575 -- channels and not the subsorted channels. 576 mkAllChanCons = map mkChanCon $ Map.toList chanNameMap 582 577 -- We build the event type out of the flat constructions and the list of 583 578 -- channel constructions 584 in (eventType, (flat:(map mkCon $ concat $ map mkChanSortPairs $ 585 Map.toList chanNameMap))) 579 in (eventType, (flat:mkAllChanCons)) 586 580 587 581 -- | Add the eq function to an Isabelle theory using a list of sorts … … 626 620 sen = TypeDef flatType subset (IsaProof [] (By proof')) 627 621 namedSen = (makeNamed sortFlatString sen) 628 in (isaTh_sign, isaTh_sen ++ [namedSen])629 630 -- | Function to add all the Data Set types. These capture the original sorts by631 -- creating sets of the bar varients. We use these sets when communicating632 -- over a channel.633 addDataSetTypes :: [SORT] -> IsaTheory -> IsaTheory634 addDataSetTypes sorts isaTh = foldl addDataSetType isaTh sorts635 636 -- | Function to add the Data Set type of a sort to an Isabelle theory.637 addDataSetType :: IsaTheory -> SORT -> IsaTheory638 addDataSetType isaTh sort =639 let sortDataSetString = mkSortDataSetString sort640 dataSetType = Type {typeId = sortDataSetString,641 typeSort = [],642 typeArgs =[]}643 isaTh_sign = fst isaTh644 isaTh_sen = snd isaTh645 x = mkFree "x"646 y = mkFree "y"647 -- y in sort_Bar648 condition1 = binMembership y (conDouble $ mkSortBarString sort)649 -- x = Abs_sort_Bar y650 condition2 = binEq x ((mkSortBarAbsOp sort) y)651 -- y in x_Bar /\ x = Flat y652 condition_eq = binConj condition1 condition2653 exist_eq = termAppl (conDouble exS) (Abs y condition_eq NotCont)654 subset = SubSet x (mkSortBarType sort) exist_eq655 proof' = AutoSimpAdd Nothing [(mkSortBarString sort) ++ "_def"]656 sen = TypeDef dataSetType subset (IsaProof [] (By proof'))657 namedSen = (makeNamed sortDataSetString sen)658 622 in (isaTh_sign, isaTh_sen ++ [namedSen]) 659 623 … … 698 662 -- signatures of the data part after translation to PCFOL and CFOL to pass 699 663 -- along the process translation. 700 addProcMap :: [Named CspCASLSen] -> C ASLSign.Sign () ()->664 addProcMap :: [Named CspCASLSen] -> CspCASLSign -> 701 665 CASLSign.Sign () () -> CASLSign.Sign () () -> 702 666 IsaTheory -> IsaTheory 703 addProcMap namedSens c aslSign pcfolSign cfolSign isaTh =704 let 667 addProcMap namedSens ccSign pcfolSign cfolSign isaTh = 668 let caslSign = ccSig2CASLSign ccSign 705 669 -- Translate a fully qualified variable (CASL term) to Isabelle 706 670 tyToks = CFOL2IsabelleHOL.typeToks caslSign … … 729 693 varTerms = map transVar fqVars 730 694 lhs = procMapTerm (foldl termAppl (procNameTerm) varTerms) 731 rhs = transProcess caslSign pcfolSign cfolSign fqVars proc 695 addToVdm fqvar vdm' = 696 case fqvar of 697 Qual_var v _ _ -> Map.insert v GlobalParameter vdm' 698 _ -> error "CspCASLProver.Utils.addProcMap: Term other than fully qualified variable in process parameter variable list" 699 vdm = foldr addToVdm Map.empty fqVars 700 rhs = transProcess ccSign pcfolSign cfolSign vdm proc 732 701 in binEq lhs rhs 733 702 -- to avoid warnings we specify the behaviour on CASL sentences. This -
trunk/Isabelle/IsaConsts.hs
r11805 r12792 96 96 membershipS :: String 97 97 membershipS = "op :" 98 99 -- | Imange of functions 100 imageS :: String 101 imageS = "image" 102 103 rangeS :: String 104 rangeS = "range" 98 105 99 106 -- * some stuff for Isabelle … … 341 348 -- * TERM CONSTRUCTORS 342 349 -- | binary junctors 343 binConj, binDisj, binImpl, binEqv, binEq, binEqvSim, binUnion, binMembership 350 binConj, binDisj, binImpl, binEqv, binEq, binEqvSim, binUnion, 351 binMembership, binImageOp 344 352 :: Term -> Term -> Term 345 353 binConj = binVNameAppl conjV … … 351 359 binUnion = binVNameAppl unionV 352 360 binMembership = binVNameAppl membershipV 361 binImageOp = binVNameAppl imageV 362 363 rangeOp :: Term -> Term 364 rangeOp t = termAppl (con rangeV) t 353 365 354 366 -- | HOL function application … … 554 566 membershipV :: VName 555 567 membershipV = VName membershipS $ Just $ AltSyntax "(_ \\<in>/ _)" [65,66] 65 568 569 imageV :: VName 570 imageV = VName imageS $ Just $ AltSyntax "(_ `/ _)" [65,66] 65 571 572 rangeV :: VName 573 rangeV = VName rangeS Nothing 556 574 557 575 -- **** keywords in theory files from the Isar Reference Manual 2005