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

Create successful ePaper yourself

Turn your PDF publications into a flip-book with our unique Google optimized e-Paper software.

152B.1.OperationDescriptions inferthetypeoftheleft-h<strong>and</strong>oper<strong>and</strong>,ifeithertheruleisoftheassignment variety,orifthetypeoftheright-h<strong>and</strong>oper<strong>and</strong>isalreadyknown. Aninferencerulecanbeusedfortypechecking.Itcanalsobeusedto<br />

ofeitheroper<strong>and</strong>canbeinferredfromthetypeoftheother. fromthemergeatoperation: tion,whichidentiestwooper<strong>and</strong>sthatmusthavethesametype.Allsuch rulesinanoperationdescriptionaredisplayedasinthefollowingexample Inthiscase,thenormalasymmetryofinferencerulesvanishes:thetype Aspecialnotationisusedforrulesinvolvingthesameasinferencefunc-<br />

B.1.3Preconditions Precondition<strong>and</strong>postconditionrulesappearinside-by-sideboxesbelow thetyperules. destinationsource<br />

timetheoperationistobeexecuted.Allpreconditionsmustbestatically veriablebythecompiler. Thepreconditionrulesspecifyvariousconditionsthatmustholdatthe<br />

deneconditionsunderwhichanexceptionisknowntobepossible.Forexample,thefollowingpreconditionindicatesthatifthedestinationoper<strong>and</strong><br />

isakeyedtable,thentheoperationcanraiseDuplicateKey: init(source) operationcantakeplace. listofoper<strong>and</strong>s.Anexamplefromthemergeatoperationis: Some\preconditions"donotcheckforanytypestateattributes.They Thisstatesthatthesourceoper<strong>and</strong>mustbeinitializedbeforethemergeat Apreconditiontakestheformofapreconditionfunctionfollowedbya<br />

B.4. B.1.4Postconditions Thepostconditionrulescharacterizetheeectsofanormal(non-exception) executionoftheoperation.Eachruleisspeciedviaapostconditionfunctionfollowedbyalistofoper<strong>and</strong>s.Anexamplefromthemergeatoperation<br />

is: Allthepreconditionfunctions<strong>and</strong>theirmeaningsarelistedinsection duplicatekey(destination)<br />

makeuninit(source)

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

Saved successfully!

Ooh no, something went wrong!