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.

insert{at(table,element,position) TypeRules: AppendixB.<strong>Hermes</strong>Operations175<br />

Preconditions: table2orderedtable<br />

element predefined!integer Exceptions:Depletion,<br />

init(table) elementtypeof(table) RangeError,<br />

lowestelementstate(element,table) (DuplicateKey)<br />

Description:Inserttheobjectstoredinelementintotable,soastomake duplicatekey(table) var(element) init(position) var(table) Postconditions:<br />

thepositionofthenewlyinsertedelementintheresultingtableequal killconstraints(table) makeuninit(element)<br />

Qualier:absent inspect{polymorph(polymorph) positionhigherinthetable. ouslyoccupiedelementpositionsatorbeyondpositionareshiftedone toposition,<strong>and</strong>leavingelementuninitialized.Allelementsthatprevi-<br />

TypeRules: Preconditions: polymorph2polymorph Exceptions:Depletion, PolymorphMismatch Seex11.6,p.110<br />

SpecialRules:Theentrytypestateforthebodyclauseidentiedinthe istheexittypestateofthebodyclause,minusanyattributesinvolving statementqualieristheentrytypestatefortheinspectpolymorph variableidentiedinthequalierintotheformaltypestateappearingin init(polymorph) statement,plusallattributesresultingfromsubsitutionoftheelement thequalier.Theexittypestatefortheinspectpolymorphstatement Postconditions:SeeSpecialRules<br />

theelementvariableoranyvariablesdeclaredinthebody.

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

Saved successfully!

Ooh no, something went wrong!