/
**t=v'_{x':B|s'}Inthiscase,Tmustbe{x:B|s'}andthelaststepinthederivatio **t=v'_{x':B|s'}Inthiscase,Tmustbe{x:B|s'}andthelaststepinthederivatio

**t=v'_{x':B|s'}Inthiscase,Tmustbe{x:B|s'}andthelaststepinthederivatio - PDF document

myesha-ticknor
myesha-ticknor . @myesha-ticknor
Follow
376 views
Uploaded On 2016-05-15

**t=v'_{x':B|s'}Inthiscase,Tmustbe{x:B|s'}andthelaststepinthederivatio - PPT Presentation

17 xB00EpvxB00EDynBvFromtheleftwehavethisderivationvBDyn152Bcastx60BpvDynAndusingthederivationthatvBwecanconstructonefortherightvB ID: 320096

17 **&#x=B00;E[pv]&#x=B00;--E[Dyn_B(v)]Fromtheleftwehavethisderivation:v:BDyn˜B------------------------[cast]&#x=-60;Bpv:DynAndusingthederivationthatv:B wecanconstructonefortheright:v:B---------

Share:

Link:

Embed:

Download Presentation from below link

Download Pdf The PPT/PDF document "**t=v'_{x':B|s'}Inthiscase,Tmustbe{x:B|s..." is the property of its rightful owner. Permission is granted to download and print the materials on this web site for personal, non-commercial use only, and to display it on your personal computer provided you do not modify the materials and that you retain all copyright notices contained in the materials. By downloading content from our website, you accept the terms of this agreement.


Presentation Transcript

