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.

subtract(result,source1,source2) TypeRules: AppendixB.<strong>Hermes</strong>Operations189<br />

Preconditions: source12numeric init(source2) init(source1) result2numeric resultsource1source2 source22numeric Exceptions:Depletion<br />

Description:Subtractsource2fromsource1<strong>and</strong>storetheresultinresult. Qualier:absent var(result) Postconditions: makeinit(result)<br />

the{element(result,table) TypeRules:<br />

table2table elementtypeof(table) table2copyable Exceptions:Depletion, NotFound,(Uncopyable) Seex11.4,p.104<br />

Preconditions: SpecialRules:Thestatementqualierisaselector.Theresultvariable init(table) uncopyable(table) var(result) SeealsoSpecialRules Postconditions:<br />

typeoftheelementvariableidentiedintheselectormustbetheelementtypeoftable.Theentrytypestatefortheselectoristheentry<br />

identiedinthatselectormustbeoftypepredefined!boolean<strong>and</strong> musthavetheinitattributeonnormalexitfromtheselector.The SeealsoSpecialRules moveelementts(table,result)<br />

Description:Copyanelementfromtablethatsatisestheselectoridentiedintheinstructionqualier,<strong>and</strong>storethecopyinresult.<br />

typestateofthetheelementstatement.Thetypestateonnormalexit tionforadiscussionofhowtypestatesarecomputedforselectors. minusanyattributesinvolvingtheresult<strong>and</strong>elementvariable.SeeSec-<br />

fromthetheelementstatementiscomputedbyapplyingthepostconditionruleslistedabovetothenormalexittypestateoftheselector,<br />

Qualier:selector Seex11.6,p.109

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

Saved successfully!

Ooh no, something went wrong!