A Continuation Semantics of Interrogatives\linebreak[1] That Accounts for Baker's Ambiguity
\protect\linebreak
\Wh-phrases in English can appear both raised and in-situ. However, only in\nobreakdash-situ \wh-phrases can take semantic scope beyond the immediately enclosing clause. I present a denotational semantics of interrogatives that naturally accounts for these two properties. It neither invokes movement or economy, nor posits lexical ambiguity between raised and in\nobreakdash-situ occurrences of the same \wh-phrase. My analysis is based on the concept of \emp{continuations}. It uses a novel type system for higher-order continuations to handle wide-scope \wh-phrases while remaining strictly compositional. This treatment sheds light on the combinatorics of interrogatives as well as other kinds of so-called \=A-movement.
pstricks.tex
%% BEGIN: pstricks.tex
%%
%% PostScript macros for Generic TeX: main input file for PSTricks 97.
%% See the PSTricks User's Guide for description.
%% This uses the header file `pstricks.pro'.
%%
\def\fileversion{97 patch 14}
\def\filedate{1999/12/23}
%%
%% COPYRIGHT 1993, 1994, 1999 by Timothy Van Zandt, tvz@nwu.edu.
%%
%% This program can be redistributed and/or modified under the terms
%% of the LaTeX Project Public License Distributed from CTAN
%% archives in directory macros/latex/base/lppl.txt.
%%
\csname PSTricksLoaded\endcsname
\let\PSTricksLoaded\endinput
\edef\PstAtCode{\the\catcode`\@}
\catcode`\@=11\relax
\expandafter\ifx\csname @latexerr\endcsname\relax
\long\def\@ifundefined#1#2#3{\expandafter\ifx\csname
#1\endcsname\relax#2\else#3\fi}
\def\@namedef#1{\expandafter\def\csname #1\endcsname}
\def\@nameuse#1{\csname #1\endcsname}
\def\@eha{%
Your command was ignored.^^J
Type \space I <command> <return> \space to replace
it with another command,^^J
or \space <return> \space to continue without it.}
\def\@spaces{\space\space\space\space}
\def\typeout#1{\immediate\write\@unused{#1}}
\alloc@7\write\chardef\sixt@@n\@unused
\def\@empty{}
\def\@gobble#1{}
\def\@nnil{\@nil}
\def\@ifnextchar#1#2#3{%
\let\@tempe#1\def\@tempa{#2}\def\@tempb{#3}\futurelet\@tempc\@ifnch}
\def\@ifnch{%
\ifx\@tempc\@sptoken
\let\@tempd\@xifnch
\else
\ifx\@tempc\@tempe \let\@tempd\@tempa \else \let\@tempd\@tempb \fi
\fi
\@tempd}
\begingroup
\def\:{\global\let\@sptoken= } \:
\def\:{\@xifnch} \expandafter\gdef\: {\futurelet\@tempc\@ifnch}
\endgroup
\fi
\typeout{`PSTricks' v\fileversion\space\space <\filedate> (tvz)}
\def\@pstrickserr#1#2{%
\begingroup
\newlinechar`\^^J
\edef\pst@tempc{#2}%
\expandafter\errhelp\expandafter{\pst@tempc}%
\typeout{%
PSTricks error. \space See User's Guide for further information.^^J
\@spaces\@spaces\@spaces\@spaces
Type \space H <return> \space for immediate help.}%
\errmessage{#1}%
\endgroup}
\def\@ehpa{%
Your command was ignored. Default value substituted.^^J
Type \space <return> \space to procede.}
\def\@ehpb{%
Your command was ignored. Will recover best I can.^^J
Type \space <return> \space to procede.}
\def\@ehpc{%
You better fix this before proceding.^^J
See the PSTricks User's Guide or ask your system administrator for help.^^J
Type \space X <return> \space to quit.}
\def\pst@misplaced#1{\@pstrickserr{Misplaced \string#1 command}\@ehpb}
\newdimen\pst@dima
\newdimen\pst@dimb
\newdimen\pst@dimc
\newdimen\pst@dimd
\newdimen\pst@dimg
\newdimen\pst@dimh
\newbox\pst@hbox
\newbox\pst@boxg
\newcount\pst@cnta
\newcount\pst@cntb
\newcount\pst@cntc
\newcount\pst@cntd
\newcount\pst@cntg
\newcount\pst@cnth
\newif\if@pst
\newtoks\pst@toks
\newif\if@star
\def\pst@ifstar#1{%
\@ifnextchar*{\@startrue\def\next*{#1}\next}{\@starfalse#1}}
\def\pst@expandafter#1#2{%
\def\next{#1}%
\edef\@tempa{#2}%
\ifx\@tempa\@empty
\@pstrickserr{Unexpected empty argument!}\@ehpb
\def\@tempa{\@empty}%
\fi
\expandafter\next\@tempa}
\def\pst@dimtonum#1#2{\edef#2{\pst@@dimtonum#1}}
\def\pst@@dimtonum#1{\expandafter\pst@@@dimtonum\the#1}
{\catcode`\p=12 \catcode`\t=12 \global\@namedef{pst@@@dimtonum}#1pt{#1}}
\def\pst@pyth#1#2#3{%
\ifdim#1>#2\pst@@pyth#1#2#3\else\pst@@pyth#2#1#3\fi}
\def\pst@@pyth#1#2#3{%
\ifdim4#1>9#2%
#3=#1\advance#3 .2122#2%
\else
#3=.8384#1\advance#3 .5758#2%
\fi}
\def\pst@divide#1#2#3{%
\pst@@divide{#1}{#2}%
\pst@dimtonum\pst@dimg{#3}}
\def\pst@@divide#1#2{%
\pst@dimg=#1\relax
\pst@dimh=#2\relax
\pst@cntg=\pst@dimh
\pst@cnth=67108863
\pst@@@divide\pst@@@divide\pst@@@divide\pst@@@divide
\divide\pst@dimg\pst@cntg}
\def\pst@@@divide{%
\ifnum
\ifnum\pst@dimg<\z@-\fi\pst@dimg<\pst@cnth
\multiply\pst@dimg\sixt@@n
\else
\divide\pst@cntg\sixt@@n
\fi}
\def\pst@configerr#1{%
\@pstrickserr{\string#1 not defined in pstricks.con}\@ehpc}
% % \begin{macrocode}
\def\pstVerb#1{\pst@configerr\pstVerb}
\def\pstverb#1{\pst@configerr\pstverb}
\def\pstverbscale{\pst@configerr\pstverbscale}
\def\pstrotate{\pst@configerr\pstrotate}
\def\pstheader#1{\pst@configerr\pstheader}
\def\pstdriver{\pst@configerr\pstdriver}
\@ifundefined{pstcustomize}%
{\def\pstcustomize{\endinput\let\pstcustomize\relax}}{}
\input pstricks.con
\newif\ifPSTricks
\PSTrickstrue
\def\PSTricksOff{%
\def\pstheader##1{}%
\def\pstverb##1{}%
\def\pstVerb##1{}%
\PSTricksfalse}
\@ifundefined{pst@def}{\def\pst@def#1<#2>{\@namedef{tx@#1}{#2 }}}{}
\@ifundefined{pst@ATH}{\def\pst@ATH<#1>{}}{}
\pstheader{pstricks.pro}
\def\pst@dict{tx@Dict begin }
\def\pst@theheaders{pstricks.pro}
\def\pst@Verb#1{\pstVerb{\pst@dict #1 end}}
\def\tx@Atan{Atan }
\def\tx@Div{Div }
\def\tx@NET{NET }
\def\tx@Pyth{Pyth }
\def\tx@PtoC{PtoC }
\def\tx@PathLength@{PathLength@ }
\def\tx@PathLength{PathLength }
\pst@dimg=\pstunit\relax
\ifdim\pst@dimg=1bp
\def\pst@stp{.996264 dup scale}
\else
\edef\pst@stp{1 \pst@@dimtonum\pst@dimg\space div dup scale}
\fi
\def\tx@STP{STP }
\def\tx@STV{STV }
\def\pst@number#1{\pst@@dimtonum#1\space}
\def\pst@checknum#1#2{%
\edef\next{#1}%
\ifx\next\@empty
\let\pst@num\z@
\else
\expandafter\pst@@checknum\next..\@nil
\fi
\ifnum\pst@num=\z@
\@pstrickserr{Bad number: `#1'. 0 substituted.}\@ehpa
\def#2{0 }%
\else
\edef#2{\ifnum\pst@num=\tw@-\fi\the\pst@cntg.%
\expandafter\@gobble\the\pst@cnth\space}%
\fi}
\def\pst@@checknum{%
\@ifnextchar-%
{\let\pst@num\tw@\expandafter\pst@@@checknum\@gobble}%
{\let\pst@num\@ne\pst@@@checknum}}
\def\pst@@@checknum#1.#2.#3\@nil{%
\afterassignment\pst@@@@checknum\pst@cntg=0#1\relax\@nil
\afterassignment\pst@@@@checknum\pst@cnth=1#2\relax\@nil}
\def\pst@@@@checknum#1\relax\@nil{%
\ifx\@nil#1\@nil\else\let\pst@num\z@\fi}
\def\pst@getnumii#1 #2 #3\@nil{%
\pst@checknum{#1}\pst@tempg
\pst@checknum{#2}\pst@temph}
\def\pst@getnumiii#1 #2 #3 #4\@nil{%
\pst@checknum{#1}\pst@tempg
\pst@checknum{#2}\pst@temph
\pst@checknum{#3}\pst@tempi}
\def\pst@getnumiv#1 #2 #3 #4 #5\@nil{%
\pst@checknum{#1}\pst@tempg
\pst@checknum{#2}\pst@temph
\pst@checknum{#3}\pst@tempi
\pst@checknum{#4}\pst@tempj}
\def\pst@getdimnum#1 #2 #3\@nil{%
\pssetlength\pst@dimg{#1}%
\pst@checknum{#2}\pst@tempg}
% DG/SR modification begin - Jan. 7, 1998 - Patch 9
% Missing from pstricks.bug 0.93
%\def\pst@getscale#1#2{%
%\pst@expandafter\pst@getnumii{#1 #1} {} {} {}\@nil
%\@psttrue
%\ifdim\pst@tempg\p@=\z@
%\@pstrickserr{Bad scaling argument `#1'}\@ehpa
%\def\pst@tempg{1 }%
%\@pstfalse
%\fi
%\ifdim\pst@temph\p@=\z@
%\if@pst\@pstrickserr{Bad scaling argument `#1'}\@ehpa\fi
%\def\pst@temph{1 }%
%\fi
%\edef#2{\pst@tempg\space \pst@temph\space scale }%
%\ifdim\pst@tempg\p@=\p@ \ifdim\pst@temph\p@=\p@
%\def#2{}%
%\fi\fi}
\def\pst@getscale#1#2{%
\edef\pst@tempg{#1}%
\ifx\pst@tempg\@none
\def#2{}%
\else
\pst@expandafter\pst@getnumii{#1 #1} {} {} {}\@nil
\ifdim\pst@tempg\p@=\z@
\@pstrickserr{Bad scaling argument `#1'}\@ehpa
\def#2{}%
\else
\ifdim\pst@temph\p@=\z@
\@pstrickserr{Bad scaling argument `#1'}\@ehpa
\def#2{}%
\else
\edef#2{\pst@tempg\space \pst@temph\space scale }%
\fi
\fi
\fi}
% DG/SR modification end
\def\pst@getint#1#2{%
\pst@cntg=#1\relax
\edef#2{\the\pst@cntg\space}}
\begingroup
\catcode`\{=12
\catcode`\}=12
\catcode`\[=1
\catcode`\]=2
\gdef\pslbrace[{ ]
\gdef\psrbrace[} ]
\endgroup
\def\@newcolor#1#2{%
\expandafter\edef\csname #1\endcsname{\noexpand\pst@color{#2}}%
\expandafter\edef\csname color@#1\endcsname{#2}%
\ignorespaces}
\def\pst@color#1{%
\def\pst@currentcolor{#1}\pstVerb{#1}\aftergroup\pst@endcolor}
\def\pst@endcolor{\pstVerb{\pst@currentcolor}}
\def\pst@currentcolor{0 setgray}
\def\altcolormode{%
\def\pst@color##1{%
\pstVerb{gsave ##1}\aftergroup\pst@endcolor}%
\def\pst@endcolor{\pstVerb{\pst@grestore}}}
\def\pst@grestore{%
currentpoint
matrix currentmatrix
currentfont
grestore
setfont
setmatrix
moveto}
\def\pst@usecolor#1{\csname color@#1\endcsname\space}
\def\newgray#1#2{%
\pst@checknum{#2}\pst@tempg
\@newcolor{#1}{\pst@tempg setgray}}
\def\newrgbcolor#1#2{%
\pst@expandafter\pst@getnumiii{#2} {} {} {} {}\@nil
\@newcolor{#1}{\pst@tempg \pst@temph \pst@tempi setrgbcolor}}
\def\newhsbcolor#1#2{%
\pst@expandafter\pst@getnumiii{#2} {} {} {} {}\@nil
\@newcolor{#1}{\pst@tempg \pst@temph \pst@tempi sethsbcolor}}
\def\newcmykcolor#1#2{%
\pst@expandafter\pst@getnumiv{#2} {} {} {} {} {}\@nil
\@newcolor{#1}{\pst@tempg \pst@temph \pst@tempi \pst@tempj setcmykcolor}}
\newgray{black}{0}
\newgray{darkgray}{.25}
\newgray{gray}{.5}
\newgray{lightgray}{.75}
\newgray{white}{1}
\newrgbcolor{red}{1 0 0}
\newrgbcolor{green}{0 1 0}
\newrgbcolor{blue}{0 0 1}
\newrgbcolor{yellow}{1 1 0}
\newrgbcolor{cyan}{0 1 1}
\newrgbcolor{magenta}{1 0 1}
\def\psset#1{\@psset#1,\@nil\ignorespaces}
\def\@psset#1,{%
\@@psset#1==\@nil
\@ifnextchar\@nil{\@gobble}{\@psset}}
\def\@@psset#1=#2=#3\@nil{%
\@ifundefined{psset@#1}%
{\@pstrickserr{Graphics parameter `#1' not defined.}\@ehpa}%
{\@nameuse{psset@#1}{#2}}}%
\def\psset@style#1{%
\@ifundefined{pscs@#1}%
{\@pstrickserr{Custom style `#1' undefined}\@ehpa}%
{\@nameuse{pscs@#1}}}
\def\newpsstyle#1#2{\@namedef{pscs@#1}{\psset{#2}}}
\def\@none{none}
\def\pst@getcolor#1#2{%
\@ifundefined{color@#1}%
{\@pstrickserr{Color `#1' not defined}\@eha}%
{\edef#2{#1}}}
\newdimen\psunit \psunit 1cm
\newdimen\psxunit \psxunit 1cm
\newdimen\psyunit \psyunit 1cm
\let\psrunit\psunit
\def\pstunit@off{\let\@psunit\ignorespaces\ignorespaces}
\def\pssetlength#1#2{%
\let\@psunit\psunit
\afterassignment\pstunit@off
#1 #2\@psunit}
\def\psaddtolength#1#2{%
\let\@psunit\psunit
\afterassignment\pstunit@off
\advance#1 #2\@psunit}
\def\pssetxlength#1#2{%
\let\@psunit\psxunit
\afterassignment\pstunit@off
#1 #2\@psunit}
\def\pssetylength#1#2{%
\let\@psunit\psyunit
\afterassignment\pstunit@off
#1 #2\@psunit}
\def\psset@unit#1{%
\pssetlength\psunit{#1}%
\psxunit=\psunit
\psyunit=\psunit}
\def\psset@runit#1{\pssetlength\psrunit{#1}}
\def\psset@xunit#1{\pssetxlength\psxunit{#1}}
\def\psset@yunit#1{\pssetylength\psyunit{#1}}
\def\pst@getlength#1#2{%
\pssetlength\pst@dimg{#1}%
\edef#2{\pst@number\pst@dimg}}
\def\pst@@getlength#1#2{%
\pssetlength\pst@dimg{#1}%
\edef#2{\number\pst@dimg sp}}
\def\pst@getcoor#1#2{\pst@@getcoor{#1}\let#2\pst@coor}
\def\pst@coor{0 0 }
\def\pst@getcoors#1#2{%
\def\pst@aftercoors{\addto@pscode{#1 \pst@coors }#2}%
\def\pst@coors{}%
\pst@@getcoors}
\def\pst@@getcoors(#1){%
\pst@@getcoor{#1}%
\edef\pst@coors{\pst@coor\pst@coors}%
\@ifnextchar({\pst@@getcoors}{\pst@aftercoors}}
\def\pst@getangle#1#2{\pst@@getangle{#1}\let#2\pst@angle}
\def\pst@angle{0 }
\def\cartesian@coor#1,#2,#3\@nil{%
\pssetxlength\pst@dimg{#1}%
\pssetylength\pst@dimh{#2}%
\edef\pst@coor{\pst@number\pst@dimg \pst@number\pst@dimh}}
\def\NormalCoor{%
\def\pst@@getcoor##1{\pst@expandafter\cartesian@coor{##1},\relax,\@nil}%
\def\pst@@getangle##1{%
\pst@checknum{##1}\pst@angle
\edef\pst@angle{\pst@angle \pst@angleunit}}%
\def\psput@##1{\pst@@getcoor{##1}\leavevmode\psput@cartesian}}
\NormalCoor
\def\degrees{\@ifnextchar[{\@degrees}{\def\pst@angleunit{}}}
\def\@degrees[#1]{%
\pst@checknum{#1}\pst@tempg
\edef\pst@angleunit{360 \pst@tempg div mul }%
\ignorespaces}
\def\radians{\def\pst@angleunit{57.2956 mul }}
\def\pst@angleunit{}
\def\SpecialCoor{%
\def\pst@@getcoor##1{%
\begingroup
\pst@activecoor
\xdef\pst@tempg{##1}%
\endgroup
\expandafter\special@coor\pst@tempg||\@nil}%
\def\pst@@getangle##1{%
\begingroup
\pst@activecoor
\xdef\pst@tempg{##1}%
\endgroup
\expandafter\special@angle\pst@tempg\@empty)\@nil}%
\def\psput@##1{\pst@@getcoor{##1}\leavevmode\psput@special}}
\begingroup
\catcode`\|=13
\catcode`\;=13
\catcode`\!=13
\gdef\pst@activecoor{%
\def|{\string|}%
\def;{\string;}%
\def!{\string!}}
\endgroup
\def\special@coor#1|#2|#3\@nil{%
\ifx#3|\relax
\mixed@coor{#1}{#2}%
\else
\special@@coor#1;;\@nil
\fi}
\def\special@@coor#1{%
\ifcat#1a\relax
\def\next{\node@coor#1}%
\else
\ifx#1[\relax
\def\next{\Node@coor[}%
\else
\ifx#1!\relax
\def\next{\raw@coor}%
\else
\def\next{\special@@@coor#1}%
\fi
\fi
\fi
\next}
\def\special@@@coor#1;#2;#3\@nil{%
\ifx#3;\relax
\polar@coor{#1}{#2}%
\else
\cartesian@coor#1,\relax,\@nil
\fi}
\def\mixed@coor#1#2{%
\begingroup
% DG/SR modification begin - Oct. 27, 1997 - Patch 6
%\specialcoor@ii#1;;\@nil
%\let\pst@tempa\pst@coor
%\specialcoor@ii#2;;\@nil
\special@@coor#1;;\@nil
\let\pst@tempa\pst@coor
\special@@coor#2;;\@nil
% DG/SR modification end
\xdef\pst@tempg{\pst@tempa pop \pst@coor exch pop }%
\endgroup
\let\pst@coor\pst@tempg}
\def\polar@coor#1#2{%
\pssetlength\pst@dimg{#1}%
\pst@@getangle{#2}%
\edef\pst@coor{\pst@number\pst@dimg \pst@angle \tx@PtoC}}
\def\raw@coor#1;#2\@nil{%
\edef\pst@coor{%
#1 \pst@number\psyunit mul exch \pst@number\psxunit mul exch }}
\def\node@coor#1\@nil{%
\@pstrickserr{You must load `pst-node.tex' to use node coordinates.}\@ehps
\def\pst@coor{0 0 }}
\def\Node@coor{\node@coor}
\def\special@angle#1#2)#3\@nil{%
\ifx!#1\relax
\edef\pst@angle{#2 \pst@angleunit}%
\else
\ifx(#1\relax
\pst@@getcoor{#2}%
\edef\pst@angle{\pst@coor exch \tx@Atan}%
\else
\pst@checknum{#1#2}\pst@angle
\edef\pst@angle{\pst@angle \pst@angleunit}%
\fi
\fi}
\def\Cartesian{%
\def\cartesian@coor##1,##2,##3\@nil{%
\pssetxlength\pst@dimg{##1}%
\pssetylength\pst@dimh{##2}%
\edef\pst@coor{\pst@number\pst@dimg \pst@number\pst@dimh}}%
\@ifnextchar({\Cartesian@}{}}
\def\Cartesian@(#1,#2){%
\pssetxlength\psxunit{#1}%
\pssetylength\psyunit{#2}%
\ignorespaces}
\def\Polar{%
\def\psput@cartesian{\psput@special}%
\def\cartesian@coor##1,##2,##3\@nil{\polar@coor{##1}{##2}}}%
\def\psset@origin#1{%
\pst@@getcoor{#1}%
\edef\psk@origin{\pst@coor \tx@NET }}
\def\psk@origin{}
\newif\ifswapaxes
\def\psset@swapaxes#1{%
\@nameuse{@pst#1}%
\if@pst
\def\psk@swapaxes{-90 rotate -1 1 scale }%
\else
\def\psk@swapaxes{}%
\fi}
\psset@swapaxes{false}
\newif\ifshowpoints
\def\psset@showpoints#1{\@nameuse{showpoints#1}}
\psset@showpoints{false}
\let\pst@setrepeatarrowsflag\relax
\def\psset@border#1{%
\pst@getlength{#1}\psk@border
\pst@setrepeatarrowsflag}
\psset@border{0pt}
\def\psset@bordercolor#1{\pst@getcolor{#1}\psbordercolor}
\psset@bordercolor{white}
\newif\ifpsdoubleline
\def\psset@doubleline#1{%
\@nameuse{psdoubleline#1}%
\pst@setrepeatarrowsflag}
\psset@doubleline{false}
\def\psset@doublesep#1{\def\psdoublesep{#1}}
\psset@doublesep{1.25\pslinewidth}
\def\psset@doublecolor#1{\pst@getcolor{#1}\psdoublecolor}
\psset@doublecolor{white}
\newif\ifpsshadow
\def\psset@shadow#1{%
\@nameuse{psshadow#1}%
\pst@setrepeatarrowsflag}
\psset@shadow{false}
\def\psset@shadowsize#1{\pst@getlength{#1}\psk@shadowsize}
\psset@shadowsize{3pt}
\def\psset@shadowangle#1{\pst@getangle{#1}\psk@shadowangle}
\psset@shadowangle{-45}
\def\psset@shadowcolor#1{\pst@getcolor{#1}\psshadowcolor}
\psset@shadowcolor{darkgray}
\def\pst@repeatarrowsflag{\z@}
\def\pst@setrepeatarrowsflag{%
\edef\pst@repeatarrowsflag{%
\ifdim\psk@border\p@>\z@ 1\else\ifpsdoubleline 1\else
\ifpsshadow 1\else \z@\fi\fi\fi}}
\def\psls@none{}
\newdimen\pslinewidth
\def\psset@linewidth#1{\pssetlength\pslinewidth{#1}}
\psset@linewidth{.8pt}
\def\psset@linecolor#1{\pst@getcolor{#1}\pslinecolor}
\psset@linecolor{black}
\def\psls@solid{0 setlinecap stroke }
\def\pst@missing{%
\z@
\@pstrickserr{Missing number or dimension. 0 substituted}\@ehpa}
\def\psset@dash#1{%
\pst@expandafter\psset@@dash{#1} {\pst@missing} {\pst@missing} {}\@nil
\edef\psk@dash{\pst@number\pst@dimg \pst@number\pst@dimh}}
\def\psset@@dash#1 #2 #3\@nil{%
\pssetlength\pst@dimg{#1}%
\pssetlength\pst@dimh{#2}}
\psset@dash{5pt 3pt}
\newif\ifpsdashadjust
\def\psset@dashadjust#1{\@nameuse{psdashadjust#1}}
\psset@dashadjust{true}
\def\psls@dashed{%
\ifpsdashadjust
\psk@dash \pst@linetype\space \tx@DashLine
\else
[ \psk@dash ] 0 setdash stroke
\fi}
\def\tx@DashLine{DashLine }
\def\psset@dotsep#1{\pst@getlength{#1}\psk@dotsep}
\psset@dotsep{3pt}
\def\psls@dotted{%
\ifpsdashadjust
\psk@dotsep \pst@linetype\space \tx@DotLine
\else
[ 0 \psk@dotsep CLW add ] 0 setdash 1 setlinecap stroke
\fi}
\def\tx@DotLine{DotLine }
\def\psset@linestyle#1{%
\@ifundefined{psls@#1}%
{\@pstrickserr{Line style `#1' not defined}\@eha}%
{\edef\pslinestyle{#1}}}
\psset@linestyle{solid}
\def\psfs@none{}
\def\psset@fillcolor#1{\pst@getcolor{#1}\psfillcolor}
\psset@fillcolor{white}
\def\psfs@solid{\pst@fill{\pst@usecolor\psfillcolor fill}}
\def\psset@hatchwidth#1{\pst@getlength{#1}\psk@hatchwidth}
\psset@hatchwidth{.8pt}
\def\psset@hatchsep#1{\pst@getlength{#1}\psk@hatchsep}
\psset@hatchsep{4pt}
\def\psset@hatchcolor#1{\pst@getcolor{#1}\pshatchcolor}
\psset@hatchcolor{black}
\def\psset@hatchangle#1{\pst@getangle{#1}\psk@hatchangle}
\psset@hatchangle{45}
\def\pst@linefill{%
\psk@hatchangle rotate
\psk@hatchwidth SLW
\pst@usecolor\pshatchcolor
\psk@hatchsep \tx@LineFill}
\def\psfs@vlines{\pst@fill\pst@linefill}
\@namedef{psfs@vlines*}{\psfs@solid \psfs@vlines}
\def\psfs@hlines{\pst@fill{90 rotate \pst@linefill}}
\@namedef{psfs@hlines*}{\psfs@solid \psfs@hlines}
\def\psfs@crosshatch{\psfs@vlines \psfs@hlines}
\@namedef{psfs@crosshatch*}{\psfs@solid \psfs@vlines \psfs@hlines}
\def\tx@LineFill{LineFill }
\def\psset@fillstyle#1{%
\edef\pst@tempg{#1}\def\pst@temph{none}%
\ifx\pst@tempg\pst@temph
\let\psk@fillstyle\relax
\else
\@ifundefined{psfs@#1}%
{\@pstrickserr{Undefined fill style: `#1'}\@eha}%
{\edef\psk@fillstyle{\expandafter\noexpand\csname psfs@#1\endcsname}}%
\fi}
\def\psset@addfillstyle#1{%
\@ifundefined{psfs@#1}%
{\@pstrickserr{Undefined fill style: `#1'}\@eha}%
{\edef\psk@fillstyle{%
\expandafter\noexpand\psk@fillstyle
\expandafter\noexpand\csname psfs@#1\endcsname}}}
\psset@fillstyle{none}
\def\psset@arrows#1{%
\begingroup
\pst@activearrows
\xdef\pst@tempg{#1}%
\endgroup
\expandafter\psset@@arrows\pst@tempg\@empty-\@empty\@nil
\if@pst\else
\@pstrickserr{Bad arrows specification: #1}\@ehpa
\fi}
\def\psset@@arrows#1-#2\@empty#3\@nil{%
\@psttrue
\def\next##1,#1-##2,##3\@nil{\def\pst@tempg{##2}}%
\expandafter\next\pst@arrowtable,#1-#1,\@nil
\@ifundefined{psas@\pst@tempg}%
{\@pstfalse\def\psk@arrowA{}}%
{\let\psk@arrowA\pst@tempg}%
\@ifundefined{psas@#2}%
{\@pstfalse\def\psk@arrowB{}}%
{\def\psk@arrowB{#2}}}
\def\psk@arrowA{}
\def\psk@arrowB{}
\def\pst@arrowtable{,<->,<<->>,>-<,>>-<<,(-),[-]}
\begingroup
\catcode`\<=13
\catcode`\>=13
\catcode`\|=13
\gdef\pst@activearrows{\def<{\string<}\def>{\string>}\def|{\string|}}
\endgroup
\def\tx@BeginArrow{BeginArrow }
\def\tx@EndArrow{EndArrow }
\def\psset@arrowscale#1{\pst@getscale{#1}\psk@arrowscale}
\psset@arrowscale{1}
\def\psset@arrowsize#1{%
\pst@expandafter\pst@getdimnum{#1} 0 {} {}\@nil
\edef\psk@arrowsize{\pst@number\pst@dimg \pst@tempg}}
\psset@arrowsize{1.5pt 2}
\def\psset@arrowlength#1{\pst@checknum{#1}\psk@arrowlength}
\psset@arrowlength{1.4}
\def\psset@arrowinset#1{\pst@checknum{#1}\psk@arrowinset}%
\psset@arrowinset{.4}
\def\tx@Arrow{Arrow }
\@namedef{psas@>}{%
false \psk@arrowinset \psk@arrowlength \psk@arrowsize \tx@Arrow}
\@namedef{psas@>>}{%
false \psk@arrowinset \psk@arrowlength \psk@arrowsize \tx@Arrow
0 h T
gsave
newpath
false \psk@arrowinset \psk@arrowlength \psk@arrowsize \tx@Arrow
CP
grestore
CP newpath moveto
2 copy
L
stroke
moveto}
\@namedef{psas@<}{%
true \psk@arrowinset \psk@arrowlength \psk@arrowsize \tx@Arrow}
\@namedef{psas@<<}{%
true \psk@arrowinset \psk@arrowlength \psk@arrowsize \tx@Arrow
CP newpath moveto 0 a neg L stroke 0 h neg T
false \psk@arrowinset \psk@arrowlength \psk@arrowsize \tx@Arrow}
\def\psset@tbarsize#1{%
\pst@expandafter\pst@getdimnum{#1} 0 {} {}\@nil
\edef\psk@tbarsize{\pst@number\pst@dimg \pst@tempg}}
\psset@tbarsize{2pt 5}
\def\tx@Tbar{Tbar }
\@namedef{psas@|}{\psk@tbarsize \tx@Tbar}
\@namedef{psas@|*}{0 CLW -2 div T \psk@tbarsize \tx@Tbar}
\@namedef{psas@>|}{%
\psk@tbarsize \tx@Tbar
0 CLW 2 div T
newpath
false \psk@arrowinset \psk@arrowlength \psk@arrowsize \tx@Arrow}
\@namedef{psas@>|*}{%
0 CLW -2 div T
\psk@tbarsize \tx@Tbar
0 CLW 2 div T
newpath
false \psk@arrowinset \psk@arrowlength \psk@arrowsize \tx@Arrow}
\edef\pst@arrowtable{\pst@arrowtable,|<*->|*,|<->|}
\def\psset@bracketlength#1{\pst@checknum{#1}\psk@bracketlength}
\psset@bracketlength{.15}
\def\tx@Bracket{Bracket }
\@namedef{psas@]}{\psk@bracketlength \psk@tbarsize \tx@Bracket}
\def\psset@rbracketlength#1{\pst@checknum{#1}\psk@rbracketlength}
\psset@rbracketlength{.15}
\def\tx@RoundBracket{RoundBracket }
\@namedef{psas@)}{\psk@rbracketlength \psk@tbarsize \tx@RoundBracket}
\def\psas@c{1 \psas@@c}
\def\psas@cc{0 CLW 2 div T 1 \psas@@c}
\def\psas@C{2 \psas@@c}
\def\psas@@c{%
setlinecap
0 0 moveto
0 CLW 2 div L
stroke
0 0 moveto}
\def\psas@{}
\psset@arrows{-}
\def\tx@SD{SD }
\def\tx@EndDot{EndDot }
\def\psas@oo{{\pst@usecolor\psfillcolor true} true \psk@dotsize \tx@EndDot}
\def\psas@o{{\pst@usecolor\psfillcolor true} false \psk@dotsize \tx@EndDot}
\@namedef{psas@**}{{false} true \psk@dotsize \tx@EndDot}
\@namedef{psas@*}{{false} false \psk@dotsize \tx@EndDot}
\def\pst@par{}
\def\addto@par#1{%
\ifx\pst@par\@empty
\def\pst@par{#1}%
\else
\expandafter\def\expandafter\pst@par\expandafter{\pst@par,#1}%
\fi}
\def\addbefore@par#1{%
\ifx\pst@par\@empty
\def\pst@par{#1}%
\else
\toks@{#1}%
\pst@toks\expandafter{\pst@par}%
\edef\pst@par{\the\toks@,\the\pst@toks}%
\fi}
\def\use@par{%
\ifx\pst@par\@empty\else
\expandafter\@psset\pst@par,\@nil
\def\pst@par{}%
\fi}
\def\pst@object#1{%
\pst@ifstar{%
\@ifnextchar[%
{\pst@@object{#1}}%
{\def\pst@par{}\@nameuse{#1@i}}}}
\def\pst@@object#1[#2]{%
\def\pst@par{#2}%
\@ifnextchar+{\@nameuse{#1@i}}{\@nameuse{#1@i}}}
\def\newpsobject#1#2#3{%
\@ifundefined{#2@i}%
{\@pstrickserr{Graphics object `#2' not defined}\@eha}{%
\@namedef{#1}{\pst@object{#1}}%
\@namedef{#1@i}{\addbefore@par{#3}\@nameuse{#2@i}}}%
\ignorespaces}
\def\pst@getarrows#1{\@ifnextchar({#1}{\pst@@getarrows{#1}}}
\def\pst@@getarrows#1#2{\addto@par{arrows=#2}#1}
\def\begin@ClosedObj{%
\leavevmode
\pst@killglue
\begingroup
\use@par
\solid@star
\ifpsdoubleline \pst@setdoublesep \fi
\init@pscode}
\def\end@ClosedObj{%
\ifpsshadow \pst@closedshadow \fi
\ifdim\psk@border\p@>\z@ \pst@addborder \fi
\psk@fillstyle
\pst@stroke
\ifpsdoubleline \pst@doublestroke \fi
\ifshowpoints
% DG modification begin - Mar. 4, 1995
%\addto@pscode{Points aload length 2 div cvi /N ED \psdots@iii}%
\pst@OpenShowPoints
% DG modification end
\fi
\use@pscode
\endgroup
\ignorespaces}
\def\begin@OpenObj{%
\begin@ClosedObj
\let\pst@linetype\pst@arrowtype
\pst@addarrowdef}
\def\begin@AltOpenObj{%
\begin@ClosedObj
\def\pst@repeatarrowsflag{\z@}%
\def\pst@linetype{0}}
\def\end@OpenObj{%
\ifpsshadow \pst@openshadow \fi
\ifdim\psk@border\p@>\z@ \pst@addborder \fi
\psk@fillstyle
\pst@stroke
\ifpsdoubleline \pst@doublestroke \fi
\ifnum\pst@repeatarrowsflag>\z@ \pst@repeatarrows \fi
\ifshowpoints \pst@OpenShowPoints \fi
\use@pscode
\endgroup
\ignorespaces}
\def\begin@SpecialObj{%
\leavevmode
\pst@killglue
\begingroup
\use@par
\init@pscode}
\def\end@SpecialObj{%
\use@pscode
\endgroup
\ignorespaces}
\def\pst@code{}%
\def\init@pscode{%
\addto@pscode{%
\pst@number\pslinewidth SLW
\pst@usecolor\pslinecolor}}
\def\addto@pscode#1{\xdef\pst@code{\pst@code#1\space}}
\def\use@pscode{%
\pstverb{%
\pst@dict
\tx@STP
\pst@newpath
\psk@origin
\psk@swapaxes
\pst@code
end}%
\gdef\pst@code{}}
\def\pst@newpath{newpath }
\def\pst@@killglue{\unskip\ifdim\lastskip>\z@\expandafter\pst@@killglue\fi}
\def\KillGlue{\let\pst@killglue\pst@@killglue}
\def\DontKillGlue{\let\pst@killglue\relax}
\DontKillGlue
\def\solid@star{%
\if@star
\pslinewidth=\z@
\psdoublelinefalse
\def\pslinestyle{none}%
\def\psk@fillstyle{\psfs@solid}%
\let\psfillcolor\pslinecolor
\fi}
\def\pst@setdoublesep{%
\pst@getlength\psdoublesep\psdoublesep
\pslinewidth=2\pslinewidth
\advance\pslinewidth\psdoublesep\p@
\let\pst@setdoublesep\relax}
\def\tx@Shadow{Shadow }
\def\pst@closedshadow{%
\addto@pscode{%
gsave
\psk@shadowsize \psk@shadowangle \tx@PtoC
\tx@Shadow
\pst@usecolor\psshadowcolor
gsave fill grestore
stroke
grestore
gsave
\pst@usecolor\psfillcolor
gsave fill grestore
stroke
grestore}}
\def\pst@openshadow{%
\addto@pscode{%
gsave
\psk@shadowsize \psk@shadowangle \tx@PtoC
\tx@Shadow
\pst@usecolor\psshadowcolor
\ifx\psk@fillstyle\relax\else
gsave fill grestore
\fi
stroke}%
\pst@repeatarrows
\addto@pscode{grestore}
\ifx\psk@fillstyle\relax\else
\addto@pscode{%
gsave
\pst@usecolor\psfillcolor
gsave fill grestore
stroke
grestore}
\fi}
\def\pst@addborder{%
\addto@pscode{%
gsave
\psk@border 2 mul
CLW add SLW
\pst@usecolor\psbordercolor
stroke
grestore}}
\def\pst@stroke{%
\ifx\pslinestyle\@none\else
\addto@pscode{%
gsave
\pst@number\pslinewidth SLW
\pst@usecolor\pslinecolor
\@nameuse{psls@\pslinestyle}
grestore}%
\fi}
\def\pst@fill#1{\addto@pscode{gsave #1 grestore}}%
\def\pst@doublestroke{%
\addto@pscode{%
gsave
\psdoublesep SLW
\pst@usecolor\psdoublecolor
stroke
grestore}}
\def\pst@arrowtype{%
\ifx\psk@arrowB\@empty 0 \else -2 \fi
\ifx\psk@arrowA\@empty 0 \else -1 \fi
add}
\def\pst@addarrowdef{%
\addto@pscode{%
/ArrowA {
\ifx\psk@arrowA\@empty
\pst@oplineto
\else
\pst@arrowdef{A}
moveto
\fi
} def
/ArrowB {
\ifx\psk@arrowB\@empty \else \pst@arrowdef{B} \fi
} def}}
\def\pst@arrowdef#1{%
\ifnum\pst@repeatarrowsflag>\z@
/Arrow#1c [ 6 2 roll ] cvx def Arrow#1c
\fi
\tx@BeginArrow
\psk@arrowscale
\@nameuse{psas@\@nameuse{psk@arrow#1}}
\tx@EndArrow}
\def\pst@repeatarrows{%
\addto@pscode{%
gsave
\ifx\psk@arrowA\@empty\else
ArrowAc ArrowA pop pop
\fi
\ifx\psk@arrowB\@empty\else
ArrowBc ArrowB pop pop pop pop
\fi
grestore}}
\def\pst@OpenShowPoints{%
\addto@pscode{%
gsave
\psk@dotsize
\@nameuse{psds@\psk@dotstyle}
newpath
Points aload length 2 div 2 sub cvi /N ED
N 0 ge
{ \ifx\psk@arrowA\@empty
Dot
\else
pop pop
\fi
N { Dot } repeat
\ifx\psk@arrowB\@empty
Dot
\else
pop pop
\fi }
{ N 2 mul { pop } repeat }
ifelse
grestore}}
\def\pscustom{\pst@object{pscustom}}
\long\def\pscustom@i#1{%
\begin@SpecialObj
\solid@star
\let\pst@ifcustom\iftrue
\let\begin@ClosedObj\begin@CustomObj
\let\end@ClosedObj\endgroup
\def\begin@OpenObj{\begin@CustomObj\pst@addarrowdef}%
\let\end@OpenObj\endgroup
\let\begin@AltOpenObj\begin@CustomObj
\def\begin@SpecialObj{%
\begingroup
\pst@misplaced{special graphics object}%
\def\addto@pscode####1{}
\let\end@SpecialObj\endgroup}%
\def\@multips(##1)(##2)##3##4{\pst@misplaced\multips}%
\def\psclip##1{\pst@misplaced\psclip}%
\def\pst@repeatarrowsflag{\z@}%
\let\pst@setrepeatarrowsflag\relax
\showpointsfalse
\let\showpointstrue\relax
\def\pst@linetype{\pslinetype}%
\let\psset@liftpen\psset@@liftpen
\psset@liftpen{\z@}%
\def\pst@cp{/currentpoint load stopped pop }%
\def\pst@oplineto{/lineto load stopped { moveto } if }%
\def\pst@optcp##1##2{%
\ifnum##1=\z@\def##2{/currentpoint load stopped { 0 0 } if }\fi}%
\let\caddto@pscode\addto@pscode
\def\cuse@par##1{{\use@par##1}}%
\the\pst@customdefs
\setbox\pst@hbox=\hbox{#1}%
\psk@fillstyle
\pst@stroke
\end@SpecialObj}
\def\begin@CustomObj{%
\begingroup
\use@par
\addto@pscode{%
\pst@number\pslinewidth SLW
\pst@usecolor\pslinecolor}}
\def\pst@oplineto{moveto }
\def\pst@cp{}
\def\pst@optcp#1#2{}
\def\psset@liftpen#1{}
\def\psset@@liftpen#1{%
\ifcase#1\relax
\def\psk@liftpen{\z@}%
\def\pst@cp{/currentpoint load stopped pop }%
\def\pst@oplineto{/lineto load stopped { moveto } if }%
\or
\def\psk@liftpen{1}%
\def\pst@cp{}%
\def\pst@oplineto{/lineto load stopped { moveto } if }%
\or
\def\psk@liftpen{2}%
\def\pst@cp{}%
\def\pst@oplineto{moveto }%
\fi}
\psset@liftpen{0}
\def\psk@liftpen{-1}
\def\psset@linetype#1{%
\pst@getint{#1}\pslinetype
\ifnum\pst@dimg<-3
\@pstrickserr{linetype must be greater than -3}\@ehpa
\def\pslinetype{0}%
\fi}
\psset@linetype{0}
\def\caddto@pscode#1{%
\@pstrickserr{Command can only be used in \string\pscustom}\@ehpa}
\let\cuse@par\caddto@pscode
\def\tx@MSave{%
/msavemtrx
[ tx@Dict /msavemtrx known { msavemtrx aload pop } if CM ]
def }
\def\tx@MRestore{%
tx@Dict /msavemtrx known { length 0 gt } { false } ifelse
{ /msavematrx [ msavematrx aload pop setmatrix ] def }
if }
\newtoks\pst@customdefs
\pst@customdefs{%
\def\newpath{\addto@pscode{newpath}}%
\def\moveto(#1){\pst@@getcoor{#1}\addto@pscode{\pst@coor moveto}}%
\def\closepath{\addto@pscode{closepath}}%
\def\gsave{\begingroup\addto@pscode{gsave}}%
\def\grestore{\endgroup\addto@pscode{grestore}}%
% DG/SR modification begin - May 12, 1997 - Patch 2
%\def\translate(#1){\pst@@getcoor{#1}\addto@pscode{\pst@coor moveto}}%
\def\translate(#1){\pst@@getcoor{#1}\addto@pscode{\pst@coor translate}}%
% DG/SR modification end
\def\rotate#1{\pst@@getangle{#1}\addto@pscode{\pst@angle rotate}}%
\def\scale#1{\pst@getscale{#1}\pst@tempg\addto@pscode{\pst@tempg}}%
\def\msave{\addto@pscode{\tx@MSave}}%
\def\mrestore{\addto@pscode{\tx@MRestore}}%
\def\swapaxes{\addto@pscode{-90 rotate -1 1 scale}}%
\def\stroke{\pst@object{stroke}}%
\def\fill{\pst@object{fill}}%
\def\openshadow{\pst@object{openshadow}}%
\def\closedshadow{\pst@object{closedshadow}}%
% DG/SR modification begin - Jan. 7, 1998 - Patch 8
%\def\movepath(#1){\pst@@getcoor{#1}\addto@pscode{\pst@coor tx@Shadow}}%
\def\movepath(#1){\pst@@getcoor{#1}\addto@pscode{\pst@coor \tx@Shadow}}%
% DG/SR modification end
\def\lineto{\pst@onecoor{lineto}}%
\def\rlineto{\pst@onecoor{rlineto}}%
\def\curveto{\pst@threecoor{curveto}}%
\def\rcurveto{\pst@threecoor{rcurveto}}%
\def\code#1{\addto@pscode{#1}}%
\def\coor(#1){\pst@@getcoor{#1}\addto@pscode\pst@coor\@ifnextchar({\coor}{}}%
\def\rcoor{\pst@getcoors{}{}}%
\def\dim#1{\pssetlength\pst@dimg{#1}\addto@pscode{\pst@number\pst@dimg}}%
\def\setcolor#1{%
\@ifundefined{color@#1}{}{\addto@pscode{\use@color{#1}}}}%
\def\arrows#1{{\psset@arrows{#1}\pst@addarrowdef}}%
\let\file\pst@rawfile
} % END \pst@customdefs
\def\closedshadow@i{\cuse@par\pst@closedshadow}
\def\openshadow@i{\cuse@par\pst@openshadow}
\def\stroke@i{\cuse@par\pst@stroke}%
\def\fill@i{\cuse@par\psk@fillstyle}%
\def\pst@onecoor#1(#2){%
\pst@@getcoor{#2}%
\addto@pscode{\pst@coor #1}}
\def\pst@threecoor#1(#2)#3(#4)#5(#6){%
\begingroup
\pst@getcoor{#2}\pst@tempa
\pst@getcoor{#4}\pst@tempb
% DG/SR modification begin - Aug.  4, 1999 - Patch 11
%\pst@getcoor{#6}\pst@tembc
\pst@getcoor{#6}\pst@tempc
% DG/SR modification end
\addto@pscode{\pst@tempa \pst@tempb \pst@tempc #1}%
\endgroup}
\def\pst@rawfile#1{%
\begingroup
\def\do##1{\catcode`##1=12\relax}"
\dospecials
\catcode`\%=14
\pst@@rawfile{#1}%
\endgroup}
\def\pst@@rawfile#1{%
\immediate\openin1 #1
\ifeof1
\@pstrickserr{File `#1' not found}\@ehpa
\else
\immediate\read1 to \pst@tempg
\loop
\ifeof1 \@pstfalse\else\@psttrue\fi
\if@pst
\addto@pscode\pst@tempg
\immediate\read1 to \pst@tempg
\repeat
\fi
\immediate\closein1\relax}
\def\tx@NArray{NArray }
\def\tx@NArray{NArray }
\def\tx@Line{Line }
\def\tx@Arcto{Arcto }
\def\tx@CheckClosed{CheckClosed }
\def\tx@Polygon{Polygon }
\def\psset@gangle#1{\pst@getangle{#1}\psk@gangle}
\psset@gangle{0}
\def\tx@Diamond{Diamond }
\def\psdiamond{\pst@object{psdiamond}}
\def\psdiamond@i(#1){%
\@ifnextchar({\psdiamond@ii(#1)}{\psdiamond@ii(0,0)(#1)}}
\def\psdiamond@ii(#1)(#2){%
\begin@ClosedObj
\pst@getcoor{#1}\pst@tempa
\pst@getcoor{#2}\pst@tempb
\addto@pscode{%
\psline@iii
pop
\psk@dimen
\pst@tempb
\psk@gangle
\pst@tempa
\tx@Diamond}%
\def\pst@linetype{4}%
\end@ClosedObj}
\def\tx@Triangle{Triangle }
\def\pstriangle{\pst@object{pstriangle}}
\def\pstriangle@i(#1){%
\@ifnextchar({\pstriangle@ii(#1)}{\pstriangle@ii(0,0)(#1)}}
\def\pstriangle@ii(#1)(#2){%
\begin@ClosedObj
\pst@getcoor{#1}\pst@tempa
\pst@getcoor{#2}\pst@tempb
\addto@pscode{%
\psline@iii
pop
\psk@dimen
\pst@tempb
\psk@gangle
\pst@tempa
\tx@Triangle}%
\def\pst@linetype{2}%
\end@ClosedObj}
\def\tx@CCA{CCA }
\def\tx@CCA{CCA }
\def\tx@CC{CC }
\def\tx@IC{IC }
\def\tx@BOC{BOC }
\def\tx@NC{NC }
\def\tx@EOC{EOC }
\def\tx@BAC{BAC }
\def\tx@NAC{NAC }
\def\tx@EAC{EAC }
\def\tx@OpenCurve{OpenCurve }
\def\tx@AltCurve{AltCurve }
\def\tx@ClosedCurve{ClosedCurve }
\def\psset@curvature#1{%
\edef\pst@tempg{#1 }%
\expandafter\psset@@curvature\pst@tempg * * * \@nil}
\def\psset@@curvature#1 #2 #3 #4\@nil{%
\pst@checknum{#1}\pst@tempg
\pst@checknum{#2}\pst@temph
\pst@checknum{#3}\pst@tempi
\edef\psk@curvature{\pst@tempg \pst@temph \pst@tempi}}
\psset@curvature{1 .1 0}
\def\pscurve{\pst@object{pscurve}}
\def\pscurve@i{%
\pst@getarrows{%
\begin@OpenObj
\pst@getcoors[\pscurve@ii}}
\def\pscurve@ii{%
\addto@pscode{%
\pst@cp
\psk@curvature\space /c ED /b ED /a ED
\ifshowpoints true \else false \fi
\tx@OpenCurve}%
\end@OpenObj}
\def\psecurve{\pst@object{psecurve}}
\def\psecurve@i{%
\pst@getarrows{%
\begin@OpenObj
\pst@getcoors[\psecurve@ii}}
\def\psecurve@ii{%
\addto@pscode{%
\psk@curvature\space /c ED /b ED /a ED
\ifshowpoints true \else false \fi
\tx@AltCurve}%
\end@OpenObj}
\def\psccurve{\pst@object{psccurve}}
\def\psccurve@i{%
\begin@ClosedObj
\pst@getcoors[\psccurve@ii}
\def\psccurve@ii{%
\addto@pscode{%
\psk@curvature\space /c ED /b ED /a ED
\ifshowpoints true \else false \fi
\tx@ClosedCurve}%
\def\pst@linetype{1}%
\end@ClosedObj}
\def\psset@dotsize#1{%
\pst@expandafter\pst@getdimnum{#1} 0 {} {}\@nil
\edef\psk@@dotsize{\pst@number\pst@dimg}%
\let\psk@@@dotsize\pst@tempg
\edef\psk@dotsize{%
/DS \psk@@dotsize \psk@@@dotsize CLW mul add 2 div def }}
\psset@dotsize{2pt 2}
\def\psset@dotscale#1{%
\pst@getscale{#1}\psk@dotscale
\ifx\psk@dotscale\@empty
\def\psk@xdotscale{1 }%
\def\psk@ydotscale{1 }%
\else
\let\psk@xdotscale\pst@tempg
\let\psk@ydotscale\pst@temph
\fi}
% DG/SR modification begin - Oct. 17, 1997 - Patch 5
%\psset@dotscale{1}
% DG/SR modification end
\def\pst@Getangle#1#2{%
\pst@getangle{#1}\pst@tempg
\def\pst@temph{0. }%
\ifx\pst@tempg\pst@temph
\def#2{}%
\else
\edef#2{\pst@tempg\space rotate }%
\fi}
\def\psset@dotangle#1{%
\pst@getangle{#1}\psk@@dotangle
\ifdim\psk@@dotangle\p@=\z@
\let\psk@dotangle\@empty
\else
% DG/SR modification begin - Aug. 8, 1997 - Patch 4
%\edef\psk@dotangle{\psk@@dotangle rotate }
\edef\psk@dotangle{\psk@@dotangle rotate }%
% DG/SR modification end
\fi}
\psset@dotangle{0}
\def\pst@getdotsize{%
\pst@dimg=\psk@@@dotsize\pslinewidth
\advance\pst@dimg\psk@@dotsize\p@
\pst@dimh=\psk@ydotscale\pst@dimg
\pst@dimg=\psk@xdotscale\pst@dimg
\divide\pst@dimh 2
\divide\pst@dimg 2\relax}
% DG/SR modification begin - Oct. 17, 1997 - Patch 5
\psset@dotscale{1}
% DG/SR modification end
\def\psdot{\pst@object{psdot}}
\def\psdot@i{\@ifnextchar({\psdot@ii}{\psdot@ii(\z@,\z@)}}
\def\psdot@ii(#1){%
\begin@SpecialObj
\pst@@getcoor{#1}%
\addto@pscode{%
\psk@dotsize
\@nameuse{psds@\psk@dotstyle}%
\pst@coor Dot}%
\end@SpecialObj}
\def\psdots{\pst@object{psdots}}
\def\psdots@i{%
\begin@SpecialObj
\pst@getcoors[\psdots@ii}
\def\psdots@ii{%
\addto@pscode{false \tx@NArray \psdots@iii}%
\end@SpecialObj}
\def\psdots@iii{%
\psk@dotsize
\@nameuse{psds@\psk@dotstyle}
newpath
n { transform floor .5 add exch floor .5 add exch itransform Dot } repeat}
% DG: dead code (to suppress until \psset@dotstyle) ? - Aug. 4, 1997
\def\tx@SQ{SQ }
\def\tx@ST{ST }
\def\tx@SP{SP }
\def\pst@gdot#1{/Dot { gsave T \psk@dotangle \psk@dotscale #1 grestore } def }
\@namedef{psds@*}{\pst@gdot{0 0 DS \tx@SD}}
\@namedef{psds@o}{%
/r2 DS CLW sub def
\pst@gdot{0 0 DS \tx@SD \pst@usecolor\psfillcolor 0 0 r2 \tx@SD}}
\@namedef{psds@square*}{%
/r1 DS .886 mul def
\pst@gdot{r1 \tx@SQ}}
\@namedef{psds@square}{%
/r1 DS .886 mul def /r2 r1 CLW sub def
\pst@gdot{r1 \tx@SQ \pst@usecolor\psfillcolor r2 \tx@SQ}}
\@namedef{psds@triangle*}{%
/y1 DS .778 mul neg def /x1 y1 1.732 mul neg def
\pst@gdot{x1 y1 \tx@ST}}
\@namedef{psds@triangle}{%
/y1 DS .778 mul neg def /x1 y1 1.732 mul neg def
/y2 y1 CLW add def /x2 y2 1.732 mul neg def
\pst@gdot{x1 y1 \tx@ST \pst@usecolor\psfillcolor x2 y2 \tx@ST}}
\@namedef{psds@pentagon*}{%
/r1 DS 1.149 mul def
\pst@gdot{r1 \tx@SP}}
\@namedef{psds@pentagon}{%
DS .93 mul dup 1.236 mul /r1 ED CLW sub 1.236 mul /r2 ED
\pst@gdot{r1 \tx@SP \pst@usecolor\psfillcolor r2 \tx@SP}}
\@namedef{psds@+}{%
/DS DS 1.253 mul def
\pst@gdot{DS 0 moveto DS neg 0 L stroke 0 DS moveto 0 DS neg L stroke}}
\@namedef{psds@|}{%
\psk@tbarsize CLW mul add 2 div /DS ED
\pst@gdot{0 DS moveto 0 DS neg L stroke}}
% DG: end dead code?
\def\psset@dotstyle#1{%
\@ifundefined{psds@#1}%
{\@pstrickserr{Dot style `#1' not defined}\@eha}%
{\edef\psk@dotstyle{#1}}}
\psset@dotstyle{*}
\def\tx@FontDot{FontDot }
\def\newpsfontdot#1[#2]#3#4{%
\@namedef{psds@#1}{%
/#3 \psk@@dotangle [#2] \tx@FontDot
% DG/SR modification begin - Dec. 12, 1999 - Patch 14
%/Dot { moveto #4 show } bind def }}
/Dot { moveto gsave \psk@dotscale #4 show grestore } bind def }}
% DG/SR modification end
\def\newpsfontdotH#1[#2]#3#4#5{%
\@namedef{psds@#1}{%
/#3 \psk@@dotangle [#2] \tx@FontDot
/Dot {
moveto
\iftrue
% DG/SR modification begin - Dec. 23, 1999 - Patch 14
%gsave \pst@usecolor\psfillcolor #5 show grestore
%\fi
%#4 show
gsave \psk@dotscale \pst@usecolor\psfillcolor #5 show grestore
\fi
gsave \psk@dotscale #4 show grestore
% DG/SR modification end
} bind def }}
\pstheader{pst-dots.pro}
\newpsfontdot{*}%
[1.0 0.0 0.0 1.0 0.0 0.0]{PSTricksDotFont}{(b)}
\newpsfontdotH{o}%
[1.0 0.0 0.0 1.0 0.0 0.0]{PSTricksDotFont}{(c)}{(b)}
\newpsfontdotH{Bo}%
[1.0 0.0 0.0 1.0 0.0 0.0]{PSTricksDotFont}{(C)}{(b)}
\newpsfontdotH{triangle}%
[1.0 0.0 0.0 1.0 0.0 0.0]{PSTricksDotFont}{(t)}{(u)}
\newpsfontdotH{Btriangle}%
[1.0 0.0 0.0 1.0 0.0 0.0]{PSTricksDotFont}{(T)}{(u)}
\newpsfontdot{triangle*}%
[1.0 0.0 0.0 1.0 0.0 0.0]{PSTricksDotFont}{(u)}
\newpsfontdotH{square}%
[1.0 0.0 0.0 1.0 0.0 0.0]{PSTricksDotFont}{(s)}{(r)}
\newpsfontdotH{Bsquare}%
[1.0 0.0 0.0 1.0 0.0 0.0]{PSTricksDotFont}{(S)}{(r)}
\newpsfontdot{square*}%
[1.0 0.0 0.0 1.0 0.0 0.0]{PSTricksDotFont}{(r)}
\newpsfontdotH{pentagon}%
[1.0 0.0 0.0 1.0 0.0 0.0]{PSTricksDotFont}{(p)}{(q)}
\newpsfontdotH{Bpentagon}%
[1.0 0.0 0.0 1.0 0.0 0.0]{PSTricksDotFont}{(P)}{(q)}
\newpsfontdot{pentagon*}%
[1.0 0.0 0.0 1.0 0.0 0.0]{PSTricksDotFont}{(q)}
% DG/SR modification begin - Mar. 18, 1997 and Dec. 16, 1999 - Patch 14
%\newpsfontdot{diamond*}%
%[1.9 0.0 0.0 1.9 -0.4598 -0.70775]{Symbol}{<E0>}
%\newpsfontdot{diamond}%
%[2.3 0.0 0.0 2.3 -0.8533 -0.5336]{Symbol}{<A8>}
% D.G. modification begin - Jan. 17, 2000
\newpsfontdotH{diamond}%
[1.0 0.0 0.0 1.0 0.0 0.0]{PSTricksDotFont}{(d)}{(l)}
\newpsfontdotH{Bdiamond}%
[1.0 0.0 0.0 1.0 0.0 0.0]{PSTricksDotFont}{(D)}{(l)}
\newpsfontdot{diamond*}%
[1.0 0.0 0.0 1.0 0.0 0.0]{PSTricksDotFont}{(l)}
% DG/SR modification end
\newpsfontdot{oplus}%
[1.44928 0.0 0.0 1.44928 -0.562319 -0.478261]{Symbol}{<C5>}
\newpsfontdot{otimes}%
[1.44928 0.0 0.0 1.44928 -0.562319 -0.475362]{Symbol}{<C4>}
\newpsfontdot{x}%
[1.8 0.0 0.0 1.8 -0.495 -0.4788]{Symbol}{<B4>}
\newpsfontdot{+}%
[2.3 0.0 0.0 2.3 -0.6486 -0.5819]{Times-Roman}{<2B>}
\newpsfontdot{asterisk}%
[2.43309 0.0 0.0 2.43309 -0.609489 -1.14477]{Times-Roman}{<2A>}
\newpsfontdot{B+}%
[2.3 0.0 0.0 2.3 -0.6555 -0.5819]{Times-Bold}{<2B>}
\newpsfontdot{Basterisk}%
[2.29358 0.0 0.0 2.29358 -0.576835 -1.08486]{Times-Bold}{<2A>}
\newpsfontdot{|}%
% DG/SR modification begin - Oct. 27, 1997 - Patch 7
%[1.98413 0.0 0.0 1.98413 -0.258929 -0.712302]{Helvetica}{(|)}
[1.98413 0.0 0.0 1.38 -0.258929 -0.5]{Helvetica}{(|)}
% DG/SR modification end
\newpsfontdot{B|}%
% DG/SR modification begin - Oct. 27, 1997 - Patch 7
%[1.98413 0.0 0.0 1.98413 -0.277778 -0.78302]{Helvetica-Bold}{(|)}
[1.98413 0.0 0.0 1.38 -0.277778 -0.5]{Helvetica-Bold}{(|)}
% DG/SR modification end
\iffalse
\newpsfontdot{*}%
[2.77778 0.0 0.0 2.77778 -0.638889 -0.813889]{Symbol}{<B7>}
\newpsfontdot{o}%
[3.33333 0.0 0.0 3.33333 -0.666667 -1.78167]{Symbol}{<B0>}
\newpsfontdot{Bo}%
[4.69484 0.0 0.0 4.69484 -0.78169 -2.97418]{Times-Bold}{<CA>}
\fi
\newdimen\pslinearc
\def\psset@linearc#1{\pssetlength\pslinearc{#1}}
\psset@linearc{0pt}
\def\psline{\pst@object{psline}}
\def\psline@i{%
\pst@getarrows{%
\begin@OpenObj
\pst@getcoors[\psline@ii}}
\def\psline@ii{%
\addto@pscode{\pst@cp \psline@iii \tx@Line}%
\end@OpenObj}
\def\psline@iii{%
\ifdim\pslinearc>\z@
/r \pst@number\pslinearc def
/Lineto { \tx@Arcto } def
\else
/Lineto /lineto load def
\fi
\ifshowpoints true \else false \fi}
\def\qline(#1)(#2){%
\def\pst@par{}%
\begin@SpecialObj
\def\pst@linetype{0}%
\pst@getcoor{#1}\pst@tempa
\pst@@getcoor{#2}%
\addto@pscode{%
\pst@tempa moveto \pst@coor L
\@nameuse{psls@\pslinestyle}}%
\end@SpecialObj}
\def\pspolygon{\pst@object{pspolygon}}
\def\pspolygon@i{%
\begin@ClosedObj
\def\pst@cp{}%
\pst@getcoors[\pspolygon@ii}
\def\pspolygon@ii{%
\addto@pscode{\psline@iii \tx@Polygon}%
\def\pst@linetype{1}%
\end@ClosedObj}
\def\psset@framearc#1{\pst@checknum{#1}\psk@framearc}
\psset@framearc{0}
\def\psset@cornersize#1{%
\pst@expandafter\psset@@cornersize{#1}\@nil}
\def\psset@@cornersize#1#2\@nil{%
\if #1a\relax
\def\psk@cornersize{\pst@number\pslinearc false }%
\else
\def\psk@cornersize{\psk@framearc true }%
\fi}
\psset@cornersize{relative}
\def\tx@Rect{Rect }
\def\tx@OvalFrame{OvalFrame }
\def\tx@Frame{Frame }
\def\psset@dimen#1{%
\pst@expandafter\psset@@dimen{#1}\@nil}
\def\psset@@dimen#1#2\@nil{%
\if #1o\relax
\def\psk@dimen{.5 }%
\else
\if #1m\relax
\def\psk@dimen{0 }%
\else
\if #1i\relax
\def\psk@dimen{-.5 }%
\fi
\fi
\fi}
\psset@dimen{outer}
\def\psframe{\pst@object{psframe}}
\def\psframe@i(#1){%
\@ifnextchar({\psframe@ii(#1)}{\psframe@ii(0,0)(#1)}}
\def\psframe@ii(#1)(#2){%
\begin@ClosedObj
\pst@getcoor{#1}\pst@tempa
\pst@@getcoor{#2}%
\addto@pscode{\psk@cornersize \pst@tempa \pst@coor \psk@dimen \tx@Frame}%
\def\pst@linetype{2}%
\showpointsfalse
\end@ClosedObj}
\def\tx@BezierNArray{BezierNArray }
\def\tx@OpenBezier{OpenBezier }
\def\tx@ClosedBezier{ClosedBezier }
\def\tx@BezierShowPoints{BezierShowPoints }
\def\psbezier{\pst@object{psbezier}}
\def\psbezier@i{%
\pst@getarrows{%
\begin@OpenObj
\pst@getcoors[\psbezier@ii}}
\def\psbezier@ii{%
\addto@pscode{%
% DG/SR modification begin - Apr. 28, 1997 - Patch 1
% \psbezier doesn't work inside \pscustom
%\pst@cp
% DG/SR modification end
\ifshowpoints true \else false \fi
\tx@OpenBezier
\ifshowpoints \tx@BezierShowPoints \fi}%
\end@OpenObj}
\def\pscbezier{\pst@object{pscbezier}}
\def\pscbezier@i{%
\begin@ClosedObj
\pst@getcoors[\pscbezier@ii}
\def\pscbezier@ii{%
\addto@pscode{%
\ifshowpoints true \else false \fi
\tx@ClosedBezier
\ifshowpoints \tx@BezierShowPoints \fi}%
\chardef\pst@linetype=1
\end@ClosedObj}
\def\tx@Parab{Parab }
\def\parabola{\pst@object{parabola}}
\def\parabola@i{\pst@getarrows\parabola@ii}
\def\parabola@ii#1(#2)#3(#4){%
\begin@OpenObj
\pst@getcoor{#2}\pst@tempa
\pst@@getcoor{#4}%
\addto@pscode{\pst@tempa \pst@coor \tx@Parab}%
\end@OpenObj}
\def\psset@gridwidth#1{\pst@getlength{#1}\psk@gridwidth}
\psset@gridwidth{.8pt}
\def\psset@griddots#1{%
\pst@cntg=#1\relax
\edef\psk@griddots{\the\pst@cntg}}
\psset@griddots{0}
\def\psset@gridcolor#1{\pst@getcolor{#1}\psgridcolor}
\psset@gridcolor{black}
\def\psset@subgridwidth#1{\pst@getlength{#1}\psk@subgridwidth}
\psset@subgridwidth{.4pt}
\def\psset@subgridcolor#1{\pst@getcolor{#1}\pssubgridcolor}
\psset@subgridcolor{gray}
\def\psset@subgriddots#1{%
\pst@cntg=#1\relax\edef\psk@subgriddots{\the\pst@cntg}}
\psset@subgriddots{0}
\def\psset@subgriddiv#1{%
\pst@cntg=#1\relax\edef\psk@subgriddiv{\the\pst@cntg}}
\psset@subgriddiv{5}
\def\psset@gridlabels#1{\pst@getlength{#1}\psk@gridlabels}
\psset@gridlabels{10pt}
\def\psset@gridlabelcolor#1{\pst@getcolor{#1}\psgridlabelcolor}
\psset@gridlabelcolor{black}
\def\tx@Grid{Grid }
\def\psgrid{\pst@object{psgrid}}
\def\psgrid@i{\@ifnextchar(%
{\psgrid@ii}{\expandafter\psgrid@iv\pic@coor}}
\def\psgrid@ii(#1){\@ifnextchar(%
{\psgrid@iii(#1)}{\psgrid@iv(0,0)(0,0)(#1)}}
\def\psgrid@iii(#1)(#2){\@ifnextchar(%
{\psgrid@iv(#1)(#2)}{\psgrid@iv(#1)(#1)(#2)}}
\def\psgrid@iv(#1)(#2)(#3){%
\begin@SpecialObj
\pst@getcoor{#1}\pst@tempa
\pst@getcoor{#2}\pst@tempb
\pst@@getcoor{#3}%
\ifnum\psk@subgriddiv>1
\addto@pscode{gsave
\psk@subgridwidth SLW \pst@usecolor\pssubgridcolor
\pst@tempb \pst@coor \pst@tempa
\pst@number\psxunit \pst@number\psyunit
\psk@subgriddiv\space \psk@subgriddots\space
{} 0 \tx@Grid grestore}%
\fi
\addto@pscode{gsave
\psk@gridwidth SLW \pst@usecolor\psgridcolor
\pst@tempb \pst@coor \pst@tempa
\pst@number\psxunit \pst@number\psyunit
1 \psk@griddots\space { \pst@usecolor\psgridlabelcolor }
\psk@gridlabels \tx@Grid grestore}%
\end@SpecialObj}
\newif\ifpsmathbox
\psmathboxtrue
\def\pst@mathflag{\z@}
\newtoks\everypsbox
\let\pst@thisbox\relax
\long\def\pst@makenotverbbox#1#2{%
\edef\pst@mathflag{%
\ifpsmathbox\ifmmode\ifinner 1\else 2\fi\else \z@\fi\else \z@\fi}%
\setbox\pst@hbox=\hbox{%
\ifcase\pst@mathflag\or$\m@th\textstyle\or$\m@th\displaystyle\fi
{\pst@thisbox\the\everypsbox#2}%
\ifnum\pst@mathflag>\z@$\fi}%
#1}
\def\pst@makeverbbox#1{%
\def\pst@afterbox{#1}%
\edef\pst@mathflag{%
\ifpsmathbox\ifmmode\ifinner 1\else 2\fi\else \z@\fi\else \z@\fi}%
\afterassignment\pst@beginbox
\setbox\pst@hbox\hbox}
\def\pst@beginbox{%
\ifcase\pst@mathflag\or$\m@th\or$\m@th\displaystyle\fi
\bgroup\aftergroup\pst@endbox
\pst@thisbox
\the\everypsbox}
\def\pst@endbox{%
\ifnum\pst@mathflag>\z@$\fi
\egroup
\pst@afterbox}
\def\pst@makebox{\pst@@makebox}
\def\psverbboxtrue{\def\pst@@makebox{\pst@makeverbbox}}
\def\psverbboxfalse{\def\pst@@makebox{\pst@makenotverbbox}}
\psverbboxfalse
\def\pst@longbox{%
\def\pst@makebox{%
\gdef\pst@makebox{\pst@@makebox}%
\pst@makelongbox}}
\def\pst@makelongbox#1{%
\def\pst@afterbox{#1}%
\edef\pst@mathflag{%
\ifpsmathbox\ifmmode\ifinner 1\else 2\fi\else \z@\fi\else \z@\fi}%
\setbox\pst@hbox\hbox\bgroup
\aftergroup\pst@afterbox
\ifcase\pst@mathflag\or$\m@th\or$\m@th\displaystyle\fi
\begingroup
\pst@thisbox
\the\everypsbox}
\def\pst@endlongbox{%
\endgroup
\ifnum\pst@mathflag>\z@$\fi
\egroup}
\def\pslongbox#1#2{%
\@namedef{#1}{\pst@longbox#2}%
\@namedef{end#1}{\pst@endlongbox}}
\newdimen\psframesep
\def\psset@framesep#1{\pssetlength\psframesep{#1}}
\psset@framesep{3pt}
\newif\ifpsboxsep
\def\psset@boxsep#1{\@nameuse{psboxsep#1}}
\psset@boxsep{true}
\def\pst@useboxpar{%
\use@par
\if@star
\let\pslinecolor\psfillcolor
\solid@star
\let\solid@star\relax
\fi
\ifpsdoubleline \pst@setdoublesep \fi}
\def\psframebox{\pst@object{psframebox}}
\def\psframebox@i{\pst@makebox\psframebox@ii}
\def\psframebox@ii{%
\begingroup
\pst@useboxpar
\pst@dima=\pslinewidth
\advance\pst@dima by \psframesep
\pst@dimc=\wd\pst@hbox\advance\pst@dimc by \pst@dima
\pst@dimb=\dp\pst@hbox\advance\pst@dimb by \pst@dima
\pst@dimd=\ht\pst@hbox\advance\pst@dimd by \pst@dima
\setbox\pst@hbox=\hbox{%
\ifpsboxsep\kern\pst@dima\fi
\begin@ClosedObj
\addto@pscode{%
\psk@cornersize
\pst@number\pst@dima neg
\pst@number\pst@dimb neg
\pst@number\pst@dimc
\pst@number\pst@dimd
.5
\tx@Frame}%
\def\pst@linetype{2}%
\showpointsfalse
\end@ClosedObj
\box\pst@hbox
\ifpsboxsep\kern\pst@dima\fi}%
\ifpsboxsep\dp\pst@hbox=\pst@dimb\ht\pst@hbox=\pst@dimd\fi
\leavevmode\box\pst@hbox
\endgroup}
\def\psdblframebox{\pst@object{psdblframebox}}
\def\psdblframebox@i{\addto@par{doubleline=true}\psframebox@i}
\def\psclip#1{%
\leavevmode
\begingroup
\begin@psclip
\begingroup
\def\use@pscode{%
\pstVerb{%
\pst@dict
/mtrxc CM def
CP CP T
\tx@STV
\psk@origin
\psk@swapaxes
newpath
\pst@code
clip
newpath
mtrxc setmatrix
moveto
0 setgray
end}%
\gdef\pst@code{}}%
\def\@multips(##1)(##2)##3##4{\pst@misplaced\multips}%
\def\nc@object##1##2##3##4{\pst@misplaced{node connection}}%
\hbox to\z@{#1}%
\endgroup
\def\endpsclip{%
\end@psclip
\endgroup}%
\ignorespaces}
\def\endpsclip{\pst@misplaced\endpsclip}
\let\begin@psclip\relax
\def\end@psclip{\pstVerb{currentpoint initclip moveto}}
\def\AltClipMode{%
\def\end@psclip{\pstVerb{\pst@grestore}}%
\def\begin@psclip{\pstVerb{gsave}}}
\def\clipbox{\@ifnextchar[{\clipbox@}{\clipbox@[\z@]}}
% DG modification begin - Apr. 3, 1997
% From paulus@immd5.informatik.uni-erlangen.de (Dietrich Paulus)
%\def\clipbox@[#1]{\pst@makebox\clipbox@@{#1}}
\def\clipbox@[#1]{\pst@makebox{\clipbox@@{#1}}}
% DG modification end
\def\clipbox@@#1{%
\pssetlength\pst@dimg{#1}%
\leavevmode\hbox{%
\begin@psclip
\pst@Verb{%
CM \tx@STV CP T newpath
/a \pst@number\pst@dimg def
/w \pst@number{\wd\pst@hbox}a add def
/d \pst@number{\dp\pst@hbox}a add neg def
/h \pst@number{\ht\pst@hbox}a add def
a neg d moveto
a neg h L
w h L
w d L
closepath
clip
newpath
0 0 moveto
setmatrix}%
\unhbox\pst@hbox
\end@psclip}}
\def\psshadowbox{\pst@object{psshadowbox}}
\def\psshadowbox@i{\pst@makebox\psshadowbox@ii}
\def\psshadowbox@ii{%
\begingroup
\pst@useboxpar
\psshadowtrue
\psboxseptrue
\def\psk@shadowangle{-45 }%
\setbox\pst@hbox=\hbox{\psframebox@ii}%
\pst@dimh=\psk@shadowsize\p@
\pst@dimh=.7071\pst@dimh
\pst@dimg=\dp\pst@hbox
\advance\pst@dimg\pst@dimh
\dp\pst@hbox=\pst@dimg
\pst@dimg=\wd\pst@hbox
\advance\pst@dimg\pst@dimh
\wd\pst@hbox=\pst@dimg
\leavevmode
\box\pst@hbox
\endgroup}
\def\pscirclebox{\pst@object{pscirclebox}}
\def\pscirclebox@i{\pst@makebox\pscirclebox@ii}
\def\pscirclebox@ii{%
\begingroup
\pst@useboxpar
\setbox\pst@hbox=\hbox{%
\pst@nodehook
\pscirclebox@iii
\box\pst@hbox}%
\ifpsboxsep \pscirclebox@sep \fi
\leavevmode
\box\pst@hbox
\endgroup}
\def\pscirclebox@iii{%
\if@star
\pslinewidth\z@
\pstverb{\pst@dict \tx@STP \pst@usecolor\psfillcolor
newpath \pscirclebox@iv \tx@SD end}%
\else
\begin@ClosedObj
\def\pst@linetype{4}\showpointsfalse
\addto@pscode{%
\pscirclebox@iv CLW 2 div add 0 360 arc closepath}%
\end@ClosedObj
\fi}
\def\pscirclebox@iv{%
\pst@number{\wd\pst@hbox}2 div
\pst@number{\ht\pst@hbox}\pst@number{\dp\pst@hbox}add 2 div
2 copy \pst@number{\dp\pst@hbox}sub 4 2 roll
\tx@Pyth \pst@number\psframesep add }
\def\pscirclebox@sep{%
\pst@dimb=\ht\pst@hbox
\advance\pst@dimb\dp\pst@hbox
\divide\pst@dimb 2
\pst@dima=.5\wd\pst@hbox
\pst@pyth\pst@dima\pst@dimb\pst@dimc
\advance\pst@dimc\pslinewidth
\advance\pst@dimc\psframesep
\advance\pst@dimb-\pst@dimc
\setbox\pst@hbox=\hbox to2\pst@dimc{%
\hss
\vbox{\kern-\pst@dimb\box\pst@hbox}%
\hss}%
\advance\pst@dimb-\dp\pst@hbox
\dp\pst@hbox=-\pst@dimb}
\let\pst@nodehook\relax
\def\psCirclebox{\pst@object{psCirclebox}}
\def\psCirclebox@i{\pst@makebox\psCirclebox@ii}
\def\psCirclebox@ii{%
\begingroup
\pst@useboxpar
\pst@dima=\ht\pst@hbox
\advance\pst@dima\dp\pst@hbox
\divide\pst@dima\tw@
\pssetlength\pst@dimb\psk@radius
\setbox\pst@hbox=\hbox{%
\pst@nodehook
\pscircle(.5\wd\pst@hbox,\pst@dima){\pst@dimb}%
\box\pst@hbox}%
\ifpsboxsep \psCirclebox@sep \fi
\leavevmode
\box\pst@hbox
\endgroup}
\def\psCirclebox@sep{%
\pst@dimc=\pst@dimb
\advance\pst@dimb-\pst@dima
\advance\pst@dima\pst@dimc
\setbox\pst@hbox=\hbox to\tw@\pst@dimc{%
\hss
\vrule width \z@ depth \pst@dimb height \pst@dima
\box\pst@hbox
\hss}}%
\def\psovalbox{\pst@object{psovalbox}}
\def\psovalbox@i{\pst@makebox{\psovalbox@ii}}
\def\psovalbox@ii{%
\begingroup
\pst@useboxpar
\psovalbox@iii
\ifpsboxsep\psovalbox@sep\fi
\leavevmode
\box\pst@hbox
\endgroup}
\def\psovalbox@iii{%
\psovalbox@iv
\setbox\pst@hbox=\hbox{%
\begin@ClosedObj
\addto@pscode{%
0 360
\pst@number\pst@dimc CLW 2 div sub
\pst@number\pst@dimd CLW 2 div sub
\pst@number\pst@dima
\pst@number\pst@dimb
\tx@Ellipse
closepath}%
\def\pst@linetype{2}%
\end@ClosedObj
\unhbox\pst@hbox}}
\def\psovalbox@iv{%
\pst@dimc=\pslinewidth\advance\pst@dimc\psframesep
\pst@dimd=\ht\pst@hbox\advance\pst@dimd\dp\pst@hbox
\pst@dima=.5\wd\pst@hbox
\pst@dimb=.5\pst@dimd\advance\pst@dimb-\dp\pst@hbox
\pst@dimd=.707\pst@dimd
\advance\pst@dimd\pst@dimc
\advance\pst@dimc.707\wd\pst@hbox}
\def\psovalbox@sep{%
\setbox\pst@hbox\hbox to 2\pst@dimc{\hss\unhbox\pst@hbox\hss}%
\pst@dimg=\pst@dimd
\advance\pst@dimg-\pst@dimb
\dp\pst@hbox=\pst@dimg
\advance\pst@dimd\pst@dimb
\ht\pst@hbox=\pst@dimd}
\def\psdiabox{\pst@object{psdiabox}}
\def\psdiabox@i{\pst@makebox{\psdiabox@ii}}
\def\psdiabox@ii{%
\begingroup
\pst@useboxpar
\psdiabox@iii
\ifpsboxsep\psdiabox@sep\fi
\leavevmode
\box\pst@hbox
\endgroup}
\def\psdiabox@iv{%
\pst@dimg=.707\pslinewidth
\advance\pst@dimg.707\psframesep
\pst@dima=\wd\pst@hbox
\divide\pst@dima 2
\pst@dimc=\pst@dima
\advance\pst@dimc\pst@dimg
\pst@dimd=\ht\pst@hbox
\advance\pst@dimd\dp\pst@hbox
\divide\pst@dimd 2
\pst@dimb=\pst@dimd
\advance\pst@dimb-\dp\pst@hbox
\advance\pst@dimd\pst@dimg}
\def\psdiabox@iii{%
\psdiabox@iv
\setbox\pst@hbox=\hbox{%
\begin@ClosedObj
\addto@pscode{%
\psline@iii
pop
.5
\pst@number\pst@dimc 2 mul \pst@number\pst@dimd 2 mul
0
\pst@number\pst@dima \pst@number\pst@dimb
\tx@Diamond}%
\def\pst@linetype{4}%
\end@ClosedObj
\box\pst@hbox}}
\def\psdiabox@sep{%
\setbox\pst@hbox\hbox to 4\pst@dimc{\hss\unhbox\pst@hbox\hss}%
\multiply\pst@dimd 2
\advance\pst@dimd\pst@dimb
\ht\pst@hbox\pst@dimd
\advance\pst@dimd-2\pst@dimb
\dp\pst@hbox\pst@dimd}
\def\psset@trimode#1{\pst@expandafter\psset@@trimode{#1}\@empty\@empty\@nil}
\def\psset@@trimode#1#2#3\@nil{%
\let\pst@tempg#1\relax
\ifx\pst@tempg*%
\let\psk@@trimode\@empty
\let\pst@tempg#2\relax
\else
\let\psk@@trimode\relax
\fi
\edef\psk@trimode{%
\ifx R\pst@tempg 1 \else\ifx D\pst@tempg 2
\else\ifx L\pst@tempg 3 \else 0 \fi\fi\fi}}
\psset@trimode{U}
\def\pstribox{\pst@object{pstribox}}
\def\pstribox@i{\pst@makebox{\pstribox@ii}}
\def\pstribox@ii{%
\begingroup
\pst@useboxpar
\pstribox@iii
\ifpsboxsep\pstribox@sep\fi
\leavevmode
\box\pst@hbox
\endgroup}
\def\pstribox@iii{%
\pstribox@iv
\setbox\pst@hbox=\hbox{%
\begin@ClosedObj
\addto@pscode{%
\psline@iii
pop
.5
\pst@number\pst@dimc \pst@number\pst@dimd
\ifodd\psk@trimode exch \fi
\psk@trimode -90 mul
\pst@number\pst@dima \pst@number\pst@dimb
\tx@Triangle}%
\def\pst@linetype{2}%
\end@ClosedObj
\box\pst@hbox}}
\def\pstribox@iv{%
\pst@dimh=\pslinewidth
\advance\pst@dimh\psframesep
\pst@dimg=\ht\pst@hbox
\advance\pst@dimg-\dp\pst@hbox
\divide\pst@dimg 2
\edef\pst@tempa{\number\pst@dimg sp}% For use by nodes.
\ifodd\psk@trimode
\pst@dimb\pst@dimg
\else
\pst@dima=\wd\pst@hbox
\divide\pst@dima 2
\fi
\ifcase\psk@trimode
\pst@dimb=-\dp\pst@hbox
\advance\pst@dimb-\pst@dimh
\or
\pst@dima=-\pst@dimh
\or
\pst@dimb=\ht\pst@hbox
\advance\pst@dimb\pst@dimh
\or
\pst@dima=\wd\pst@hbox
\advance\pst@dima\pst@dimh
\fi
\pst@dimd=\dp\pst@hbox
\advance\pst@dimd\ht\pst@hbox
\ifx\psk@@trimode\relax
\pst@dimc=\wd\pst@hbox
\advance\pst@dimc\ifodd\psk@trimode 1.447\else 1.789\fi\pst@dimh
\multiply\pst@dimc 2
\advance\pst@dimd\ifodd\psk@trimode 1.789\else 1.447\fi\pst@dimh
\multiply\pst@dimd 2
\else
\ifodd\psk@trimode
\advance\pst@dimd 1.1547\wd\pst@hbox
\advance\pst@dimd 3.4641\pst@dimh
\pst@dimc=.866\pst@dimd
\else
\advance\pst@dimd .866\wd\pst@hbox %.866=(sqrt(3)/2)
\advance\pst@dimd 3\pst@dimh
\pst@dimc=1.1547\pst@dimd % 1.1547=(2/sqrt(3))
\fi
\fi}
\def\pstribox@sep{%
\ifodd\psk@trimode
\advance\pst@dimb.5\pst@dimd
\ht\pst@hbox=\pst@dimb
\advance\pst@dimd-\pst@dimb
\dp\pst@hbox=\pst@dimd
\else
\setbox\pst@hbox\hbox to \pst@dimc{\hss\unhbox\pst@hbox\hss}%
\global\pst@dimg=.5\pst@dimc
\fi
\ifcase\psk@trimode
\dp\pst@hbox-\pst@dimb
\advance\pst@dimd\pst@dimb
\ht\pst@hbox\pst@dimd
\or
\pst@dimg=.5\wd\pst@hbox
\global\advance\pst@dimg-\pst@dima
\setbox\pst@hbox\hbox to \pst@dimc{\kern-\pst@dima\box\pst@hbox\hss}%
\or
\ht\pst@hbox\pst@dimb
\advance\pst@dimd-\pst@dimb
\dp\pst@hbox\pst@dimd
\or
\pst@dimg=\pst@dimc
\advance\pst@dimg-\pst@dima
\global\advance\pst@dimg.5\wd\pst@hbox
\setbox\pst@hbox\hbox to \pst@dimc{%
\hss\box\pst@hbox\kern\psframesep\kern\pslinewidth}%
\fi}
\def\psset@arcsepA#1{\pst@getlength{#1}\psk@arcsepA}
\def\psset@arcsepB#1{\pst@getlength{#1}\psk@arcsepB}
\def\psset@arcsep#1{%
\psset@arcsepA{#1}\let\psk@arcsepB\psk@arcsepA}
\psset@arcsep{0}
\def\tx@ArcArrow{ArcArrow }
\def\psarc{\pst@object{psarc}}
\def\psarc@i{%
\@ifnextchar({\psarc@iii}{\psarc@ii}}
\def\psarc@ii#1{\addto@par{arrows=#1}%
\@ifnextchar({\psarc@iii}{\psarc@iii(0,0)}}
\def\psarc@iii(#1)#2#3#4{%
\begin@OpenObj
\pst@getangle{#3}\pst@tempa
\pst@getangle{#4}\pst@tempb
\pst@@getcoor{#1}%
\pssetlength\pst@dima{#2}%
\addto@pscode{\psarc@iv \psarc@v}%
\gdef\psarc@type{0}%
\showpointsfalse
\end@OpenObj}
\def\psarc@iv{%
\pst@coor /y ED /x ED
/r \pst@number\pst@dima def
/c 57.2957 r \tx@Div def
/angleA
\pst@tempa
\psk@arcsepA c mul 2 div
\ifcase \psarc@type add \or sub \fi
def
/angleB
\pst@tempb
\psk@arcsepB c mul 2 div
\ifcase \psarc@type sub \or add \fi
def
\ifshowpoints\psarc@showpoints\fi
\ifx\psk@arrowA\@empty
\ifnum\psk@liftpen=2
r angleA \tx@PtoC
y add exch x add exch
moveto
\fi
\fi}
\def\psarc@v{%
x y r
angleA
\ifx\psk@arrowA\@empty\else
{ ArrowA CP }
{ \ifcase\psarc@type add \or sub \fi }
\tx@ArcArrow
\fi
angleB
\ifx\psk@arrowB\@empty\else
{ ArrowB }
{ \ifcase\psarc@type sub \or add \fi }
\tx@ArcArrow
\fi
\ifcase\psarc@type arc \or arcn \fi}
\def\psarc@type{0}
\def\psarc@showpoints{%
gsave
newpath
x y moveto
x y r \pst@tempa \pst@tempb
\ifcase\psarc@type arc \or arcn \fi
closepath
CLW 2 div SLW
[ \psk@dash\space ] 0 setdash stroke
grestore }
\def\psarcn{\pst@object{psarcn}}
\def\psarcn@i{\def\psarc@type{1}\psarc@i}
\def\pscircle{\pst@object{pscircle}}
\def\pscircle@i{\@ifnextchar({\pscircle@do}{\pscircle@do(0,0)}}
\def\pscircle@do(#1)#2{%
\if@star
{\use@par\qdisk(#1){#2}}%
\else
\begin@ClosedObj
\pst@@getcoor{#1}%
\pssetlength\pst@dimc{#2}%
\def\pst@linetype{4}%
\addto@pscode{%
\pst@coor
\pst@number\pst@dimc
\psk@dimen CLW mul sub
0 360 arc
closepath}%
\showpointsfalse
\end@ClosedObj
\fi
\ignorespaces}
\def\qdisk(#1)#2{%
\def\pst@par{}%
\begin@SpecialObj
\pst@@getcoor{#1}%
\pssetlength\pst@dimg{#2}%
\addto@pscode{\pst@coor \pst@number\pst@dimg \tx@SD}%
\end@SpecialObj}
\def\psset@radius#1{\pst@@getlength{#1}\psk@radius}
\psset@radius{.25cm}
\def\psCircle{\pst@object{psCircle}}
\def\psCircle@i{\@ifnextchar({\psCircle@ii}{\psCircle@ii(0,0)}}
\def\psCircle@ii(#1){\pscircle@do(#1){\psk@radius}}
\def\pswedge{\pst@object{pswedge}}
\def\pswedge@i{\@ifnextchar({\pswedge@ii}{\pswedge@ii(0,0)}}
\def\pswedge@ii(#1)#2#3#4{%
\begin@ClosedObj
\pssetlength\pst@dimc{#2}
\pst@getangle{#3}\pst@tempa
\pst@getangle{#4}\pst@tempb
\pst@@getcoor{#1}%
\def\pst@linetype{1}%
\addto@pscode{%
\pst@coor
2 copy
moveto
\pst@number\pst@dimc \psk@dimen CLW mul sub % Adjusted radius
\pst@tempa \pst@tempb
arc
closepath}%
\showpointsfalse
\end@ClosedObj}
\def\tx@Ellipse{Ellipse }
\def\psellipse{\pst@object{psellipse}}
\def\psellipse@i(#1){\@ifnextchar(%
{\psellipse@ii(#1)}{\psellipse@ii(0,0)(#1)}}
\def\psellipse@ii(#1)(#2){%
\begin@ClosedObj
\pst@getcoor{#1}\pst@tempa
\pst@@getcoor{#2}%
\addto@pscode{%
0 360
\pst@coor
\ifdim\psk@dimen\p@=\z@\else
\psk@dimen CLW mul
dup 4 -1 roll sub neg 3 1 roll sub
\fi
\pst@tempa
\tx@Ellipse
closepath}%
\def\pst@linetype{2}%
\end@ClosedObj}
\def\multips{\@ifnextchar({\def\pst@par{}\multips@ii}{\multips@i}}
\def\multips@i#1{\def\pst@par{rot=#1}\multips@ii}
\def\multips@ii(#1){\@ifnextchar({\multips@iii(#1)}{\multips@iii(\z@,\z@)(#1)}}
\long\def\multips@iii(#1)(#2)#3#4{%
\begingroup
\use@par
\pst@getcoor{#1}\pst@tempa
\pst@@getcoor{#2}%
\pst@cnta=#3\relax
\init@pscode
\addto@pscode{%
\pst@tempa T \the\pst@cnta\space \pslbrace
gsave \ifx\psk@rot\@empty\else\psk@rot rotate \fi}%
\hbox to\z@{%
\def\init@pscode{%
\addto@pscode{%
gsave
\pst@number\pslinewidth SLW
\pst@usecolor\pslinecolor}}%
\def\use@pscode{\addto@pscode{grestore}}%
\def\psclip##1{\pst@misplaced\psclip}%
\def\nc@object##1##2##3##4{\pst@misplaced{node connection}}%
#4}%
\addto@pscode{grestore \pst@coor T \psrbrace repeat}%
\leavevmode
\use@pscode
\endgroup
\ignorespaces}
\def\scalebox#1{\pst@makebox{\@scalebox{#1}}}
\def\@scalebox#1{%
\begingroup
\pst@getscale{#1}\pst@tempa
\let\pst@tempc\pst@tempg
\let\pst@tempd\pst@temph
\@@scalebox
\endgroup}
\def\@@scalebox{%
\leavevmode
\hbox{%
\ifdim\pst@tempd\p@<\z@
\pst@dimg=\pst@tempd\ht\pst@hbox
\pst@dimh=\pst@tempd\dp\pst@hbox
\dp\pst@hbox=-\pst@dimg
\ht\pst@hbox=-\pst@dimh
\else
\ht\pst@hbox=\pst@tempd\ht\pst@hbox
\dp\pst@hbox=\pst@tempd\dp\pst@hbox
\fi
\pst@dima=\pst@tempc\wd\pst@hbox
\ifdim\pst@dima<\z@\kern-\pst@dima\fi
\pst@Verb{CP CP translate \pst@tempa \tx@NET}%
\hbox to \z@{\box\pst@hbox\hss}%
\pst@Verb{%
CP CP translate
1 \pst@tempc div 1 \pst@tempd div scale
\tx@NET}%
\ifdim\pst@dima>\z@\kern\pst@dima\fi}}
\pslongbox{Scalebox}{\scalebox}
\def\scaleboxto(#1,#2){\pst@makebox{\@scaleboxto(#1,#2)}}
\def\@scaleboxto(#1,#2){%
\begingroup
\pssetlength\pst@dima{#1}%
\pssetlength\pst@dimb{#2}%
\ifdim\pst@dima=\z@\else
\pst@divide{\pst@dima}{\wd\pst@hbox}\pst@tempc
\edef\pst@tempc{\pst@tempc\space}%
\fi
\ifdim\pst@dimb=\z@
\ifdim\pst@dima=\z@
\@pstrickserr{%
\string\scaleboxto\space dimensions cannot both be zero}\@ehpa
\def\pst@tempa{}%
\def\pst@tempc{1 }%
\def\pst@tempd{1 }%
\else
\let\pst@tempd\pst@tempc
\fi
\else
\pst@dimc=\ht\pst@hbox
\advance\pst@dimc\dp\pst@hbox
\pst@divide{\pst@dimb}{\pst@dimc}\pst@tempd
\edef\pst@tempd{\pst@tempd\space}%
\ifdim\pst@dima=\z@ \let\pst@tempc\pst@tempd \fi
\fi
\edef\pst@tempa{\pst@tempc \pst@tempd scale }%
\@@scalebox
\endgroup}
\pslongbox{Scaleboxto}{\scaleboxto}
\def\tx@Rot{Rot }
\def\rotateleft{\pst@makebox{\@rotateleft\pst@hbox}}
\def\@rotateleft#1{%
\leavevmode\hbox{\hskip\ht#1\hskip\dp#1\vbox{\vskip\wd#1%
\pst@Verb{90 \tx@Rot}
\vbox to \z@{\vss\hbox to \z@{\box#1\hss}\vskip\z@}%
\pst@Verb{-90 \tx@Rot}}}}
\def\rotateright{\pst@makebox{\@rotateright\pst@hbox}}
\def\@rotateright#1{%
\hbox{\hskip\ht#1\hskip\dp#1\vbox{\vskip\wd#1%
\pst@Verb{-90 \tx@Rot}
\vbox to \z@{\hbox to \z@{\hss\box#1}\vss}%
\pst@Verb{90 \tx@Rot}}}}
\def\rotatedown{\pst@makebox{\@rotatedown\pst@hbox}}
\def\@rotatedown#1{%
\hbox{\hskip\wd#1\vbox{\vskip\ht#1\vskip\dp#1%
\pst@Verb{180 \tx@Rot}%
\vbox to \z@{\hbox to \z@{\box#1\hss}\vss}%
\pst@Verb{-180 \tx@Rot}}}}
\pslongbox{Rotateleft}{\rotateleft}
\pslongbox{Rotateright}{\rotateright}
\pslongbox{Rotatedown}{\rotatedown}
\def\pst@starbox{%
\setbox\pst@hbox\hbox{\psframebox*[boxsep=false]{\unhbox\pst@hbox}}}
\def\pst@@makesmall#1{%
\setbox#1=\hbox to\z@{\hss\vbox to \z@{\vss\box#1\vss}\hss}}
\def\pst@@@makesmall#1{%
\pst@dimh=\psk@xref\wd#1%
\ifx\psk@yref\relax
\pst@dimg=\dp#1%
\else
\pst@dimg=\psk@yref\ht#1%
\advance\pst@dimg\psk@yref\dp#1%
\fi
\setbox#1=\hbox to\z@{%
\kern-\pst@dimh\vbox to\z@{\vss\box#1\kern-\pst@dimg}\hss}}
\def\psset@ref#1{\pst@expandafter\psset@@ref{#1}\@empty,,\@nil}
\def\psset@@ref#1#2,#3,#4\@nil{%
\def\psk@xref{.5}%
\def\psk@yref{.5}%
\let\pst@makesmall\pst@@@makesmall
\ifx\@empty#3\@empty
\@nameuse{getref@#1}%
\@nameuse{getref@#2}%
\else
\pst@checknum{#1#2}\psk@xref
\pst@checknum{#3}\psk@yref
\fi}
\def\getref@c{\let\pst@makesmall\pst@@makesmall}
\def\getref@t{\def\psk@yref{1}}
\def\getref@b{\def\psk@yref{0}}
\def\getref@B{\let\psk@yref\relax}
\def\getref@l{\def\psk@xref{0}}
\def\getref@r{\def\psk@xref{1}}
\psset@ref{c}
\def\psset@rot#1{%
\pst@expandafter{\@ifnextchar*{\psset@@@rot}{\psset@@rot}}{#1}\@nil}
\def\psset@@rot#1\@nil{%
\def\next##1@#1=##2@##3\@nil{%
\ifx\relax##2%
\pst@getangle{#1}\psk@rot
\else
\def\psk@rot{##2}%
\fi}%
\expandafter\next\pst@rottable @#1=\relax @\@nil}
\def\psset@@@rot#1#2\@nil{%
\psset@@rot#2\@nil
\edef\psk@rot{\pst@rotlist \ifx\psk@rot\@empty\else\psk@rot add \fi}}
\def\pst@rotlist{mark RAngle /a ED cleartomark a neg }
\def\pst@rottable{%
@0=%
@U=%
@L=90 %
@D=180 %
@R=-90 %
@N=\pst@rotlist
@W=\pst@rotlist 90 add %
@S=\pst@rotlist 180 add %
@E=\pst@rotlist 90 sub }
\psset@rot{0}
\def\tx@RotBegin{RotBegin }
\def\tx@RotEnd{RotEnd }
\def\pst@rotate#1#2{%
\ifx#1\@empty\else
\setbox#2=\hbox{\pst@Verb{#1 \tx@RotBegin}\box#2\pst@Verb{\tx@RotEnd}}%
\fi}
\def\psput@cartesian#1{%
\hbox to \z@{\kern\pst@dimg{\vbox to \z@{\vss\box#1\vskip\pst@dimh}\hss}}}
\def\psput@special#1{%
\hbox{%
\pst@Verb{{ \pst@coor } \tx@PutCoor \tx@PutBegin}%
\box#1%
\pst@Verb{\tx@PutEnd}}}
\def\tx@PutCoor{PutCoor }
\def\tx@PutBegin{PutBegin }
\def\tx@PutEnd{PutEnd }
\def\rput{\def\pst@par{}\pst@ifstar{\@ifnextchar[{\rput@i}{\rput@ii}}}
\def\rput@i[#1]{\addto@par{ref={#1}}\rput@ii}
\def\rput@ii{\@ifnextchar({\rput@iv}{\rput@iii}}
\def\rput@iii#1{\addto@par{rot={#1}}\@ifnextchar({\rput@iv}{\rput@iv(\z@,\z@)}}
\def\rput@iv(#1){\pst@killglue\pst@makebox{\rput@v{#1}}}
\def\rput@v#1{%
\begingroup
\use@par
\if@star\pst@starbox\fi
\pst@makesmall\pst@hbox
\pst@rotate\psk@rot\pst@hbox
\psput@{#1}\pst@hbox
\endgroup
\ignorespaces}
\def\multirput{%
\def\pst@par{}%
\pst@ifstar{\@ifnextchar[{\multirput@i}{\multirput@ii}}}
\def\multirput@i[#1]{\addto@par{ref={#1}}\multirput@ii}
\def\multirput@ii{\@ifnextchar({\multirput@iv}{\multirput@iii}}
\def\multirput@iii#1{\addto@par{rot={#1}}\multirput@iv}
\def\multirput@iv(#1){%
\@ifnextchar({\multirput@v(#1)}{\multirput@v(\z@,\z@)(#1)}}
\def\multirput@v(#1,#2)(#3,#4)#5{%
\pst@makebox{\multirput@vi(#1,#2)(#3,#4){#5}}}
\def\multirput@vi(#1,#2)(#3,#4)#5{%
\begingroup
\use@par
\if@star\pst@starbox\fi
\pst@makesmall\pst@hbox
\pst@rotate\psk@rot\pst@hbox
\pssetxlength\pst@dima{#1}%
\pssetylength\pst@dimb{#2}%
\pssetxlength\pst@dimc{#3}%
\pssetylength\pst@dimd{#4}%
\pst@cntg=#5\relax
\pst@cnth=\@ne
\leavevmode
\loop
\vbox to \z@{%
\vss
\hbox to \z@{\kern\pst@dima\copy\pst@hbox\hss}%
\vskip\pst@dimb}%
\ifnum\pst@cntg>\pst@cnth
\advance\pst@dima\pst@dimc
\advance\pst@dimb\pst@dimd
\advance\pst@cnth\@ne
\repeat
\endgroup
\ignorespaces}
\newif\if@fixedradius
\def\cput{\pst@object{cput}}
\def\cput@i{\@fixedradiusfalse\cput@ii}
\def\cput@ii{\pst@killglue\@ifnextchar({\cput@iv}{\cput@iii}}
\def\cput@iii#1{%
\addto@par{rot={#1}}%
\@ifnextchar({\cput@iv}{\cput@iv(\z@,\z@)}}
\def\cput@iv(#1){\pst@makebox{\cput@v{#1}}}
\def\cput@v#1{%
\begingroup
\use@par
\setbox\pst@hbox=\hbox{%
\psboxsepfalse
\if@fixedradius\psCirclebox@ii\else\pscirclebox@ii\fi}%
\pst@@makesmall\pst@hbox
\pst@rotate\psk@rot\pst@hbox
\psput@{#1}\pst@hbox
\endgroup
\ignorespaces}
\def\Cput{\pst@object{Cput}}
\def\Cput@i{\@fixedradiustrue\cput@ii}
\newdimen\pslabelsep
\def\psset@labelsep#1{\pssetlength\pslabelsep{#1}}
\psset@labelsep{5pt}
\def\psset@refangle#1{\pst@expandafter\psset@@refangle{#1}\@nil}
\def\psset@@refangle#1\@nil{%
\def\next##1@#1=##2"##3@##4\@nil{%
\ifx\relax##2%
\pst@getangle{#1}\psk@refangle
\def\psk@uputref{}%
\else
\def\psk@refangle{##2 }%
\def\psk@uputref{##3}%
\fi}%
\expandafter\next\pst@refangletable @#1=\relax"@\@nil}
\def\pst@refangletable{%
@r=0"20%
@u=90"02%
@l=180"10%
@d=-90"01%
@ur=45"22%
@ul=135"12%
@dr=-135"21%
@dl=-45"11}
\psset@refangle{0}
% DG/SR modification begin - Mar. 24, 1999 - Patch 10
%\def\uput{\def\pst@par{}\@ifnextchar[{\uput@ii}{\uput@i}}
\def\uput{\def\pst@par{}\pst@ifstar{\@ifnextchar[{\uput@ii}{\uput@i}}} 
% DG/SR modification end
\def\uput@i#1{\addto@par{labelsep=#1}\uput@ii}
\def\uput@ii[#1]{%
\addto@par{refangle={#1}}%
\@ifnextchar({\uput@iv}{\uput@iii}}
\def\uput@iii#1{%
\addto@par{rot={#1}}%
\@ifnextchar({\uput@iv}{\uput@iv(\z@,\z@)}}
\def\uput@iv(#1){\pst@killglue\pst@makebox{\uput@v{#1}}}
\def\uput@v#1{%
\begingroup
\use@par
\if@star\pst@starbox\fi
\uput@vi
\psput@{#1}\pst@hbox
\endgroup
\ignorespaces}
\def\uput@vi{%
\ifx\psk@uputref\@empty
\uput@vii\tx@UUput{}%
\else
\ifx\psk@rot\@empty
\expandafter\uput@viii\psk@uputref
\else
\uput@vii\tx@UUput{}%
\fi
\fi}
\def\uput@vii#1#2{%
\edef\pst@coor{%
\pst@number\pslabelsep
#2%
\pst@number{\wd\pst@hbox}%
\pst@number{\ht\pst@hbox}%
\pst@number{\dp\pst@hbox}%
\psk@refangle\space \ifx\psk@rot\@empty\else\psk@rot\space sub \fi
\tx@Uput #1}%
\setbox\pst@hbox=\hbox to\z@{\hss\vbox to\z@{\vss\box\pst@hbox\vss}\hss}%
\setbox\pst@hbox=\psput@special\pst@hbox
\ifx\psk@rot\@empty\else\pst@rotate\psk@rot\pst@hbox\fi}
\def\uput@viii#1#2{%
\ifnum#1>\z@\ifnum#2>\z@\pslabelsep=.707\pslabelsep\fi\fi
\setbox\pst@hbox=\vbox to\z@{%
\ifnum#2=1 \vskip\pslabelsep\else\vss\fi
\hbox to\z@{%
\ifnum#1=2 \hskip\pslabelsep\else\hss\fi
\box\pst@hbox
\ifnum#1=1 \hskip\pslabelsep\else\hss\fi}%
\ifnum#2=2 \vskip\pslabelsep\else\vss\fi}}
\def\tx@Uput{Uput }
\def\tx@UUput{UUput }
\def\Rput{\def\pst@par{}\pst@ifstar{\@ifnextchar[{\Rput@ii}{\Rput@i}}}
\def\Rput@i#1{\addto@par{labelsep=#1}\Rput@ii}
\def\Rput@ii[#1]{\addto@par{ref={#1}}\@ifnextchar({\Rput@iv}{\Rput@iii}}
\def\Rput@iii#1{\addto@par{rot={#1}}\@ifnextchar({\Rput@iv}{\Rput@iv(\z@,\z@)}}
\def\Rput@iv(#1){\pst@killglue\pst@makebox{\Rput@v{#1}}}
\def\Rput@v#1{%
\begingroup
\use@par
\if@star\pst@starbox\fi
\Rput@vi
\pst@makesmall\pst@hbox
\pst@rotate\psk@rot\pst@hbox
\psput@{#1}\pst@hbox
\endgroup
\ignorespaces}
\def\Rput@vi{%
\pst@dimg=\dp\pst@hbox
\advance\pst@dimg\pslabelsep
\dp\pst@hbox=\pst@dimg
\pst@dimg=\ht\pst@hbox
\advance\pst@dimg\pslabelsep
\ht\pst@hbox=\pst@dimg
\setbox\pst@hbox\hbox{\kern\pslabelsep\box\pst@hbox\kern\pslabelsep}}%
\def\oldpsput{%
\def\pst@par{}\pst@ifstar{\@ifnextchar[{\oldpsput@i}{\oldpsput@ii}}}
\def\oldpsput@i[#1]{\addto@par{ref={#1}}\oldpsput@ii}
\def\oldpsput@ii{\@ifnextchar<{\oldpsput@iii}{\oldpsput@iv}}
\def\oldpsput@iii<#1>{\rput@iii{#1}}
\def\OldPsput{\let\psput\oldpsput}
\def\NewPsput{\let\psput\rput}
\def\pspicture{\begingroup\pst@ifstar\pst@picture}
\def\pst@picture{%
\@ifnextchar[{\pst@@picture}{\pst@@picture[0]}}
\def\pst@@picture[#1]#2(#3,#4){%
\@ifnextchar({\pst@@@picture[#1](#3,#4)}%
{\pst@@@picture[#1](0,0)(#3,#4)}}
\def\pst@@@picture[#1](#2,#3)(#4,#5){%
\pssetxlength\pst@dima{#2}%
\pssetylength\pst@dimb{#3}%
\pssetxlength\pst@dimc{#4}%
\pssetylength\pst@dimd{#5}%
\ifdim\pst@dima>\pst@dimc
\pst@dimg=\pst@dima
\pst@dima=\pst@dimc
\pst@dimc=\pst@dimg
\fi
\ifdim\pst@dimb>\pst@dimd
\pst@dimg=\pst@dimb
\pst@dimb=\pst@dimd
\pst@dimd=\pst@dimg
\fi
\def\pst@tempa{#1}%
\setbox\pst@hbox=\hbox\bgroup
\begingroup\KillGlue
\@ifundefined{@latexerr}{}{\let\unitlength\psunit}%
\edef\pic@coor{(#2,#3)(#2,#3)(#4,#5)}\ignorespaces}
\def\pic@coor{(0,0)(0,0)(10,10)}
\def\endpspicture{%
\pst@killglue
\endgroup
\egroup
\ifdim\wd\pst@hbox=\z@\else
%\@pstrickserr{Extraneous space in the pspicture environment}%
%{Type \space <return> \space to procede.}%
\fi
\ht\pst@hbox=\pst@dimd
\dp\pst@hbox=-\pst@dimb
\setbox\pst@hbox=\hbox{%
\kern-\pst@dima
\ifx\pst@tempa\@empty\else
\advance\pst@dimd-\pst@dimb
\pst@dimd=\pst@tempa\pst@dimd
\advance\pst@dimd\pst@dimb
\lower\pst@dimd
\fi
\box\pst@hbox
\kern\pst@dimc}%
\if@star\setbox\pst@hbox=\hbox{\clipbox@@\z@}\fi
\leavevmode\box\pst@hbox
\endgroup}
\@namedef{pspicture*}{\pspicture*}
\@namedef{endpspicture*}{\endpspicture}
\def\tx@BeginOL{BeginOL }
\def\tx@InitOL{InitOL }
\def\pst@initoverlay#1{\pst@Verb{\tx@InitOL /TheOL (#1) def}}
\def\AltOverlayMode{%
\def\pst@initoverlay##1{%
\pst@Verb{%
\tx@InitOL
/Visible { initclip } def
/Invisible {
CP newpath OLUnit itransform moveto clip newpath moveto
} def
/TheOL (##1) def}}}
\def\pst@overlay#1{%
\edef\curr@overlay{#1}%
\pst@Verb{(#1) BOL}%
\aftergroup\pst@endoverlay}
\def\pst@endoverlay{%
\pst@Verb{(\curr@overlay) BOL}}
\def\curr@overlay{all}
\newbox\theoverlaybox
\def\overlaybox{%
\global\setbox\theoverlaybox=\hbox\bgroup
\begingroup
\let\psoverlay\pst@overlay
\def\overlaybox{%
\@pstrickserr{Overlays cannot be nested}\@eha}%
\def\putoverlaybox{%
\@pstrickserr{You must end the overlay box
before using \string\putoverlaybox}}%
\psoverlay{main}%
\ignorespaces}
\def\endoverlaybox{\endgroup\egroup}
\def\putoverlaybox#1{%
\hbox{\pst@initoverlay{#1}\copy\theoverlaybox}}
\def\psoverlay{\@pstrickserr{\string\psoverlay\space
can only be used after \string\overlaybox}}
\ifx\pstcustomize\relax \input pstricks.con \fi
\catcode`\@=\PstAtCode\relax
%
\endinput
%%
%% END: pstricks.tex

salt12-paper.tex
\documentclass[12pt,leqno,tbtags]{amsart}

\makeatletter

\usepackage{endnotes}
\let\footnote=\endnote
\def\notesname{Endnotes}
\def\enotesize{\normalsize}
\def\enoteheading{\section*{\notesname
  \@mkboth{\uppercase{\notesname}}{\uppercase{\notesname}}}%
     \leavevmode\par}
\def\enoteformat{\rightskip\z@ \leftskip\z@ \parindent\z@
     \leavevmode$^{\@theenmark}$}

% Use the txfonts package to get Times text, but replace \ltimes and
% \rtimes in the txfonts package with our own version.  (Note that our own
% \ltimes and \rtimes are defined as macros rather than math symbols, so
% things like \mathrel\ltimes won't work -- say \mathrel{\ltimes} instead.)
%
\usepackage{txfonts}
\renewcommand{\ltimes}{\mathbin{\mathpalette\leftbar\times}}
\renewcommand{\rtimes}{\mathbin{\mathpalette\rightbar\times}}
\newbox\barb@x
\newbox\barb@y
\newcommand{\leftbar}[2]{%
    \setbox\barb@x\hbox{$#1#2$}%
    \setbox\barb@y\hbox{$#1\mkern -2.735mu|$}%
    \mkern 1.585mu
    \kern -\wd\barb@y
    \vrule height\ht\barb@x depth\dp\barb@x width\wd\barb@y
    \setbox\barb@y\box\voidb@x
    \mkern -1.585mu
    \box\barb@x}
\newcommand{\rightbar}[2]{%
    \setbox\barb@x\hbox{$#1#2$}%
    \setbox\barb@y\hbox{$#1\mkern -2.735mu|$}%
    \copy\barb@x
    \mkern -1.585mu
    \vrule height\ht\barb@x depth\dp\barb@x width\wd\barb@y
    \kern -\wd\barb@y
    \setbox\barb@x\box\voidb@x
    \setbox\barb@y\box\voidb@x
    \mkern 1.585mu}

\setlength{\headheight}{0pt}
\setlength{\headsep   }{0pt}
\setlength{\textheight}{9in}
\setlength{\textwidth }{5.5in}
\calclayout

\setlength{\normalparindent}{0.5in}
\setlength{\parindent      }{0.5in}

\def\@settitle{%
  \begingroup\centering
  \large\bfseries
  \@title
  \par\endgroup
}

\def\@setauthors{\normalfont\normalsize
  \begingroup\centering
  \vskip\linespacing
  \andify\authors
  \def\\{\protect\linebreak}%
  \authors
  \def\author##1{}%
  \def\address##1##2{\par\textit{%
    \@ifnotempty{##1}{\ignorespaces##1\unskip}{\ignorespaces##2\unskip}}}%
  \def\curraddr##1##2{}%
  \def\email##1##2{}%
  \def\urladdr##1##2{}%
  \addresses
  \par\endgroup
}

\renewenvironment{abstract}{%
  \ifx\maketitle\relax
    \ClassWarning{\@classname}{Abstract should precede
      \protect\maketitle\space in AMS documentclasses; reported}%
  \fi
  \global\setbox\abstractbox=\vtop \bgroup
    \normalfont\normalsize
    \list{}{\labelwidth\z@
      \leftmargin0pt \rightmargin\leftmargin
      \listparindent\normalparindent \itemindent\z@
      \parsep\z@ \@plus\p@
      \let\fullwidthdisplay\relax
    }%
    \item[]%
}{%
  \endlist\egroup
  \ifx\@setabstract\relax \@setabstracta \fi
}

\def\@setabstracta{%
  \ifvoid\abstractbox
  \else
    \skip@2\linespacing \advance\skip@-\lastskip
    \advance\skip@-\baselineskip \vskip\skip@
    \box\abstractbox
    \prevdepth\z@ % because \abstractbox is a vtop
  \fi
}

\def\@setthanks{\def\thanks##1{\par##1\@addpunct.}\@thankses}

\def\@maketitle{%
  \normalfont\normalsize
  \let\@makefnmark\relax  \let\@thefnmark\relax
  \ifx\@empty\thankses\else \def\@theenmark{*} \global\let\@thankses\thankses
    \@endnotetext{\def\par{\let\par\@par}\@setthanks}\fi
  \@mkboth{\@nx\shortauthors}{\@nx\shorttitle}%
  \@settitle
  \ifx\@empty\authors \else \@setauthors \fi
  \ifx\@empty\@dedicatory
  \else
    \baselineskip18\p@
    \vtop{\centering{\footnotesize\itshape\@dedicatory\@@par}%
      \global\dimen@i\prevdepth}\prevdepth\dimen@i
  \fi
  \@setabstract
  \normalsize
  \if@titlepage
    \newpage
  \else
    \vskip\z@\relax
  \fi
} % end \@maketitle

\let\enddoc@text\relax

\def\@sect#1#2#3#4#5#6[#7]#8{%
  \edef\@toclevel{\ifnum#2=\@m 0\else\number#2\fi}%
  \ifnum #2>\c@secnumdepth \let\@secnumber\@empty
  \else \@xp\let\@xp\@secnumber\csname the#1\endcsname\fi
  \@tempskipa #5\relax
  \ifnum #2>\c@secnumdepth
    \let\@svsec\@empty
  \else
    \refstepcounter{#1}%
    \edef\@secnumpunct{%
      \ifdim\@tempskipa>\z@ % not a run-in section heading
        \@ifnotempty{#8}{.\space\space}%
      \else .\space\space
      \fi
    }%
    \protected@edef\@svsec{%
      \ifnum#2<\@m
        \@ifundefined{#1name}{}{%
          \ignorespaces\csname #1name\endcsname\space
        }%
      \fi
      \@seccntformat{#1}%
    }%
  \fi
  \ifdim \@tempskipa>\z@ % then this is not a run-in section heading
    \begingroup #6\relax
    \@hangfrom{\hskip #3\relax\@svsec}{\interlinepenalty\@M #8\par}%
    \endgroup
    \ifnum#2>\@m \else \@tocwrite{#1}{#8}\fi
  \else
  \def\@svsechd{#6\hskip #3\@svsec
    \@ifnotempty{#8}{\ignorespaces#8\unskip
       \@addpunct.}%
    \ifnum#2>\@m \else \@tocwrite{#1}{#8}\fi
  }%
  \fi
  \global\@nobreaktrue
  \@xsect{#5}}

\def\section{\def\@secnumfont{\bfseries}%
 \@startsection{section}{1}%
  \z@{-2\linespacing}{\linespacing}%
  {\normalfont\bfseries}}
\def\subsection{\def\@secnumfont{\mdseries}%
 \@startsection{subsection}{2}%
  \z@{-\linespacing}{\linespacing}%
  {\normalfont\itshape}}
\def\subsubsection{\def\@secnumfont{\mdseries}%
 \@startsection{subsubsection}{3}%
  \z@{-\linespacing}{\z@}%
  {\normalfont}}

\def\@adjustvertspacing{%
  \bigskipamount2\baselineskip
  \medskipamount\baselineskip
  \smallskipamount\z@
  \abovedisplayskip\baselineskip
  \belowdisplayskip\baselineskip
  \abovedisplayshortskip\baselineskip
  \belowdisplayshortskip\baselineskip
  \jot\z@ \relax
}
\listisep\z@
\captionindent\z@

\makeatother

\usepackage{url}
\usepackage{pstricks}
\usepackage{tree-dvips}
\usepackage{stmaryrd}

\usepackage[longnamesfirst,sort&compress]{natbib}
\setlength{\bibhang}{0.5in}

% Trick to omit punctuation that natbib usually inserts automatically.
%
\newcommand{\citearound}[2]{{\let\realspace\ \def\ {\let\ \realspace#1}{#2}}}
\newcommand{\citegenitive}{\citearound{'s }}
\newcommand{\citets}[1]{\citegenitive{\citet{#1}}}
\newcommand{\Citets}[1]{\citegenitive{\Citet{#1}}}

% Use the linguex package for linguistic examples, but number examples
% along with equations.
%
\usepackage{linguex}
\renewcommand{\refdash}{}
\setlength{\Extopsep}{\linespacing}
\settowidth{\Exlabelwidth}{(100)}
\setlength{\Exlabelsep}{0.5in}
\addtolength{\Exlabelsep}{-\Exlabelwidth}
\setlength{\SubExleftmargin}{0.25in}
\setlength{\SubSubExleftmargin}{0.25in}
\makeatletter
\let\c@ExNo\c@equation
\let\theExNo\theequation
\renewcommand{\theSubExNo}{\hbox{\if@noftnote\arabic{ExNo}\else
   \roman{FnExNo}\fi\refdash\alph{SubExNo}}}
\renewcommand{\theSubSubExNo}{%
   \hbox{\if@noftnote\arabic{ExNo}\else\roman{FnExNo}\fi
          \refdash\alph{SubExNo}\refdash\if@noftnote\roman{SubSubExNo}%
                          \else\arabic{SubSubExNo}\fi}}
\makeatother

% Use the qtree package for trees, but disable automatic centering.
%
% The macro \roof draws a roofed branch; it takes the leaf contents and the
% label as arguments.
%
% The macro \qobitreecenter draws a vertically centered tree; it takes an
% optional argument that specifies punctuation to be placed at the
% lower-right corner of the tree.
%
% The macro \branchfakewidth is like \branch, but in addition it pretends
% that the width of the entire branch is just the width of the branch
% label.
%
\usepackage{qtree}
\qtreecenterfalse
\newcommand{\roof}[2]{\leaf{\qroof{#1}.{#2} }}
\newcommand{\qobitreecenter}[1][]
    {\vcenter{\hbox{\raise-3.5pt\vbox{\hbox{\qobitree}\vskip0pt}#1}}}
\newcommand{\branchfakewidth}[2]
    {\branch{#1}{#2}\faketreewidth{#2}}

% Inside AMS-LaTeX's math alignment environments, say \displayleft{...} to
% make a left-justified alignment row, and \displayright{...} to make a
% right-justified alignment row.
%
\makeatletter
\newcommand{\displayleft}[1]{\strut@#1\span\omit\column@plus\tabskip\alignsep@\hfill\\}
\newcommand{\displayright}[1]{\strut@#1\span\omit\column@plus\tabskip\alignsep@\\}
\makeatother

% \sref is like \ref, but with a section sign prepended to the output.
%
% \srefrange{xxx}{yyy} is sort of like \sref{xxx}--\ref{yyy}, but it omits
% common elements in the section numbering, so instead of 1.2.3.4--1.2.5.6
% it prints 1.2.3.4--5.6.  The optional argument specifies the delimiter
% between numbers, which defaults to a period.
%
\newcommand{\sectionsign}{Section~}
\newcommand{\multisectionsign}{Sections~}
\newcommand{\sref}[1]{\sectionsign\ref{#1}}
\makeatletter
\newcommand{\srefrange}[3][.]{%
  \expandafter\ifx\csname r@#2\endcsname\relax
    \sref{#2}\nobreakdash--\ref{#3}%
  \else
  \expandafter\ifx\csname r@#3\endcsname\relax
    \sref{#2}\nobreakdash--\ref{#3}%
  \else
    \def\beforedot##1#1##2\end@fref{##1}%
    \def\afterdot ##1#1##2\end@fref{##2}%
    \def\finalize ##1#1\end@fref   {##1}%
    \edef\ref@ne{\ref{#2}#1}%
    \edef\reftw@{\ref{#3}#1}%
    \multisectionsign
    \def\next{%
      \expandafter\edef\expandafter\pre@ne
        \expandafter{\expandafter\beforedot\ref@ne\end@fref}%
      \expandafter\edef\expandafter\pretw@
        \expandafter{\expandafter\beforedot\reftw@\end@fref}%
      \ifx\pre@ne\pretw@
        \pre@ne#1%
        \expandafter\edef\expandafter\ref@ne
          \expandafter{\expandafter\afterdot\ref@ne\end@fref}%
        \expandafter\edef\expandafter\reftw@
          \expandafter{\expandafter\afterdot\reftw@\end@fref}%
        \ifx\@empty\ref@ne
          \ifx\@empty\reftw@
            \let\next\relax
          \else
            \def\next{\errmessage{The reference #2 has fewer #1-components than the reference #3.}}%
          \fi
        \else
          \ifx\@empty\reftw@
            \def\next{\errmessage{The reference #3 has fewer #1-components than the reference #2.}}%
          \fi
        \fi
      \else
        \expandafter\finalize\ref@ne\end@fref
        \nobreakdash--%
        \expandafter\finalize\reftw@\end@fref
        \let\next\relax
      \fi
      \next
    }%
    \next
  \fi\fi}
\makeatother

% The "stacked" environment is like the "aligned" environment, but does not
% add extra space between rows compared to usual interline spacing.
%
\makeatletter
\newenvironment{stacked}{%
  \begingroup
  \jot\z@
  \let\displaystyle\textstyle
  \begin{aligned}
}{%
  \end{aligned}
  \endgroup
}
\makeatother

% Denotations (logical form constants).
%
\newcommand{\denotation}[1]{\text{\scshape\lowercase{#1}}}
\newcommand{\Alice       }{\denotation{Alice}}
\newcommand{\Bob         }{\denotation{Bob}}
\newcommand{\Carol       }{\denotation{Carol}}
\newcommand{\Smoke       }{\denotation{smoke}}
\newcommand{\Love        }{\denotation{love}}
\newcommand{\Animate     }{\denotation{animate}}
\newcommand{\Everyone    }{\denotation{everyone}}
\newcommand{\We          }{\denotation{we}}
\newcommand{\Buy         }{\denotation{buy}}
\newcommand{\Remember    }{\denotation{remember}}
\newcommand{\For         }{\denotation{for}}
\newcommand{\You         }{\denotation{you}}
\newcommand{\Think       }{\denotation{think}}

% \eqish{...} sets its argument in math mode, centered to line up with an
% equal sign.  \eqishcolon means \eqish{:}, useful for typing definitions.
%
\newcommand{\eqish}[1]{\mathrel{\makebox[0pt]{\hphantom{$=$}\hss$#1$\hss}\hphantom{=}}}
\newcommand{\eqishcolon}{\eqish{:}}

% Miscellaneous macro definitions.
%
\newcommand{\phrase}[1]{\emph{\frenchspacing#1}}
\newcommand{\denote}[1]{\ensuremath{\llbracket}#1\ensuremath{\rrbracket}}
\newcommand{\emp}[1]{\textsc{#1}}
\newcommand{\compose}{\mathbin\circ}
\newcommand{\denotes}{\mathrel\vdash}
\newcommand{\limplies}{\mathbin\Rightarrow}
\newcommand{\fun}[1]{\mathopen{\lambda\mathord{#1}.\,}}
\newcommand{\presuppose}[1]{\mathopen{[\mathord{#1}]\,}}
\newcommand{\Forall}[1]{\mathopen{\forall\mathord{#1}.\,}}
\newcommand{\Exists}[1]{\mathopen{\exists\mathord{#1}.\,}}
\newcommand{\comma}{\text{, }}
\newcommand{\pref}[1]{\ensuremath{\text{\ref{#1}}'}}
\DeclareMathOperator*{\argmin}{arg\,min}
\DeclareMathOperator*{\argmax}{arg\,max}
\newcommand{\toF}{\mathbin\rightarrow}
\newcommand{\toC}{\mathbin\rightharpoonup}
\newcommand{\toQ}{\mathbin\leadsto}
\newcommand{\stuff}{\text{--}}
\newcommand{\Wh}{\protect\phrase{Wh}\protect\nobreakdash}
\newcommand{\wh}{\protect\phrase{wh}\protect\nobreakdash}

% Notation for continuation types.
%
\newcommand{\cc}[2]{%
    \mathchoice{\ccDisplay{#1}{#2}}%
               {\ccInline{#1}{#2}}%
               {\ccInline{#1}{#2}}%
               {\ccInline{#1}{#2}}}
\newcommand{\ccDisplay}[2]{%
    \protect\bmatrix#2\\#1\endbmatrix}
\newcommand{\ccInline}[2]{%
    \bigl[\!\protect\smallmatrix#2\\#1\protect\endsmallmatrix\!\bigr]}

\newcommand{\branchaux}[3]{#1{\smash[b]{%
    \begin{tabular}[t]{@{}c@{}}%
        \begin{tabular}[b]{@{}c@{}}%
            $#3$%
        \end{tabular}%
        \\%
        #2%
    \end{tabular}}}}

\newcommand{\unarybranch}[1][]{\branchaux{\branch{1}}{\rlap{ $\scriptstyle#1$}}}
\newcommand{\binarybranch}[1][]{\branchaux{\branch{2}}{$\scriptstyle#1$}}
\newcommand{\unarybranchfakewidth}[1][]{\branchaux{\branchfakewidth{1}}{\rlap{ $\scriptstyle#1$}}}
\newcommand{\binarybranchfakewidth}[1][]{\branchaux{\branchfakewidth{2}}{$\scriptstyle#1$}}

%stopzone

\begin{document}

\title{A Continuation Semantics of Interrogatives\linebreak[1]
       That Accounts for Baker's Ambiguity}
\author{Chung-chieh Shan}
\address{Harvard University}
\email{ccshan@post.harvard.edu}
\urladdr{http://www.digitas.harvard.edu/\textasciitilde ken}
\date{\today}
\thanks{%
Thanks to Stuart Shieber, Chris Barker, Danny Fox,
Pauline Jacobson, Norman Ramsey, Dylan Thurston, MIT 24.979 Spring 2001
(Kai von Fintel and Irene Heim), the Harvard AI Research Group, the Center
for the Study of Language and Information at Stanford University, and the
referees at SALT~12.  This work is supported by National Science Foundation
Grant IRI-9712068.%
}

\begin{abstract}
\Wh-phrases in English can appear both raised and in-situ.  However, only
in\nobreakdash-situ \wh-phrases can take semantic scope beyond the immediately
enclosing clause.  I present a denotational semantics of interrogatives
that naturally accounts for these two properties.  It neither invokes
movement or economy, nor posits lexical ambiguity between raised and
in\nobreakdash-situ occurrences of the same \wh-phrase.  My analysis is based on the
concept of \emp{continuations}.  It uses a novel type system for
higher-order continuations to handle wide-scope \wh-phrases while remaining
strictly compositional.  This treatment sheds light on the
combinatorics of interrogatives as well as other kinds of so-called
\=A-movement.
\end{abstract}
\maketitle

\thispagestyle{empty}
\pagestyle{empty}

\section{Introduction}
\label{s:introduction}

\citet{baker-indirect} discusses multiple-\wh\ questions such
as those in~\eqref{e:baker-indirect}.
\ex. \label{e:baker-indirect}
     \a. \label{e:baker-indirect-1}
         Who remembers where we bought what?
     \b. \label{e:baker-indirect-2}
         Who do you think remembers what we bought for whom?\par
Each question in~\eqref{e:baker-indirect} contains three \wh-phrases and is
ambiguous between two readings with different notions of what constitutes
an appropriate answer.
\ex. Who remembers where we bought what?
     \a. \label{e:wide-scope-answer-1}
         Alice remembers where we bought the vase.
     \b. \label{e:narrow-scope-answer-1}
         Alice remembers where we bought what.\par
\ex. Who do you think remembers what we bought for whom?
     \a. \label{e:wide-scope-answer-2}
         I think Alice remembers what we bought for Bob.
     \b. \label{e:narrow-scope-answer-2}
         I think Alice remembers what we bought for whom.\par
Intuitively, both cases of ambiguity are because the final
\wh-phrase---\phrase{what} in~\eqref{e:baker-indirect-1} and \phrase{whom}
in~\eqref{e:baker-indirect-2}---can take either wide
scope~(\ref{e:wide-scope-answer-1}, \ref{e:wide-scope-answer-2}) or narrow
scope~(\ref{e:narrow-scope-answer-1}, \ref{e:narrow-scope-answer-2}).%
  \footnote{I disregard here the distinction between questions
  that allow or expect \emp{pair-list} answers (\phrase{Alice
  remembers where we bought the vase, and Bob remembers where we bought the
  table}) and questions that require or expect non-pair-list answers.}

In this paper, I focus on two properties of interrogatives.
\begin{itemize}
\item \label{i:puzzle-1} \Wh-phrases appear both raised and in-situ.  For
      example, in~\eqref{e:baker-indirect-2}, \phrase{who} and \phrase{what}
      appear raised while \phrase{whom} appears in-situ.
\item \label{i:puzzle-2} Raised \wh-phrases must take semantic scope exactly
      over the clause they are raised to overtly.  For example,
      in~\eqref{e:baker-indirect-2}, \phrase{who} must take wide scope, and
      \phrase{what} must take narrow scope.  Only \phrase{whom} has
      ambiguous scope; accordingly, the question has only $2$ readings, not
      $4$ or $8$.%
  \footnote{To be clear, a raised \wh-phrase can often take
  scope beyond the clause immediately enclosing its corresponding gap.
  The generalization I state here is that a raised \wh-phrase cannot take
  scope beyond the clause in front of which it is pronounced.}
\end{itemize}
I present a strictly compositional semantics of interrogatives in
English that accounts for these properties.  Specifically, in my analysis,
\begin{itemize}
\item there is no covert movement or \wh-raising between surface syntax and
      denotational semantics (contra \citets{epstein-derivational} economy
      account), yet a single denotation suffices for both raised and
      in-situ appearances of each \wh-phrase.  Moreover,
\item as a natural consequence of the denotation of \wh-phrases and the
      rules of the grammar, only in-situ \wh-phrases can take scope
      ambiguously.
\end{itemize}
I describe my system below as one where, roughly speaking, interrogative
clauses denote functions from answers to propositions (an old idea).
However, such
denotations are not crucial for my purposes---the essential ideas in my
analysis carry over easily to a system where interrogative clauses denote
say sets of propositions instead.  Hence this paper bears not so much
on what interrogatives denote, but how.

My analysis builds upon Barker's (\citeyear{barker-continuations},
\citeyear{barker-higher-order}) use of \emp{continuations} to characterize
quantification in natural language.  In~\sref{s:from-ptq}, I introduce
continuation semantics as a two-step generalization of
\citets{montague-proper} treatment of quantification.  The system I present
generalizes Barker's semantics in several aspects, which I point out below
as we encounter.  In~\sref{s:manipulating-answer-types}, I specify
denotations for interrogative elements and account for the properties
above.  In doing so, I am not concerned with the semantics of verbs such as
\phrase{know} that take interrogative complements, but rather with how to
derive denotations for interrogative clauses themselves.  Finally,
in~\sref{s:discussion}, I conclude with some speculations on further
applications of my treatment, for example to explain superiority effects.

This paper loosely follows the framework of Combinatory Categorial Grammar
(\citealp{steedman-combinatory}, \citeyear{steedman-surface}).  However,
I expect the central insights to be easy to adapt to other frameworks of
compositional semantics.

\section{From PTQ to Continuations in Two Steps}
\label{s:from-ptq}

Continuations are a well-known and widely applied idea in computer science.
Many analogies have been drawn to explain the concept; for example, in
programming language semantics, it is often said that ``the continuation
represents an entire (default) future for the computation''
{\citep{kelsey-r5rs}}.

From the perspective of natural language semantics, a continuation can be
thought of as ``a semantic value with a hole''.  To illustrate,
consider the sentence
\ex.\label{e:alice-loves-bob}Alice loves Bob.\par
In Montague grammar, the meaning of~\eqref{e:alice-loves-bob} is
computed compositionally from denotations assigned to
\phrase{Alice}, \phrase{loves}, and \phrase{Bob}.  Starting
with the values
%
\begin{equation}
    \Alice: e,\qquad
    \Love : e\toF e\toF t,\qquad
    \Bob  : e,
\end{equation}
%
where $e$ is the base type of individuals and $t$ is the base type of
propositions, we recursively combine semantic values by function
application (Figure~\ref{f:direct-application})
%
\begin{figure}[tp]
\centerline{$
    \leaf{$f : \alpha\toF\beta\qquad$}
    \leaf{$\qquad x : \alpha$}
    \branch{2}{$f(x) : \beta$}
    \qobitree
$}
\makeatletter
\caption{Function application%
    \hbox{\@textsuperscript{\normalfont\ref{f:type-variables}}}}
\makeatother
\label{f:direct-application}
\end{figure}
%
to obtain the top-level denotation $\Love(\Bob)(\Alice)$, of type~$t$
(Figure~\ref{f:alice-loves-bob}).%
    \footnote{\label{f:type-variables}%
    Throughout this paper, I use the Greek letters $\alpha$, $\beta$,
    $\gamma$, and~$\delta$ to represent type variables, in other words
    variables that can be instantiated with any type.  Thus what this paper
    calls types are known as \emp{type-schemes} in the Hindley-Milner type
    system \citep{hindley-combinators}.  Also, by convention, all binary
    type constructors associate to the right: The type $e\toF
    e\toF t$, unparenthesized, means $e\toF(e\toF t)$.}%
%
\begin{figure}[tp]
\centerline{$
    \leaf{$\Alice : e$}
    \leaf{$\Love : e\toF e\toF t$}
    \leaf{$\Bob : e$}
    \branch{2}{$\Love(\Bob) :e\toF t$}
    \branch{2}{$\Love(\Bob)(\Alice) :t$}
    \qobitree
$}
\caption{\protect\phrase{Alice loves Bob}}
\label{f:alice-loves-bob}
\end{figure}
%stopzone
Borrowing computer science terminology, I say that the
\emp{evaluation context} of the constituent \phrase{Bob}
in the sentence~\eqref{e:alice-loves-bob} is the ``sentence with a hole''
\ex.\label{e:alice-loves-hole}
    Alice loves~\_.\par
Semantically, this evaluation context is essentially a map
\begin{equation}
\label{e:alice-loves-cont}
    c = \fun{x} \Love(x)(\Alice)
\end{equation}
from individuals to propositions---in particular, the map~$c$ sends the
individual $\Bob$ to the proposition $\Love(\Bob)(\Alice)$.  The map~$c$ is
called the \emp{continuation} of \phrase{Bob}
in~\eqref{e:alice-loves-bob}.  I assign it the type
\begin{equation}
    e\toC t,
\end{equation}
where $\toC$ is a binary type constructor.

The \emp{value type} of a continuation is its domain, and the \emp{answer
type} of a continuation is its codomain.  For example, the continuation~$c$
has value type~$e$ and answer type~$t$.%
  \footnote{The concept of answer types in continuation semantics is
  separate from the concept of appropriate answerhood in
  interrogatives.}
I distinguish between the continuation type $e\toC t$ and the function type
$e\toF t$, even though they may be interpreted the same way
model-theoretically (standardly, as sets of functions).
In fact, I use the same notation to construct and apply functions (namely
$\lambda$ and parentheses) as for continuations.  The purpose of
distinguishing between continuations and functions is to maintain mental
hygiene and rule out undesirable semantic combination
(see \sref{s:raised-wh-phrases} below).

With the continuation~$c$ in~\eqref{e:alice-loves-cont} in hand, we can
apply it to $\Bob$ to recover the proposition that Alice loves Bob, or
apply it to $\Carol$ to generate the proposition that Alice loves Carol.
We can play ``what-if'' with the hole in~\eqref{e:alice-loves-hole},
plugging in different individuals to see what proposition the top-level
answer would come out to be.  In particular, we can compute
\begin{equation}
\label{e:everyone-intuition}
    \Forall{x} c(x)
\end{equation}
to generate the proposition that Alice loves every individual.  This
intuition is why \citets{montague-proper} ``Proper Treatment of
Quantification'' (PTQ) assigns essentially the denotation
\begin{equation}
\label{e:everyone-denotation}
    \denote{\phrase{everyone}} = \fun{c} \Forall{x} c(x)
    : (e\toC t)\toF t
\end{equation}
to the quantificational NP \phrase{everyone}.%
    \footnote{So do \citets{hendriks-studied} and
    \citets{barker-continuations} later proposals.  For simplicity and
    because they are irrelevant, I omit restrictions on quantification
    (``$\Animate(x)\limplies\dotsb$'') in~\eqref{e:everyone-denotation} and
    below.}

Note that the type in~\eqref{e:everyone-denotation} is $(e\toC t)\toF t$
rather than the more familiar $(e\toF t)\toF t$.  This type documents our
intuition that the denotation of \phrase{everyone} is a function that maps
each proposition with an $e$\nobreakdash-hole (type $e\toC t$) to
a proposition with no hole (type~$t$).  In general, a semantic value whose
type is of the form $\alpha\toC\gamma$ can be thought of as ``an~$\gamma$
with a $\alpha$\nobreakdash-hole'', in other words a continuation
that---given a hole-filler of type~$\alpha$---promises to produce an answer
of type~$\gamma$.  To redeem this promise is to feed the continuation to
a function of type $(\alpha\toC\gamma)\toF\gamma'$ in return for a final
answer of type~$\gamma'$.  (In the case of \phrase{everyone}
in~\eqref{e:everyone-denotation}, the two answer types $\gamma$
and~$\gamma'$ are both~$t$, and the value type~$\alpha$ is~$e$.)

As one might expect from this discussion, types of the form
$(\alpha\toC\gamma)\toF\gamma'$ recur throughout this paper.  I write
$\alpha\cc{\gamma}{\gamma'}$
as shorthand for such a type.  For example, the denotation of
\phrase{everyone} given in~\eqref{e:everyone-denotation} can be
alternatively written
\begin{equation}
    \denote{\phrase{everyone}} = \fun{c} \Forall{x} c(x) : e\ccInline{t}{t}.
\end{equation}
I call $\alpha$ the \emp{value type}, $\gamma$ the \emp{incoming answer
type}, and $\gamma'$ the \emp{outgoing answer type}.

Continuation semantics can be understood as a generalization of PTQ, in
two steps:
\begin{itemize}
\item Lift not just the semantic type of NPs from~$e$ to $e\cc{t}{t}$,
      but also the semantic type of other phrases from say~$\alpha$ to
      $\alpha\cc{t}{t}$.
\item Lift each type~$\alpha$ to not just the type $\alpha\cc{t}{t}$, but
      any type of the form $\alpha\cc{\gamma}{\gamma'}$, where $\gamma$
      and~$\gamma'$ are types.
\end{itemize}
I detail these steps below.

\subsection{First Generalization: From $e\cc{t}{t}$ to $\alpha\cc{t}{t}$}
\label{s:generalization-1}

In PTQ, the semantic type of NPs is not~$e$ but $e\cc{t}{t}$.
For example, the NPs \phrase{Alice} and \phrase{Bob} denote not the
individuals $\Alice:e$ and $\Bob:e$, but rather the lifted values
\begin{subequations}
\begin{alignat}{2}
    \denote{\phrase{Alice}} &= \fun{c} c(\Alice) &&: e\ccInline{t}{t},\\
    \denote{\phrase{Bob}}   &= \fun{c} c(\Bob)   &&: e\ccInline{t}{t}.
\end{alignat}
\end{subequations}
In general, any value~$x:e$ can be lifted to the value $\fun{c}
c(x):e\cc{t}{t}$.  The lifted type~$e\cc{t}{t}$ is borne by all NPs,
from proper names like \phrase{Alice} and \phrase{Bob} to quantificational
NPs such as \phrase{everyone} and \phrase{someone}.
\begin{subequations}
\label{e:everyone-someone-denotation}
\begin{alignat}{2}
    \denote{\phrase{everyone}} &= \fun{c} \Forall{x} c(x) &&: e\ccInline{t}{t},\\
    \denote{\phrase{someone}}  &= \fun{c} \Exists{x} c(x) &&: e\ccInline{t}{t}.
\end{alignat}
\end{subequations}
Although proper names and quantificational NPs share the same lifted type,
the denotations of the latter do not result from lifting any value.

PTQ is appealing in part because it assigns the same lifted type to all
NPs, quantificational or not.  We can generalize this uniformity beyond
NPs.  For example, let us lift intransitive verbs from the type $e\toF
t$ to $(e\toF t)\cc{t}{t}$, and transitive verbs from the type
$e\toF e\toF t$ to $(e\toF e\toF t)\cc{t}{t}$.
\begin{subequations}
\begin{alignat}{2}
    \label{e:smoke-denotation}
    \denote{\phrase{smoke}} &= \fun{c} c(\Smoke) &&: (e\toF t)\ccInline{t}{t},\\
    \denote{\phrase{love}}  &= \fun{c} c(\Love)  &&: (e\toF e\toF t)\ccInline{t}{t}.
\end{alignat}
\end{subequations}
In general, any semantic value~$x$, say of type~$\alpha$, can be lifted to
the value $\fun{c} c(x)$, of type~$\alpha\cc{t}{t}$.  This lifting rule
is shown in Figure~\ref{f:lifting-t}.
%
\begin{figure}[tp]
\centerline{$
    \leaf{$x : \alpha$}
    \branch{1}{$\fun{c} c(x) : \alpha\cc{t}{t}$}
    \qobitree
$}
\caption{Lifting semantic values}
\label{f:lifting-t}
\end{figure}

To maintain the uniformity of types across the grammar, we want every VP to
take the same semantic type $(e\toF t)\cc{t}{t}$.  Furthermore, just
as the new denotation of \phrase{smoke} in~\eqref{e:smoke-denotation} is
its old denotation $\Smoke$ lifted, the new denotation of \phrase{love Bob}
should also be its old denotation, $\Love(\Bob)$, lifted.  What we now need
is a semantic rule that will combine a lifted function with a lifted
argument to form a lifted result.  For example, the rule should combine
$\denote{\phrase{love}} = \fun{c} c(\Love)$ with $\denote{\phrase{Bob}}
= \fun{c} c(\Bob)$ to form $\fun{c} c(\Love(\Bob))$, the denotation we
desire for \phrase{love Bob}.  This situation is depicted in
Figure~\ref{f:desired-fa}.
%
\begin{figure}[tp]
\centerline{$
    \leaf{$
        \denote{\phrase{love}} = \fun{c} c(\Love) : (e\toF e\toF t)\cc{t}{t}
    $}
    \leaf{$
        \denote{\phrase{Bob}} = \fun{c} c(\Bob) : e\cc{t}{t}
    $}
    \binarybranch[\raisebox{-2ex}{\framebox{\makebox[\totalheight]?}}]{
        \denote{\phrase{love Bob}}
        = \fun{c} c(\Love(\Bob))
        : (e\toF t)\cc{t}{t}}
    \qobitree
$}
\caption{The desired output of a lifted semantic rule}
\label{f:desired-fa}
\end{figure}

Consider now the following calculation.
%
\begin{equation}
\label{e:rewriting-1}
\begin{split}
    \fun{c} c(\Love(\Bob)) &= \fun{c} \bigl(\fun{c'}c'(\Love)\bigr) \bigl(\fun{f} c(f(\Bob))\bigr)
    \\                     &= \fun{c} \denote{\phrase{love}} \bigl(\fun{f} c(f(\Bob))\bigr)
    \\                     &= \fun{c} \denote{\phrase{love}} \bigl(\fun{f} \bigl(\fun{c'} c'(\Bob)\bigr) \bigl(\fun{x} c(f(x))\bigr) \bigr)
    \\                     &= \fun{c} \denote{\phrase{love}} \bigl(\fun{f} \denote{\phrase{Bob}} \bigl(\fun{x} c(f(x))\bigr) \bigr).
\end{split}
\end{equation}
%
In the first two lines, the atom~$\Love$ is replaced with a
variable~$f$, which gets its value from the lifted denotation of
\phrase{love}.  In the last two lines, the atom~$\Bob$ is similarly
replaced with~$x$, which gets its value from the
lifted denotation of \phrase{Bob}.  The end result is a way to write down
the lifted result of a function application in terms of the lifted function
and the lifted argument, without mentioning any unlifted atoms.  This
technique generalizes to a new semantic rule, \emp{lifted
function application}, shown in Figure~\ref{f:lifted-fa-1-t}.  It satisfies
the requirement in Figure~\ref{f:desired-fa}, as is easily checked.
%
\begin{figure}[tp]
\centerline{$
    \leaf{$\bar{f} : (\alpha\toF\beta)\cc{t}{t}\qquad$}
    \leaf{$\qquad\bar{x} : \alpha\cc{t}{t}$}
    \branch{2}{$
          \fun{c} \bar{f}\bigl(\fun{f}
                  \bar{x}\bigl(\fun{x}
                  c(f(x))\bigr)\bigr) : \beta\cc{t}{t}$}
    \qobitree
$}
\caption{Lifted function application
    (evaluating function then argument)}
\label{f:lifted-fa-1-t}
\end{figure}

As it turns out, there is another way to satisfy the requirement.
The calculation
in~\eqref{e:rewriting-1} above replaces the atom~$\Love$ first and the
atom~$\Bob$ second.  If instead we replace $\Bob$ first and $\Love$
second, we arrive at a different result.
%
\begin{equation}
\label{e:rewriting-2}
\begin{split}
    \fun{c} c(\Love(\Bob)) &= \fun{c} \bigl(\fun{c'}c'(\Bob)\bigr) \bigl(\fun{x} c(\Love(x))\bigr)
    \\                     &= \fun{c} \denote{\phrase{Bob}} \bigl(\fun{x} c(\Love(x))\bigr)
    \\                     &= \fun{c} \denote{\phrase{Bob}} \bigl(\fun{x} \bigl(\fun{c'} c'(\Love)\bigr) \bigl(\fun{f} c(f(x))\bigr) \bigr)
    \\                     &= \fun{c} \denote{\phrase{Bob}} \bigl(\fun{x} \denote{\phrase{love}} \bigl(\fun{f} c(f(x))\bigr) \bigr).
\end{split}
\end{equation}
%stopzone
This alternative calculation in turn gives rise to a different lifted
function application rule, that in Figure~\ref{f:lifted-fa-2-t}.
%
\begin{figure}[tp]
\centerline{$
    \leaf{$\bar{f} : (\alpha\toF\beta)\cc{t}{t}\qquad$}
    \leaf{$\qquad\bar{x} : \alpha\cc{t}{t}$}
    \branch{2}{$
          \fun{c} \bar{x}\bigl(\fun{x}
                  \bar{f}\bigl(\fun{f}
                  c(f(x))\bigr)\bigr)
        : \beta\cc{t}{t}$}
    \qobitree
$}
\caption{Lifted function application
    (evaluating argument then function)}
\label{f:lifted-fa-2-t}
\end{figure}

The two rules in Figures~\ref{f:lifted-fa-1-t}
and~\ref{f:lifted-fa-2-t} differ in \emp{evaluation order}.  Roughly
speaking, the evaluation order of a programming language is the order in
which ``computational side effects'' like input and output occur as
expressions are evaluated (in other words as code is executed).
Continuations are often used in programming language semantics to model
evaluation order, for instance in \citets{plotkin-call} seminal work.
Adopting this terminology, I say that our first rule evaluates the function
before the argument, and our second rule evaluates the argument before the
function.

\subsection{Quantification}

With the semantic rules and lexical denotations introduced so far, we can
derive the sentence \phrase{Alice loves everyone}.
Figure~\ref{f:alice-loves-everyone} shows one analysis, essentially that of
\citets{barker-continuations}.
%
\begin{figure}[tp]
\centerline{$
    \leaf{$\Alice:e$}
    \unarybranch[\wedge]{\fun{c} c(\Alice) :e\cc{t}{t}}
    \leaf{$\Love:e\toF e\toF t$}
    \unarybranch[\wedge]{\fun{c} c(\Love) :(e\toF e\toF t)\cc{t}{t}}
    \leaf{$\fun{c} \Forall{x} c(x):e\cc{t}{t}$}
    \binarybranchfakewidth[>]{\fun{c} \Forall{x} c(\Love(x)) :(e\toF t)\cc{t}{t}}
    \binarybranch[>]{\fun{c} \Forall{x} c(\Love(x)(\Alice)) : t\cc{t}{t}}
    \qobitree
$}
\caption{\protect\phrase{Alice loves everyone}}
\label{f:alice-loves-everyone}
\end{figure}
%stopzone

I indicate semantic rules used in derivations with the following notation.
\begin{itemize}
\item A unary branch decorated with~$\wedge$ invokes the lifting rule
      (Figure~\ref{f:lifting-t}).
\item A binary branch decorated with~$>$ invokes the one of the two lifted
      function application rules that evaluates the left
      daughter first, in other words either the
      function-then-argument rule (Figure~\ref{f:lifted-fa-1-t})
      or the mirror image of the argument-then-function rule
      (Figure~\ref{f:lifted-fa-2-t}).
\item A binary branch decorated with~$<$ invokes the other of the two
      lifted function application rules, which evaluates
      the right daughter first.
\end{itemize}
In this derivation, all evaluation orders give the same result, so both
binary branches in Figure~\ref{f:alice-loves-everyone} could have been
decorated with~$<$ instead of~$>$.  Evaluation order does not matter for
this sentence because it only contains one quantificational NP\@.  For
other sentences, such as \phrase{someone loves everyone}, different orders
of evaluation give differently scoped results \citep{barker-continuations}.

\subsection{Lowering}

The top-level denotation derived in Figure~\ref{f:alice-loves-everyone} has
type~$t\cc{t}{t}$, in other words $(t\toC t)\toF t$.  This type is not~$t$,
the type that clauses usually receive in Montague grammar.  This
discrepancy is expected, since every type~$\alpha$, say $\alpha=t$, has been
lifted to the type $\alpha\cc{t}{t}=t\cc{t}{t}$.  We can recover the usual,
type\nobreakdash-$t$ denotation of the sentence
by applying the lifted denotation---as a function---to the identity continuation.
That is, compute
\begin{equation}
\bigl( \fun{c} \Forall{x} c(\Love(x)(\Alice)) \bigr)
\bigl( \fun{x} x \bigr)
= \Forall{x} \Love(x)(\Alice) : t
\end{equation}
to recover the propositional meaning of \phrase{Alice loves everyone}.
Here the identity continuation $\fun{x} x : t\toC t$ corresponds to the
trivial evaluation context~``$\_$'': a sentence with a sentence hole, and
nothing else.

In general, from any value~$\bar{x}$ whose type is~$t\cc{t}{t}$ we can
recover the propositional value $\bar{x}(\fun{x}x)$, of type~$t$.
This gives us the \emp{lowering} rule in Figure~\ref{f:lowering-t}.
%
\begin{figure}[tp]
\centerline{$
    \leaf{$\bar{x} : t\cc{t}{t}$}
    \unarybranch[\vee]{\bar{x}(\fun{x}x) : t}
    \qobitree
$}
\caption{Lowering lifted propositions}
\label{f:lowering-t}
\end{figure}
%
Where this rule is used in derivations below, I decorate the unary branch
with~$\vee$.

\subsection{Second Generalization: From $\alpha\cc{t}{t}$ to $\alpha\cc{\gamma}{\gamma'}$}
\label{s:generalization-2}

The type~$t$ plays a special role in PTQ: It is the only answer type.
Because PTQ is after all a treatment of quantification, it is natural there
for the answer type to be fixed at~$t$ by lexical denotations like those of
\phrase{everyone} and \phrase{someone}
in~\eqref{e:everyone-someone-denotation}.  However, in the treatment of
extraction and interrogation that I present below, not all clauses have the
same type.  Gapped and interrogative clauses do not denote propositions;
they have types other than~$t$.  So our semantic rules must deal with
lifted values whose answer types are not~$t$.

\begin{figure}[tp]
\centerline{$
    \leaf{$x : \alpha$}
    \unarybranch[\wedge]{\fun{c} c(x) : \alpha\cc{\gamma}{\gamma}}
    \qobitree
$}
\caption{Lifting semantic values, revised}
\label{f:lifting}
\end{figure}

The semantic rules introduced so far (Figures~\ref{f:lifting-t},
\ref{f:lifted-fa-1-t}, \ref{f:lifted-fa-2-t}, and~\ref{f:lowering-t}) do not
mention any logical operator.  Thus the type~$t$ plays no essential role in
these rules, and can be replaced with a type variable~$\gamma$.  Start with
the lifting rule (Figure~\ref{f:lifting-t}): Any semantic value~$x$, say of
type~$\alpha$, can be lifted to the value~$\fun{c}c(x)$, of (polymorphic)
type~$\alpha\cc{\gamma}{\gamma}$.  This revised lifting rule is shown in
Figure~\ref{f:lifting}.

\begin{figure}[tp]
\centerline{$
    \leaf{$\bar{f} : (\alpha\toF\beta)\cc{\gamma_1}{\gamma_0}\qquad$}
    \leaf{$\qquad\bar{x} : \alpha\cc{\gamma_2}{\gamma_1}$}
    \binarybranch[>]{
          \fun{c} \bar{f}\bigl(\fun{f}
                  \bar{x}\bigl(\fun{x}
                  c(f(x))\bigr)\bigr) : \beta\cc{\gamma_2}{\gamma_0}}
    \qobitree
$}
\caption{Lifted function application
    (evaluating function then argument), revised}
\label{f:lifted-fa-1}
\end{figure}
%stopzone

\begin{figure}[tp]
\centerline{$
    \leaf{$\bar{f} : (\alpha\toF\beta)\cc{\gamma_2}{\gamma_1}\qquad$}
    \leaf{$\qquad\bar{x} : \alpha\cc{\gamma_1}{\gamma_0}$}
    \binarybranch[<]{
          \fun{c} \bar{x}\bigl(\fun{x}
                  \bar{f}\bigl(\fun{f}
                  c(f(x))\bigr)\bigr) : \beta\cc{\gamma_2}{\gamma_0}}
    \qobitree
$}
\caption{Lifted function application
    (evaluating argument then function), revised}
\label{f:lifted-fa-2}
\end{figure}
%stopzone

\begin{figure}[tp]
\centerline{$
    \leaf{$\bar{x} : \alpha\cc{\alpha}{\gamma}$}
    \unarybranch[\vee]{\bar{x}(\fun{x}x) : \gamma}
    \qobitree
$}
\caption{Lowering lifted values, revised}
\label{f:lowering}
\end{figure}
%stopzone

The other semantic rules can be similarly revised, by substituting~$\gamma$
for~$t$ throughout.  However, further generalization is possible.  We can
not only support answer types other than~$t$, but also allow multiple
answer types to occur in the same derivation.  In technical terms, consider
the $\lambda$\nobreakdash-terms in our semantic rules: How polymorphic can
their types be without risking a mismatch?  The most general types that can
be assigned are shown in Figures
\ref{f:lifted-fa-1}\nobreakdash--\ref{f:lowering}.  (Note that the two
versions of lifted function application now differ in their types.)

Let me summarize the semantics we have arrived at.  Alongside of function
application, we have added to Montague grammar four semantic rules:
lifting, two versions of lifted function application, and lowering.  These
four rules, shown in Figures \ref{f:lifting}\nobreakdash--\ref{f:lowering},
suffice below to analyze extraction and interrogation, except \wh-phrases
taking wide scope call for higher-order continuations
(\sref{s:higher-order}).

\section{Manipulating Answer Types}
\label{s:manipulating-answer-types}

In this section, I present my analysis of interrogatives using
continuations.  I first analyze extraction and raised \wh-phrases, then
turn to in-situ \wh-phrases and multiple-\wh\ interrogatives.

\subsection{Extraction}
\label{s:extraction}

\begin{figure}[tp]
\centerline{$
    \leaf{$\We:e$}
    \unarybranch[\wedge]{\fun{c} c(\We) : e\cc{e\toC t}{e\toC t}}
    \leaf{$\Buy:e\toF e\toF t$}
    \unarybranch[\wedge]{\fun{c} c(\Buy) :(e\toF e\toF t)\cc{e\toC t}{e\toC t}}
    \leaf{$\fun{c}c:(e\toC t)\toF (e\toC t)$}
    \binarybranchfakewidth[>]{\fun{c} \fun{x} c(\Buy(x)) : (e\toF t)\cc{t}{e\toC t}}
    \binarybranchfakewidth[>]{\fun{c} \fun{x} c(\Buy(x)(\We)) : t\cc{t}{e\toC t}}
    \unarybranch[\vee]{\fun{x} \Buy(x)(\We) : e\toC t}
    \qobitree
$}
\caption{\protect\phrase{We bought~\_}}
\label{f:we-bought-t}
\end{figure}
%stopzone

In order to analyze interrogatives with raised \wh-phrases, I first need a
theory of extraction.  Fortunately, continuation semantics provides for a
natural and compositional analysis of extraction.  One possible
implementation is to posit a phonologically null NP, notated~``\_'',
whose denotation is%
  \footnote{That I posit a phonologically null element
  is a matter of presentation and not critical to the approach to
  extraction sketched here.  It would work equally well for my purposes to
  introduce type-shift operations that effectively roll
  $\denote{\phrase{\_}}$ into binary rules.}
\begin{equation}
\label{e:trace-denotation}
    \denote{\phrase{\_}} = \fun{c} c : (e\toC\gamma)\toF(e\toC\gamma),
\end{equation}
that is, the identity function over individual-taking continuations.%
  \footnote{The idea that a variable or gap is in some sense an identity
  function over continuations appeared in the work of
  \citeauthor{danvy-functional} (\citeyear{danvy-functional}, \S3.4),
  and also has been mentioned to me by
  Barker.  The more general idea that a variable or gap is
  an identity function of some sort has an even longer history in computer
  science \citep{hindley-combinators} and linguistics
  \citep{jacobson-variable-free}.}
Figure~\ref{f:we-bought-t} shows how to
derive \phrase{we bought~\_}.  The final denotation has type $e\toC t$,
a continuation type.  This is typical of a clause with an unsaturated gap,
and is intuitive considering that continuations are supposed to model
evaluation contexts, in other words expressions with holes.

Figure~\ref{f:we-bought-t} reflects one important difference between the
continuation semantics here and Barker's system.  Barker takes
the answer type to be~$t$ everywhere; he does not generalize PTQ to
arbitrary answer types (as I do in \sref{s:generalization-2} above).
My present purposes require that we not fix a single answer type, for two
reasons.  First, not all clauses have the same type.  Although basic
declarative sentences such as \phrase{Alice loves Bob} have type~$t$,
I want sentences with gaps and interrogatives to have other semantic types.
Second, my semantics not only calls for a mixture of different answer
types, but in fact contains denotations that modify what can be
thought of as the ``current answer type''.

Manipulation of answer types is exemplified by the denotation
of~\phrase{\_} in~\eqref{e:trace-denotation} and the derivation of
\phrase{we bought~\_} in Figure~\ref{f:we-bought-t}.  Examining the
denotation of~\phrase{\_}, we see that it takes as input an
$e$\nobreakdash-taking
continuation whose answer type is $\gamma$, but returns a final answer of
type $e\toC\gamma$ instead.  Informally speaking, $\denote{\phrase{\_}}$
acts like an $e$ locally, but in addition prepends ``$e\>\toC$'' to the
current answer type; hence \phrase{we bought~\_} receives the semantic type
$e\toC t$ rather than $t$.  In general, a value of type
\begin{equation}
\label{e:manipulation}
    (\alpha\toC\gamma)\toF\gamma'
\end{equation}
acts like the value type~$\alpha$ locally, but in addition transforms the
incoming answer type~$\gamma$ to the outgoing answer type~$\gamma'$.  The
denotation $\denote{\phrase{\_}}$ is a special case where $\alpha = e$ and
$\gamma' = e\toC\gamma$.  Another special case is denotations lifted using
the lifting rule, for which $\gamma=\gamma'$ and manipulation of
answer types degenerates into propagation.%
  \footnote{This pseudo-operational description is merely an intuitive
  sketch.  The denotations in my semantics are computed purely in-situ
  according to local composition rules.}

The intuition that values like $\denote{\phrase{\_}}$ ``change the current
answer type'' is reflected my shorthand notation for continuation types,
introduced above in \sref{s:from-ptq}.  The type of $\denote{\phrase{\_}}$
can be written alternatively as~$e\cc{\gamma}{e\toC\gamma}$, so as to
emphasize that it acts locally like an $e$, but prepends ``$e\>\toC$'' to
the answer type.  Note also, in Figures~\ref{f:lifted-fa-1}
and~\ref{f:lifted-fa-2}, how lifted function application concatenates two
changes to the answer type---first from~$\gamma_2$ to~$\gamma_1$, and then
from~$\gamma_1$ to~$\gamma_0$---into a change from $\gamma_2$ to
$\gamma_0$.

\subsection{Raised \protect\Wh-phrases}
\label{s:raised-wh-phrases}

As alluded to in~\sref{s:introduction}, my interrogative denotations
are roughly functions mapping answers to propositions.  To
make this idea precise, I introduce yet another binary type constructor
$\toQ$, so as to form \emp{question types} such as $e\toQ t$.
As before, I distinguish between the question type $e\toQ t$, the
continuation type $e\toC t$, and the function type $e\toF t$, even though
they may have the same models and I overload the same notation to construct
and apply all three kinds of abstractions.

I now analyze the sentences
\ex. \a. \label{e:john-remembers-what-we-bought-t}
         Alice remembers what [we bought~\_].
     \b. What did we buy~\_?\par
I ignore the subject-auxiliary inversion triggered by direct (top-level)
interrogatives.

In~\sref{s:extraction} is derived a denotation of type $e\toC t$ for the
embedded clause \phrase{we bought~\_}.  Let us assume, as is commonly done,
that remembrance relates persons (type $e$) and questions (type $e\toQ t$
for now).  Then \phrase{remember} has type $(e\toQ t)\toF e\toF t$.

Having assigned meanings to every other word
in~\eqref{e:john-remembers-what-we-bought-t}, I need to specify
what \phrase{what} means.  Note that \phrase{we bought~\_} is of type $e\toC
t$, but \phrase{remember} requires the distinct type $e\toQ t$ for its
input.  Therefore, the denotation of \phrase{what} should convert
\phrase{we bought~\_} from $e\toC t$ to $e\toQ t$.  I make the simplest
assumption to that effect---that \phrase{what} has the semantic type
$(e\toC t) \toF (e\toQ t)$.
The semantic content of \phrase{what} should be essentially the identity
function, but express the requirement that the
input to $e\toQ t$ be somehow inanimate.  I am not
concerned with the nature of this requirement here,
so I simply notate it as a bracketed formula
$\presuppose{\neg\Animate(x)}\!$, as in%
\begin{subequations}
\label{e:wh-proto-denotations}
\begin{alignat}{2}
\label{e:what-proto-denotation}
    \denote{\phrase{what}}
          &= \fun{c} \fun{x} \presuppose{\neg\Animate(x)} c(x)
         &&: (e\toC t) \toF (e\toQ t),\\
\label{e:who-proto-denotation}
    \denote{\phrase{who}}
          &= \fun{c} \fun{x} \presuppose{\Animate(x)} c(x)
         &&: (e\toC t) \toF (e\toQ t).
\end{alignat}
\end{subequations}
The formula $\presuppose{\neg\Animate(x)} c(x)$
can be thought of as ``if $\neg\Animate(x)$ then $c(x)$, otherwise undefined''.

\begin{figure}[tp]
\centerline{$
    \leaf{$\Alice:e$}
    \leaf{$\Remember:(e\toQ t)\toF e\toF t$}
    \leaf{$\denote{\phrase{what}}:(e\toC t)\toF (e\toQ t)$}
    \roof{we bought~\_\\(Figure~\ref{f:we-bought-t})}{$
        \fun{x} \Buy(x)(\We) : e\toC t
      $}
    \binarybranchfakewidth{e\toQ t}
    \binarybranchfakewidth{e\toF t}
    \binarybranch{
        \Remember\bigl(\fun{x} \presuppose{\neg\Animate(x)} \Buy(x)(\We)\bigr)
                 \bigl(\Alice\bigr)
        : t
      }
    \qobitree
$}
\caption{\protect\phrase{Alice remembers what} [\protect\phrase{we bought~\_}]}
\label{f:john-remembers-what-we-bought-t}
\end{figure}
%stopzone

The definitions in~\eqref{e:wh-proto-denotations} makes no concrete use of the
base type~$t$.  Indeed, we can generalize them to%
\begin{subequations}
\label{e:wh-denotations}
\begin{alignat}{2}
\label{e:what-denotation}
    \denote{\phrase{what}}
          &= \fun{c} \fun{x} \presuppose{\neg\Animate(x)} c(x)
         &&: (e\toC \gamma) \toF (e\toQ \gamma),\\
\label{e:who-denotation}
    \denote{\phrase{who}}
          &= \fun{c} \fun{x} \presuppose{\Animate(x)} c(x)
         &&: (e\toC \gamma) \toF (e\toQ \gamma).
\end{alignat}
\end{subequations}
I use this generalization to analyze multiple-\wh\ clauses in
\sref{s:in-situ-wh-phrases} below.  Regardless, we can derive
\eqref{e:john-remembers-what-we-bought-t}.  One derivation is shown in
Figure~\ref{f:john-remembers-what-we-bought-t}.  Once the meaning of
\phrase{we bought~\_} is derived, the rest of the derivation consists
entirely of (unlifted) function application.

Why distinguish between function types
($\toF$), continuation types ($\toC$), and question types ($\toQ$)\@?
The distinction prevents the grammar from
overgenerating sentences like *\phrase{I remember Alice bought} or
*\phrase{I remember what what Alice bought}.  The types
enforce a one-to-one correspondence between gaps and \wh-phrases---more
precisely, interrogatives gaps and raised \wh-phrases.

\subsection{In-situ \protect\Wh-phrases}
\label{s:in-situ-wh-phrases}

The analyses above of extraction and raised \wh-phrases are both natural in
the spirit of continuation semantics.  The primary payoff from these
analyses is that little more needs to be said to treat interrogatives with
in-situ \wh-phrases and to account for the two properties I listed
in~\sref{s:introduction}.

\begin{figure}[tp]
\centerline{$
    \leaf{$
      \begin{stacked}
        \displayleft{\denote{\phrase{what}}:(e\toC e\toQ t)}
        \displayright{ \toF (e\toQ e\toQ t)}
      \end{stacked}$}
    \leaf{$\We:e$}
    \unarybranch[\wedge]{e\cc{e\toC e\toQ t}{e\toC e\toQ t}}
    \leaf{$\Buy:e\toF e\toF t$}
    \unarybranch[\wedge]{(e\toF e\toF t)\cc{e\toC e\toQ t}{e\toC e\toQ t}}
    \leaf{$\hspace{-2em}\fun{c}c$\\${}:e\cc{e\toQ t}{e\toC e\toQ t}$}
    \binarybranchfakewidth[>]{\fun{c} \fun{x} c(\Buy(x)) : (e\toF t)\cc{e\toQ t}{e\toC e\toQ t}}
    \leaf{$\For:e\toF(e\toF t)\toF(e\toF t)$}
    \unarybranchfakewidth[\wedge]{\hspace{-2em}\bigl(e\toF(e\toF t)$\\${}\toF(e\toF t)\bigr)\cc{e\toQ t}{e\toQ t}}
    \leaf{$\denote{\phrase{who}}:e\cc{t}{e\toQ t}$}
    \binarybranchfakewidth[>]{\qquad\bigl((e\toF t)\toF(e\toF t)\bigr)\cc{t}{e\toQ t}\quad}
    \binarybranchfakewidth[>]{(e\toF t)\cc{t}{e\toC e\toQ t}}
    \binarybranchfakewidth[>]{
        \rlap{$\fun{c} \fun{x} \fun{y} \presuppose{\Animate(y)}$}\qquad\qquad$\\$
        \rlap{$c(\For(y)(\Buy(x))(\We)) : t\cc{t}{e\toC e\toQ t}$}\qquad}
    \unarybranchfakewidth[\vee]{
        \rlap{$\fun{x} \fun{y} \presuppose{\Animate(y)}$}\qquad\qquad$\\$
        \rlap{$\For(y)(\Buy(x))(\We) :e\toC e\toQ t$}\qquad}
    \binarybranch{\rlap{$\fun{x} \presuppose{\neg\Animate(x)}
                         \fun{y} \presuppose{\Animate(y)}
                         \For(y)(\Buy(x))(\We) :e\toQ e\toQ t$}
        \hspace{15em}}
    \qobitree
$}
\caption{\protect\phrase{What we bought~\_ for whom}, with the narrow-scope reading for
    \protect\phrase{whom}}
\label{f:what-we-bought-t-for-whom'}
\end{figure}
%stopzone

The first property is that \wh-phrases appear both raised and
in-situ.  For instance, the clauses in~\eqref{e:double-wh}
contain \phrase{what} raised and \phrase{whom} in-situ.
\ex. \label{e:double-wh}
     \a. \label{e:what-did-we-buy-t-for-whom}
         What did we buy~\_ for whom?
     \nopagebreak
     \b. \label{e:what-we-bought-t-for-whom}
         what we bought~\_ for whom\par
Ignoring the subject-auxiliary inversion
in~\eqref{e:what-did-we-buy-t-for-whom}, these two clauses are identical.
To derive them, all we need is an uncontroversial meaning
for \phrase{for}:
\begin{equation}
\label{e:for-denotation}
    \denote{\phrase{for}} = \For : e\toF(e\toF t)\toF(e\toF t).
\end{equation}
Given that it was with raised usage in mind that we assigned to
\phrase{whom} its meaning in~\eqref{e:who-denotation}, it may come as a
surprise that the same meaning works equally well for in-situ usage.  But
it does all work out: The derivation, which culminates in the top-level
type $e\toQ e\toQ t$, is shown in
Figure~\ref{f:what-we-bought-t-for-whom'}.  (If we
assume furthermore that \phrase{remember} can take semantic type $(e\toQ
e\toQ t)\toF e\toF t$, then it is straightforward to produce the
narrow-scope reading~\eqref{e:narrow-scope-answer-2} of the
example~\eqref{e:baker-indirect-2} from \sref{s:introduction}.)

To see how this derivation works, it is useful to
examine~\eqref{e:wh-denotations}, where \phrase{what} and \phrase{who} were
assigned the (polymorphic) type $(e\toC\gamma) \toF (e\toQ\gamma)$.
In~\sref{s:raised-wh-phrases}, this type was justified because
\phrase{what} needed to convert ($\toF$) an $e$\nobreakdash-\hspace{0pt}taking
continuation ($\toC$) to an $e$\nobreakdash-\hspace{0pt}wondering question ($\toQ$).
However, the same type can also be written as
$e\cc{\gamma}{e\toQ\gamma}$.
A value of this
type takes as input an $e$\nobreakdash-taking continuation whose answer is
$\gamma$, but returns a final answer of type $e\toQ\gamma$ instead.
Informally speaking, interrogative NPs
act like $e$s locally, but in addition prepends ``$e\>\toQ$''
to the current answer type.

Hence, as one might expect, the double-\wh\ constructions
in~\eqref{e:double-wh} receive the semantic type $e\toQ e\toQ t$.  The
first ``$e\>\toQ$'' in the type is contributed by the raised \wh-phrase
\phrase{what}, or rather, contributed as ``$e\>\toC$'' by the extraction
gap and subsequently converted to ``$e\>\toQ$'' by \phrase{what}.  The
second ``$e\>\toQ$'' in the type is contributed directly by the in-situ
\wh-phrase \phrase{whom}.  Figure~\ref{f:building-type} illustrates this
process.

\begin{figure}[tp]
\centerline{$
\newcommand{\explanation}[1]{\underset{\makebox[0pt]{\hss\small\strut#1\hss}}{\vdots}}
\newcommand{\stagetext}[2][]{\xleftarrow[#1]{\rotateleft{\mbox{\small\strut#2}}}}
    \boxed{e\toQ e\toQ t}
    \stagetext[\explanation{Convert ``$e\>\toC$'' to ``$e\>\toQ$''}]{what}
    \boxed{e\toC e\toQ t}
    \stagetext{we bought}
    \boxed{e\toC e\toQ t}
    \stagetext[\explanation{\hspace{-2em}Prepend ``$e\>\toC$''}]{\_}
    \boxed{e\toQ t}
    \stagetext{for}
    \boxed{e\toQ t}
    \stagetext[\explanation{\hspace{-3em}Prepend ``$e\>\toQ$''}]{whom}
    \boxed{t}
$}
\caption{Building the semantic type $e\toQ e\toQ t$ for
\protect\phrase{what we bought~\_ for whom}, with the narrow-scope reading for
\protect\phrase{whom}.  Whereas the in-situ elements~\protect\phrase{\_} and \protect\phrase{whom}
manipulate the answer type, the raised element \protect\phrase{what} manipulates
the value type.}
\label{f:building-type}
\end{figure}
%stopzone

It may be initially perplexing that the types in
Figure~\ref{f:building-type} are manipulated \emph{right-to-left}.  This
pattern is explained if we postulate that evaluation in natural
language tends to proceed \emph{left-to-right}.
That is, when a function occurs linearly before its argument, the
function-then-argument version of lifted function application is preferred,
and vice versa.
Left-to-right evaluation results in right-to-left answer type manipulation,
because constituents to the
left decide what the answer type looks like at outer levels.
For example, $\denote{\phrase{\_}}$ wants the answer type to be
a continuation at the outermost level it gets to affect.  When building the
answer type bottom-up from~$t$ to $e\toQ e\toQ t$, the outermost decisions
are executed last, not first.

Critical to the ability of the type $(e\toC\gamma) \toF (e\toQ\gamma)$ to
serve two roles at once is the lowering rule.  In-situ
\wh-phrases (and gaps) combine with other constituents and manipulate the
answer type through lifted function application.  By contrast, raised
\wh-phrases combine with other constituents through ordinary (unlifted) function
application, and perform the conversion from ``$e\>\toC$'' to ``$e\>\toQ$''
not on the answer type but on the value type.  Before a raised \wh-phrase
can act on a gapped clause, then, the clause needs a meaning whose value
type---\emph{not answer type}---is of the form $e\toC\dotsb$.  The lowering
rule fills this need: It extracts an answer out of a lifted value
by feeding it the identity continuation.

\subsection{Higher-Order Continuations}
\label{s:higher-order}

We have seen above that, in my analysis of interrogatives, a single
denotation for each \wh-phrase suffices for both raised and in-situ
appearances, as long as the \wh-phrase takes narrow scope.  To fulfill the
promises I made in \sref{s:introduction}, I have to turn to wide scope and
account for two additional facts about interrogatives: First, I have to
show in my system that in-situ \wh-phrases can take semantic scope wider
than the immediately enclosing clause, as they do in my initial examples
\eqref{e:wide-scope-answer-1} and~\eqref{e:wide-scope-answer-2}.  Second,
I have to show that raised \wh-phrases cannot take wide scope; in other
words, they must take semantic scope exactly where they are overtly
located.

I claim that \emp{higher-order continuations} account for wide scope
interrogatives\hspace{0pt}.%
  \footnote{In the same spirit, \citet{barker-higher-order} used
  higher-order continuations to treat wide-scope specific indefinites and
  interactions between coordination and antecedent-contained deletion.}
Our analyses in previous sections are lifted only to the first order.  In
PTQ terms, this means that our values are sets of sets; more generally, our
types are of the form~$\alpha\cc{\gamma}{\gamma'}$.  Wide scope calls for
lifting to the second order.  In PTQ terms, this means that our values need
to be sets of sets of sets of sets; more generally, we need to deal with
types of the form~$\alpha\cc{\gamma}{\gamma'}\cc{\delta}{\delta'}$.  Recall
that values lifted to the first order are manipulated using four additional
semantic rules: lifting, lowering, and lifted function application (two
versions).  I explain below how to introduce further semantic rules into
the grammar that manipulate values lifted to higher orders.

As described in \sref{s:generalization-1}, lifted function application is
obtained by ``lifting'' ordinary function application.  Since ordinary
function application is a binary rule, it can be lifted in two ways
(evaluation orders), giving two rules for lifted function application.  In
general, any $n$\nobreakdash-ary semantic rule, schematically
\begin{equation}
\label{e:unlifted-rule}
    \leaf{$x_1 : \alpha_1$}
    \leaf{$x_2 : \alpha_2$}
    \leaf{$\dotsm$}
    \leaf{$x_n : \alpha_n$}
    \branch{4}{$y : \beta$}
    \qobitreecenter[,]
\end{equation}
can be lifted in $n!$ ways, giving rise to $n!$ lifted rules: For each
permutation~$\sigma$ of the numbers $1$, $2$,~\dots,~$n$, 
we can lift~\eqref{e:unlifted-rule} to a new rule
\begin{equation}
\label{e:lifted-rule}
    \leaf{$\bar{x}_1 : \alpha_1\cc{\gamma_{\sigma_1}}{\gamma_{\sigma_1-1}}$}
    \leaf{$\bar{x}_2 : \alpha_2\cc{\gamma_{\sigma_2}}{\gamma_{\sigma_2-1}}$}
    \leaf{$\dotsm$}                                                    
    \leaf{$\bar{x}_n : \alpha_n\cc{\gamma_{\sigma_n}}{\gamma_{\sigma_n-1}}$}
    \branch{4}{$
        \fun{c}
        \bar{x}_{\sigma^{-1}_1}\bigl(\fun{x_{\sigma^{-1}_1}}
        \bar{x}_{\sigma^{-1}_2}\bigl(\fun{x_{\sigma^{-1}_2}}
        \dotsm
        \bar{x}_{\sigma^{-1}_n}\bigl(\fun{x_{\sigma^{-1}_n}}
        c(y)
        \bigr)
        \dotsm
        \bigr)
        \bigr)
        : \beta\cc{\gamma_n}{\gamma_0}$}
    \qobitreecenter[.]
\end{equation}
For example, ordinary function application
(Figure~\ref{f:direct-application}) can be lifted with $\sigma_1=1$,
$\sigma_2=2$ (Figure~\ref{f:lifted-fa-1}) or with $\sigma_1=2$,
$\sigma_2=1$ (Figure~\ref{f:lifted-fa-2}).

Let $G$ be a Montague grammar, each of whose semantic rules are of the form
in~\eqref{e:unlifted-rule}.  We can \emp{lift}~$G$ to a new
grammar~$G'$, with the following semantic rules:
\begin{itemize}
\item the value lifting rule (Figure~\ref{f:lifting});
\item the value lowering rule (Figure~\ref{f:lowering}); and
\item every rule in~$G$, along with the $n!$ ways to lift it, where $n$ is
      the arity.
\end{itemize}
Let $G_0$ be ``pure'' Montague grammar, where the only semantic rule
is function application.  Lifting
$G_0$ gives a new grammar $G_0'$; call it~$G_1$.  Lifting $G_1$ gives
another grammar $G_1' = G_0''$; call it~$G_2$.
%
\begin{table}
\caption{Lifting Montague grammar.  Starting from function application
($G_0$), lifting once gives a grammar ($G_1$) with $2$ unary rules and $3$
binary rules.  Lifting again gives a grammar ($G_2$) with $4$ unary rules
and $7$ binary rules.  In the table, ``$f>x$'' means ``evaluating function
first''; ``$x>f$'' means ``evaluating argument first''.}
\label{f:lifting-grammar}
\def\=#1 {\node{#1}{$\bullet$}}
\def\fta{, lifted $f>x$}
\def\atf{, lifted $x>f$}
\begin{center}
\begin{tabular}{lccccc}
\hline
Unary rule & $G_0$ && $G_1$ && $G_2$ \\
\hline
Value lifting                         &           & & \=lift1   &=& \=lift2   \\
Value lifting, lifted                 &           & &           & & \=liftL2   \\
Value lowering                        &           & & \=lower1  &=& \=lower2   \\
Value lowering, lifted                &           & &           & & \=lowerL2   \\
\hline
Binary rule & $G_0$ && $G_1$ && $G_2$ \\
\hline
Function application\fta\fta          &           & &           & & \=faFF2   \\
Function application\fta              &           & & \=faF1    &=& \=faF2   \\
Function application\fta\atf          &           & &           & & \=faFA2   \\
Function application                  & \=fa0     &=& \=fa1     &=& \=fa2   \\
Function application\atf\fta          &           & &           & & \=faAF2   \\
Function application\atf              &           & & \=faA1    &=& \=faA2   \\
Function application\atf\atf          &           & &           & & \=faAA2   \\
\hline
\end{tabular}
\anodeconnect[r]{lift1}[l]{liftL2}%
\anodeconnect[r]{lower1}[l]{lowerL2}%
\anodeconnect[r]{fa0}[l]{faF1}%
\anodeconnect[r]{fa0}[l]{faA1}%
\anodeconnect[r]{faF1}[l]{faFF2}%
\anodeconnect[r]{faF1}[l]{faFA2}%
\anodeconnect[r]{faA1}[l]{faAF2}%
\anodeconnect[r]{faA1}[l]{faAA2}%
\end{center}
\end{table}
%
These grammars and their rules are illustrated in
Figure~\ref{f:lifting-grammar}.  The grammar~$G_2$ contains the semantic
rules we need to manipulate values lifted to the second order: lifted
lifting, lifted lowering, and twice-lifted function application (four
versions).  The process may continue indefinitely.

In a once-lifted grammar, many types are of the
form~$\alpha\cc{\gamma}{\gamma'}$.
As explained in \sref{s:extraction}, such a type can be understood
to mean ``acts locally like an~$\alpha$ while changing the
answer type from~$\gamma$ to~$\gamma'$''.  In a twice-lifted grammar, many
types are of the form~$\alpha\cc{\gamma}{\gamma'}\cc{\delta}{\delta'}$.
One way to understand such types is to think of a derivation in
a twice-lifted grammar as maintaining two answer types---an \emph{inner}
answer type corresponding to the first time the grammar is lifted, and an
\emph{outer} one corresponding to the second time.  A type of the
form~$\alpha\cc{\gamma}{\gamma'}\cc{\delta}{\delta'}$ means ``acts locally
like an~$\alpha$ while changing the inner answer type
from~$\gamma$ to~$\gamma'$ and the outer answer type from~$\delta$
to~$\delta'$''.

To strengthen this understanding, let us examine how answer types are
manipulated in the four binary composition rules that result from\pagebreak[3]
lifting function application twice.  In Figure~\ref{f:lifted-lifted-fa},
I expand out the rules, in particular the types.
%
\begin{figure}[tp]
\centerline{$
    \leaf{$\bar{\bar{f}} : (\alpha\toF\beta)
               \cc{\gamma_1}{\gamma_0}
               \cc{\delta_1}{\delta_0}$}
    \leaf{$\bar{\bar{x}} : \alpha
               \cc{\gamma_2}{\gamma_1}
               \cc{\delta_2}{\delta_1}$}
    \binarybranch[>^>]{\fun{d}
                  \bar{\bar{f}}\bigl(\fun{\bar{f}}
                  \bar{\bar{x}}\bigl(\fun{\bar{x}}
                  d\bigl(\fun{c}
                  \bar{f}\bigl(\fun{f}
                  \bar{x}\bigl(\fun{x}
                  c(f(x))\bigr)\bigr)\bigr)\bigr)\bigr)
        : \beta\cc{\gamma_2}{\gamma_0}
               \cc{\delta_2}{\delta_0}}
    \qobitreecenter
$}
\vspace{\jot}
\centerline{$
    \leaf{$\bar{\bar{f}} : (\alpha\toF\beta)
               \cc{\gamma_1}{\gamma_0}
               \cc{\delta_2}{\delta_1}$}
    \leaf{$\bar{\bar{x}} : \alpha
               \cc{\gamma_2}{\gamma_1}
               \cc{\delta_1}{\delta_0}$}
    \binarybranch[>^<]{\fun{d}
                  \bar{\bar{x}}\bigl(\fun{\bar{x}}
                  \bar{\bar{f}}\bigl(\fun{\bar{f}}
                  d\bigl(\fun{c}
                  \bar{f}\bigl(\fun{f}
                  \bar{x}\bigl(\fun{x}
                  c(f(x))\bigr)\bigr)\bigr)\bigr)\bigr)
        : \beta\cc{\gamma_2}{\gamma_0}
               \cc{\delta_2}{\delta_0}}
    \qobitreecenter
$}
\vspace{\jot}
\centerline{$
    \leaf{$\bar{\bar{f}} : (\alpha\toF\beta)
               \cc{\gamma_2}{\gamma_1}
               \cc{\delta_1}{\delta_0}$}
    \leaf{$\bar{\bar{x}} : \alpha
               \cc{\gamma_1}{\gamma_0}
               \cc{\delta_2}{\delta_1}$}
    \binarybranch[<^>]{\fun{d}
                  \bar{\bar{f}}\bigl(\fun{\bar{f}}
                  \bar{\bar{x}}\bigl(\fun{\bar{x}}
                  d\bigl(\fun{c}
                  \bar{x}\bigl(\fun{x}
                  \bar{f}\bigl(\fun{f}
                  c(f(x))\bigr)\bigr)\bigr)\bigr)\bigr)
        : \beta\cc{\gamma_2}{\gamma_0}
               \cc{\delta_2}{\delta_0}}
    \qobitreecenter
$}
\vspace{\jot}
\centerline{$
    \leaf{$\bar{\bar{f}} : (\alpha\toF\beta)
               \cc{\gamma_2}{\gamma_1}
               \cc{\delta_2}{\delta_1}$}
    \leaf{$\bar{\bar{x}} : \alpha
               \cc{\gamma_1}{\gamma_0}
               \cc{\delta_1}{\delta_0}$}
    \binarybranch[<^<]{\fun{d}
                  \bar{\bar{x}}\bigl(\fun{\bar{x}}
                  \bar{\bar{f}}\bigl(\fun{\bar{f}}
                  d\bigl(\fun{c}
                  \bar{x}\bigl(\fun{x}
                  \bar{f}\bigl(\fun{f}
                  c(f(x))\bigr)\bigr)\bigr)\bigr)\bigr)
        : \beta\cc{\gamma_2}{\gamma_0}
               \cc{\delta_2}{\delta_0}}
    \qobitreecenter
$}
\caption{Twice-lifted function application (four versions)}
\label{f:lifted-lifted-fa}
\end{figure}
%stopzone
%
In the rules $>^>$ and~$>^<$, evaluation proceeds from function to argument\pagebreak[3]
at the first continuation level.  Accordingly, the subscripts on~$\gamma$
show that the inner answer type is threaded first through the
argument~$\smash[t]{\bar{\bar{x}}}$ and then through the function~$\smash[t]{\bar{\bar{f}}}$.  In
the rules $<^>$ and~$<^<$ the reverse happens: Evaluation proceeds from
argument to function, and the inner answer type is threaded through
first~$\smash[t]{\bar{\bar{f}}}$ and then~$\smash[t]{\bar{\bar{x}}}$.

Similarly for the second continuation level: In the rules $>^>$ and~$<^>$,
evaluation proceeds from function to argument, and the subscripts
on~$\delta$ show that the outer answer type is threaded first
through~$\smash[t]{\bar{\bar{x}}}$ and then through~$\smash[t]{\bar{\bar{f}}}$.  In the rules
$>^<$ and~$<^<$, evaluation proceeds from argument to function, and the
outer answer type is threaded through first~$\smash[t]{\bar{\bar{f}}}$ and
then~$\smash[t]{\bar{\bar{x}}}$.

\subsection{Wide Scope and Baker's Ambiguity}
\label{s:wide-scope}

With second-order continuations, we can compute the wide-scope
reading \eqref{e:wide-scope-answer-2} for
the sentence~\eqref{e:baker-indirect-2} from~\sref{s:introduction},
repeated here with gaps represented explicitly.
\ex.[(\pref{e:baker-indirect-2})]
    \label{e:baker-indirect-2'}
    Who do you think~\_ remembers [what we bought~\_ for whom]?\par
I extend the grammar only by lifting it again as discussed above, and
add no new denotations to the lexicon other than the obvious missing
entries
\begin{equation}
    \You:e,\qquad \Think:t\toF e\toF t.
\end{equation}

The wide-scope reading of the example~\eqref{e:baker-indirect-2} is a
double-\wh\ question.  Thus, we expect the matrix clause to have the semantic
type $e\toQ e\toQ t$.  What about the embedded clause?  It acts locally
like a single-\wh\ question (\phrase{what}), but in addition should prepend
``$e\>\toQ$'' to the answer type (\phrase{whom}).  We thus expect the
embedded clause to have the type \smash[b]{$(e\toQ
t)\cc{\delta}{e\toQ\delta}$}, a special case of which is $(e\toQ
t)\cc{t}{e\toQ t}$.

\begin{figure}
\centerline{$
    \leaf{$
      \begin{stacked}
        \displayleft{\denote{\phrase{what}}: (e\toC t)}
        \displayright{\toF(e\toQ t)}
      \end{stacked}$}
    \unarybranch[\wedge]{\bigl((e\toC t) \toF(e\toQ t)\bigr) \cc{e\toQ \delta}{e\toQ \delta}}
    \leaf{$\We : e$}
    \unarybranch[\wedge]{e\cc{e\toC t}{e\toC t}}
    \unarybranch[\wedge]{e\cc{e\toC t}{e\toC t}\cc{e\toQ \delta}{e\toQ \delta}}
    \leaf{$\Buy : e\toF e\toF t$\hspace*{-0.05in}}
    \unarybranch[\wedge]{(e\toF e\toF t)\cc{e\toC t}{e\toC t}}
    \unarybranch[\wedge]{(e\toF e\toF t) $\\$ \cc{e\toC t}{e\toC t}\cc{e\toQ \delta}{e\toQ \delta}}
    \leaf{$\fun{c}c : e\cc{t}{e\toC t}$}
    \unarybranch[\wedge]{e\cc{t}{e\toC t}\cc{e\toQ \delta}{e\toQ \delta}}
    \binarybranch[>^>]{\fun{d} d\bigl(\fun{c} \fun{x} c(\Buy(x))\bigr)
        $\\$\qquad :(e\toF t)\cc{t}{e\toC t}\cc{e\toQ \delta}{e\toQ\delta}}
    \leaf{$\For : e\toF (e\toF t) \toF (e\toF t)$}
    \unarybranch[\wedge]{\bigl(e\toF (e\toF t) \quad $\\$ \toF (e\toF t)\bigr)\cc{t}{t}}
    \unarybranchfakewidth[\wedge]{\bigl(e\toF (e\toF t) \quad\qquad $\\$ \toF (e\toF t)\bigr)\cc{t}{t}\cc{e\toQ \delta}{e\toQ \delta}}
    \leaf{$\denote{\phrase{who}}\quad $\\$ : e\cc{\delta}{e\toQ \delta}$}
    \unarybranch[\wedge^*]{e\cc{t}{t}\cc{\delta}{e\toQ \delta}}
    \binarybranchfakewidth[>^>]{\qquad\bigl((e\toF t)\toF(e\toF t)\bigr)\cc{t}{t}\cc{\delta}{e\toQ \delta}\qquad}
    \binarybranchfakewidth[>^>]{
        \rlap{$\fun{d} \fun{y} \presuppose{\Animate(y)} d\bigl(\fun{c} \fun{x} $}\hspace{11em}$\\$
        \rlap{$c(\For(y)(\Buy(x)))\bigr) : (e\toF t)\cc{t}{e\toC t}\cc{\delta}{e\toQ \delta}$}\hspace{7em}}
    \binarybranchfakewidth[>^>]{
        \rlap{$\fun{d} \fun{y} \presuppose{\Animate(y)} d\bigl(\fun{c} \fun{x} $}\qquad\qquad$\\$
        \rlap{$c(\For(y)(\Buy(x))(\We))\bigr) : t\cc{t}{e\toC t}\cc{\delta}{e\toQ \delta}$}\qquad}
    \unarybranchfakewidth[\vee^*]{
        \rlap{$\fun{d} \fun{y} \presuppose{\Animate(y)} d\bigl(\fun{x} $}\qquad\qquad$\\$
        \rlap{$\For(y)(\Buy(x))(\We)\bigr) : (e\toC t)\cc{\delta}{e\toQ \delta}$}\qquad}
    \binarybranch[>]{
      \rlap{$\fun{d} \fun{y} \presuppose{\Animate(y)} d\bigl(\fun{x} \presuppose{\neg\Animate(x)} $}\qquad\qquad$\\$
      \rlap{$\For(y)(\Buy(x))(\We)\bigr) : (e\toQ t)\cc{\delta}{e\toQ \delta}$}\qquad}
    \qobitree
    \hspace{-1.75em}
$}
\caption{\protect\phrase{What we bought~\_ for whom}, with the wide-scope
    reading for \protect\phrase{whom}}
\label{f:what-we-bought-t-for-whom-wide}
\end{figure}
%stopzone

Figure~\ref{f:what-we-bought-t-for-whom-wide} shows a derivation for
\phrase{what we bought~\_ for whom} that culminates in precisely the
expected type.
The interesting part of the derivation is how the three
continuation-manipulating elements \phrase{what},~\phrase{\_}, and
\phrase{whom} enter it.  The narrow-scope elements \phrase{what}
and~\phrase{\_} need to manipulate the inner answer type while remaining
oblivious to the second continuation level, so we lift them.  The
wide-scope element \phrase{whom}, on the other hand, needs to manipulate
the outer answer type while leaving the first continuation
level alone; to achieve this effect, we lift it ``from the inside'' using the
lifted lifting rule (depicted as $\wedge^*$).  Near the top of the
derivation, we use the lifted lowering rule (depicted as $\vee^*$)
to lower the embedded clause's denotation ``from the inside'', that is, on the
first rather than second continuation level.

Given a meaning for \phrase{what we bought~\_ for whom} of the expected
type above, the semantics of the matrix question follows easily from the
techniques already demonstrated in previous sections.  Second-order
continuations are no longer involved.  The embedded clause is just
a constituent that contains an in-situ \wh-phrase \phrase{whom}; like any
other such constituent, it combines with the rest of the sentence,
including the raised \wh-phrase \phrase{who}, to give a final denotation of
type $e\toQ e\toQ t$, typical of a double-\wh\ interrogative.
Figure~\ref{f:who-you-think-t-remembers-what-we-bought-t-for-whom-wide}
shows the derivation.

\begin{figure}
\centerline{$
    \leaf{$
      \begin{stacked}
        \displayleft{\denote{\phrase{who}}}
        \displayright{: (e\toC e\toQ t)}
        \displayright{\toF(e\toQ e\toQ t)}
      \end{stacked}\hspace{-1em}$}
    \leaf{$\You:e$}
    \unarybranchfakewidth[\wedge]{e\cc{e\toC e\toQ t}{e\toC e\toQ t}}
    \leaf{\qquad\llap{$\Think:t\toF e\toC t$}}
    \unarybranchfakewidth[\wedge]{\qquad\llap{$(t\toF e\toC t)\cc{e\toC e\toQ t}{e\toC e\toQ t}$}}
    \leaf{\qquad\llap{$\fun{c}c:e\cc{e\toQ t}{e\toC e\toQ t}$}}
    \leaf{\qquad\llap{$\Remember:(e\toQ t)\toF e\toF t$}}
    \unarybranchfakewidth[\wedge]{\qquad\llap{$\bigl((e\toQ t)\toF e\toF t\bigr)\cc{e\toQ t}{e\toQ t}$}}
    \roof{what we bought~\_ for whom\\(Figure~\ref{f:what-we-bought-t-for-whom-wide})}{$
        (e\toQ t)\cc{t}{e\toQ t}
      $}
    \binarybranchfakewidth[>]{(e\toF t)\cc{t}{e\toQ t}}
    \binarybranchfakewidth[>]{
      \rlap{$\fun{d} \fun{z} \fun{y} \presuppose{\Animate(y)}$}\qquad\qquad\qquad$\\$
      \rlap{$d\bigl( \Remember\bigl( \fun{x} \presuppose{\neg\Animate(x)} $}\qquad\qquad$\\$
      \rlap{$\For(y)(\Buy(x))(\We)\bigr)(z) \bigr) : t\cc{t}{e\toC e\toQ t}$}\qquad}
    \binarybranchfakewidth[>]{
      \rlap{$\fun{d} \fun{z} \fun{y} \presuppose{\Animate(y)}$}\qquad\qquad\qquad$\\$
      \rlap{$d\bigl( \Think\bigl( \Remember\bigl( \fun{x} \presuppose{\neg\Animate(x)} $}\qquad\qquad$\\$
      \rlap{$\For(y)(\Buy(x))(\We)\bigr)(z) \bigr) \bigr) : (e\toF t)\cc{t}{e\toC e\toQ t}$}\qquad}
    \binarybranchfakewidth[>]{
      \rlap{$\fun{d} \fun{z} \fun{y} \presuppose{\Animate(y)}$}\qquad\qquad\qquad$\\$
      \rlap{$d\bigl( \Think\bigl( \Remember\bigl( \fun{x} \presuppose{\neg\Animate(x)} $}\qquad\qquad$\\$
      \rlap{$\For(y)(\Buy(x))(\We)\bigr)(z) \bigr)(\You) \bigr) : t\cc{t}{e\toC e\toQ t}$}\qquad}
    \unarybranchfakewidth[\vee]{
      \rlap{$\fun{z} \fun{y} \presuppose{\Animate(y)}$}\qquad\qquad\qquad$\\$
      \rlap{$\Think\bigl( \Remember\bigl( \fun{x} \presuppose{\neg\Animate(x)} $}\qquad\qquad$\\$
      \rlap{$\For(y)(\Buy(x))(\We)\bigr)(z) \bigr)(\You) : e\toC e\toQ t$}\qquad}
    \binarybranchfakewidth{
      \rlap{$\fun{z} \presuppose{\Animate(z)} \fun{y} \presuppose{\Animate(y)}$}\qquad\qquad\qquad$\\$
      \rlap{$\Think\bigl( \Remember\bigl( \fun{x} \presuppose{\neg\Animate(x)} $}\qquad\qquad$\\$
      \rlap{$\For(y)(\Buy(x))(\We)\bigr)(z) \bigr)(\You) : e\toQ e\toQ t$}\qquad}
    \qobitree
    \hspace{3em}
$}
\caption{\protect\phrase{Who you thinks~\_ remembers what we bought~\_ for whom}, with the wide-scope
    reading for \protect\phrase{whom}}
\label{f:who-you-think-t-remembers-what-we-bought-t-for-whom-wide}
\end{figure}
%stopzone

We have seen that higher-order continuations allow in-situ
\wh-phrases to take wide scope.  I now explain why raised
\wh-phrases cannot take wide scope,
no matter how many times we lift the grammar.  What does it mean for
a raised \wh-phrase to take wide scope?  Based on the
analyses so far, I make the following definitional characterization: A
raised \wh-phrase takes narrow scope when it contributes its ``$e\>\toQ$''
to the clause's value type, and wide scope when it contributes its
``$e\>\toQ$'' to the clause's outgoing answer type (or rather, one of the
clause's outgoing answer types, in the presence of higher-order
continuations).
More precisely, consider a clause with a raised
\wh-phrase in front and a corresponding gap inside.
\exi. \label{e:wh-clause}
      [$a$ [$b$ wh] [$c$ {\dots} [$d$ t] \mbox{ \dots}]]\par
For the \wh-phrase $b$ to take narrow scope is
for the clause $a$ to have semantic type of the form
$   \bigl(e\toQ\alpha\bigr)
    \smash{\cc{\gamma_1}{\gamma'_1} \dotsm \cc{\gamma_n}{\gamma'_n}} $,
and the clause-sans-\wh-phrase $c$ the corresponding form
$   \bigl(e\toC\alpha\bigr)
    \smash{\cc{\gamma_1}{\gamma'_1} \dotsm \cc{\gamma_n}{\gamma'_n}} $,
such that the ``$e\>\toQ$'' was contributed as ``$e\>\toC$'' by the gap $d$
and subsequently converted to ``$e\>\toQ$'' by the \wh-phrase $b$.  This is
demonstrated in \sref{s:raised-wh-phrases}.

By contrast, for the \wh-phrase $b$ to take wide scope is for $a$
to have semantic type of the form
$   \beta
    \cc{\alpha}{e\toQ\alpha}
    \smash{\cc{\gamma_1}{\gamma'_1} \dotsm \cc{\gamma_n}{\gamma'_n}} $,
and $c$ the corresponding form
$   \beta
    \cc{\alpha}{e\toC\alpha}
    \smash{\cc{\gamma_1}{\gamma'_1} \dotsm \cc{\gamma_n}{\gamma'_n}} $,
such that the ``$e\>\toQ$'' was contributed as ``$e\>\toC$'' by $d$ and
subsequently converted to ``$e\>\toQ$'' by $b$.  This
is impossible because it requires replacing ``$e\>\toC$'' with
``$e\>\toQ$'' in an answer type, a feat performed by neither any element in
the lexicon nor any rule in the grammar:  A survey of
the lexical items and grammar rules in this paper reveals that the they and
their descendants-by-lifting only manipulate answer types by adding
to them.  Nothing ever takes apart any answer type
until the answer has been lowered to value level.  The
formalism I use here does not stipulate this---in fact, one can easily
introduce into the lexicon raised \wh-phrases that take wide scope, but
English does not appear to contain these denotations:
\begin{subequations}
\begin{alignat}{2}
\denote{\phrase{what}}
       &\ne \fun{p} \fun{c} \fun{x} \presuppose{\neg\Animate(x)} p(c)(x)
      &&\eqishcolon\textstyle
          \alpha\cc{\gamma}{e\toC\gamma} \toF
          \alpha\cc{\gamma}{e\toQ\gamma}, \\
\denote{\phrase{who}}
       &\ne \fun{p} \fun{c} \fun{x} \presuppose{    \Animate(x)} p(c)(x)
      &&\eqishcolon\textstyle
          \alpha\cc{\gamma}{e\toC\gamma} \toF
          \alpha\cc{\gamma}{e\toQ\gamma}.
\end{alignat}
\end{subequations}

\section{Discussion}
\label{s:discussion}

This paper presents a grammar fragment that captures two properties
of English interrogatives:  First, \wh-phrases can appear both raised and
in-situ.  Second, in-situ \wh-phrases can take scope beyond the immediately
enclosing clause, but raised \wh-phrases must take scope exactly where they
are pronounced.  My fragment is inspired by Barker's continuation
semantics for natural
language~\citeyearpar{barker-continuations,barker-higher-order} and
work on continuations and typed contexts in programming languages
\citep{danvy-functional,danvy-abstracting,murthy-control,wadler-composable}.

As a semantics of interrogatives, this paper leaves many concerns
unaddressed:
languages other than English;
pair-list questions;
relative clauses;
interactions with intensionality and quantification; and so on.
Regardless, the two properties of interrogatives that I
do explore fall out surprisingly naturally:
The same \wh-denotation works both raised and in-situ,
but in raised position it is forced
to take overt scope by a theorem of the type system.
The basic ideas probably carry over to other kinds of
so-called \=A-movement, such as topicalization.  Continuations also suggest
new ways to understand phenomena such as superiority and pied-piping, but
for lack of space I leave these investigations for elsewhere.



\theendnotes

\bibliographystyle{mcbride}
\bibliography{ccshan}

\end{document}

salt12-paper.bbl
\providecommand{\leanTAP}{\mbox{{\sf lean}\smash{$T^{\!\!\textstyle A}\!\!P$}}}
\begin{thebibliography}{16}
\expandafter\ifx\csname natexlab\endcsname\relax\def\natexlab#1{#1}\fi
\expandafter\ifx\csname bibnamefont\endcsname\relax
  \def\bibnamefont#1{#1}\fi
\expandafter\ifx\csname bibfnamefont\endcsname\relax
  \def\bibfnamefont#1{#1}\fi
\expandafter\ifx\csname citenamefont\endcsname\relax
  \def\citenamefont#1{#1}\fi
\expandafter\ifx\csname url\endcsname\relax
  \def\url#1{\texttt{#1}}\fi
\expandafter\ifx\csname urlprefix\endcsname\relax\def\urlprefix{URL }\fi
\providecommand{\bibinfo}[2]{#2}
\providecommand{\eprint}[2][]{\url{#2}}

\bibitem[{\citenamefont{Baker}(1968)}]{baker-indirect}
\bibinfo{author}{\bibnamefont{Baker}, \bibfnamefont{Carl~Leroy}}.
  \bibinfo{year}{1968}.
\newblock \bibinfo{title}{Indirect questions in {E}nglish}.
\newblock Ph.D. thesis, \bibinfo{school}{University of Illinois}.

\bibitem[{\citenamefont{Barker}(2000{\natexlab{a}})}]{barker-continuations}
\bibinfo{author}{\bibnamefont{Barker}, \bibfnamefont{Chris}}.
  \bibinfo{year}{2000}{\natexlab{a}}.
\newblock \bibinfo{title}{Continuations and the nature of quantification}.
\newblock \bibinfo{howpublished}{Manuscript, University of California, San
  Diego; \url{http://www.semanticsarchive.net/Archive/902ad5f7/}}.

\bibitem[{\citenamefont{Barker}(2000{\natexlab{b}})}]{barker-higher-order}
---------. \bibinfo{year}{2000}{\natexlab{b}}.
\newblock \bibinfo{title}{Notes on higher-order continuations}.
\newblock \bibinfo{howpublished}{Manuscript, University of California, San
  Diego}.

\bibitem[{\citenamefont{Danvy and Filinski}(1989)}]{danvy-functional}
\bibinfo{author}{\bibnamefont{Danvy}, \bibfnamefont{Olivier}},
  \bibnamefont{and} \bibinfo{author}{\bibfnamefont{Andrzej}
  \bibnamefont{Filinski}}. \bibinfo{year}{1989}.
\newblock \bibinfo{title}{A functional abstraction of typed contexts}.
\newblock \bibinfo{type}{Tech. Rep.} \bibinfo{number}{89/12},
  \bibinfo{institution}{{DIKU}, University of Co\-pen\-ha\-gen, Den\-mark}.
\newblock
  \bibinfo{note}{\url{http://www.daimi.au.dk/~danvy/Papers/fatc.ps.gz}}.

\bibitem[{\citenamefont{Danvy and Filinski}(1990)}]{danvy-abstracting}
---------. \bibinfo{year}{1990}.
\newblock \bibinfo{title}{Abstracting control}.
\newblock In \emph{\bibinfo{booktitle}{Proceedings of the 1990 {ACM} conference
  on {L}isp and functional programming}}, \bibinfo{pages}{151--160}.
  \bibinfo{address}{{N}ew {Y}ork}:\@ \bibinfo{publisher}{{ACM} {P}ress}.

\bibitem[{\citenamefont{Epstein}(1992)}]{epstein-derivational}
\bibinfo{author}{\bibnamefont{Epstein}, \bibfnamefont{Samuel~David}}.
  \bibinfo{year}{1992}.
\newblock \bibinfo{title}{Derivational constraints on {{\=A}}-chain formation}.
\newblock \emph{\bibinfo{journal}{Linguistic Inquiry}}
  \bibinfo{volume}{23}(\bibinfo{number}{2}):\penalty0
  \bibinfo{pages}{235--259}.

\bibitem[{\citenamefont{Hendriks}(1993)}]{hendriks-studied}
\bibinfo{author}{\bibnamefont{Hendriks}, \bibfnamefont{Herman}}.
  \bibinfo{year}{1993}.
\newblock \bibinfo{title}{Studied flexibility: Categories and types in syntax
  and semantics}.
\newblock Ph.D. thesis, \bibinfo{school}{Institute for Logic, Language and
  Computation, Universiteit van Amsterdam}.

\bibitem[{\citenamefont{Hindley and Seldin}(1986)}]{hindley-combinators}
\bibinfo{author}{\bibnamefont{Hindley}, \bibfnamefont{J.~Roger}},
  \bibnamefont{and} \bibinfo{author}{\bibfnamefont{Jonathan~P.}
  \bibnamefont{Seldin}}. \bibinfo{year}{1986}.
\newblock \emph{\bibinfo{title}{Introduction to combinators and
  $\lambda$-calculus}}.
\newblock \bibinfo{address}{Cambridge}:\@ \bibinfo{publisher}{Cambridge
  University Press}.

\bibitem[{\citenamefont{Jacobson}(1999)}]{jacobson-variable-free}
\bibinfo{author}{\bibnamefont{Jacobson}, \bibfnamefont{Pauline}}.
  \bibinfo{year}{1999}.
\newblock \bibinfo{title}{Towards a variable-free semantics}.
\newblock \emph{\bibinfo{journal}{Linguistics and Philosophy}}
  \bibinfo{volume}{22}(\bibinfo{number}{2}):\penalty0
  \bibinfo{pages}{117--184}.

\bibitem[{\citenamefont{Kelsey et~al.}(1998)\citenamefont{Kelsey, Clinger, Rees
  et~al.}}]{kelsey-r5rs}
\bibinfo{author}{\bibnamefont{Kelsey}, \bibfnamefont{Richard}},
  \bibinfo{author}{\bibfnamefont{William} \bibnamefont{Clinger}},
  \bibinfo{author}{\bibfnamefont{Jonathan} \bibnamefont{Rees}},
  \bibnamefont{et~al.} \bibinfo{year}{1998}.
\newblock \bibinfo{title}{Revised${}^5$ report on the algorithmic language
  {S}cheme}.
\newblock \emph{\bibinfo{journal}{Higher-Order and Symbolic Computation}}
  \bibinfo{volume}{11}(\bibinfo{number}{1}):\penalty0 \bibinfo{pages}{7--105}.
\newblock \bibinfo{note}{Also as {\em ACM SIG{\-}PLAN Notices\/} 33(9):26--76}.

\bibitem[{\citenamefont{Montague}(1974)}]{montague-proper}
\bibinfo{author}{\bibnamefont{Montague}, \bibfnamefont{Richard}}.
  \bibinfo{year}{1974}.
\newblock \bibinfo{title}{The proper treatment of quantification in ordinary
  {E}nglish}.
\newblock In \emph{\bibinfo{booktitle}{Formal philosophy: Selected papers of
  {R}ichard {M}ontague}}, ed. \bibinfo{editor}{Richmond Thomason},
  \bibinfo{pages}{247--270}. \bibinfo{address}{New Haven}:\@
  \bibinfo{publisher}{Yale University Press}.

\bibitem[{\citenamefont{Murthy}(1992)}]{murthy-control}
\bibinfo{author}{\bibnamefont{Murthy}, \bibfnamefont{Chetan~R.}}
  \bibinfo{year}{1992}.
\newblock \bibinfo{title}{Control operators, hierarchies, and pseudo-classical
  type systems}.
\newblock In \emph{\bibinfo{booktitle}{{CW}'92: Proceedings of the {ACM}
  {SIG{\-}PLAN} workshop on continuations}}, ed. \bibinfo{editor}{Olivier
  Danvy} and \bibinfo{editor}{Carolyn Talcott}, \bibinfo{pages}{49--71}.
  \bibinfo{series}{Tech.\ Rep.}   \bibinfo{number}{STAN-CS-92-1426},
  \bibinfo{publisher}{Department of Computer Science, Stanford University}.
\newblock
  \bibinfo{note}{\url{ftp://cstr.stanford.edu/pub/cstr/reports/cs/tr/92/1426}}.

\bibitem[{\citenamefont{Plotkin}(1975)}]{plotkin-call}
\bibinfo{author}{\bibnamefont{Plotkin}, \bibfnamefont{Gordon~D.}}
  \bibinfo{year}{1975}.
\newblock \bibinfo{title}{Call-by-name, call-by-value and the
  $\lambda$-calculus}.
\newblock \emph{\bibinfo{journal}{Theoretical Computer Science}}
  \bibinfo{volume}{1}(\bibinfo{number}{2}):\penalty0 \bibinfo{pages}{125--159}.

\bibitem[{\citenamefont{Steedman}(1987)}]{steedman-combinatory}
\bibinfo{author}{\bibnamefont{Steedman}, \bibfnamefont{Mark}}.
  \bibinfo{year}{1987}.
\newblock \bibinfo{title}{Combinatory grammars and parasitic gaps}.
\newblock \emph{\bibinfo{journal}{Natural Language and Linguistic Theory}}
  \bibinfo{volume}{5}:\penalty0 \bibinfo{pages}{403--439}.

\bibitem[{\citenamefont{Steedman}(1996)}]{steedman-surface}
---------. \bibinfo{year}{1996}.
\newblock \emph{\bibinfo{title}{Surface structure and interpretation}}.
\newblock \bibinfo{address}{Cambridge}:\@ \bibinfo{publisher}{{MIT} Press}.

\bibitem[{\citenamefont{Wadler}(1994)}]{wadler-composable}
\bibinfo{author}{\bibnamefont{Wadler}, \bibfnamefont{Philip}}.
  \bibinfo{year}{1994}.
\newblock \bibinfo{title}{Monads and composable continuations}.
\newblock \emph{\bibinfo{journal}{{L}isp and Symbolic Computation}}
  \bibinfo{volume}{7}(\bibinfo{number}{1}):\penalty0 \bibinfo{pages}{39--56}.

\end{thebibliography}
