28.01.2015 Views

Hermes: A Tutorial and Reference Manual - Researcher - IBM

Hermes: A Tutorial and Reference Manual - Researcher - IBM

Hermes: A Tutorial and Reference Manual - Researcher - IBM

SHOW MORE
SHOW LESS

You also want an ePaper? Increase the reach of your titles

YUMPU automatically turns print PDFs into web optimized ePapers that Google loves.

it.Avariableisconstantataparticularprogrampointif: 10.6Constants Althoughweusetheterm\variable"todenoteacellwhichcanholdavalue <strong>and</strong>appearasanoper<strong>and</strong>,sometimes\variables"are\constant"!Thatis, sometimesitisonlylegaltoaccessthevalueofavariablebutnottochange 8810.5.Coercions<br />

Itisabasevariable,<strong>and</strong>anenclosingblockstatementliststhatbase Itisacomponentofaninitializedcallmessage,<strong>and</strong>thecallmessage Itisabasevariablewhichwasinitializedtoaconstantcopy.(See Theprogrampointisinsideanexpressionblock<strong>and</strong>thebasevariable typedenitionliststhatcomponentasaconstant. selector,inspect,forstatements.) variableasconstant.<br />

typestatetoitssuccessorstatements: Herearethestepsincheckingasinglestatement<strong>and</strong>propagatinganew 10.7HowtoApplytheTypestateRules Itisacomponentofaconstant. wasdeclaredoutsidethatexpressionblock.<br />

2.Ifanyrequiredattributeismissing,thisisanerror. 3.Introducecoercionswhichdropattributeswhicharepresentbutare 1.Determinethepreconditionfortheoperation.Thereisatablegiving<br />

forbidden.Ifwecannotaddcoercionswithoutalsodroppingrequired exceptions. asetofpreconditionrulesforeachoperation.Theserulesdetermine:<br />

attributes,thenthisisanerror.Otherwise,wehavesucceededin (1)asetofrequiredattributes,(2)asetofforbiddenattributes,<br />

generatingatypestatewhichisconsistentwiththepreconditions. (3)theoper<strong>and</strong>smodiedbytheoperation,(4)possibleadditional<br />

4.Generateanerrorifanyvariablesmodiedbytheoperationareconstantseral\exception"outcomes.Thetableentryforeachoperationdenemal"outcomeforalloperations(exceptexit),<strong>and</strong>therecanbesev-<br />

whichexceptionoutcomestheoperationhas.Thetablemaylistaddi-<br />

5.Determinethesetofoutcomesoftheoperation.Thereisa\nortionalexceptionswhichtheoperationhasundercertaincircumstances

Hooray! Your file is uploaded and ready to be published.

Saved successfully!

Ooh no, something went wrong!