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.

AppendixB <strong>Hermes</strong>Operations Thischapterlistsallthehermesoperations<strong>and</strong>providespreciserulesfor typechecking,typeinferencing,<strong>and</strong>typestatecheckingeachoperation. AtypicaloperationdescriptionappearsinFigureB.1.Theexamplewillbe usedthroughoutthissection. B.1OperationDescriptions merge{at(destination,source,position)Exceptions:Depletion, TypeRules: Preconditions:<br />

destination2orderedtable source2table destinationsource predefined!integer RangeError,<br />

init(source) (DuplicateKey)<br />

Description:Removealltableelementsfromsource<strong>and</strong>insertthem duplicatekey(destination) var(destination) init(destination) init(position) var(source) Postconditions:<br />

intodestinationsothattheresultingpositionofthersttransferred makeuninit(source)<br />

element,ifany,willbeequaltoposition.Allothertransferredelements killconstraints(destination)<br />

Qualier:absent <strong>and</strong>followingthelasttransferredelement. Allelementsofdestinationthatformerlyoccupiedpositionsatposition willfollowconsecutively,inthesameorderastheyappearedinsource. orbeyondareshiftedsothattheyappearinthesamerelativeorder, FIGUREB.1.SampleoperationdescriptionSeex11.6,p.112

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

Saved successfully!

Ooh no, something went wrong!