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.

11011.6.TableOperations ashorth<strong>and</strong>forwhere('true').Ifthemappinglisthasasingleexpression, <strong>and</strong>thetableisordered,thenexpressionisassumedtobeaposition<strong>and</strong>the selectedelementistheelementatthatposition.Thust[n]isshorth<strong>and</strong>for eintwhere(positionofe=n).Iftheaboveruledoesnotapply,<strong>and</strong><br />

toselectasingleelement;thepurposeofothersistoselectanentireset. elementsdependsupontheoperation.Thepurposeofsomeoperationsis illegal. =x<strong>and</strong>e.address=y).Ifnoneoftheserulesapply,orifmorethanone keyhasthecorrectnumberofvariables,theuseofthemappingselectoris themappinglisthaskexpressions,<strong>and</strong>onekeyhaskvariables,thekexpressionsareassumedtobecomparisonvaluesforthosekeys.Thusifthas<br />

typepersontable,thent[x,y]isshorth<strong>and</strong>foreintwhere(e.name<br />

anarbitrarychoiceismade. Whenthepurposeistoselectasingleelement,<strong>and</strong>noelementisselected, tableisordered,theearliestelementischosen.Ifthetableisunordered, exceptionNotFoundisraised.Ifmorethanoneelementisselected,<strong>and</strong>the Theresultisacopyofthechosenselectedelement,orelseNotFoundis Aselectorbyitselfinanexpressionistheoperationcalledtheelement. Selectorsappearaspartofseveraloperations.Theuseoftheselected<br />

raised.Theresulthastheelementtype<strong>and</strong>elementtypestate.Theelement Every typemustbecopyable. Theeveryoperationreturnsatablecontainingacopyofalltheselected elements.Iftheoriginaltablewasordered,thecopiedelementsareinthe sameorder.Theresultofeverywillbeanemptytableifnoelementsare Exists,Forall selected.Theelementtypemustbecopyable. secondary::=everyofselector<br />

selected;elseitreturnsfalse.Theforalloperationreturnsatrueboolean Theexistsoperationreturnsatruebooleanvalueifatleastoneelementis valueifallelementsareselected;elseitreturnsfalse. Insert,Insert-at secondary::=existsofselector<br />

simple{statement ::=forallofselector ::=insertelement{expressionintotable{variable [atposition{expression]

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

Saved successfully!

Ooh no, something went wrong!