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.

Ifinit(CM)ispresent<strong>and</strong>CMisacallmessage,thentheattributes theformaltypestatedenedforcomponentAinthetypedenitionfor aninitializedbuthiddenvariant. typestateofarevealedvariantmustbehigherthanthetypestateof variantV.Thisfollowsfromthefactthatwerequiretheseattributes tobepresentwhenwehidethevariant,<strong>and</strong>werequirethatthe 10.TypestateChecking87<br />

intheminimumtypestateofCMmustbepresent.Theseattributes<br />

isitselfuninitialized. typestateareillegal|e.g.anassignmenttorecordcomponentR.AwhenR Otherwiselegaloperationswhoseeectwouldbetoproduceaninvalid areobtainedbysubstitutingCMintotheformaltypestatedenedor impliedastheminimumtypestate.(Seediscussionofcallmessages.) discardedbytheprocessreceivingthecall. thatcertaincallparametersmustremaininitialized<strong>and</strong>cannotbe Thisisbecausetheprogrammerisallowedtostateintheinterface<br />

typestatewhenthesetofattributesoftherstisasubsetofthesetofattributesofthesecond.Themeetoftwotypestatesissimplytheintersection<br />

Thesemilatticestructureissimple.Atypestateislowerthanasecond oftheattributesets. 10.4OrderingofTypestates<br />

10.5Coercions Coercionsaretypestate-loweringoperationswhichareinsertedautomaticallybythecompiler.Therearethreecoercions:<br />

hideVremovestheattributecase(V,V.X),alongwithanyother dropconstraint(P1,...,Pn)removestheattributeconstraint(P1, discardXremovestheattributeinit(X),aswellasanyotherat-<br />

...,Pn). attributesofV.X.<br />

init(V.B)gisfinit(V)g. finit(V),case(V,V.A),init(V.A)g<strong>and</strong>finit(V),case(V,V.B), Example:finit(A)gislowerthanfinit(A),even(A)g.Themeetof<br />

tributesofXorX'scomponents.

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

Saved successfully!

Ooh no, something went wrong!