(**ThemostpopularCoqsyntaxencodingtodayisthe%\textit{%#<i>#locallynameless#</i>#%}%style,whichhasbeenaroundforawhilebutwaspopularizedrecentlybyAydemiretal.,followingamethodologysummarizedintheirpaper"Engineering Formal Metatheory."#<ahref="http://www.cis.upenn.edu/~plclub/oregon08/">#Aspecializedtutorialbythatgroup#</a>#%\footnote{\url{http://www.cis.upenn.edu/~plclub/oregon08/}}% explains the approach, based on a library. In this section, we will build up all of the necessary ingredients from scratch.
ReservedNotation"G |-v x : t"(noassociativity,atlevel90,xatnextlevel).
Definitionctx:=list(free_var*type).
ReservedNotation"G |-v x : t"(noassociativity,atlevel90,xatnextlevel).
...
...
@@ -608,7 +616,7 @@ Module LocallyNameless.
HintConstructorslookup.
ReservedNotation"G |-e e : t"(noassociativity,atlevel90,eatnextlevel).
(**Thefirstunusualoperationweneedis%\textit{%#<i>#opening#</i>#%}%,wherewereplaceaparticularboundvariablewithaparticularfreevariable.Wheneverwe"go under a binder,"inthetypingjudgmentorelsewhere,wechooseanewfreevariabletoreplacetheoldboundvariableofthebinder.Openingimplementsthereplacementofonebytheother.ItislikeaspecializedversionofthesubstitutionfunctionweusedforpuredeBruijnterms.*)