**t=v'_{x':B|s'}Inthiscase,Tmustbe{x:B|s'}andthelaststepinthederivationthatG+x:S|-t:Tmusthavebeen:G+x:S|-v':Bs'[x':=v']�--*true-------------------------------------------G+x:S|-v'_{x':B|s'}:{x':B|s'}Byinduction,G|-v'[x:=v]:B.Also,weknowthats'[x':=v'][x:=v]=s'[x':=v']becausetheonlyfreevariableins'isx'since{x':B|s'}isawell-formedtype.ThuswecanconcludethatG|-t[x:=v]:T**t=s'�|pv'_{x':B|u'}Inthiscase,T={x':B|u'}andthelaststepinthederivationmusthavebeenG+x:S|-s':boolG+x:S|-v'_{x':B|u}:{x':B|u}u'[x':=v']�--*s'-------------------------------------------G+x:S|-s'�|pv'_{x':B|u'}:{x':B|u'}Frominduction,weknowthatG|-s'[x:=v]:boolG|-v'_{x':B|u}[x:=v]:{x':B|u}Also,weknowthats'[x':=v'][x:=v]=s'[x':=v']becausetheonlyfreevariableins'isx'since{x':B|s'}isawell-formedtype.ThuswecanconcludethatG|-t[x:=v]:T*CanonicalformsIf|-v:S�-Ttheneither:v=\x:S.twithx:S|-t:Tv=cwithty(c)=S�-T,orv=&#xS-00;&#x=-60;�&#x=-60;�S'-T'pv'with|-v':S'&#x=-60;�-T'If|-v:{x:B|t}thenv=v'_{x:B|t}and|-v':Bandt[x:=v']&#x=-60;�-*trueIf|-v:Dynthenv=Dyn_G(v')and|-v':GFollowsbyasimplecaseanalysis(notingthatccannothaveeitherthetypeDynorthetype{x:B|t}foranyx,B,ort). 17 **&#x=B00;E[pv]&#x=B00;--E[Dyn_B(v)]Fromtheleftwehavethisderivation:v:BDyn˜B------------------------[cast]&#x=-60;�Bpv:DynAndusingthederivationthatv:B,wecanconstructonefortheright:v:B-------------[Dyn]Dyn_B(v):B**&#x=S-0;&#x=S-0;E[pv]&#x=S-0;--E[Dyn_{Dy&#x=S-0;n-Dyn} yn-;(&#x=-60;�&#x=-60;�S-Tpv)]Fromtheleftwehavethisderivation:v:S&#x=-60;�-TDyn˜&#x=-60;�S-T-----------------------------[cast]&#x=S-0;&#x=S-0;pv:Dynwhichletsusconstructthisonefortheright(since&#x=S-0;Dyn-Dyn˜&#x=S-0;S-TforanySandT).v:S&#x=S-0;-T&#x=S-0;Dyn-Dyn˜&#x=S-0;S-T-------------------------------------------[cast] yn-;&#x=-60;�&#x=-60;�S-Tv:&#x=-60;�Dyn-Dyn-------------------------------------------[Dyn]&#x=-60;�Dyn_{Dyn-Dyn} yn-;(&#x=-60;�&#x=-60;�S-Tv):Dyn**E[&#x=-60;�DynpDyn_G(v)]&#x=-60;�--E[T&#x=-60;�Gpv]ifG˜TGiven:v:G-----------------[Dyn]Dyn_G(v):DynDyn˜T------------------------------[cast]&#x=-60;�DynpDyn_G(v):TSowecanbuildthisone:v:GG˜T-----------------------[cast]&#x=-60;�Gpv:T**E[&#x=-60;�DynpDyn_G(v)]&#x=-60;�--blame(p)ifT˜/˜G 19 Vacuouslytrue.**E[&#x=-60;�{x:B|s}pv_{x:B|s}]--&#x=-60;�E[&#x=-60;�Bpv]Fromtheleft-handsidewegetthis:v:Bs[x:=v]&#x=-60;�--*true---------------------------[sub]v_{x:B|s}:{x:B|s}{x:B|s}˜T------------------------------------------------[cast]&#x=-60;�{x:B|s}pv_{x:B|s}:{x:B|s}{x:B|s}˜TtellusthatB˜Tandwecanusethederivationthatv:Btobuildthisderivationfortheright-handside.v:BB˜T----------------[cast]&#x=-60;�Bpv:T*Progress:if|-s:Tthens&#x=-60;�-t,s&#x=-60;�-blame(p)orsisavalue.Byinductiononthestructureofs.**s=xDoesnottypecheck.**s=cIsavalue**s=\x:S.s'Isavalue.**s=t's'Ifeithert'ors'arenotvalues,thenbyinductionplusthedefinitionofevaluationcontexts,weknowthatsreduces.Sinces:T,byinversionweknowthatt':S'&#x=-60;�-Tands':S'.Bycanonicalforms,then,therearethreepossibilitiesfort'***t'=\x:S.tInthiscase,t's'reducesbyrule(2).***t'=cwithty(c)=&#x=-60;�S-T 21 Ifs'reduces,thensodoess.Thus,byinductionwecanassumethats'=v'.Sincethetypingrulestellusthats':Bool,thenweknowthatsiseithertrue(sorule(11)applies)orfalse(sorule(12)does). A.2 Proofthatthesubtypingrelationsaretransitive,proposition3*TransitivityforandFollowsfromthefactoringlemmasandthetransitivityargumentsbelow.*TransitivityforSRandRTimpliesSTCasesareorderedbytheorderinwhichtherulesappearinmainbodyofthepaper.IjustskippedcaseswheretherelevantrulescannotapplyduetostructuralmismatchesandIdidn'twriteoutthecaseswhereTisDyn,orwheretwooftheS,R,andTareidentical(ie,bothaspecificB).**case1.SRbyfirstrule.ThusS=R=B***case1a.RTbyrule1.ThusT=B.***case1b.RTbyrule2.ThusT=Dyn.***case1c.RTbyrule5.ThusT={x:B|t}.FollowsimmediatelybecauseS=RandRT.**case2.SRbysecondrule.Thus,R=Dyn.***case2a,RTbyrule2.ThusT=Dyn.***case2b,RTbyrule5.ThusT={x:B|t}andDynB.Thiscannothappen,sinceDynBisnotderivable.**case3.SRbythethirdrule.Thus&#x:+-6;�S=S'-S''and&#x:+-6;�R=R'-R''.***case3a.RTbyrule2.ThusT=Dyn.***case3b.RTbyrule3.ThusT=&#x:+-6;�T'-T''.Followsfrominduction.***case3c.RTbyrule5.ThusT={x:B|t}.andRB.Cannothappen,since&#x:+-6;�R'-R''Bisnotderivable.**case4.SRbythefourthrule.ThusS={x:B|t}andBR.***case4a.RTbyrule1.ThusR=T=B.***case4b.RTbyrule2.ThusT=Dyn.***case4c.RTbyrule3.Thus&#x:+-6;�R=R'-R''and&#x:+-6;�T=T'-T''Thiscannothappen,sinceB&#x:+-6;�R'-R''isnotderivable.***case4d.RTbyrule4.ThusR={x:B'|t'}andB'T.So,weknowthatB{x:B'|t'}.Theonlyrulethatcandeducethatisthefifthrule,sowealsoknowthatBB'.Thus,byinduction,BT.Reapplyingthefourthrule,wehavethatST.***case4e.RTbyrule5.ThusT={x:B'|t'},RB',andx:B'|=t' 23 &#x=-60;�&#x=B00;{x:B|t}&#x=B00;--*&#x=-60;�{x:B|t}w_{x:B|t}byrule10&aboveobservation&#x=-60;�--wbyrule13Thus,wehavesatisfiedtherequirementstousex:B|=t'toshowthatt'[x:=w]&#x={x:; |t};&#x-600;--*trueandthusx:B|=t'.*TransitivityforSRandRTimpliesST**case1.SRbytheruleone.ThusS=R=B**case2.SRbytheruletwo.ThusS=Dyn.Reapplycase2togetDynT.**case3.SRbyrulethree.ThusS=&#x:--6;�S'-S''and&#x:--6;�R=R'-R''***case3a.RTbyrulethree.Thus&#x:--6;�T=T'-T''.Followsbyinduction.***case3b.RTbyrulefive.Thus,T={x:B|t}andRBTheonlyrulethatmatchesthepattern&#x:--6;�R'-R''Bisrule6.Fromthatweknowthat&#x:--6;�R'-R''G.Fromthecaseanalysisinlemmainthefactoringsection,weknowthatRmustbeDyn&#x:--6;�-Dyn.Since&#x:--6;�S'-S''&#x:--6;�Dyn-Dynand&#x:--6;�Dyn-Dyn=G,thenweknowthat&#x:--6;�S'-S''Tbyrule6.***case3c.RTbyrule6.ThusRG.Thisholdbythesamereasoningasincase3b.**case4.SRbyrulefour.ThusS={x:B|s}andBR.***case4a.RTbyruleone.ThusR=T=B.***case4b.RTbyrulefive.ThusT={x:B'|t'}andRB'Byinduction,weknowthatUB'.ThuswecanapplybothrulesfourandfivetoconcludethatST.***case4c.RTbyrule6.ThusRG.SinceBG,byrule6wehaveBTandbyrule4,wehaveST.**case5.SRbyrulefive.Thus,R={x:B|t}andSBSinceSG,wecanuserule6toconcludethatST. 25 ifG=B:B{x:B|t}DynifG=�Dyn-DynDyn�-DynDynThisisallofthetypesthatareG.ifG=B:B{x:B|t}if&#x:-60;�G=Dyn-Dyn:&#x:-60;�Dyn-Dyn*FactoringLemma2:SDyn&#x:--6;�=SDynByacaseanalysis.*FactoringLemma3:DynS&#x:+-6;�=DynSByacaseanalysis.*STimpliesSTandSTByinductiononthestructureofthederivationthatST.**STbyruleone.ThusS=T=B.**STbyruletwo.ThusS=T=Dyn.**STbyrulethree.Thus&#x:-60;�S=S'-S''&&#x:-60;�T=T'-T''Byinduction.**STbyrulefour.ThusS={x:B|t}andUT.Byinduction.**STbyrulefive.ThusT={x:B|t}andx:B|=tByinduction.**STbyrule6.ThusT=DynandSGByinduction,wehaveSG,whichgivesusSSsinceeverythingis.*STandSTimplesST**STbyruleone.ThusS=T=B.**STbyruletwo.ThusT=Dyn.***case2a.STbyrule2.ThusS=Dyn.***case2b.STbyrule4.ThusS={x:B|t}andBDyn 27 ST.*STimplesSTandTS**case1.STbyrule1.ThusS=T=B.**case2.STbyrule2.ThusT=Dyn.**case3.STbyrule3.ThusS=&#x:n-6;�S'-S''andT=&#x:n-6;�T'-T''Byinduction.**case4.STbyrule4.ThusS={x:B|t}Byinduction.**case5.STbyrule5.ThusT={x:B|t}andx:B|=t.Byinduction.*STandTSimplesST**STbyruleone.ThusS=T=B.**STbyruletwo.ThusT=Dyn.**STbyrule3.Thus&#x:+-6;�S=S'-S''and&#x:+-6;�T=T'-T''.***3a.TSbyrule3.Thus&#x:--6;�T'-T''&#x:--6;�S'-S''Byinduction***3b.TSbyrule6.ThusTG.FromtheanalysisaboveandthefactthatT=&#x:--6;�T'-T'',weknowthatT=&#x:--6;�Dyn-Dynandwecanderivedirectlythat&#x:--6;�S'-S''&#x:n-6;�Dyn-Dyn.**STbyrule4.ThusS={x:B|t}andBT.***TSbyrule2.ThusT=DynUserule2of***TSbyrule4.ThusT={x:B'|t'}andB'SThereisonlyonewaytoconcludethatB'{x:B|t},rule5.Thus,B'B.ThereisonlyonewaytoconcludethatB{x:B'|t'},rule5,whichalsotellsusthatwehaveBB'andx:B'|=t'.Byinduction,weknowthatBB'.Byrule5ofwehavethatB{x:B'|t'}.Byrule4ofwehavethat{x:B|t}{x:B'|t'}.***TSbyrule5.ThusTU.Byinduction,wehavethatTU.Byrule4ofwecanconcludethatST.***TSbyrule6.ThusTGByrule6againwehavethatTU.ByinductionweknowthatUT,andthenbyrule4ofweknowthatST. 29 Ifthecastislabelledp,wehave:DynTimplesT=Dyn,orT={x:Dyn|t}andx:DynDyn|=t.Inbothcases,wecanderivethatGT.Ifthecastislabelled˜p,wehave:sinceGG,weknowthatGT.**rule9;eliminatedacast,no&#x:--6;�|introduced**rule10;If{x:B|t}S,thenBS.DittoThereisa&#x:-]T;&#xJ 0 ;&#x-23.;鄄&#x Td[;|expressionintroduced,butthedefinitionofentailmenttellsusthatitwillproducetrue.**rule11;nocastschange,no&#x:-]T;&#xJ 0 ;&#x-23.;鄄&#x Td[;|introduced**rule12;cannothappen,accordingtothepremise**rule13;If{x:B|s}T,thenBT.Ditto*Progress:iftsafeforp,thent&#x:-.];&#xTJ/F;P 8;&#x.966; Tf;&#x 0 -;%.2;ࠡ ;&#xTd[0;-/-blame(p)Theonlyrelevantreductionrulesarethosethatendinblame(p),namelyrules9and12.**rule9IfDynT,thenjustreadingoffoftheconclusionsfromallofthecasesofentailmenteliminatesallbutthesecondandfifthcase.***Case2:T=Dyn.Fromtheside-conditiononthisrule,weknowthatG˜Tdoesnothold;buteverytypeis˜withDyn.Thus,thisreductionrulecannotfire.***Case5:T={x:B|t}Inthiscase,thepremisetellsusthatDynB,butthatisnotderivable.HenceTcannotbe{x:B|t}.**rule12.Theleft-handsideofthisruleisnotsafeforp. 31