AppendixC.PredenedModule215 coercion,88,89 coercionoperations,57 comment,73 comparison,94,125 ofrecords,107 ofvariants,115 componentname resolutionof,77 components,107 concatenate,109 connect,14,121 constant,88 constant,22 constantcopy,88,112,113,119, 127 constraint,131 ConstraintErrorexception,132 ConstraintFailureexception,132 conversion<strong>and</strong>resolution,72 convertoperator,106 copyof,29 copyingavalue,94 create,124 createof,15,16,24 currentprogram,129 deadcode,91 declaration,18,19 hidingnotallowed,20 declarationslist,76 denition,18 denitionsmodule,21,77 denitionsmodules,19 Depletionexception,95 discard,57,95,95 Discardedexception,29,119,123 discardedexceptions,78 Disconnectedexception,29,99, 122,123 dissolve,116 DivideByZeroexception,104 DuplicateKeyexception,43,48, 111,112 element,107 elementtype,107 else,97 empty,61,120 enabledclause,99 entrytypestate,118 enumerationtypefamily,102 evaluate,seeexpressionblock eventguard,26,98 every,110 everyof,42 exception,11,119,122 denition,22 h<strong>and</strong>ler,11,96 nameresolution,78 return,123 exists,110 existsof,48 exitnameresolution,79 exit,79,88,123 exit,101 exitformaltypestate,119 exittypestate,24 expressionblock,59,88,100{101 extract,42,111 fairness inreceivestatement,122 inselectstatement,99 lterprogram,12 forenumerate,106 forstatement,46 for-inspect,113 forall,110 formaltypestate,86 full,23,78,85 function call,121 functioncall,122 functionnotation,12 generator process,125 generatorprocess,125 guard,98
216C.1.<strong>Reference</strong>s guardedselect,26 h<strong>and</strong>lerclause,79,96 <strong>Hermes</strong>,3{5 researchdirections,67 typesystem,55 hide,117 hidestatement,63 Hoare,C.A.R.,55 identiers,74 if,97 importslist,19,78 inferencefunction elementtypeof,151 sameas,152 inferencerule,151 inferencerules,21,80 inferreddeclaration,81 init,23,78,84{86 init(),56 initializationport,8,19 inport,118 inputport,8,22,94,118,119 aseventguard,98 denition,23,24 enabled,26 insert,29,111,111 insert-at,111 inspect,46,112 inspectvariable,112 integerliterals,50 integertypefamily,103 interface,11,22,60 denition,22,24 InterfaceMismatchexception,17, 124,124 key,108,110{112 keys(),43 keyword,74 latebinding,5 lexicalanalysis,71 linkinglist,51,79 literal named,73 numeric,73 real,73 string,73 literals,104 long-livedsystems,55 mainclause,96 mainprogram,124 meet,89 merge,112 merge-at,112 messagetype,118 minimumformaltypestate,119 default,119 minimumtypestate,87 mod,104 module,4 move,93 movingavalue,93 movingversuscopying,29,93 nameequivalenceoftypedenitions,24 namespace,75,78 ofbasevariables,76 ofcomponentnames,77 oftypeidentiers,77 ofuser-denedexceptionnames, 78 namedliteral,73 new,14,107,119,120 nominaltypefamily,101,105 normalexit,96 not,105 notation association,121 function,121 positional,121 NotFoundexception,42,110{112 numericliteral,73 object-orientedlanguages,27 occurrence applied,72
- Page 1 and 2:
DavidF.BaconArthurP.GoldbergAndyLow
- Page 3 and 4:
Preface Thisdocumentcontainsatutori
- Page 5 and 6:
iv3TypeandTypestateChecking 5Resear
- Page 8:
Tutorial PartI 1
- Page 11 and 12:
ortransactions.AHermesmoduleisastra
- Page 13 and 14:
61.2.GettingStarted|ASimpleHermesPr
- Page 15 and 16:
81.2.GettingStarted|ASimpleHermesPr
- Page 17 and 18:
101.2.GettingStarted|ASimpleHermesP
- Page 19 and 20:
121.4.PuttingProcessesTogether thec
- Page 21 and 22:
141.4.PuttingProcessesTogether newI
- Page 23 and 24:
fullycheckedfortypeandtypestateerro
- Page 25 and 26:
constructs:thenewinput-port,connect
- Page 27 and 28:
201.5.DeclarationsandDenitions whil
- Page 29 and 30:
221.5.DeclarationsandDenitions Stan
- Page 31 and 32:
whichtheoutputportconnects|calledth
- Page 33 and 34:
261.6.ASimpleServer begin QuitCM:Qu
- Page 35 and 36:
281.6.ASimpleServer towritedataabst
- Page 37 and 38:
toaservice,whileretainingtheability
- Page 39 and 40:
322.1.Requirements PutLine PutLine
- Page 41 and 42:
342.3.Interfaces WMInterface:callme
- Page 43 and 44:
asmallchangetotheinterfaceFilter.Re
- Page 45 and 46:
382.5.Front-endProcess callParms.Ge
- Page 47 and 48:
402.5.Front-endProcess paringavalue
- Page 49 and 50:
ationtable[expr].Wehaveencounteredt
- Page 51 and 52:
ishiddenandinnowayaectsthesemantics
- Page 53 and 54:
462.7.TheWindowManager callCurrentW
- Page 55 and 56:
name.Ifwewaitedtobuildtheapplicatio
- Page 57 and 58:
502.8.CreatingaWindowApplication re
- Page 59 and 60:
522.8.CreatingaWindowApplication be
- Page 61 and 62:
examplesillustratedhere. errorhandl
- Page 63 and 64:
563.TypeandTypestateChecking anerro
- Page 65 and 66:
583.TypeandTypestateChecking Therei
- Page 67 and 68:
604.1.ExpressionBlocks anexpression
- Page 69 and 70:
624.3.Variants thevariantcomponents
- Page 71 and 72:
thetypestate(i.e.addattributes),but
- Page 73 and 74:
accesscontrol{anyonecangetit. 664.4
- Page 75 and 76:
685.ResearchDirectionsinHermes
- Page 78 and 79:
6Introduction Thereferencemanualpre
- Page 80 and 81:
7LexicalandSyntacticRules lectionso
- Page 82 and 83:
8Resolution name,attributename,exce
- Page 84 and 85:
8.1.2ComponentNames eachhaveacompon
- Page 86 and 87:
onthehandlerandusedontheexitstateme
- Page 88 and 89:
theelementwillalsobeknownbyapplying
- Page 90 and 91:
documentationpurposesevenwheretheya
- Page 92 and 93:
ments.Therstargumenttocasemustbeava
- Page 94 and 95:
Ifinit(CM)ispresentandCMisacallmess
- Page 96 and 97:
6.Determinethepostconditionsforeach
- Page 98 and 99:
droppedattributesafternormalcomplet
- Page 100 and 101:
11 HermesOperations Throughoutthere
- Page 102 and 103:
Thediscardstatementremovesthevaluef
- Page 104 and 105:
Ifnoneoftheclausescanexitsnormally,
- Page 106 and 107:
Ifthereisanoptionalselectexpression
- Page 108 and 109:
stmemberisanatomwithprintnamematchi
- Page 110 and 111:
types.Additionally,theoperations\an
- Page 112 and 113:
Less,Less-equal,Greater,Greater-equ
- Page 114 and 115:
RecordTypeFamily 11.5RecordOperatio
- Page 116 and 117:
valueofthetable,ifany,isdiscarded.
- Page 118 and 119:
thetableisordered,theelementisinser
- Page 120 and 121:
notallowedonconstantcopies.Avariabl
- Page 122 and 123:
thereisnoselectedelement,aNotFounde
- Page 124 and 125:
willbeuninitialized,andthedestinati
- Page 126 and 127:
Itistheabilityforprogramstosendandr
- Page 128 and 129:
Connect Theconnectstatementhastwoop
- Page 130 and 131:
possible,andstoresitinadestinationv
- Page 132 and 133:
incompatiblewiththeinputporttypeoft
- Page 134 and 135:
Inspect-polymorph willincludefinit(
- Page 136 and 137:
theprogramwhichembedsit.Thereforeth
- Page 138 and 139:
type).Ifthecheckfails,theexceptionD
- Page 140 and 141:
isusuallygeneratedasacoercionwhenme
- Page 142 and 143:
A.1LexicalRules Webeginwiththerules
- Page 144 and 145:
accuracy against andy assert drop e
- Page 146 and 147:
Thesimplestatements: simple{stateme
- Page 148 and 149:
oolean{guard event{guard::=eventinp
- Page 150 and 151:
::=(expression)AppendixA.HermesConc
- Page 152 and 153:
user{exception constant{parameters
- Page 154 and 155:
formal{variable module{name::=ident
- Page 156 and 157:
Typestatesappearinginparticularcont
- Page 158 and 159:
destination,source,andposition.Some
- Page 160 and 161:
operandwillnolongerbeinitialized. B
- Page 162 and 163:
Followingaretheinferencefunctionsap
- Page 164 and 165:
lowestentrycondition(message,port):
- Page 166 and 167:
copy(source,destination):Foreachatt
- Page 168 and 169:
assert(continued) Description:Evalu
- Page 170 and 171:
case(continued) Description:Copythe
- Page 172 and 173: copy(continued) Preconditions: unco
- Page 174 and 175: drop(continued) SpecialRules:Thenum
- Page 176 and 177: exists(continued) SpecialRules:Thes
- Page 178 and 179: forall(continued) Description:Ifeve
- Page 180 and 181: greater(continued) Description:Ifso
- Page 182 and 183: insert{at(table,element,position) T
- Page 184 and 185: integer{literal(result) TypeRules:
- Page 186 and 187: merge{at(continued) Description:Rem
- Page 188 and 189: not(result,source) TypeRules: Appen
- Page 190 and 191: print(variable) TypeRules:None Prec
- Page 192 and 193: emove(element,table) TypeRules: App
- Page 194 and 195: select(continued) SpecialRules:Allt
- Page 196 and 197: subtract(result,source1,source2) Ty
- Page 198 and 199: unary{minus(result,source) TypeRule
- Page 200 and 201: wrap(continued) Preconditions: var(
- Page 202 and 203: definitions predefined:using() Appe
- Page 204 and 205: );'named'->typename:typenameffullg
- Page 206 and 207: {{Specicinformationneededtocomplete
- Page 208 and 209: attrdefinition:record( attributeid:
- Page 210 and 211: statement:record( id:statementid, o
- Page 212 and 213: {{Ablockstatementqualieridentiesthe
- Page 214 and 215: {{expressionisfalse. ifqualifier:re
- Page 216 and 217: {{expression.The'element'rootvariab
- Page 218 and 219: [ASU88]AlfredV.Aho,RaviSethi,andJer
- Page 220 and 221: [SYB87a]RobertE.Strom,ShaulaAlexand
- Page 224 and 225: AppendixC.PredenedModule217 dening,
- Page 226: variablename discarded,29 variant,6