MLP Selection Grammar Source
 
— The following syntactic types with NULL definitions are included
— in emgrm because they appear as OBJLIST attributes (names of BNF
— definitions which can serve as object strings) of some verbs
— in emlex, even though currently they are not called upon or
— substantively defined in emgrm. Should it be desirable to
— reinstate them, their definitions are given in Appendix 1
— of N. Sager, Natural Language Information Processing: A Computer
— Grammar of English and its Applications, Addison-Wesley (1981).
<ADJN> ::= NULL.
<DP1P> ::= NULL.
<DP2PN> ::= NULL.
<DP3PN> ::= NULL.
<DP4PN> ::= NULL.
<DPSN> ::= NULL.
<NASOBJBE> ::= NULL.
<NPVINGSTG> ::= NULL.
<NSVINGO> ::= NULL.
<NPSNWH> ::= NULL.
<PSNWH> ::= NULL.
<NPSVINGO> ::= NULL.
<NSNWH> ::= NULL.
<PNSNWH> ::= NULL.
<PNTHATSVO> ::= NULL.
<PNVINGSTG> ::= NULL.
<VINGSTGPN> ::= NULL.
<PNN> ::= NULL.
<PVINGSTG> ::= NULL.
<SNWH> ::= NULL.
<VINGOFN> ::= NULL.
<VINGSTG> ::= NULL.
— The following terminal symbols of the grammar appear as category
— assignments (part of speech) of some words in emlex, hence they
— must appear in a definition in emgrm even though currently they
— are not called upon.
<UNUSED> ::= <*CS0> / <*CS2> / <*CS3> / <*CS4> / <*CS5> /
        <*CS6> / <*CS7> / <*CS8> / <*CS10> /
        <*GRAM-NODE> / <*INT> / <*NG> /
        <*NULLPRO1> / <*NULLPRO2> / <*NULLC> / <*NULLN> .
<AINSIQUESTG> ::= NULL.
<AND-ORSTG> ::= NULL.
<AS-WELL-AS-STG> ::= NULL.
<ASSTG> ::= NULL.
<ASTGP> ::= NULL.
<BEDATE> ::= NULL.
<BEINGO> ::= NULL.
<BOTHSTG> ::= NULL.
<C1SHOULD> ::= NULL.
<COLONSTG> ::= NULL.
<CPDNUMBR> ::= NULL.
<CSSTG> ::= NULL.
<DASHSTG> ::= NULL.
<DATEVAR> ::= NULL.
<DAYYEAR> ::= NULL.
<DMQSTG> ::= NULL.
<DOSE-OF-N> ::= NULL.
<EGSTG> ::= NULL.
<EITHERSTG> ::= NULL.
<ENVINGO> ::= NULL.
<ESPECIALLY-STG> ::= NULL.
<ETCSTG> ::= NULL.
<FORTOVO-N> ::= NULL.
<FRACTION> ::= NULL.
<FTIME> ::= NULL.
<HOWQASTG> ::= NULL.
<HOWQSTG> ::= NULL.
<IMPERATIVE> ::= NULL.
<INTRO-PHRASE> ::= NULL.
<INTSTG> ::= NULL.
<LAR1> ::= NULL.
<LCDA> ::= NULL.
<LCDN> ::= NULL.
<LCDVA> ::= NULL.
<LCS> ::= NULL.
<LDATE> ::= NULL.
<LDATER> ::= NULL.
<LNAME> ::= NULL.
<LNAMER> ::= NULL.
<LNSR> ::= NULL.
<LPRO> ::= NULL.
<LQNR> ::= NULL.
<LTIME> ::= NULL.
<LTVR> ::= NULL.
<LVSA> ::= NULL.
<MEDDOSE> ::= NULL.
<MOREDATE> ::= NULL.
<MORESPEC> ::= NULL.
<NAMESTG> ::= NULL.
<NEG> ::= NULL.
<NEGV> ::= NULL.
<NEITHERSTG> ::= NULL.
<NINRN> ::= NULL.
<NISTG> ::= NULL.
<NNN> ::= NULL.
<NORSTG> ::= NULL.
<NOTOPT> ::= NULL.
<NPDOSE> ::= NULL.
<NPSNWH> ::= NULL.
<NPSVINGO> ::= NULL.
<NPVO> ::= NULL.
<NPWHS> ::= NULL.
<NQ> ::= NULL.
<NSNWH> ::= NULL.
<NSPOS> ::= NULL.
<NSTGP> ::= NULL.
<NTHATS> ::= NULL.
<NUMBRSTG> ::= NULL.
<NVINGO> ::= NULL.
<NVSA> ::= NULL.
<NWHSTG> ::= NULL.
<OBJBESA> ::= NULL.
<ORNOT> ::= NULL.
<PA> ::= NULL.
<PAREN-FRAG> ::= NULL.
<PARENSTG> ::= NULL.
<PART> ::= NULL.
<PARTICULARLY-STG> ::= NULL.
<PNPVO> ::= NULL.
<PNSNWH> ::= NULL.
<PNTHATSVO> ::= NULL.
<PNVINGSTG> ::= NULL.
<PNVO> ::= NULL.
<PROPOS> ::= NULL.
<PROSENT> ::= NULL.
<PSNWH> ::= NULL.
<PSVINGO> ::= NULL.
<PUISSTG> ::= NULL.
<PVO-N> ::= NULL.
<PVO> ::= NULL.
<PWHNQ-PN> ::= NULL.
<PWHNQ> ::= NULL.
<PWHNS-PN> ::= NULL.
<PWHNS> ::= NULL.
<PWHQ-PN> ::= NULL.
<PWHQ> ::= NULL.
<PWHS-PN> ::= NULL.
<PWHS> ::= NULL.
<Q-ASSERT> ::= NULL.
<Q-INVERT> ::= NULL.
<Q-OF> ::= NULL.
<Q-PHRASE> ::= NULL.
<QN-TIME> ::= NULL.
<QNREP> ::= NULL.
<QNS> ::= NULL.
<QUAL> ::= NULL.
<QUECOMP> ::= NULL.
<QUISEG> ::= NULL.
<QUOTESTG> ::= NULL.
<RA1> ::= NULL.
<RDATE> ::= NULL.
<RNAME> ::= NULL.
<PAREN-RN> ::= NULL.
<RNWH> ::= NULL.
<RSUBJ> ::= NULL.
<RXMODE> ::= NULL.
<S-N> ::= NULL.
<SAWH> ::= NULL.
<SAWHICHSTG> ::= NULL.
<SEGADJ> ::= NULL.
<SN> ::= NULL.
<SOBJBE> ::= NULL.
<SOBJBESA> ::= NULL.
<SPECIMEN> ::= NULL.
<STOVO-N> ::= NULL.
<SUB10> ::= NULL.
<SUB2> ::= NULL.
<SUB3> ::= NULL.
<SUB4> ::= NULL.
<SUB5> ::= NULL.
<SUB6> ::= NULL.
<SUB7> ::= NULL.
<THANSTG> ::= NULL.
<THATS-N> ::= NULL.
<TITLE> ::= NULL.
<TOBE> ::= NULL.
<TOSTG> ::= NULL.
<TSUBJVO> ::= NULL.
<VERB1> ::= NULL.
<VERB2> ::= NULL.
<VERSUSSTG> ::= NULL.
<VINGSTG> ::= NULL.
<VINGSTGPN> ::= NULL.
<VOIRESTG> ::= NULL.
<WH-PHRASE> ::= NULL.
<WHATS-N> ::= NULL.
<WHERES> ::= NULL.
<WHETHS> ::= NULL.
<WHETHTOVO> ::= NULL.
<WHEVERS-N> ::= NULL.
<WHN> ::= NULL.
<WHNQ-N> ::= NULL.
<WHNS-N> ::= NULL.
<WHQ-N> ::= NULL.
<WHQ> ::= NULL.
<WITHSTG> ::= WITH <SACONJ> <Q-CONJ> .
<YESNOQ> ::= NULL.
— BNF DEFINITIONS

— 1. SENTENCE
<SENTENCE> ::= <TEXTLET>.
<TEXTLET> ::= <ONESENT> <MORESENT>.
<ONESENT> ::= <SECTION> <INTRODUCER> <CENTER> <ENDMARK>.
<SECTION> ::= <SECT-NAME> / <*NULL>.
<SECT-NAME> ::= '[' (SUBJECTIVE / OBJECTIVE / ASSESSMENT / PLAN
        / ADMINISTRATION / BIRTHDATE / RISK-BEHAVIORS
        / HISTORY-OF-PRESENT-ILLNESS / IMPRESSION
        / PAST-MEDICAL-HISTORY / SOCIAL-HISTORY
        / FAMILY-HISTORY / MEDICATIONS / PHYSICAL-EXAM
        / PHYSICAL-EXAMINATION / LABORATORY-DATA
        / LAB / FOLLOW-UP / MEDICATIONS-ON-DISCHARGE
        / DISCHARGE-DIAGNOSIS / DISCHARGE-PROCEDURES
        / SURGERIES / DISCUSSION / ALLERGIES / GENERAL
        / HOSPITAL-COURSE / PATIENT-INSTRUCTIONS)
        ( MALE / FEMALE / <*NULL> )
        ']
'.
<MORESENT> ::= <*NULL> / <TEXTLET>.
<INTRODUCER> ::= <LISTMARK> / AND / OR / BUT / <INT-PHRASE> (':'/ '-')
        / <*NULL>.
<LISTMARK> ::= 'A.' / 'B.' / 'C.' / 'D.' / 'E.' / '1.' / '2.' / '3.'
        / '4.' / '5.'.
<INT-PHRASE> ::= PROBLEM LIST / LABORATORY DATA / NEUROLOGIC
        / LABORATORY DATA '/' TEST RESULTS / CHIEF COMPLAINT
        / <LDATER> / <LNR> ['/' <LNR> ] / <*ADJ> [ '/' <*ADJ>].
<CENTER> ::= (<ASSERTION> / <FRAGMENT>
        / <TSUBJVO> / <OBES>) <PAREN-FRAG>.
<PAREN-FRAG> ::= '(' <FRAGMENT> ')' / '(' <ASSERTION> ')' / <*NULL>.
<ENDMARK> ::= '.' / ';'.
— 2. CENTER STRINGS
<ASSERTION> ::= <SA> <SUBJECT> <SA> <TENSE> <SA> <VERB> <SA>
        <OBJECT> <SA-LAST>.
<FRAGMENT> ::= <SA> (<TOVO> / <TVO> / <VO> / <VINGO> /<NSTGF>
        / <BESHOW> / <SVEN> / <VENPASS> /<ASTGF> / <PN>
        / <WHOSEG>/ <LDATER>) <SA-LAST>.
<TSUBJVO> ::= (NEITHER / NOR) ((DID / DOES) <SUBJECT> <VO>)
        / (HAS <SUBJECT> <VENO>).
<NSTGF> ::= <NSTG>.
<ASTGF> ::= <ASTG>.
<BESHOW> ::= <PROC> <BESUBJ> (':' / '-' / <*NULL>)
        (<PDATE>/<SACONJ>/<*NULL>)
        (<OBJBE>/<VENPASS>/<VINGO>/<ASSERTION>) <SA-LAST>.
<PROC> ::= <NSTG> (<PDATE>/<*NULL>) (':'/<*NULL>) / <*NULL>.
<BESUBJ> ::= <NSTG> / <*NULL>.
<WHOSEG> ::= WHO <TENSE> <SA> <VERB> <SA> <OBJECT> <SA-LAST>.
<OBES> ::= <ASTG> <SA> <TENSE> <SA> <VERB> <SA> <SUBJECT>
        <SA-LAST>.
— 5. SUBJECT STRINGS
<SUBJECT> ::= THERE / <EKGSTG> / <NSTG> / <*NULLWH> / <*NULLC> /
        <WHATS-N>.
<NSTG> ::= <LNR>.
<LNR> ::= <LN> <NVAR> <RN>.
<NVAR> ::= <*N> / <*PRO> / <*VING> / <*DS> / <QN>/ <NQ> / <Q10S>.
<Q10S> ::= <*Q>.
<EKGSTG> ::= <LWVR>.
<LWVR> ::= <LN> <WVVAR> <RWV>.
<WVVAR> ::= <*N>.
<RWV> ::= <RWVOPTS> <RWV> / <*NULL>.
<RWVOPTS> ::= <IN-LEADS> / <PN> / <VENPASS> / <TOVO> / <ADJINRN>/
        <QUANT>.
<IN-LEADS> ::= (<*P> / <*NULL>) <LLEADR>.
<LLEADR> ::= <LN> <LEADVAR> <RLEAD>.
<LEADVAR> ::= <*N> '-' <*N> /
        <*N> THROUGH <*N> /
        <*N> '-' <*Q> /
        <*N> THROUGH <*Q> /
        <*N>.
<RLEAD> ::= <*D> / <*NULL>.
— 7. VERB AND VERBAL OBJECT STRINGS
<VERB> ::= <*NULLFRAG> / <*NULLC> / <LV> <VVAR> <RV>.
<VVAR> ::= <*TV> / <*V>.
<TENSE> ::= <LW> <*W> <RW> / <*NULL> / <*NULLC>.
<LVR> ::= <LV> <*V> <RV>.
<VENO> ::= <LVENR> <SA> <OBJECT> <SA-LAST>.
<LVENR> ::= <LV> <*VEN> <RV>.
<VENPASS> ::= <LVENR> <SA> <PASSOBJ> <SA-LAST>.
<VINGO> ::= <LVINGR> <SA> <OBJECT> <SA-LAST>.
<LVINGR> ::= <LV> <*VING> <RV>.
— 8. OBJECT STRINGS
<OBJECT> ::= <*NULLFRAG> / <*NULLC> / <NPVINGO> / <NTOVO> / <NPN>/
        <VENO> / <THATS> / <NSTGO> / <NPDOSE> / <PDATE> /
        <PQUANT> / <PVINGO> / <PSVINGO> / <DP2> / <DP3> /
        <DP1>/ <TOVO> / <PN> / <VO> /
        <ND> / <DSTG> / <PNTHATS> / <VINGO> /
        <OBJECTBE> / <OBJBE> / <SVEN> / <VENPASS> / <NTHATS>/
        <ASTG> / <NN> / <SOBJBE> / <WHETHS> / <ASSERTION> /
        <C1SHOULD> / <SVO> / <NA> / <*NULLOBJ>.
<PASSOBJ> ::= <ASTG> / <PVINGO> / <ASOBJBE> / <PNTHATS> / <PN> /
        <PDOSE> / <NSTGO> / <WHETHS> /
        <TOVO> / <P1> / <DP1> / <OBJBE> / <*NULLOBJ> / <THATS>/
        <DSTG> / <ASSERTION> / <DP1PN>.
<OBJECTBE> ::= <VINGO> / <VENPASS> / <EKGSTG> / <TOVO> / <OBJBE>/
        <THATS> / <WHERES>.
<OBJBE> ::= <ASTG> / <QUANT> / <NSTG> / <PVINGO> / <PN> / <PQUANT>/
        <PDATE> / <LDR>.
<QUANT> ::= <QN> <TIME-ADJ> / <QPERUNIT> <TIME-ADJ> /
        <NQ> <TIME-ADJ>.
<TIME-ADJ> ::= <PDATE> / <WHENS> / <PN> / <*NULL>.
<NQ> ::= <*N> <LQR>.
<QPERUNIT> ::= (THE/ A / AN /<*NULL>) <LQR> <PERUNIT> <REG-ADJ>.
<PERUNIT> ::= (BY / '/') <*N> / '%' / PER <*N> / A <*N> / <*NULL>.
<REG-ADJ> ::= (AND / <*NULL>) <*ADJ> / <*NULL>.
<QN> ::= <LQR> <*N> <RQ> <PERUNIT> <SCALESTG> <MORE-QN>.
<MORE-QN> ::= ('X'/'TO'/'BY'/<*NULL>) <QN>/<*NULL>.
<SCALESTG> ::= <*ADJ> / <IN-DIM> / <*D> / <*NULL>.
<IN-DIM> ::= (IN / OF) <*N>.
<PQUANT> ::= <*P> <QUANT>.
<ASTG> ::= <LAR>.
<NSTGO> ::= <EKGSTG> / <NSTG> / <QUANT> / <*NULLC> / <*NULLWH>.
<DSTG> ::= <LDR>.
<ND> ::= <NSTGO> <DSTG>.
<LDR> ::= <LD> <*D> <RD>.
<NTOVO> ::= <NSTGO> <TOVO>.
<TOVO> ::= <LP> TO <VO>.
<THATS> ::= THAT <ASSERTION>.
<C1SHOULD> ::= (THAT /<*NULL>) <ASSERTION>.
<NTHATS> ::= <NSTGO> <THATS>.
<TVO> ::= <TENSE> <SA> <VERB> <SA> <OBJECT> <SA-LAST>.
<VO> ::= <TENSE> <SA> <LVR> <SA> <OBJECT> <SA-LAST>.
<SVO> ::= <ASSERTION>.
— 8A. P STRINGS
<PD> ::= <*P> <LDR>.
<PN> ::= <LP> <*P> <NSTGO>.
<NPN> ::= <NSTGO> <PN>.
<PNTHATS> ::= <PN> <THATS>.
<PVINGO> ::= <*P> <VINGO>.
<PSVINGO> ::= <*P> <SVINGO>.
<NPVINGO> ::= <NSTGO> <SA> <PVINGO>.
<NPDOSE> ::= <NSTGO> <PDOSE>.
<PDOSE> ::= <*P> <*DS> (<*P> <*DS>/<*NULL>).
<P1> ::= <*P>.
— 8B. DP STRINGS
<DP1> ::= <*DP>.
<DP2> ::= <*DP> <NSTGO>.
<DP3> ::= <NSTGO> <*DP>.
<DP4> ::= <*DP> OF (<NSTGO> / <VINGO>).
<DP1PN> ::= <*DP> <PN>.
— 8D. NOMINALIZATION WITH ZEROED VERB BE
<NA> ::= <NSTGO> <ASTG>.
<NN> ::= <NSTGO> <NSTGO>.
<SOBJBE> ::= <SUBJECT> <OBJBE>.
<SVEN> ::= <SUBJECT> <VENPASS>.
<SASOBJBE> ::= <NSTG> AS <OBJBE>.
<ASOBJBE> ::= AS <OBJBE>.
— 9. SENTENCE ADJUNCT STRINGS
<SA> ::= <*NULL> / <SAOPTS> <SA>.
<SA-LAST> ::= <SAOPTS> <SA> / <*NULL>.
<SAOPTS> ::= <PAREN-SA> / <PDATE> / <SUB11> / <SUB9> / <SUB12> /
        <SUB3> / <PN> / <SUB6> / <SUB2> / <PD> / <SUB0> /
        <LDR> / <VENPASS> / <VINGO> / <NTIME> / <NSTGT> /
        <RNSUBJ> / <RSUBJ> / <SUB5> / <THATS> / <SUB1> /
        <SUB13> / <SUB8> / <TOVO> / <PVINGO> / <PWHERES>/
        <QN>.
<PAREN-SA> ::= '(' (<VO> / <SUB0>) ')'.
<PDATE> ::= (<*P> / <*NULL>) <LDATER>.
<LDATER> ::= <LDATE> <DATEVAR> <RDATE>.
<DATEVAR> ::= <*DT> '-' <*DT> / <*DT> / <T-DATE>.
<T-DATE> ::= THE <*Q>.
<NSTGT> ::= <NSTG>.
<RNSUBJ> ::= <WHS-N> / <PWHS> / <VENPASS> / <PAREN-RN> /
        <FORTOVO>/ <ADJINRN>.
<RSUBJ> ::= (<*PRO> / <*Q> / <*T>) (<PN> / <*D> / <*NULL>).
<SACONJ> ::= <SA>.
— 10. SUBORDINATE CONJUNCTION STRINGS
<SUB0> ::= <*CS0> <OBJBE>.
<SUB1> ::= <*CS1> <ASSERTION>.
<SUB2> ::= <*CS2> <VENPASS>.
<SUB3> ::= <*CS3> <VINGO>.
<SUB5> ::= <*CS5> <SVINGO>.
<SUB6> ::= <*CS6> <SOBJBE>.
<SVINGO> ::= <SUBJECT> <SA> <VINGO>.
<SUB8> ::= AS (WAS / WERE /DID) <SUBJECT>.
<SUB9> ::= <*CS9> <VO>.
<SUB11> ::= <TM-PHRASE> <ASSERTION>.
<TM-PHRASE> ::= FOLLOWING WHICH / DURING WHICH TIME / DURING WHICH
        / BEFORE WHICH / AFTER WHICH / AFTER WHICH TIME.
<SUB12> ::= SHOULD <SVO>.
<SUB13> ::= <SUB1-PHRASE> <ASSERTION>.
<SUB1-PHRASE> ::= IN THAT.
— 11. RN RIGHT ADJUNCTS OF N
<RN> ::= <RNOPTS> <RN> / <*NULL>.
<RNOPTS> ::= <PAREN-RN> / <TQVINGO> / <PDATE> / <BPART> / <VENPASS>
        / <ADJINRN> / <NTIME> / <NSTGT>
        / <*DS> / <QUANT> / <LDR> / <PQUANT> / <PDOSE>
        /<PVINGO> / <TOVO> / <PN> / <VINGO> / <THATS>
        / <WHERES> / <WHENS> / <WHETHS> / <PWHS> / <WHS-N>
        / <TOVO-N> / <WHOSES>/ <S-N>
        / <PAREN-NSTG> / <APPOS>.
<NTIME> ::= <*N>.
<TQVINGO> ::= <TQ> <VINGO>.
<TQ> ::= <*T> / <*Q>.
<S-N> ::= <ASSERTION>.
<PAREN-RN> ::= '(' <RNOPTS> <RN> ')'.
<PAREN-NSTG> ::= '(' <NSTG> / <VO> / <PERUNIT> ')'.
<ADJINRN> ::= <LAR>.
<BPART> ::= <LNR> / <*ADJ>.
<TOVO-N> ::= <LP> TO <LVR> <SA> <OBJECT> <SA-LAST>.
<APPOS> ::= <LNR>.
— 12. LN LEFT ADJUNCTS OF N
<LN> ::= <TPOS> <QPOS> <APOS> <NPOS>.
<TPOS> ::= <LTR> / <*NULL> / <LNS>.
<LTR> ::= <LT> <*T> <RT>.
<LNS> ::= <TPOS> <*NS>.
<QPOS> ::= <LQR> / <*NULL>.
<LQR> ::= <LQ> <QVAR> <RQ>.
<QVAR> ::= <*Q> X <*Q> / <RATIO> / <QPER> / <RANGE>
        / <*Q> OVER <*Q> / <*Q> '+' <*Q> / <*Q> OR <*Q>
        / <*Q> X <*Q> X <*Q> / <*Q> OF <*Q>
        / <*Q> 'OUT OF' <*Q> / <*Q> X NORMAL / <*Q>.
<RANGE> ::= <*Q> ('-'/TO) <*Q> ['/' <*Q> ('-'/TO) <*Q>].
<QPER> ::= <*Q> '/' <*N>.
<RATIO> ::= <*Q> '/' <*Q> (('/' <*Q>)/<*NULL>).
<APOS> ::= <ADJADJ> / <*NULL>.
<ADJADJ> ::= <LAR> / <QN-OF> / <QN> / <NQ>
        / <ADJADJ> (<LAR> / <QN> / <QPERUNIT> / <NQ>).
<LAR> ::= <LA> <AVAR> <RA>.
<AVAR> ::= <*ADJ> / <*VEN> /<*VING>.
<QN-OF> ::= <QN> OF.
<NPOS> ::= <NNN> / <*NULL>.
<NNN> ::= <*N> / <*DS> / POST <*N> / <*N> (<*ADJ>/<*VEN>)
        / <NNN> (<*N> / <*DS>).
— 13. RIGHT ADJUNCTS - OTHER THAN RN
<RT> ::= <*NULL>.
<RQ> ::= <*D> / <REG-ADJ> / NORMAL / TOTAL / <*NULL>.
<RA> ::= ENOUGH / <PAREN-ADJ> / <PDATE> / <PQUANT> /
        <FORTOVO> / <PN> <MORE-RA> / <PVINGO> / <TOVO> /
        <TOSTG> / <TOVO-N> / <THATS> / <ASSERTION> /
        <WHETHS> / <*NULL>.
<MORE-RA> ::= <THATS> / <WHETHS> / <*NULL>.
<PAREN-ADJ> ::= '(' <*ADJ> ')'.
<FORTOVO> ::= FOR <SUBJECT> <SA> <TOVO>.
<TOSTG> ::= TO <LAR>.
<RD> ::= <*NULL>.
<RV> ::= <PAREN-RV> / <FORTOVO> / <PVINGO> / <PDATE> / <PQUANT>
        / <PN> <MORE-RV> / <THATS> / <ASSERTION> / <C1SHOULD>
        / <LDR> <MORE-RV> / <TOVO>
        / <NSTGT> / <*NULL> / <QN>.
<MORE-RV> ::= <THATS> / <WHETHS> / <C1SHOULD> / <*NULL>.
<PAREN-RV> ::= '(' <PDATE> ')'.
<RW> ::= <LDR> / <*NULL>.
<RDATE> ::= <WHENS> / <PTIME> / <*NULL>.
<PTIME> ::= (<*P> / <*NULL>) (<*Q> ( AM / PM ) / THIS YEAR).
— 14. LEFT ADJUNCTS - OTHER THAN LN
<LT> ::= <*NULL> / <*Q> /<Q-OF> / <*D>.
<LA> ::= <*NULL> / THOUGH / <THIS-THAT> / <LDR> / <QN> / <*Q>.
<LQ> ::= BETWEEN / NUMBER / <*D> / <ADJPREQ> / <*NULL>.
<LV> ::= <LDR> / <*NULL>.
<LW> ::= <*D> / <*NULL>.
<LD> ::= <*NULL> / <*D>.
<LP> ::= THAN / <QN-TIME> / <NQ-TIME> / <LDR> / <*NULL>.
<LDATE> ::= <*NULL> / MID / EARLY / LATE / THE / <*D>.
<ADJPREQ> ::= <*ADJ>.
<QN-TIME> ::= <LQR> <*N>.
<NQ-TIME> ::= <*N> <LQR>.
<THIS-THAT> ::= THIS / THAT.
::= <*NULL> / <*D>.
— 15. WH-STRINGS
<WHS-N> ::= (WHO / WHOM / <Q-OF> WHICH <N-PRE-S> / THAT)
        <ASSERTION>.
<Q-OF> ::= <*NULL> / <*D> /<*Q> OF.
<N-PRE-S> ::= <*NULL> / <*N>.
<S-N> ::= <ASSERTION>.
<PWHS> ::= <*P> WHICH <ASSERTION>.
<WHENS> ::= <WHEN-PHRASE> <ASSERTION>.
<WHEN-PHRASE> ::= WHEN / AT WHICH TIME / AT WHICH POINT / AFTER WHICH
        /DURING WHICH / <*NULL>.
<WHATS-N> ::= WHAT <ASSERTION>.
<WHERES> ::= WHERE <ASSERTION>.
<PWHERES> ::= <*P> WHERE <ASSERTION>.
<WHOSES> ::= WHOSE <ASSERTION>.
<WHETHS> ::= (WHETHER [OR NOT] / [AS TO] WHETHER [OR NOT] / WHERE/
        WHEN / HOW / WHY / IF) ((<ASSERTION>/<TOVO>)[OR NOT]).
— 16. CONJUNCTION STRINGS
<ANDSTG> ::= (AND / '&') <SACONJ> <Q-CONJ> (EACH / <*NULL>).
<ORSTG> ::= OR <SACONJ> <Q-CONJ>.
<BUTSTG> ::= BUT <SACONJ> <Q-CONJ>.
<THANSTG> ::= THAN <Q-CONJ>.
<NORSTG> ::= NOR <Q-CONJ>.
<INCLUDINGSTG> ::= INCLUDING <Q-CONJ>.
<PLUSSTG> ::= PLUS <Q-CONJ>.
<COMMASTG> ::= ',' ( <SACONJ> <Q-CONJ> / <*NULL>).
<ANDORSTG> ::= 'AND / OR' <Q-CONJ>.
<ASWELLASSTG> ::= 'AS WELL AS' <Q-CONJ>.
<INADDITIONTOSTG> ::= 'IN ADDITION TO' <Q-CONJ>.
<PARTICULARLYSTG> ::= PARTICULARLY <Q-CONJ>.
<EGSTG> ::= 'E.G.' <Q-CONJ>.
<IESTG> ::= 'I.E.' <Q-CONJ>.
<Q-CONJ> ::= <*NULL>.
— ATTRIBUTE LISTS
—       1. BASE ATTRIBUTES USED IN DICTIONARY AND PARSING GRAMMAR.
—       MISSING DIDOMPN. UNUSED PT1.
—       2. SELECTION COMPONENT ADDS: PASS-SEL, LINKC, N-OMITSTG,
—       START-HGRAPH, STAY-HGRAPH, TRY-ATT.
—       3. TRANSFORMATION COMPONENT ADDS:
—       PREFX, DEL-ATT, INDEX, TENSE-ATT, TFORM-ATT,
—       [** ATTRIBUTES ASSIGNED TO TENSE-ATT **]
—       CONDITIONNEL, FUTURE, IMPARFAIT, IMPERTVE, PERF, PRESNT, PROG,
—       [** ATTRIBUTES ASSIGNED TO TFORM-ATT **]
—       TFORTOVO, TNPVINGO, TNPVO, TNSVINGO, TPVO, TRNFILLIN,
—       TRNWH, TSASOBJBE, TSOBJBE, TSVINGO, TTHATS, TWHATSN,
—       TWHETHS.
—       4. REGULARIZATION COMPONENT ADDS: FORMAT-ATT, EMBED-OBJ,
—       EMBED-SUBJ, REFPT-ATT, TYPE-ATT, PT2, SEM-CORE,
—       [** ATTRIBUTES ASSIGNED TO FORMAT-ATT **]
—       FRMT-UNIT, FRMT00, FRMT0, FRMT1, FRMT2, FRMT3, FRMT4,
—       FRMT4-5, FRMT5, FRMT5F, FRMT6, NOFRMT.
—       5. FORMAT COMPONENT ADDS:
—       FILLED-PT, FORMAT-PT, TRANSFORM-ATT, UNIT-ATT [NOT USED].
— WD-ATTRIBUTES USED IN DICTIONARY
ATTRIBUTE =
        [* ATTRIBUTES CURRENTLY USED *]
        AASP, ACCUSATIVE, ACT, AFORTO, APREQ, ASENT1,
        ASENT3, ATHAT,
        C, COLLECTIVE, COND,
        DATIVE, DEF, DEM, DEVAL, DLA, DLD, DLP, DLQ, DLTIME, DLV,
        DRA, DRD, DRQ, DRV, DSA,
        F, FUT,
        IMP, INDEF, INDEFINITE, INSTR, INV,
        LESS,
        M, MODAL-AFFIX, MORE, MORPH,
        NCOUNT1, NEG-MEAN, NEG-PREFIX, NEGATIVE, NHUMAN,
        NMONTH, NO-REP, NOMINATIVE, NSCALE, NSENT1, NSENT4,
        NVN,PLACE-HOLDER [for non anaphoric it],
        PAST, PERS1, PERS2, PERS3, PLURAL, POST, PRESNT, PREV, PVAL,
        QALL, QNUMBER, QROVING, [* new *] QAGE, QTENS, QDATE, QTESTVAL,
        SAME, SCOPE, SINGULAR, SUBJONCTIF [French],
        TDEM, TIMETAG, TPOSS, TRANSITIVE,
        VBE, VETRE, VHAVE, VMIDDLE, VSE, VVERYVING,
        [* ATTRIBUTES CURRENTLY UNUSED *]
        ACOMPOUND, AGGREGATE, AINPA, AINRN, ARG, ARGPTR, ARGUMENT,
        ASCALE, ASENT2, ASHOULD, AWH,
        CATEGORIES, COMPARATIVE,
        CS0AS, CS1INNER,
        DLCOMP, DLCS, DLOC1, DLOC2, DLOC3, DLT, DLTPRO, DLW,
        DMANNER, DMIDDLE, DMOBILE, DPERM, DPRED, DRN,
        DRW, DSA1, DUNIV, DVERY,
        EACHEVRY,
        NAME, NCLASSIFIER1, NCLASSIFIER2, NCOUNT2, NCOUNT3,
        NCOUNT4, NEGADJ, NEO, NLETTER, NONHUMAN, NONTRANSITIVE,
        NPREQ, NSENT2, NSENT3, NSENTP, NTH, NTITLE,
        POS, PRE, PREFX, PROPOSS, PROSELF,
        QHALF, QMANY,
        REFLEXIVE,
        SUPERLATIVE,
        TQUAN,
        VASP, VCOLLECTIVE, VDO, VENDADJ, VEVENT, VEXP,
        VMANNER, VMOD, VMOTION, VRARE, VRECIP,
        VSENT1, VSENT2, VSENT3, VSENT4,
        W7WORD.
— GR-ATTRIBUTES USED IN GRAMMAR
ATTRIBUTE =
        [* ATTRIBUTES CURRENTLY USED *]
        ANYTHING [DVC1, DVC2],
        CONDITIONNEL, CONJ-LIKE,
        FRMT-UNIT, FRMT0, FRMT00, FRMT1, FRMT2, FRMT3,
        FRMT4, FRMT4-5, FRMT5, FRMT5F, FRMT6, FUTURE,
        IMPARFAIT, IMPERTVE,
        NOFRMT,
        OBJECTPRO, OBJLIST,
        PASS-SEL [CLASS FOR SELECTION LISTS- ALWAYS PASS],
        POBJLIST, PROG,
        TFORTOVO, TNPVINGO, TNTOVO, TNSVINGO, TTOVO,
        TRNFILLIN, TRNWH, TSASOBJBE, TSOBJBE, TSVINGO,
        TTHATS, TWHATSN, TWHETHS,
        [* ATTRIBUTES CURRENTLY UNUSED *]
        BVAL,
        DECIMAL, DPVAL,
        NOTNOBJ, NOTNSUBJ, NPNPN,
        OVAL,
        P-ITIS, PERF, PNPN, POBJECT, PVAL1, PVAL2,
        SENTOBJ, SUB, SVAL,
        TOBJLIST.
— SUBLANGUAGE-ATTRBS
ATTRIBUTE =
        [* LIST TYPE DECLARATIONS *]
        ADJUNCT-TYPE,
        BODYFUNC-PN, BODYLOC-PN, CONN-PN,
        CONN-TYPE,
        INSTR-TYPE,
        NULLNCLASS,
        QUANT-ADVERBIAL,
        TIME-ADVERBIAL, TIME-CLASS [USED TO MARK TIME CLASS LIST],
        VHAVE-TYPE,
        [* ATTRIBUTES CURRENTLY USED *]
        BEREP,
        E-AX [axis], E-EKGPROC [EKG test], E-LEAD [leads],
        E-INTVL [interval], E-WV [wave, for EKG], EMPTY-SET,
        FAIL-SEL, FEM,
        GENERIC,
        H-AGE, H-ALLERGY, H-AMT,
        H-BECONN, H-BEH,
        H-CELLTYPE, H-CHANGE, H-CHANGE-MORE, H-CHANGE-LESS,
        H-CHANGE-SAME, H-CHANGEMK, H-CHEM, H-CONN,
        H-DESCR, H-DEVMED, H-DIAG,
        H-ETHNIC, H-EVID,
        H-FAMILY,
        H-GEOGR,
        H-INDIC, H-INST,
        H-MODAL,
        H-NEG, H-NOCLASS, H-NORMAL, H-NULL,
        H-OBSERVE, H-ORG,
        H-POST, H-PT, H-PTAREA, H-PTFUNC, H-PTLOC, H-PTMEAS,
        H-PTPALP, H-PTPART, H-PTSPEC, H-PTVERB,
        H-RECORD, H-DIET [formerly H-REPAS], H-RESP, H-RESULT,
        H-SHOW,
        H-TMBEG, H-TMEND, H-TMLOC, H-TMDUR, H-TMPREP, H-TMREP,
        H-TRANSP,
        H-TTSURG, H-TTCOMP, H-TTFREQ, H-TTGEN, H-TTMED, H-TTMODE,
        H-TXCLIN, H-TXPROC, H-TXRES, H-TXSPEC, H-TXVAR,
        H-UNDEF [undefined word],
        MASC,
        NO-TYPE, NTIME1, NTIME2, NUNIT,
        PAST,
        TIME-PREFIX, TRANSP,
        [* ATTRIBUTES CURRENTLY UNUSED *]
        G-VRELFAC,
        H-ADJSPINE,
        H-DIMENSION, H-DOCTOR,
        H-ERROR, H-EVENT,
        H-GENERIC, H-GROW,
        H-HOSP,
        H-INGEST, H-INTOX,
        H-LABRES,
        H-MULT,
        H-NORM,
        H-OCCASION,
        H-PART, H-PSYCH, H-PTDESCR,
        H-SET, H-SHAPE, H-STATUS,
        H-TRIGGER [*weak causative*], H-TESTVIEW, H-TIMEQUAL, H-TYPE,
        H-VRX, H-VTEST,
        H-VTENSE,
        V-HEAL.
— NODE-ATTRIBUTES
ATTRIBUTE =
        AMBIG [* ambiguous expansion *],
        ADVERBIAL-TYPE, ASSIGN-ATT,
        COMMA-NULLFRAG, COMPUTED-ATT,
        DEFERRED, DEL-ATT, DIDOMIT, DIDOMPN, DIRECT,
        EMBED-OBJ, EMBED-SUBJ,
        FILLED-PT, FORMAT-ATT, FORMAT-PT,
        HGRAPH-ATT,
        INDIRECT, INDEX,
        LAST-NODE, LINKC, LN-TO-N-ATT,
        MATCHED, MED-ATT,
        N-OMITSTG, N-TO-LN-ATT, N-TO-RN-ATT,
        NO-RN-ATT, NOT-DISTR-LN-ATT, NOT-DISTR-RN-ATT, NOT-FREE,
        POSTCONJELEM, PRECONJELEM, PVAL-ATT, PT1, PT2,
        REFPT-ATT [IDENTIFIES PN WITH REFPT IN IT], RN-TO-N-ATT,
        SE, SELECT-ATT, SEM-CORE, SHARED-CONNECTIVE,
        START-HGRAPH, STAY-HGRAPH,
        TENSE-ATT, TFORM-ATT, TRANSFORM-ATT, TRY-ATT, TYPE-ATT,
        WORD-POS, UNIT-ATT.
— WORD POSITION ATTRIBUTES
ATTRIBUTE = W001, W002, W003, W004, W005, W006, W007, W008, W009,
        W010, W011, W012, W013, W014, W015, W016, W017, W018, W019,
        W020, W021, W022, W023, W024, W025, W026, W027, W028, W029,
        W030, W031, W032, W033, W034, W035, W036, W037, W038, W039,
        W040, W041, W042, W043, W044, W045, W046, W047, W048, W049,
        W050, W051, W052, W053, W054, W055, W056, W057, W058, W059,
        W060, W061, W062, W063, W064, W065, W066, W067, W068, W069,
        W070, W071, W072, W073, W074, W075, W076, W077, W078, W079,
        W080, W081, W082, W083, W084, W085, W086, W087, W088, W089,
        W090, W091, W092, W093, W094, W095, W096, W097, W098, W099,
        W100, W101, W102, W103, W104, W105, W106, W107, W108, W109,
        W110, W111, W112, W113, W114, W115, W116, W117, W118, W119,
        W120, W121, W122, W123, W124, W125, W126, W127, W128, W129,
        W130, W131, W132, W133, W134, W135, W136, W137, W138, W139,
        W140, W141, W142, W143, W144, W145, W146, W147, W148, W149.
— PHRASE-ATTRIBUTES
ATTRIBUTE = PHRASE-ATT,
        AGE-PHRASE, DATE-PHRASE, DOSE-PHRASE, INFLUENCE-PHRASE,
        PTPART-PHRASE, QUANT-PHRASE, RADIATE-PHRASE, SOURCE-ATT,
        SOURCE-PHRASE, TIME-PHRASE, TIME-POST-PHRASE,TESTENV-PHRASE.
ATTRIBUTE = SAVE-SELECT-ATT [* save Pronoun select-att for antecedent *].
ATTRIBUTE = SUPPORT-ATT [* save support class *].
— GLOBAL LISTS

GLOBAL = $ASCNT [ROUTINE L(X)],
   $ASSIGN-PRE-AND-POST [PRE-POST-CONJELEM],
   $AT-LADJ [HOST-, HOST],
   $AT-RADJ [HOST-, HOST],
   $ATRNSUBJ [HOST-, HOST],
   $CORE-PATH [CORE-],
   $NHUMAN-CHK [CORE-ATT, CORE-SELATT],
   $PRECONJ [COEL1],
   $POSTCONJ [CORE, DOWN1, STACK-FOR-LEFT],
   $RIGHT-TO-HOST [FOLLOWING-ELEMENT, HOST-ELEMENT],
   $STACK-TEST [DOWN1],
   $TO-PRECONJUNCTION-Y [COEL1],
   $UP-CONJ [LEFT-ADJUNCT, RIGHT-ADJUNCT].
GLOBAL = $ASPECTUAL [DEEPEST-COVERB],
   $UP-THROUGH-Q [IMMEDIATE, PRESENT-STRING].
— GLOBAL-SELS
GLOBAL =
   $ADD-TO-LIST [TSEL-P-N, TSEL-VERB-SUBJ],
   $ASSIGN-COMP-AND-SEL [TSEL-P-N, TSEL-ADJ-IN-RN],
   $ASSIGN-FAIL-SEL [TSEL RESTR],
   $ASSIGN-NA-X2-X3 [TSEL-P-N, TSEL-VERB-SUBJ],
   $ASSIGN-NEW [TSEL-ADJINRN],
   $ASSIGN-SEL [TSEL-ADJINRN, TSEL-VERB-SUBJ, TSEL-VEN-SUBJ,]
        [TSEL-PN, TSEL-PASS-OBJ],
   $ASSIGN-X1-SEL [TSEL-NVAR-APOS,TSEL-NNN-N,TSEL-P-N, ]
        [TSEL-VERB-SUBJ, TSEL-ADJ-IN-RN],
   $ASSIGN-X2-SEL [TSEL-NVAR-APOS,TSEL-NNN-N,TSEL-ADJ-IN-RN],
   $ASSIGN-X2-TYPE [TSEL-GLOBAL],
   $COEL-SUBJ [TSEL-VERB-SUBJ, TSEL-VEN-SUBJ],
   $CONN-CHK [TSEL-ADJ-IN-RN, TSEL-P-N, TSEL-VERB-SUBJ],
   $CO-OCCUR-CHK [TSEL-NVAR-APOS,TSEL-VERB-SUBJ,]
        [TSEL-NVAR-NPOS,TSEL-P-N,TSEL-OBJ-VS,TSEL-NNN-N],
   $DO-EQUIV-TST [TSEL-VERB-SUBJ, TSEL-P-N],
   $DO-P-SEL [TSEL-P-N, TSEL-SA-PN],
   $GET-P [TSEL-SPEC-A2, TSEL-RESP-AVEC, TSEL-PN],
   $GET-PN [TSEL-P-N, TSEL-SA-PN],
   $GET-SUBCLASS-LIST [TSEL-GLOBAL],
   $GO-TO-VERB [TSEL-OBJ-VS, TSEL-NULLWH-NSTGO],
   $OBJ-FOR-SEL [TSEL-NULLC, TSEL-OBJ-VS],
   $OBJ-OF-VENPASS [TSEL-VEN-SUBJ, TSEL-PASSOBJ],
   $PRINT-LIST-INFO [TSEL-GLOBAL],
   $PRINT-MESSGE [TSEL-GLOBAL,TSEL-NVAR-APOS,TSEL-ADJINRN,]
        [TSEL-RN-OTHER, TSEL-PN, TSEL-WHENS],
   $PRINT-NEW-HOST [TSEL-GLOBAL],
   $PRINT-NODE-INFO [TSEL-GLOBAL],
   $PRINT-NOCHNGE [TSEL-PN, TSEL-NVAR-NPOS],
   $PRINT-RESTR [TSEL-GLOBAL],
   $PRINT-RESTR-INFO [TSEL-NVAR-APOS,TSEL-VERB-SUBJ],
   $PRINT-SEL-INFO [TSEL-GLOBAL],
   $PRINT-SEL-MESSGE [TSEL-GLOBAL],
   $PRINT-SEL-WORDS [TSEL-GLOBAL],
   $PRINT-RESULT [TSEL-GLOBAL],
   $PRINT-X1 [TSEL-GLOBAL],
   $RESET-X1-LIST [TSEL-NVAR-APOS, TSEL-ADJINRN],
   $RN-SEL-TEST [TSEL-ADJ-IN-RN, TSEL-RN-OTHER],
   $SEL-SA [TSEL-SA-PN, TSEL-SA],
   $SEL-TIME [TSEL-RN-OTHER, TSEL-SA],
   $SELECT-FOR-VERB [TSEL-VERB-SUBJ, TSEL-VEN-SUBJ],
   $SELECT-ON [TURNS SELECTION ON (TRUE) OR OFF (FALSE)],
   $SET-N-ADJ-REG [TSEL-ADJ-IN-RN, TSEL-RN-OTHER],
   $SET-SEL [TSEL-P-N, TSEL-VERB-SUBJ],
   $SET-UP-X3 [TSEL-OBJ-VS,TSEL-NULLWH-NSTGO],
   $SET-X2-LIST [TSEL-P-N, TSEL-SA-PN],
   $SET-X3-LIST [TSEL-P-N, TSEL-SA-PN],
   $SET-V-S-O-REG [TSEL-VERB-SUBJ, TSEL-VEN-SUBJ],
   $SUBJ-OF-VENPASS [* 6/2/88 TSEL-VEN-SUBJ, TSEL-PASSOBJ],
   $TESTRES-TEST [TSEL-GLOBAL],
   $UP-TO-O [TSEL-VERB-SUBJ,TSEL-OBJ-VS],
   $UP-TO-OBJ-OR-RN [TSEL-VERB-SUBJ, TSEL-VEN-SUBJ],
   $VERB-SUBJ-CHK [TSEL-VERB-SUBJ,TSEL-OBJ-VS,]
        [TSEL-NULLOBJ-VS,TSEL-SENTOBJ-VS].
— GLOBAL-SEL-SEQUENCE
GLOBAL =
   $DESCENT-TYPE [TSEQ-STRING, TSEQ-ADJUNCT, TSEQ-OBJ],
   $LXR-TYPE [TSEQ-STRING, TSEQ-ADJUNCT],
   $STRING-TYPE [TSEQ-STRING, TSEQ-ADJUNCT].
— SUBLANGUAGE SELECTION LISTS
LIST VBE-LIST = VBE.
—       THE FOLLOWING LISTS ARE USED BY SUBLANGUAGE SELECTION AND
—       CONJUNCTION RESTRICTIONS

— SUBLANGUAGE-ATTS
—       list of all attributes involved in selection. This includes all
—       sublanguage classes and those English classes which participate
—       in selection (given at beginning of the list).
—       Any class on this list will be required to conjoin to words of
—       the same class. Unless the class also appears on the list
—       CONJ-EQUIV-CLASSES, which defines an equivalence class for
—       conjunction.
LIST SUBLANGUAGE-ATTS =
        [* English classes *]
        [ASENT1, ASENT2, AASP,]
        [BEREP,]
        [CONJ-LIKE, EMPTY-SET,] FEM,
        [INSTR,] MASC,
        [NSENT1, NSENT2, NSENT3, NSENTP,]
        NTIME1, NTIME2, [NULLNCLASS,] NUNIT,
        QNUMBER,
        VBE, VDO, VHAVE,
        [* Sublanguage classes *]
        E-AX, E-EKGPROC, E-INTVL, E-LEAD, E-WV [for EKG],
        H-AGE, H-AMT,
        H-BECONN, [H-BEH,]
        H-CHANGE, H-CHANGE-MORE, H-CHANGE-LESS, H-CHANGE-SAME,
        H-CHEM, H-CONN, [H-CELLTYPE,]
        H-DESCR, H-DEVMED, H-DIAG, H-DIET, [H-DIMENSION, H-DOCTOR,]
        H-ETHNIC, [H-EVENT,] H-EVID,
        H-FAMILY,
        H-GEOGR, [H-GROW, H-HOSP,]
        H-INDIC, H-INST, [H-INTOX,]
        [H-LABRES,]
        H-MODAL,
        H-NEG, [H-NOCLASS,] H-NORMAL, H-NULL,
        H-OBSERVE, [H-OCCASION,] H-ORG,
        H-POST, H-PT, H-PTAREA, H-PTDESCR, H-PTFUNC, H-PTLOC,
        H-PTMEAS, [H-PTPALP,] H-PTPART, H-PTSPEC, H-PTVERB,
        H-RECORD, H-RESP, H-RESULT,
        H-SHOW, [H-STATUS,]
        H-TMBEG, H-TMEND, H-TMLOC, H-TMDUR, H-TMPREP, H-TMREP,
        H-TTSURG, H-TTCOMP, [H-TTFREQ,] H-TTGEN, H-TTMED, H-TTMODE,
        H-TXCLIN, H-TXPROC, H-TXRES, H-TXSPEC, H-TXVAR,
        H-TESTVIEW, H-TRANSP, [H-TRIGGER,]
        [H-VTENSE,] H-VTEST,
        H-UNDEF.
— NOTE the following command line: *include emgrmtbl_101.txt.
— COMP-ATT lists and CONJ-EQUIV lists (the contents of emgrmtbl_100.txt)
— are inserted here during compilation of the grammar.

— Inclusion of emgrmtbl_100.txt at Thu Mar 16 13:59:19 2006
— CONJ-EQUIV-CLASSES
—       A list used by the parsing grammar (rules appearing in WCONJ9)
—       to determine sublanguage semantic compatibility of conjuncts
—       (two or more phrases joined by commas, "and", "or", nor",...).

—       The following assumptions apply:
—       A. An attribute is always conjunctionally equivalent
—       to itself (full list of attributes is found in
—       SUBLANGUAGE-ATTS list).
—       E.g. 'headache, fever and vomiting' each has identical
—       sublanguage attribute H-INDIC.
—       B. CONJ-EQUIV-CLASSES list is a list of all equivalence
—       classes appearing in sublists (shown below).
—       E.g. 'pain on upper surface and fingers'
—       (H-PTAREA and H-PTPART are conjunction equivalents
—       C. A computed attribute COMPUTED-ATT of a phrase is
—       used first to determine compatibility with its conjoined
—       phrase. For example, 'fever and stiff neck' are judged
—       CONJ-EQUIVALENT because 'stiff neck' has
—       COMPUTED-ATT = H-INDIC. The lists N-COMP-ATT-LN and
—       N-COMP-ATT-RN contain the word class combinations that
—       that constitute COMPUTED-ATTs.

LIST CONJ-EQUIV-CLASSES =
        (H-CHANGE, H-CHANGE-MORE, H-CHANGE-LESS, H-CHANGE-SAME,
        H-TXRES, H-RESULT
        [* creatinine increase H-CHANGE-MORE and MB of 12 H-RESULT *]),
        (H-CHEM, H-INDIC
        [* signs of black widow toxin and venomization *]),
        (H-TXRES, E-WV [* EKG revealed sinus rhythm with Q-waves *]),
        (H-TXRES, H-PTMEAS [* salt content and volume of water *]),
        (H-PTFUNC, H-PTPART [* sensory and motor exam *]),
        (H-PTFUNC, H-TTCOMP [* deficits in mobility and self-care *]),
        (H-PTFUNC, H-TXCLIN
        [* deep tendon reflexes, motor and sensory exam are intact *]),
        (H-PTPART, H-PTAREA, H-PTSPEC),
        (H-PT, H-RECORD),
        (H-PT, H-FAMILY [* according to the patient and his mother *]),
        (H-PTDESCR, H-FAMILY [* no change in Social Hx or Family Hx *]),
        (H-DIAG, H-PTDESCR, H-INDIC, H-RESULT, H-TXRES, H-ORG,
        H-RESP, H-DESCR, H-NORMAL
        [* normal left vein H-NORMAL but occlusion H-INDIC of distal RCA *]),
        (H-INDIC, H-PTLOC
        [* chest pain unassociated with SOB or radiation *]),
        (H-RESP, H-TTGEN, H-DIAG, H-TTMED
        [* pt's condition, instructions, diagnosis and medications *]),
        (H-INDIC, H-TXCLIN,
        H-RESULT [* pain profile, PE, normal lactate *]),
        (H-TTMED [* allergic to penicillin *], H-DIAG, H-CHEM, H-TXVAR,
        H-DIET
        [* denies reaction to bee stings, latex, iodine or shellfish *]),
        (H-DIAG, H-MODAL [* assessment and plan will be... *]),
        (H-DIAG, H-TTSURG [* status post MI, CABG *],
        H-RESULT [* including CABG and ejection fraction of 20 % *]),
        (H-VTEST, H-TXPROC [* blood sampling and biopsy *]),
        (H-TXCLIN, H-TXPROC [* ... exam and stress test *]),
        (H-TXCLIN, H-TTSURG [* refused surgery or workup *]),
        (H-TXCLIN, H-TTGEN [* examination and consult *]),
        (H-TMLOC, H-TXCLIN, H-TTGEN
        [* history, exam, and medical decision making *]),
        (H-TXPROC, H-RESP [* pleased with procedure and recuperation *]),
        (H-TXPROC, H-TXVAR [* no new ECG or enzyme changes *]),
        (H-TMLOC, H-TXPROC, H-TXRES
        [* his history, exercise tolerance test and EKG changes *]),
        (H-DEVMED, H-TXPROC [* his battery pack and leads *]),
        (H-DEVMED, H-TTGEN [* inhaler and peak flow self-monitoring *]),
        (H-DEVMED, H-TTMED [* IV steroids and nebulizers *]),
        (H-TXSPEC, H-TXVAR,H-TXPROC,H-PTSPEC,H-PTPART,H-ORG[,H-RESULT]),
        (H-TTCOMP, H-TTMED, H-TTSURG[, H-TTGEN, H-DEVMED]),
        (H-TTCOMP, H-TTGEN, H-TXPROC
        [* hospitalization, oxygenation, monitoring *]),
        (H-TTCOMP, H-TTSURG, H-DEVMED [* ...therapy, angioplasty, stent *]),
        (H-TTCOMP, H-INST [* physical therapy and nursing Home Health *]),
        (H-TTCOMP, H-DIET [* hydration and nutrition are adequate *]),
        (H-TTSURG, H-TXPROC
        [* coronary angiography and cardiac catheterization *]),
        (H-TTSURG, H-DIAG [* left hip arthroplasty and Perth's disease *]),
        (NTIME1, NTIME2 [* last week and again yesterday *]),
        (H-TMBEG, H-CHANGE, H-TMEND, H-TMLOC, H-POST,
        H-CHANGE-MORE, H-CHANGE-LESS, H-CHANGE-SAME),
        (H-TMREP, H-TMDUR [* prolonged and desynchronized *]),
        (H-AMT, H-DESCR [* in severity and frequency *]),
        (NSENT1, NSENT2, NSENT3),
        (NSENT1,
        H-INDIC [* In view of the chest pain and the fact that... *]),
        (H-TTMED, H-CHEM, H-PTFUNC,
        H-TTCOMP [* relieved by drugs and sleep *]),
        (H-TMLOC, H-TXPROC [* by history and electrocardiagrams *]),
        (H-DESCR, H-PTLOC [* nondermatomal and poorly localizing *]),
        (H-TXCLIN, H-TXVAR [french]).
— N-COMP-ATT-LN
—       A list whose members are attributes of a head Noun N which can
—       take an LN COMPUTED-ATTRIBUTE; the resultant attribute(s) created
—       by the procedure WCOMP-ATT-LN using the list N-COMP-ATT-LN are
—       assigned as attribute(s) of the head N. Each resultant attribute
—       will in turn have sub-attributes which are the classes in the
—       modifier (LN)> which cause the resultant COMPUTED-ATTRIBUTE.

—       The resultant attribute 'TRANSP' means that the COMPUTED
—       ATTRIBUTE IS "transparent": it takes on the class of the word in
—       the modifier causing the COMPUTED ATTRIBUTE. For example,
—       'H-PTPART' modified by 'H-INDIC' is "transparent", according to
—       the list N-COMP-ATT-LN, which has as a member
—       H-PTPART:(H-RESULT:(H-NEG, H-CHANGE),TRANSP:(H-INDIC, H-DIAG)).
—       For e.g. 'stiff neck' where 'stiff' is H-INDIC and 'neck'
—       is H-PTPART, the procedure will assign the COMPUTED-ATT = H-INDIC
—       to the head Noun 'neck' due to the H-INDIC modifier in LN.
—       Note the attribute H-RESULT, which is not a lexical attribute of
—       any word but is the resultant COMPUTED-ATTRIBUTE for certain
—       word class combinations, e.g. a PTPART word modified by H-NEG
—       or H-CHANGE, as in 'no stools' or 'change in lung'.
LIST N-COMP-ATT-LN =
H-PTMEAS:(H-RESULT:(H-AMT,H-EVID,H-NORMAL [* normal AP diameter *],
        NUNIT, H-CHANGE,
        H-CHANGE-MORE [* increased AP diameter *],
        H-CHANGE-LESS, H-CHANGE-SAME),
        H-INDIC:(H-INDIC), H-DIAG:(H-DIAG)),
H-PTFUNC:(H-RESULT:(H-AMT,H-EVID,H-DESCR,H-TXRES,H-CHANGE,
        H-CHANGE-MORE, H-CHANGE-LESS, H-CHANGE-SAME,
        NUNIT),
        H-INDIC:(H-NEG,H-INDIC,H-TMDUR [* rapid heart rate *],
        H-TMLOC [* delayed closure *]),
        H-NORMAL:(H-NORMAL),
        H-DIAG:(H-DIAG),
        H-TTSURG:(H-TTSURG)),
H-PTPART:(H-RESULT:(H-CHANGE,H-DESCR [* black stool *],
        QNUMBER [* 2+ carotids *],H-CHANGE-MORE,
        H-CHANGE-LESS [* decreased cartilage *],
        H-CHANGE-SAME, H-RESP ),
        H-NORMAL:(H-NORMAL),
        H-INDIC:(H-INDIC, H-TMDUR [* rapid heart *],
        H-NEG [* false lumen *],
        H-EVID [* true lumen *]),
        H-TXRES:(H-TXRES),
        H-DIAG:(H-DIAG)),
H-PTAREA:(H-RESULT:(H-CHANGE,H-RESP,
        H-CHANGE-MORE, H-CHANGE-LESS, H-CHANGE-SAME),
        H-PTPART:(H-PTPART), H-NORMAL:(H-NORMAL),H-INDIC:(H-INDIC),
        H-DIAG:(H-DIAG)),
H-PTSPEC:(H-TXRES:(H-TXRES)),
H-CHANGE:(H-RESULT:(H-PTFUNC,H-PTMEAS,H-TXCLIN,H-PT,H-FAMILY,
        H-NEG [* no change *], H-PTPART,H-PTAREA,H-PTLOC),
        TRANSP:(H-INDIC,H-DIAG, H-TTMED,H-TTCOMP,H-TTGEN,
        H-RESP)),
H-CHANGE-MORE:(H-RESULT:(H-PTFUNC,H-PTMEAS,H-TXCLIN,H-PT,H-FAMILY,
        H-NEG [* no increase *],[H-PTPART,]H-PTAREA,H-PTLOC),
        TRANSP:(H-INDIC,H-DIAG, H-TTMED,H-TTCOMP,H-TTGEN,
        H-RESP)),
H-CHANGE-LESS:(H-RESULT:(H-PTFUNC,H-PTMEAS,H-TXCLIN,H-PT,H-FAMILY,
        H-NEG [* no change *],[H-PTPART,]H-PTAREA,H-PTLOC),
        TRANSP:(H-INDIC,H-DIAG, H-TTMED,H-TTCOMP,H-TTGEN,
        H-RESP)),
H-CHANGE-SAME:(H-RESULT:(H-PTFUNC,H-PTMEAS,H-TXCLIN,H-PT,H-FAMILY,
        H-NEG [* no change *],[H-PTPART,]H-PTAREA,H-PTLOC),
        TRANSP:(H-INDIC,H-DIAG, H-TTMED,H-TTCOMP,H-TTGEN,
        H-RESP)),
NUNIT:(H-AMT:(H-CHANGE-LESS,H-CHANGE-MORE [* to a lesser degree *])),
H-EVID:(TRANSP),
H-INDIC:(H-INDIC:(H-NEG)[for ambiguous 'no growth' prefer H-INDIC],
        H-DIAG:(H-ORG [* herpes_viral infection 8/23/01 Dave *])),
H-ORG:(H-RESULT:(H-NORMAL [* normal flora *])),
H-DIET:(H-TTCOMP:(H-NEG [* no eggs in diet *])),
H-RESP:(H-RESP:(H-TMEND)),
H-TMEND:(H-RESULT:(H-PTMEAS,H-PTFUNC,H-TXCLIN),TRANSP),
H-TMLOC:(H-INDIC:(H-INDIC [* with prior smoking history *])),
[H-TMLOC:(H-RESULT:(H-NEG,H-NORMAL)),no significant medical history]
H-TMDUR:(H-RESULT:(H-PTFUNC),H-INDIC:(H-INDIC [* syncopal episode *]),
        H-TTMED:(H-TTMED)),
H-TRANSP:(TRANSP),
H-TTGEN:(H-TTSURG:(H-TTSURG [* surgical back_up *]),
        H-TXPROC:(H-TXPROC [* angiographic evaluation *])),
H-TXCLIN:(H-TMLOC:(H-TMLOC),
        H-RESULT:(H-NORMAL [* normal physical exam *])),
H-TXPROC:(H-RESULT:(QNUMBER), H-NORMAL:(H-NORMAL), H-INDIC:(H-INDIC)
        [H-TXRES:(H-TXRES) 'a 2d echo']),
H-TXSPEC:(H-RESULT:(H-ORG,QNUMBER,H-INDIC),
        H-TXRES:(H-TXRES)),
H-TXVAR:(H-RESULT:(H-TXRES,H-ORG,QNUMBER,H-NEG,H-AMT,H-CHANGE,H-NORMAL,
        H-CHANGE-MORE, H-CHANGE-LESS, H-CHANGE-SAME,
        NUNIT [* 1% eosinophils *]),
        H-INDIC:(H-INDIC)).
— N-COMP-ATT-NPOS
—       NPOS-N COMPUTED ATTRIBUTE MUST USE THIS LIST RATHER THAN GENERAL
—       N-COMP-ATT-LN. THIS LIST IS USED IN WCOMP-ATT-LN$NPOS.
LIST N-COMP-ATT-NPOS =
        H-TTSURG:(H-TTSURG:
        (H-DEVMED [* stent placement, defibrillator insertion *]
[* resolve H-TTSURG/H-PTAREA pacemaker insertion vs biceps insertion *])),
        H-TTCOMP:(H-TTMED:
        (H-TTMED [* oxygen therapy - resolve H-TTMED/H-TXVAR *])),
        H-TXSPEC:(H-TXSPEC:
        (H-PTPART [* blood culture - resolve H-PTPART/H-INDIC *])),
        H-PTFUNC:(H-INDIC:(H-INDIC [* plaque formation *])),
        H-INDIC:(H-DIAG:(H-ORG [* herpes infection 8/23/01 Dave *])),
        H-TMLOC:(H-DIAG:(H-DIAG [* hepatitis history rbhiv *])),
        H-CHANGE:(H-RESULT:(H-PTFUNC,H-PTMEAS,[H-PTPART,][ H-PT,]
        E-INTVL [* ST segment changes *],
        H-TXCLIN,[H-FAMILY,]H-PTAREA,H-PTLOC),
        TRANSP:(H-INDIC,H-DIAG,H-TTMED,H-TTCOMP,H-TTGEN, H-RESP)),
        H-CHANGE-MORE:(H-RESULT:(H-PTFUNC,H-PTMEAS,[H-PTPART,][ H-PT,]
        E-INTVL [* ST elevation *],
        H-TXCLIN, [H-FAMILY,]H-PTAREA,H-PTLOC),
        TRANSP:(H-INDIC,H-DIAG,H-TTMED,H-TTCOMP,H-TTGEN, H-RESP)),
        H-CHANGE-LESS:(H-RESULT:(H-PTFUNC,H-PTMEAS,[H-PTPART,][ H-PT,]
        E-INTVL [* ST depression *],
        H-TXCLIN,[H-FAMILY,]H-PTAREA,H-PTLOC),
        TRANSP:(H-INDIC,H-DIAG,H-TTMED,H-TTCOMP,H-TTGEN, H-RESP)),
        H-CHANGE-SAME:(H-RESULT:(H-PTFUNC,H-PTMEAS,[H-PTPART,][ H-PT,]
        H-TXCLIN,[H-FAMILY,]H-PTAREA,H-PTLOC),
        TRANSP:(H-INDIC,H-DIAG,H-TTMED,H-TTCOMP,H-TTGEN, H-RESP)),
        H-TRANSP:(TRANSP),
        H-TTMED:(H-TXVAR:(H-PTPART [* serum dilantin *])),
        H-TTCOMP:(H-TTMED:(H-TTMED [* heparin protocol *])),
        H-PTAREA:(H-PTPART:(H-PTPART)).
— N-COMP-ATT-RN
—       The RN COMPUTED ATTRIBUTE falls into two groups:
—       1. COMPUTED ATTRIBUTE
—       In the case of the RN COMPUTED ATTRIBUTE, the head noun
—       of the N + RN structure that may result in a COMPUTED
—       ATTRIBUTE appears first, followed by a ':', which is
—       followed in parentheses by the resultant; the resultant
—       in turn is followed by a ':' and in parentheses the
—       word classes such that, if one occurs as the core of the
—       RN adjunct, will cause the COMPUTED ATTRIBUTE to be created
—       with that word class as its value. For example, H-CHANGE in
—       the list N-COMP-ATT-RN has the entry
—       H-CHANGE:(H-RESULT:(H-PTAREA,H-PTFUNC,...))
—       which meanS that H-CHANGE combined with an RN with
—       H-PTAREA oR H-PTFUNC as head will give an H-RESULT LNR.
—       2. TRANSPARENT (abbreviated 'TRANSP')
—       A word having this subattribute takes on the attribute
—       of whatever head noun is in the right adjunct, provided
—       that head noun is on the 'TRANSP' list.
—       3. BOTH COMPUTED AND TRANSPARENT ATTRIBUTES
—       A word may have both COMPUTED ATTRIBUTEs for certain
—       RN's and be transparent with respect to the
—       remainging attributes on the TRANSP list; for example,
—       for H-CHANGE, the entry
—       H-CHANGE:(H-RESULT:(H-PTAREA,H-PTFUNC),TRANSP)
—       means that H-CHANGE with an H-PTAREA or H-PTFUNC word as
—       head noun of an RN adjunct would give an H-RESULT LNR,
—       but with (e.g.) H-TTGEN or H-TTCOMP comparably placed
—       would give an H-TTGEN or H-TTCOMP LNR.

LIST N-COMP-ATT-RN =
        H-AMT:(H-RESULT:(H-NORMAL,H-INDIC,H-DIAG,H-TTCOMP,H-PTFUNC,
        H-PTMEAS,H-TXVAR,H-TXRES)),
        H-CHANGE:(H-RESULT:(H-TXCLIN,H-TXVAR [* aucun movement enzymatique *]),
        H-INDIC:(H-PT, H-PTAREA,H-PTFUNC [* no change in vision *],
        H-PTLOC,H-PTMEAS,H-PTPART),
        TRANSP:(H-INDIC,H-DIAG,H-TTMED,H-TTCOMP,H-TTGEN,H-RESP)),
        H-CHANGE-MORE:(H-RESULT:(H-PT,
        H-PTAREA,H-PTFUNC,H-PTLOC,H-PTMEAS,H-PTPART,
        H-TXCLIN,H-TXVAR [* aucun movement enzymatique *]),
        TRANSP:(H-INDIC,H-DIAG,H-TTMED,
        H-TTCOMP,H-TTGEN,H-RESP)),
        H-CHANGE-LESS:(H-RESULT:(H-PT,
        H-PTAREA,H-PTFUNC,H-PTLOC,H-PTMEAS,H-PTPART,
        H-TXCLIN,H-TXVAR [* aucun movement enzymatique *]),
        TRANSP:(H-INDIC,H-DIAG,H-TTMED,
        H-TTCOMP,H-TTGEN,H-RESP)),
        H-CHANGE-SAME:(H-RESULT:(H-PT,
        H-PTAREA,H-PTFUNC,H-PTLOC,H-PTMEAS,H-PTPART,
        H-TXCLIN,H-TXVAR [* aucun movement enzymatique *]),
        TRANSP:(H-INDIC,H-DIAG,H-TTMED,
        H-TTCOMP,H-TTGEN,H-RESP)),
        H-EVID:(TRANSP:
        (H-INDIC [* evidence of bibasilar atelectasis *])),
        H-FAMILY:(H-DIAG:
        (H-DIAG [* denies family hx of CAD; family_hx=H-FAMILY *])),
        H-INST:(H-INST:(H-PTPART)),
        H-MODAL:(TRANSP),
        H-NEG:(H-RESULT:(H-NORMAL,H-INDIC,H-DIAG,H-PTFUNC,H-PTMEAS,H-RESULT),
        H-TTCOMP:(H-DIET [* elimination of eggs from diet *]),
        TRANSP),
        H-NORMAL:(H-RESULT:(H-PTPART [* vierge de toute cicatrice *])),
        H-NULL:(TRANSP:(H-INDIC)) [* signs of infection *],
        H-PTAREA:(H-DEVMED:(H-DEVMED),
        TRANSP:(H-INDIC,H-DIAG,H-RESP)),
        H-PTFUNC:(H-RESULT:(H-NORMAL,H-INDIC,
        H-CHANGE [* JVP raised *],NUNIT,H-AMT,
        H-CHANGE-MORE, H-CHANGE-LESS, H-CHANGE-SAME,
        QNUMBER [,NTIME1])),
        H-PTMEAS:(H-RESULT:(NUNIT,H-NORMAL,H-AMT)),
        H-PTPART:(H-RESULT:(H-DESCR,H-TTSURG,QNUMBER)
        [* arm with redness; knees post surgery; carotids 2+ *],
        TRANSP:(H-INDIC,H-DIAG,H-NORMAL,H-RESP)),
        H-PTSPEC:(TRANSP:(H-TXRES,H-ORG)),
        H-RECORD:(TRANSP:(H-INDIC,H-DIAG [* record of arrhythmia *])),
        H-TMBEG:(H-RESULT:(H-PTFUNC [* reprise du transit *]),
        TRANSP:(H-INDIC,H-DIAG,H-TTMED, H-TTSURG,
        H-TTCOMP,H-TTGEN,H-RESP)),
        H-TMEND:(H-INDIC:(H-PTFUNC),
        H-RESULT:(H-INDIC,H-DIAG [* disappearance of fever *]),
        TRANSP:(H-TTMED, H-TTSURG, H-TTCOMP,H-TTGEN,
        H-RESP)),
        H-TMLOC:(H-INDIC:(H-PTPART [* cardiac history *]),
        TRANSP:(H-TTMED,H-TTSURG,H-TTCOMP,
        H-ORG [* history of salmonella *],
        [H-TTGEN,morning after admission/=H-TTGEN 9/30/98]
        H-INDIC,H-DIAG,H-RESP)),
        H-TMDUR:(TRANSP:(H-INDIC,H-DIAG,H-TTGEN,H-RESP,H-TTMED, H-TTSURG,
        H-TTCOMP [* a course of irradiation *]),
        H-TTMED:( H-DEVMED [* a period of bronchodilators *]),
        H-TMLOC:(NTIME1 [* during the course of the day *])),
        H-TRANSP:(TRANSP),
        H-TTGEN:(H-TXPROC:(H-TXPROC [* review of chest xray *])),
        H-TXCLIN:(H-RESULT:(H-TXRES,H-NORMAL)),
        H-TXPROC:(H-RESULT:(H-TXRES,H-NORMAL,H-INDIC
        [* swallowing study markedly abnormal for solid foods *])),
        H-TXSPEC:(H-RESULT:(QNUMBER,H-AMT,NUNIT,H-NORMAL)),
        H-TXRES:(TRANSP:(H-INDIC [* image de lithiase *])),
        H-TXVAR:(H-RESULT:(QNUMBER,H-AMT,NUNIT,H-TXRES,H-ORG,H-NORMAL,
        H-CHANGE-MORE, H-CHANGE-LESS, H-CHANGE-SAME,
        H-INDIC, H-CHANGE)),
        H-AMT:(H-INDIC:(H-INDIC [* 2-3 ounces QN=H-AMT of alcohol H-INDIC *])),
        NUNIT:(H-INDIC:(H-INDIC [* moderate degree of hypoxia *]),
        H-TTMED:(H-TTMED)).
LIST MAJOR-EQUIV-CLASSES =
        [* Special list used in WCONJ4A and WCONJ9 (ljt)]
        H-CHEM, H-ORG,
        H-PT, H-PTAREA, H-PTLOC, H-PTMEAS, H-PTPART, H-PTFUNC, H-PTSPEC,
        H-DIAG, H-INDIC, H-RESP, H-DESCR, H-NORMAL,
        H-TTSURG, H-TTCOMP, H-TTGEN, H-TTMED, H-TTMODE,
        H-TXSPEC, H-TXVAR, H-TXPROC, H-TXRES, H-TXCLIN.
LIST WPOS18-PRED =
        [* Sublanguage classes allowed in predicate position. *]
        [* Used by WPOS18, WPOS18A and WPOS18B. *]
        H-INDIC, H-TXRES, H-NORMAL, H-DIAG, H-ORG, H-AMT, H-PTMEAS,
        H-RESULT, H-NEG, H-TTSURG, H-TTCOMP, H-TTMED, H-TTGEN,
        H-DESCR, H-RESP, H-MODAL, H-TXPROC [* test was Bruce_protocol *],
        H-PTDESCR, H-DEVMED [* Pacemaker/VVI for sinus bradycardia *],
        H-SHOW [* noteworthy for coronary artery disease *],
        H-INST [* Discharge Diagnosis: Consultants *],
        H-TESTVIEW [ * PA pelvis and lateral *],
        H-CHANGE,H-CHANGE-MORE,H-CHANGE-LESS,H-CHANGE-SAME [* unchanged *],
        H-PTFUNC [* reported as awake *],H-RECORD [* ng (= none given) *],
        H-TXSPEC, H-TXVAR, H-TXPROC [these TX are preds only in PLAN section],
        H-TMDUR [* acute *], H-TMLOC [* history *],
        E-WV, E-INTVL, E-AX [these E-xxx for EKGSTG].
LIST WCONJ21-ARTERY =
        [* Arteries to which grafts are made in CABG surgery. ]
        [* NOTE: This is the list of words with attrb H-CARD-ARTERY ]
        [* in the lexicon emlex. Used in WCONJ21. As words with this ]
        [* attribute are added to the lexicon, add them to this list.]
        'CORONARY ARTERY', 'CORONARY-ARTERY',
        'RCA','LAD','PDA','PL','RAMUS', 'RAMUS INTERMEDIUS',
        'OM' [* obtuse marginal *],'OM-1','OM-2','OM-3','OM-4','OM-5',
        'OM1', 'OM2', 'OM3', 'OM4', 'OM5', 'PROXIMAL',
        'CIRCUMFLEX MARGINAL ARTERY #1'.
LIST WCONJ21-GRAFT =
        [* Vesels used to construct grafts in CABG surgery ]
        [* NOTE: This is the list of words with attrb H-CARD-GRAFT ]
        [* in the lexicon emlex. Used in WCONJ21. As words with this ]
        [* attribute are added to the lexicon, add them to this list.]
        'SVG','LIMA','VG','RIMA', 'IMAG', 'LSVG', 'RSVG',
        'REVERSE SAPHENOUS VEIN GRAFT',
        'SAPHENOUS VEIN', 'SAPHENOUS VEIN GRAFT', 'VEIN GRAFT',
        'VEIN GRAFTS'.
LIST DOPT29-PREP =
        [* Prepositions in PDATE; used by DOPT29 and DPOS12]
        'BY','FOR','FROM','IN','ON','TO','OF','AROUND', 'BETWEEN',
        'THROUGH','THROUGHOUT','WITH'.
LIST PATIENT-LIST =
        [* PATIENT-LIST is used in WATT0-SELATT, WATT-PT. WPOS103 ]
        [* to partially resolve 'he', 'she' = H-PT/H-FAMILY. ]
        H-PT.
LIST NEG-LIST =
        [* Contains negative attribute H-NEG for COMPUTED-ATTRIBUTE]
        H-NEG.
LIST H-PTPART-LIST =
        [* Used in WPOS18B to restrict H-PTPART as predicate]
        H-PTPART.
— TRANSP-CLASS
—       LIST OF WORDS WHICH, IN THE RN OF A WORD ON THE N-COMP-ATT-RN
—       LIST, GIVE A COMPUTED ATTRIBUTE WITH THE SAME CLASS.
LIST TRANSP-CLASS = EMPTY-SET .
— SPECIAL-LISTS NEEDED FOR CONJUNCTION AND SELECTION RETSTRICTIONS

— EMPTY-LIST
—       USED FOR WORDS THAT HAVE NO MEDICAL SUBCLASSES
LIST EMPTY-LIST = EMPTY-SET.
— HUMAN-LIST
—       USED IN $NHUMAN-CHK; CONTAINS LIST OF HUMAN SUBCLASSES FOR
—       THE SUBLANGUAGE, ADDED ONTO WORDS WHICH ARE ONLY NHUMAN, AND
—       NOT OTHERWISE SUBCLASSIFIED (E.G., 'PERSON', OR 'SHE').
LIST HUMAN-LIST =
        H-FAMILY, H-INST, [H-DOCTOR,] H-PT.
— INDIC-LIST
—       used in TSEL-CONDITION.
LIST INDIC-LIST = H-INDIC.
— SIGN-SYMP
—       list of signs and symptoms.
LIST SIGN-SYMP = H-INDIC, H-DIAG.
— LIST NON-PRONOUN-CLASSES
—       classes in SUBLANGUAGE-ATTS that are not a PROnoun.
— -- This is currently used for pronoun-antecedent resolution.
—       May 7, 2000
LIST NON-PRONOUN-CLASSES =
        H-AMT, H-BECONN,
        [H-BEH,] H-DESCR, [H-CELLTYPE,] H-CHEM, H-CONN,
        [H-GROW,] H-EVID, [H-EVENT,] [H-DOCTOR, H-DIMENSION,]
        H-NULL, [H-NOCLASS, H-LABRES, H-INTOX, H-HOSP,]
        H-PTLOC, H-PTDESCR, [H-OCCASION,] H-OBSERVE,
        [H-STATUS,] H-SHOW, H-ETHNIC, H-PTVERB, [H-PTPALP,]
        H-VTEST, [H-VTENSE, H-TRIGGER,] H-TRANSP, [H-TTFREQ,]
        [E-WV,] E-INTVL, E-LEAD, E-AX,
        QNUMBER, NUNIT, [NULLNCLASS,] MASC, FEM,
        VHAVE, VDO, VBE,
        [* Time antecedents will be done separately *]
        H-TMBEG, H-TMDUR, H-TMEND, H-TMLOC, H-TMREP, H-TMPREP,
        NTIME2, NTIME1.
LIST TVO-SUBJECT = H-INST, H-PT.
— NEG-LIST
—       CONTAINS NEGATIVE ATTRIBUTE H-NEG FOR COMPUTED-ATTRIBUTE.
LIST NEG-LIST = H-NEG.
— NO-REP-LIST
—       CONTAINS 'NO-REP' TO DETERMINE IF QNUMBER SHOULD CAUSE COMPUTED
—       ATTRIBUTE FOR CERTAIN WORDS.
LIST NO-REP-LIST = NO-REP.
— SIG-CLASS
—       LIST OF SIGNIFICANT MEDICAL SUBCLASSES. IF WORD HAS MORE THAN
—       ONE OF THESE, IT IS A HOMOGRAPH, EXCEPT FOR H-CHANGE, H-STATUS
—       COMBINATION.
LIST SIG-CLASS =
        EMPTY-SET, [H-BEH,]
        [H-CHEM, H-NOCLASS,]
        H-CHANGE, H-CHANGE-MORE, H-CHANGE-LESS, H-CHANGE-SAME,
        H-DIAG, H-EVID, [H-GROW,]
        H-INDIC, H-MODAL, H-NEG, H-NORMAL,
        H-PTAREA, H-PTDESCR, H-PTFUNC, H-PTLOC, H-PTMEAS, H-PTPART,
        H-RESP, [H-STATUS,]
        H-TMEND, H-TMBEG,
        H-TTSURG, H-TTCOMP, H-TTGEN, H-TTMED,
        H-TXCLIN, H-TXPROC, H-TXRES, H-TXSPEC, H-TXVAR,
        H-TRANSP,
        NUNIT.
— MAJOR-SEL-CLASS
—       INDICATES THE MAJOR SUBLANGUAGE CLASSES WHICH IF
—       PARTICIPATING IN A FAILED SELECTION LIST, THE
—       ENTIRE SENTENCE IS REJECTED. [980218]
LIST MAJOR-SEL-CLASS =
        [H-NEG, H-MODAL,]
        H-CHEM [*S*], [H-CELLTYPE, H-NOCLASS,] H-ORG,
        H-PT, H-PTAREA, H-PTLOC, H-PTMEAS, H-PTPART, H-PTFUNC, H-PTSPEC,
        H-DIAG, H-INDIC, H-RESP, H-DESCR, H-NORMAL,
        H-TTSURG, H-TTCOMP, H-TTGEN, H-TTMED, H-TTMODE,
        H-TXSPEC, H-TXVAR, H-TXPROC, H-TXRES, H-TXCLIN.
— MOD-CLASS
—       LIST OF MODIFIER SUBCLASSES - WORDS WITH THESE SUBCLASSES MAP
—       INTO MODIFIER FIELDS IN THE FORMATS.
LIST MOD-CLASS =
        H-AMT,
        H-CHANGE, H-CHANGE-MORE, H-CHANGE-LESS, H-CHANGE-SAME, H-CHANGEMK,
        H-EVID, H-MODAL, H-NEG,
        H-PTAREA, H-PTLOC, H-PTPART,
        H-TMBEG, H-TMDUR, H-TMEND, H-TMLOC, H-TMREP,
        H-TRANSP, [H-VTENSE,]
        NTIME1, NTIME2, NUNIT, QNUMBER.
LIST CONN-TYPE-LIST = CONN-TYPE.
LIST CHANGE-LIST = H-CHANGE, H-CHANGE-MORE, H-CHANGE-LESS, H-CHANGE-SAME.
— H-PTSPEC-LIST
LIST H-PTSPEC-LIST = H-PTSPEC.
LIST H-TXVAR-LIST = H-TXVAR.
LIST TESTRES-LIST = H-TXRES.
LIST VSENT-LIST = VSENT1, VSENT2, VSENT3.
— Special lists needed for conjunction and selection restrictions
LIST ADD-BACK-LIST = FEM, H-NEG, [H-HOSP,] MASC, QNUMBER, H-AMT,
        DEVAL [, H-PTPALP].
LIST NONHUMAN-LIST = NONHUMAN.
LIST NUNIT-LIST = NUNIT.
LIST QNUMBER-LIST = QNUMBER.
— AREA-LIST
—       USED BY T-FIXUP-ATOMS TO REMOVE H-PTAREA FROM
—       LIST ALSO CONTAINING H-PTPART- THIS IS DONE TO DETERMINE
—       WHETHER OR NOT WORD WITH H-PTPART AND H-PTAREA HAS ANOTHER SIG>
—       SUBCLASS AND THEREFORE IS A HOMOGRAPH.
LIST AREA-LIST = H-PTAREA.
— N-NQ-LIST
—       USED FOR SELECTION BETWEEN N AND RN = NQ.
LIST N-NQ-LIST =
        E-INTVL,
        H-DIAG, H-INDIC, H-TXCLIN, H-FAMILY, H-TXRES, H-OBSERVE,
        [H-OCCASION, H-PTPALP,] H-TMDUR, H-PT, H-RECORD,
        H-RESULT, H-TTMED, H-TTSURG, H-TXVAR, H-TTGEN, H-TTCOMP.
— N-LQR
—       USED FOR SELECTION BETWEEN N AND RN = LQR.
LIST N-LQR = H-AGE, H-PTPART, H-FAMILY, [H-PTPALP,] H-PT,
        H-TXVAR, H-PTMEAS, H-PTFUNC.
— CONNECTIVE-LIST CONTAINS LIST OF WORD CLASSES TO BE TREATED AS
—       CONNECTIVES.
LIST CONNECTIVE-LIST =
        H-CONN, H-BECONN, CONJ-LIKE.
— NULLOBJ-LIST IS USED BY SELECTION TSEL-NULLOBJ WHEN OBJECT IS
—       NULLOBJ.
LIST NULLOBJ-LIST = NULLOBJ .
— SENTOBJ-LIST IS USED BY SELECTION TSEL-SENTOBJ FOR SENTENTIAL OBJ
LIST SENTOBJ-LIST = SENTOBJ .
— TIME-MOD-CLASSES
—       LIST OF SUBCLASSES WHICH FORMAT INTO TIME OR MODIFIER SLOTS.
LIST TIME-MOD-CLASSES =
        H-TMBEG, H-CHANGE, H-CHANGE-MORE, H-CHANGE-LESS, H-CHANGE-SAME,
        H-TMEND, H-EVID, H-MODAL,
        H-NEG, H-OBSERVE, H-TMDUR, H-TRANSP,
        H-TMLOC, NTIME1.
— PN-NULLOBJ-LIST IS USED IN TSEL-VEN-SUBJ TO CHECK THAT SURFACE SUBJECT
—       IS UNDERLYING OBJECT; THIS IS TRUE ONLY IF PASSOBJ = PN OR NULLOBJ
LIST PN-NULLOBJ-LIST = PN, NULLOBJ.
LIST NULLN-LIST = NULLNCLASS.
— BE-OR-SHOW-LIST IS USED BY TSEL-OBJ-VS FOR 'BE' OR 'SHOW'
— IN BESHOW.
LIST BE-OR-SHOW-LIST = VBE, H-SHOW .
— CONJSEL IS USED IN $WITH-CONJ OF TSEL-P-N TO MARK CONJUNCTION-LIKE
—       USE OF 'WITH', AS IN 'SWELLING WITH TENDERNESS'.
LIST CONJSEL = CONJ-LIKE.
— BECONN-LIST IS USED IN TSEL-VERB-SUBJ TO MARK CONNECTIVE-LIKE USE
—       OF 'BE' AS IN 'FOOT IS A BODYPART'
LIST BECONN-LIST = H-BECONN.
— CONN-LIST IS USED IN TSEL-VERB-OBJ TO MARK VERBS WHICH ARE H-CONN.
LIST CONN-LIST = H-CONN .
— BEREP-LIST IS USED IN TSEL-VERB-SUBJ TO SET UP A LIST SIMILIAR
— TO LIST BE-S-O BUT HAVING BEREP AS SUBCLASS IN PLACE OF VBE.
LIST BEREP-LIST = BEREP.
— WHERE-LIST
—       LISTS ALLOWABLE HOSTS FOR WHERE + ASSERTION RELATIVE CLAUSE
LIST WHERE-LIST = EMPTY-SET.
— NAME-LISTS
— THE FOLLOWING NAME LISTS ARE USED BY THE SELECTION RESTRICTIONS
— TO PRINT THE NAMES OF THE LISTS BEING USED BY THE RESTRICTION.
LIST NAME-CONNECTIVE = 'CONNECTIVE-LIST'.
LIST NAME-N-ADJ = 'N-ADJ'.
LIST NAME-V-S-O = 'V-S-O'.
LIST NAME-BE-S-O = 'BE-S-O'.
LIST NAME-P-NSTGO-HOST = 'P-NSTGO-HOST'.
LIST NAME-N-NPOS = 'N-NPOS'.
LIST NAME-WHERE = 'WHERE'.
LIST NAME-TIME-ADVERBIAL = 'TIME-ADVERBIAL'.
LIST NAME-N-NQ = 'N-NQ'.
LIST NAME-N-LQR = 'N-LQR'.
LIST NAME-N-PQUANT = 'N-PQUANT'.
LIST WORD-POS-LIST =
        W001, W002, W003, W004, W005, W006, W007, W008, W009,
        W010, W011, W012, W013, W014, W015, W016, W017, W018, W019,
        W020, W021, W022, W023, W024, W025, W026, W027, W028, W029,
        W030, W031, W032, W033, W034, W035, W036, W037, W038, W039,
        W040, W041, W042, W043, W044, W045, W046, W047, W048, W049,
        W050, W051, W052, W053, W054, W055, W056, W057, W058, W059,
        W060, W061, W062, W063, W064, W065, W066, W067, W068, W069,
        W070, W071, W072, W073, W074, W075, W076, W077, W078, W079,
        W080, W081, W082, W083, W084, W085, W086, W087, W088, W089,
        W090, W091, W092, W093, W094, W095, W096, W097, W098, W099,
        W100, W101, W102, W103, W104, W105, W106, W107, W108, W109,
        W110, W111, W112, W113, W114, W115, W116, W117, W118, W119,
        W120, W121, W122, W123, W124, W125, W126, W127, W128, W129,
        W130, W131, W132, W133, W134, W135, W136, W137, W138, W139,
        W140, W141, W142, W143, W144, W145, W146, W147, W148, W149.
— MAJOR-SELECTION-LISTS
—       NTN July 3, 1997
—       lists to be used by MLP grammars for cooccurrence selections
—       of words in phrases. This section includes
—       LIST CONJ-EQUIV-CLASSES tests conjunct matches;
—       LIST CONN-ARGS-CLASSES tests conjunct-like matches [obsolete];
—       LIST ADVERBIAL-TYPE-LIST adverb types and their acceptable hosts;
—       LIST P-NSTGO-HOST tests prepositional phrases and their hosts;
—       LIST NOT-CONN-ATT =
—       LIST N-ADJ tests adjectives and their head nouns;
—       LIST N-NPOS tests compound nouns;
—       LIST V-S-O tests verb, subject and object cooccurrences; and
—       LIST BE-S-O tests verb BE, and its subject and object.
— Inclusion of emseltbl_100.txt at Thu Mar 16 14:02:46 2006
— SUPPORT-CLASSES-LIST
—       list of support classes and their main classes
LIST SUPPORT-CLASSES-LIST =
        GENERIC:(H-AMT [* extent, magnitude *],
        H-DESCR [* attribute, description, descriptor *],
        H-DIAG [* diagnosis, syndrome, disorder,... *],
        H-INDIC [* event, problem, issue, side effect,... *],
        H-ORG [* species *],
        H-TTCOMP [* treatment *],
        H-TTGEN [* alternative, rationale *],
        H-TTMED [* medication, reload, pharmacotherapy,... *],
        H-TXRES [* finding *]),
        MASC:(H-PT,H-FAMILY,H-INST),
        FEM:(H-PT,H-FAMILY,H-INST),
        H-ALLERGY:(H-DIAG [* allergy *], H-INDIC [* allergen *]),
        H-POST:(H-DIAG, H-DIET, H-INDIC, H-ORG, H-PTFUNC,
        H-TTCOMP, H-TTGEN, H-TTSURG, H-TXPROC),
        H-TMLOC:(H-AGE [* old *],
        H-CONN [* lead *],
        H-DIAG, H-DIET, H-INDIC, H-ORG,
        H-MODAL [* temporize *],
        H-TTCOMP, H-TTGEN, H-TTSURG, H-TXPROC,
        H-PTDESCR [* vacation *],
        H-PTFUNC [* menopause, thelarche *]),
        H-TMREP:(H-AMT [* mostly *],
        H-CHANGE-SAME [* remaintain *],
        H-DIAG [* reinfarcts *],
        H-INDIC [* reoccurrence *],
        H-MODAL [* reconsider *],
        H-OBSERVE [* re-read *],
        H-PTVERB [* re-present *],
        H-RESP [* relapse *],
        H-TMLOC [* monthly, daily, nightly, weekly, yearly, seasonal *],
        H-TTCOMP [* recast, ... *],
        H-TTGEN [* readmit, reevaluate, ... *],
        H-TTSURG [* re-excision, re-cardiac catheterization *],
        H-TXPROC [* rechallenge *],
        H-TXRES [* reinterpret *],
        H-TXCLIN [* reexamination *]),
        H-TMDUR:(H-CHANGE-MORE [* progress *],
        H-CHANGE-SAME [* remain *],
        H-DESCR [* slow, slower, slowly *],
        H-TTGEN [* phased *]),
        H-TMBEG:(H-CONN [* trigger *],
        H-TTGEN [* initiate *]),
        H-TMEND:(H-RESP [* resolve *],H-TTGEN [* stop *],
        H-TTSURG [* removal *]).
— WITH-EQUIV-CLASSES
—       used in T-PSEUDO-CONJ-WITH series for 'with' that acts
—       like a conjunction.
—       E.g. Chest examination revealed extensive wheezing *with* prolonged
—       expiratory phase .
—       where 'prolonged expiratory phase' is also revealed by chest exam.
LIST WITH-EQUIV-CLASSES =
        (H-INDIC, H-DIAG, H-TXRES, H-RESULT, H-NORMAL,
        E-WV, E-INTVL, E-AX).
— ADVERBIAL-TYPE-LIST
—       lists types of prepositional phrases and their hosts.
—       A prepositional phrase is a phrase that has a preposition
—       followed by a noun phrase. For example, 'after surgery'
—       is a TIME-ADVERBIAL expression, headed by 'after' a
—       preposition of location and time, followed by 'surgery'
—       a surgical procedure (H-TTSURG).
—       The phrase 'after surgery' is labelled ADVERBIAL-TYPE
—       with specific value TIME-ADVERBIAL.

—       There are 6 adverbial phrase types. A prepositional
—       phrase (a phrase formed by a preposition followed by
—       a noun phrase) is labelled ADVERBIAL-TYPE with value:
—       1. TIME-ADVERBIAL: a time phrase ('after surgery')
—       2. BODYLOC-PN: a phrase of body location
—       ('in the lung')
—       3. BODYFUNC-PN: a phrase of body function
—       ('in appetite')
—       4. CONN-TYPE: the preposition is a connective
—       ('due to alcoholism')
—       5. QUANT-ADVERBIAL: a quantity phrase ('at 2 cm')
—       6. INSTR-TYPE: an instrumental phrase
—       ('[treatment] by acupuncture').

—       A host of a prepositional phrase is noun or adjective
—       that the phrase modifies. For example, 'allergic to peniciline'
—       has the adjective 'allergic' (H-INDIC) as the host of the
—       prepositional phrase 'to peniciline' (to+H-TTMED).
—       Each type of phrase has an attribute list containing
—       the possible class of hosts that it can modify (used
—       in P-NSTGO-HOST list), except for ADJUNCT-TYPE.
—       ADJUNCT-TYPE is an attribute of a phrase which, notwithstanding
—       its own semantic class, is considered by the grammar
—       as a phrase inseparable from its host.
LIST ADVERBIAL-TYPE-LIST =
        ADJUNCT-TYPE,
        [NO-TYPE,]
        TIME-ADVERBIAL:(H-AMT,H-CHANGE,H-CHANGE-MORE,H-CHANGE-LESS,
        H-CHANGE-SAME,H-CONN,H-EVID,H-DEVMED,
        H-SHOW, H-DIAG, H-INDIC, H-NORMAL,
        H-TMBEG, H-TMLOC, H-TMDUR, H-TMREP, H-RESULT,
        H-PT,H-PTPART,H-PTVERB,H-PTMEAS,H-PTDESCR,H-PTFUNC,
        H-VTEST, H-INST [not in GRI], H-NULL, H-OBSERVE,
        NUNIT, NTIME1, NTIME2, H-MODAL [* planned in 2 wks *],
        H-TTCOMP, H-TTSURG, H-TTMED, H-TTGEN,
        VBE, VHAVE,H-RESP,
        H-TXRES, H-TXCLIN, H-TXVAR, H-TXSPEC, H-TXPROC),
        BODYLOC-PN:(H-INDIC, H-DIAG, H-NORMAL, H-OBSERVE,H-DESCR,
        H-RESULT, H-RESP,H-VTEST, NUNIT,
        H-DEVMED [* cutting balloon was used in coronary artery *],
        H-TTGEN [* CT evaluation of the head *],
        H-TTSURG [* angioplasty in the 2nd diagonal branch *],
        H-TXRES, H-TXVAR, H-TXCLIN, H-TXPROC, H-TXSPEC,
        H-PTLOC,H-PTFUNC,H-PTMEAS,H-PTPART,H-PTAREA,
        H-CHANGE,H-CHANGE-MORE,H-CHANGE-LESS,H-CHANGE-SAME),
        BODYFUNC-PN:(H-INDIC,H-RESP,H-RESULT,H-CHANGE,H-CHANGE-MORE,
        H-CHANGE-LESS,H-CHANGE-SAME,H-NORMAL,H-TXCLIN),
        INSTR-TYPE:(H-RESULT,H-NORMAL,H-INDIC,
        H-CHANGE,H-CHANGE-MORE,H-CHANGE-LESS,H-CHANGE-SAME,
        H-RESP, H-TTCOMP),
        CONN-TYPE:(H-INDIC,H-DIAG,H-TTCOMP,H-TTGEN,H-TTSURG,H-TXRES,
        [H-TTMED,] H-RESULT,[H-CHANGE,H-TMBEG, H-TMEND,]
        [H-RECORD,]H-NORMAL,H-RESP,H-TXVAR [981020],
        H-TXSPEC,H-TXPROC,H-ORG,H-PTMEAS [,H-PTPART--GRI]),
        CONN-PN,
        VHAVE-TYPE:(H-PT, H-PTPART, H-PTAREA),
        QUANT-ADVERBIAL:(H-PTMEAS, H-PTFUNC,H-TXCLIN,H-CHANGE,
        H-CHANGE-MORE,H-CHANGE-LESS,H-CHANGE-SAME,
        H-INDIC, H-RESULT, H-TXVAR, H-TRANSP, H-VTEST).
— P-NSTGO-HOST
—       is a list of triplets of semantic classes representing words
—       from a noun phrase that contains a prepositional phrase.
—       The table contains a preposition, semantic class of its object
—       noun phrase and semantic class of its host.
—       This list is used by grammar rules TSEL-P-N and TSEL-SA-PN.

—       For example, the list entry 'IN' H-PTPART H-INDIC below
—       asserts that a host H-INDIC, with a prepositional phrase
—       consisting of 'IN' and its object H-PTPART is a
—       semantically well-formed co-occurrence. It represents
—       phrases like, "bruises in the arms".

—       If a preposition that does not appear on this list and does
—       not have its semantic class on this list, then the entire
—       prepositional phrase and its host will be considered acceptable
—       (will be passed 'benignly') and no computation is made.

— ** NOTE: before P-NSTGO-HOST selection is done, a check is made to
—       see if proposition is 'bound' to its host as a PVAL.
—       Therefore, 'with' in 'compatible with' will not undergo
—       selection for 'WITH'.

— ** Certain preposition + noun combinations form a unit:
—       Time expressions = TIME-ADVERBIAL, e.g., 'after two weeks';
—       Locative bodypart expressions = BODYLOC-PN, e.g., 'IN LUNG';
—       Quantitative expressions = QUANT-ADVERBIAL, e.g., 'AT 2 CM';
—       To capture these PN types, the type of PN is given as the
—       attribute list of the P+NSTGO combination,
—       e.g. 'IN' NTIME1 [TIME-ADVERBIAL],
—       instead of listing
—       explicitly all the hosts that such an expression can modify.
—       The list of allowable hosts for a TIME-ADVERBIAL is
—       given as the attribute list of TIME-ADVERBIAL in LIST
—       ADVERBIAL-TYPE-LIST (see above).

—       A prepositional phrase is labelled FAIL-SEL when either
—       (a) the case will be considered by the grammar separately, or
—       (b) the phrase is ill-formed.

— --- Old prose [will appear as MLP program reminders]:
— ** Take out NO-TYPE because it is the same as regular
—       selection behavior.
—       IN CASE PREPOSITION + NOUN DO NOT FORM ANY PARTICULAR
—       PN TYPE, THE ATTRIBUTE 'NO-TYPE' IS USED, WITH THE LIST OF
—       ALLOWED HOSTS AS ITS ATTRIBUTE LIST,
—       e.g. 'ON' H-PTFUNC [NO-TYPE] H-INDIC
—       for 'DYSPNEA ON EXERTION'.
— ** WHEN THE INNERMOST ARGUMENT CONTAINS A TYPE OF PHRASE, E.G.
—       TIME-ADVERBIAL, INSTEAD OF A SUBCLASS THEN NO OTHER TYPE
—       OR SUBCLASS SHOULD BE ON THAT LIST. E.G.
—       THE FOLLOWING IS INCORRECT:
—       'ON':(H-EVENT:(TIME-ADVERBIAL,NO-TYPE:(H-PTPALP)))
—       THE CORRECT WAY TO PLACE NO-TYPE IN P-NSTGO-LIST WOULD
—       BE TO REPEAT H-EVENT... FOR 'ON', E.G.
—       'ON':(H-EVENT:(TIME-ADVERBIAL),
—       H-EVENT:(NO-TYPE:(H-PTPALP)), ...
LIST P-NSTGO-HOST =
        'ABOUT':(NTIME1:(TIME-ADVERBIAL), NUNIT:(QUANT-ADVERBIAL),
        H-PTPART:(H-NULL),H-PTPART:(BODYLOC-PN)),
        'AT':(H-TTGEN:(TIME-ADVERBIAL),
        H-INST:(VBE,H-INST,H-TXSPEC,H-TXPROC [* tests at ZZZ *],
        H-DIAG [* pneumonia at outside hosp *],
        H-INDIC [* unresponsive at a nursing home *],
        H-TTCOMP [* cardioversion at ZZZ *],
        H-TTSURG [* cardiac catheterization at ZZZ *],
        H-TTGEN [* followup at the dialysis unit *]),
        NUNIT:(H-TMREP,H-TTGEN [* reinstituted at lower doses *],
        QUANT-ADVERBIAL [* palpate at 8 cm *]),
        H-PTPART:(H-INDIC [* narrowing at L2-3 *]),H-PTPART:(BODYLOC-PN),
        H-PTAREA:(BODYLOC-PN),NTIME1:(TIME-ADVERBIAL),
        H-TMLOC:(TIME-ADVERBIAL),H-TMEND:(TIME-ADVERBIAL)),
        'ACCOUNTING FOR':(H-INDIC:(CONN-TYPE:(H-INDIC))),
        'AGGRAVATED BY':(H-INDIC:(CONN-TYPE:(H-INDIC))),
        'ALTERNATING BETWEEN':(H-INDIC:(CONN-TYPE:(H-INDIC))),
        'ALTERNATING WITH':(H-INDIC:(CONN-TYPE:(H-INDIC))),
        'AS A RESULT OF':(H-INDIC:(CONN-TYPE:(H-INDIC))),
        'ASSOCIATED WITH':(H-INDIC:(CONN-TYPE:(H-INDIC))),
        'CHARACTERIZED AS':(H-INDIC:(CONN-TYPE:(H-INDIC))),
        'CHARACTERIZED BY':(H-INDIC:(CONN-TYPE:(H-INDIC))),
        'COMPATIBLE WITH':(H-INDIC:(CONN-TYPE:(H-INDIC))),
        'CONSISTENT WITH':(H-INDIC:(CONN-TYPE:(H-INDIC))),
        'CONSISTING OF':(H-INDIC:(CONN-TYPE:(
        H-DIAG [* angina with chest discomfort *],H-INDIC))),
        'EVOLVING TO':(H-INDIC:(CONN-TYPE:(H-INDIC))),
        'FOLLOWED BY':(H-INDIC:(CONN-TYPE:(H-INDIC))),
        'IMPROVED BY':(H-INDIC:(CONN-TYPE:(H-INDIC))),
        ['IN ABSENCE OF':(H-INDIC:(CONN-TYPE:(H-INDIC))),]
        'IN ADDITION TO':(H-TTMED:(CONN-TYPE:(H-TTMED))),
        'IN ANTICIPATION OF':(H-INDIC:(CONN-TYPE:(H-INDIC))),
        'IN COMPETITION WITH':(H-INDIC:(CONN-TYPE:(H-INDIC))),
        'IN THE COURSE OF':(H-INDIC:(CONN-TYPE:(H-INDIC))),
        'INCONSISTENT WITH':(H-INDIC:(CONN-TYPE:(H-INDIC))),
        'INDEPENDENT OF':(H-INDIC:(CONN-TYPE:(H-INDIC))),
        'INSTEAD OF':(H-INDIC:(CONN-TYPE:(H-INDIC))),
        'MADE WORSE BY':(H-INDIC:(CONN-TYPE:(H-INDIC))),
        'MANIFEST AS':(H-INDIC:(CONN-TYPE:(H-INDIC))),
        'NOTABLE FOR':(H-INDIC:(CONN-TYPE:(H-INDIC))),
        'NOTABLE ONLY FOR':(H-INDIC:(CONN-TYPE:(H-INDIC))),
        'ON TOP OF':(H-INDIC:(CONN-TYPE:(H-INDIC))),
        'OTHER THAN':(H-INDIC:(CONN-TYPE:(H-INDIC))),
        ['OUT OF':(H-INDIC:(CONN-TYPE:(H-INDIC))), H-NEG]
        'PRECIPITATED BY':(H-INDIC:(CONN-TYPE:(H-INDIC))),
        'PRIOR TO':(H-INDIC:(CONN-TYPE:(H-INDIC))),
        'REGARDLESS OF':(H-INDIC:(CONN-TYPE:(H-INDIC))),
        'RELIEVED BY':(H-INDIC:(CONN-TYPE:(H-INDIC))),
        'REMARKABLE FOR':(H-INDIC:(CONN-TYPE:(H-INDIC))),
        'S / P':(H-INDIC:(CONN-TYPE:(H-INDIC))),
        'SIGNIFICANT FOR':(H-INDIC:(CONN-TYPE:(H-INDIC))),
        'SIMILAR TO':(H-INDIC:(CONN-TYPE:(H-INDIC))),
        'SPECIFIC FOR':(H-INDIC:(CONN-TYPE:(H-INDIC))),
        'STATUS POST':(H-INDIC:(CONN-TYPE:(H-INDIC))),
        'SUBSEQUENT TO':(H-INDIC:(CONN-TYPE:(H-INDIC))),
        'SUCH AS':(H-INDIC:(CONN-TYPE:(H-INDIC))),
        'SUGGESTIVE OF':(H-INDIC:(CONN-TYPE:(H-INDIC))),
        'SUSPICIOUS FOR':(H-INDIC:(CONN-TYPE:(H-INDIC))),
        'SUSPICIOUS OF':(H-INDIC:(CONN-TYPE:(H-INDIC))),
        'TOLERANT OF':(H-INDIC:(CONN-TYPE:(H-INDIC))),
        'TRIGGERED BY':(H-INDIC:(CONN-TYPE:(H-INDIC))),
        'TYPICAL OF':(H-INDIC:(CONN-TYPE:(H-INDIC))),
        ['UNASSOCIATED WITH':(H-INDIC:(CONN-TYPE:(H-INDIC))),]
        'WITH AND WITHOUT':(H-INDIC:(CONN-TYPE:(H-INDIC))),
        'WITH REGARDS TO':(H-INDIC:(CONN-TYPE:(H-INDIC))),
        'WITH RESPECT TO':(H-INDIC:(CONN-TYPE:(H-INDIC))),
        ['WITHOUT EVIDENCE OF':(H-INDIC:(CONN-TYPE:(H-INDIC))),]
        'WORSENED BY':(H-INDIC:(CONN-TYPE:(H-INDIC))),
        'BY':(H-TTMED:(H-TTMED [* Garamycin ointment by itself *],INSTR-TYPE),
        H-TTSURG:(VBE,INSTR-TYPE),H-TTCOMP:(VBE,INSTR-TYPE),
        H-DEVMED:(ADJUNCT-TYPE:(H-RESP [* unrelieved by nebuliser *])),
        H-PTFUNC:(BODYFUNC-PN:(H-CHANGE,H-CHANGE-MORE,H-CHANGE-LESS,
        H-CHANGE-SAME,H-RESP))),
        'IN':(H-PTFUNC:(H-PT [* pt in her usual state of health *],
        H-RESP [* blood sugars normalized in fasting *],
        H-PTDESCR [* independence in mobility *],H-TMBEG),
        H-PTFUNC:(BODYFUNC-PN),
        H-PTPART:(H-AMT [* 1 cm in RLL *]),H-PTPART:(BODYLOC-PN),
        H-PTAREA:(H-NORMAL [* pain-free in the triage area *]),
        H-PTAREA:(BODYLOC-PN),
        H-INST:(H-CHANGE-SAME [* remained in the hospital *],
        H-INDIC [* shortness of breath in the ER *],
        H-NORMAL [* pain-free in the ER *],
        H-INST [* Dr in this facility *],
        H-PT [* patient in the office *],
        H-RESP [* he symptomps resolved in the ER *],
        H-TMBEG [* started in CCU *],
        H-TTGEN [* seen in ER *],H-TTCOMP [* treated in ER *],
        H-TTMED [* heparin in ER *],H-TXCLIN [* workup in ER *],
        H-TXSPEC [* tests in ER *],
        H-TXPROC [* esophagogram in the ER *]),
        H-CHANGE:(H-DIAG,H-CHANGE,H-CHANGE-MORE,H-CHANGE-LESS,
        H-CHANGE-SAME,H-INDIC),
        H-CHANGE-MORE:(H-DIAG,H-CHANGE,H-CHANGE-MORE,H-CHANGE-LESS,
        H-CHANGE-SAME,H-INDIC),
        H-CHANGE-LESS:(H-DIAG,H-CHANGE,H-CHANGE-MORE,H-CHANGE-LESS,
        H-CHANGE-SAME,H-INDIC),
        H-CHANGE-SAME:(H-DIAG,H-CHANGE,H-CHANGE-MORE,H-CHANGE-LESS,
        H-CHANGE-SAME,H-INDIC),
        H-DIAG:(H-PT [* he is in type 1 resp failure *],
        H-INDIC [* URI in an asthmatic *]),
        H-DIAG:(CONN-TYPE:(
        H-TXPROC [* duodenoscopy in the acute setting of AMI *])),
        NTIME1:(TIME-ADVERBIAL),H-TMLOC:(TIME-ADVERBIAL)),
        'ON':(NTIME1:(TIME-ADVERBIAL),H-PTFUNC:(BODYFUNC-PN),
        H-INDIC:(H-TXRES,H-TTGEN [* following up on a prn basis *],
        H-TMDUR [* acute on chronic renal failure *]),
        H-PTFUNC:(H-PTFUNC [* restricted motion on internal rotation *],
        H-INDIC [* febrile on vital signs *]),
        H-PTPART:(H-TTSURG,H-TTMED,H-TTGEN [pcardi 12/94]),
        H-PTPART:(BODYLOC-PN),
        H-TXVAR:(H-TXVAR, H-RESULT [* 3+ protein on dipstick *],
        H-TXSPEC [* blood gases on 60% oxygen *]),
        H-TTGEN:(H-PTFUNC,TIME-ADVERBIAL),
        H-TTMED:(H-VTEST,H-TMBEG,H-TMDUR,NTIME1,H-INDIC [GRI],H-NULL,
        H-CHANGE,H-CHANGE-MORE,H-CHANGE-LESS,
        H-CHANGE-SAME,H-RESP,H-DIAG,H-NORMAL,
        H-TTGEN [* discharged on aspirin *],H-TTCOMP,
        VHAVE,VBE,H-FAMILY,H-PT [* she is on reducing doses *]),
        H-TTMED:(ADJUNCT-TYPE:(H-TXVAR)),
        H-TTMED:(CONN-TYPE:(H-PTFUNC,H-RECORD))),
        'OVER':(NUNIT:(H-TTGEN,QUANT-ADVERBIAL),
        NTIME1:(TIME-ADVERBIAL),H-PTPART:(BODYLOC-PN)),
        'FOR':(NTIME1:(TIME-ADVERBIAL),H-DEVMED:(H-INDIC,H-DIAG,H-DEVMED),
        H-PT:(H-MODAL,H-TTMED,H-TTCOMP,H-TTGEN,
        H-DESCR [* ready for the procedure *],
        H-TXRES [* HIV--available for males *]),
        H-PT:(ADJUNCT-TYPE:([H-INST, mgh25] H-RECORD)),
        H-INDIC:(H-DESCR,H-CHANGE,H-CHANGE-MORE,H-CHANGE-LESS,
        H-CHANGE-SAME,H-NEG [*chpath2*],H-DEVMED,
        H-AMT [* significant for appendicitis *],
        H-INDIC [* at risk for osteoporosis *],
        H-INST [* to ZZZ for pulmonary edema *],
        H-TTGEN [* admitted for asthma exacerbation *],
        H-TTCOMP,H-TTSURG,H-TTMED,
        H-TXCLIN,H-TXSPEC, H-TXPROC,H-TXRES),
        H-DIAG:(H-TTCOMP,H-TTGEN,H-TTSURG,H-TTMED,H-DEVMED,
        H-NEG,H-EVID,H-INDIC [* worrisome for carcinoma *],
        H-SHOW [* noteworthy for coronary artery disease *],
        H-TXRES [* positive for c.h.disease *],
        H-TXCLIN,H-TXPROC,H-TXSPEC,H-RECORD),
        H-TTGEN,
        H-TTSURG:(H-TTGEN, H-PT [* candidate for angioplasty *],
        H-INST [* to operating room for VATS pleurodesis *],
        H-MODAL [* concern for denuding old stent *],
        H-TRANSP [* ready for the procedure *]),
        H-TXPROC:(H-DESCR [* ready for the procedure *]),
        H-TXVAR:(H-MODAL [* necessary for blood sugar *],
        H-TXRES [* UA - positive for protein *],
        H-TTGEN,H-DEVMED,H-TXSPEC[,H-TXCLIN]),
        H-TMDUR:(TIME-ADVERBIAL), H-TMBEG:(TIME-ADVERBIAL),
        H-PTPART:(H-MODAL [* necessary for cells *]),
        H-PTPART:(BODYLOC-PN), H-PTAREA:(BODYLOC-PN),
        H-RESULT [*7/23/97*],NUNIT:(QUANT-ADVERBIAL)),
        'FROM':(H-PTPART:(H-TTSURG [* excision from forearm *]),
        H-PTPART:(BODYLOC-PN), H-PTAREA:(BODYLOC-PN),
        H-NULL:(H-INDIC [* a fall from a horse *], H-RECORD,
        H-PT,H-FAMILY,H-INST [* patient from Connecticut *],
        H-TMREP [* returning from a party *]),
        H-PTFUNC:(H-INDIC [* Medcin-awakening from sleep *]),
        H-PTFUNC:(BODYFUNC-PN),
        H-INST:(H-PT,H-TTGEN [discharge from hospital], H-RECORD),
        NUNIT:(QUANT-ADVERBIAL), H-TMDUR:(TIME-ADVERBIAL),
        H-RECORD:(CONN-TYPE:(H-TTGEN, H-TTCOMP)),
        NTIME1:(TIME-ADVERBIAL), NTIME2:(TIME-ADVERBIAL),
        H-TMLOC:(TIME-ADVERBIAL)),
        'THROUGHOUT':(NTIME1:(TIME-ADVERBIAL), H-TMLOC:(TIME-ADVERBIAL),
        NTIME2:(TIME-ADVERBIAL), H-PTPART:(BODYLOC-PN),
        H-PTAREA:(BODYLOC-PN), H-TMDUR:(TIME-ADVERBIAL),
        H-TTGEN:(TIME-ADVERBIAL), H-TTCOMP:(TIME-ADVERBIAL)),
        'TO':(NUNIT:(H-RESP),H-TTGEN:(H-RESP,H-VTEST [970702]),
        H-TMREP:(H-RESP [* stable enough to return to nursing home *]),
        H-TTSURG:(H-TMBEG [* proceed to diag CC *]),
        H-TTMED:(H-RESULT,H-CHANGE,H-CHANGE-MORE,H-CHANGE-LESS,
        H-DIAG [* allergy to Neosporin *],H-INDIC,H-TTMED,
        H-CHANGE-SAME,H-NORMAL,H-RESP),
        H-TXPROC:(ADJUNCT-TYPE:(H-DIAG [* allergies to iv contrast *])),
        H-INDIC:(H-TTMED [* Gentamicin ointment to abrasions bid *],
        H-MODAL [* suspicious elements to clinical situation *]),
        H-NULL:(H-DIAG [* allergies to grasses *]),
        H-NULL:(ADJUNCT-TYPE:(H-PTFUNC [* reactive to light *],
        H-TTGEN [* discharged to home *],
        H-NULL [* travel to Mexico *]))),
        'UNTIL':(NTIME1:(TIME-ADVERBIAL)),
        'WITH':(H-DIAG:(H-TTMED,H-CHANGE,H-CHANGE-MORE,H-CHANGE-LESS,
        H-INST [* to hospital with AMI *],
        H-CHANGE-SAME,H-TMBEG,H-TMEND[,H-TXVAR]),
        H-DIAG:(VHAVE-TYPE:(H-PT,H-FAMILY [* father with AMI *])),
        H-DIAG:(CONN-TYPE),
        H-CHANGE:(H-TXVAR,H-RESULT,
        H-INDIC [* defect with partial reversibility *]),
        H-CHANGE-SAME:(H-TXVAR,H-DIAG,H-INDIC,
        H-RESULT [* static with creatinine at 240 *]),
        H-CHANGE-LESS:(H-TXVAR,H-RESULT,H-DIAG,H-INDIC,H-CHANGE-MORE),
        H-CHANGE-MORE:(H-TXVAR,H-RESULT,H-DIAG,H-CHANGE-LESS,
        H-INDIC [* tachycardic with ST segment elevation *]),
        H-CHEM:(ADJUNCT-TYPE:(H-TXPROC [* CT with contrast *])),
        H-INDIC:(H-DESCR,H-SHOW,H-VTEST,H-TTMED,H-NULL,VHAVE,
        H-INST [* to hospital with AMI *],
        H-TMDUR [* antibiotic course with minimal symptoms *],
        H-PTPART [* carotids with bilateral bruits *],
        H-PTAREA,H-PTFUNC,H-TXVAR), [GRI]
        H-INDIC:(VHAVE-TYPE:(H-PT,H-FAMILY [* father with TB *])),
        H-INDIC:(CONN-TYPE), H-NORMAL:(CONN-TYPE:(H-INDIC)),
        H-INST:(H-TTGEN [* followup with cardiologist *],H-TMLOC),
        H-NORMAL:(H-INDIC [* nontender with no hepatosplenomegaly *],
        H-PTPART [* heart with normal S1 *],
        H-PTFUNC,H-RESULT [* regular rhythm with normal S1 *],
        H-NORMAL [* nontender with normal bowel sounds *],
        H-TXRES [* RRR with normal S1 *],
        H-CHANGE-SAME [* unchanged with intact neuro function *]),
        H-NULL:(H-RECORD [* reports with Mexico *]),
        H-PT:(H-RESULT,H-TXVAR [* patient with hematocrit of 28 *],
        H-TXPROC [* reviewed the films with him *],
        H-TTGEN,H-MODAL [* discussion was held with pt *]),
        H-PTAREA:(BODYLOC-PN), H-PTLOC:(BODYLOC-PN),
        H-PTPART:(H-TTGEN,H-TXPROC), H-PTPART:(BODYLOC-PN),
        H-PTFUNC:(H-INDIC [* chest pain with activity *],
        H-NORMAL [* comfortable with ambulation *],
        H-RESULT [* awoke with a heart rate of 80 *],
        H-TMREP [* frequency with urination *],
        H-CHANGE-LESS [* limitation with ROM *]),
        H-PTFUNC:(CONN-TYPE:(H-TXPROC [GRI],
        H-PTFUNC [* heart rate in the 50's with bp of 70/50 *],
        H-RESP [* stable with rhythm being slow *],
        H-TXRES [* stable with rhythm being slow *])),
        H-PTMEAS:(CONN-TYPE [GRI]), H-TMREP:(TIME-ADVERBIAL),
        H-TTCOMP:(H-RESP [GRI],H-TTCOMP,H-PT,
        H-TMDUR [* pt was to continue with hymodialysis *],
        H-TTSURG,H-PTFUNC [* ambulating with assistance *],
        H-INDIC [* fracture with casting *]),
        H-TTCOMP:(ADJUNCT-TYPE:(H-TXPROC)),
        H-TTSURG,H-TMEND [* feel better with increased fluid removal *],
        H-TTMED:(H-TTMED,H-TMBEG,H-TMDUR,H-TMEND [GRI],
        H-CONN [* controlled with Pravachol *],
        H-DIAG [* managed her diabetes with Ameryl *],
        H-PTFUNC [* pt was dressed with Garamycin ointment *],
        H-TTGEN [* discharged with MED *],
        H-TTSURG [* underwent intervention with heparin *]),
        H-TTMED:(INSTR-TYPE),
        H-RESP:(H-TXRES [* stable with no tachy findings *],
        H-TTCOMP [* steroid injection with no improvement *],
        H-TTMED [* treated with lasix with some relief *]),
        H-RESP:(CONN-TYPE:(H-RESP [* stable with rate control *])),
        H-RESULT:(H-SHOW,H-DESCR,H-PTPART,H-RESULT,H-ORG,
        H-MODAL [* ruled in with a troponin T H-TXVAR of 0.15 *],
        H-TXVAR, H-TXSPEC [* CBC with Diff plus Platelets *],
        H-TTSURG [* mastectomy with residual tissue *],
        H-CHANGE [* peaked with MB fraction of 20% *]),
        H-RESULT:(CONN-TYPE:(H-NORMAL [* normal with urea 6.1 *],
        H-DIAG [* chf with decreased saturation to 87% *],
        H-INDIC [* unresponsive with bp of 68 *],
        H-PTFUNC [* heart rate in the 50's with bp of 70/50 *],
        H-TXRES,H-TXPROC [* EKG with a peak CK of 234 *])),
        H-TXVAR:(H-INDIC [* hypoxia with normal PC02 *],
        H-TXSPEC [* SMA-7 with blood urea nitrogen *],
        H-RESULT,H-PTPART [* leucocytes with 69% segs *]),
        H-TXVAR:(CONN-TYPE:(H-TXCLIN,H-TXVAR [* CPK's with 11 MB's *],
        H-TTMED [* Coudamin with a followup prothrombin time *],
        H-TXPROC [* EKG with a peak CPKs *],H-RESULT)),
        H-TXRES:(H-TXVAR,H-TXPROC,H-RESULT,H-TXVAR [* white cnt w/ diff *],
        H-PT [* pt with a kyphotic appearance *],H-FAMILY,
        H-CHANGE-MORE [* st elevation w/ Twave inversion *],
        H-CHANGE-LESS [* st depression w/ Twave inversion *]),
        H-TXRES:(CONN-TYPE:(H-DIAG [* AMI with ECG changes *],
        H-INDIC [* pleural effusions with ...redistribution *],
        H-TTSURG [* catheterization with results *],
        H-TXRES [* sinus rhythm with PR interval 0.14 *])),
        NTIME1:(TIME-ADVERBIAL), NUNIT:(QUANT-ADVERBIAL)),
        'OF':(H-DESCR:(H-DIAG,H-INDIC [* seizures of unknown_etiology *]),
        H-CHEM:(H-PTFUNC,H-RESULT [* JVP ~ 9 cm of water *]),
        H-DEVMED:(H-TTSURG [* removal of pacemaker *],
        H-INDIC [* a repeat dilatation of the stent *]),
        H-DIAG:(H-AMT,H-EVID,H-MODAL,H-CHANGE,H-CHANGE-MORE,
        H-CHANGE-LESS,H-CHANGE-SAME,H-TRANSP,H-PT,H-FAMILY,
        H-DIAG,H-NORMAL,H-INDIC,H-RESP [* resolution of CHF *],
        H-TTSURG,H-TTGEN [* follow up of asthma *],H-NEG,
        H-CONN [* cause of diabetes mellitus *],
        H-TXRES [* result of PMV disease *],
        H-TMLOC,H-TMDUR,H-TMREP,H-TMBEG,H-TMEND,NTIME1 [*GRI*]),
        H-INDIC:(H-DIAG,H-INDIC,H-NEG,H-PTFUNC,H-PTVERB [*mgh25*],
        H-PTLOC [* radiation of pressure sensation into the neck *],
        H-PTDESCR [* aware of the risks *],
        H-DEVMED [* pacemaker of the type for bradycardia *],
        H-TMREP [* return of cough *], H-CONN [* cause of cough *],
        H-TTCOMP [* treatment of urolepsis *],
        H-TTGEN [* evaluation of painful hip *],
        H-TTSURG [* removal of cysts *],H-RESULT,
        H-TXCLIN [* investigation *],H-RESP,H-TMDUR,NTIME1),
        H-PTPART:(H-TTCOMP,H-TTSURG [* removal of colon *],
        H-INDIC [* narrowing of LAD *],H-TESTVIEW [* AP of pelvis *]),
        H-PTPART:(ADJUNCT-TYPE:(H-TXPROC)), H-PTPART:(BODYLOC-PN),
        H-PTAREA:(H-TXPROC) [pcardi 12/94],H-PTAREA:(BODYLOC-PN),
        H-PTFUNC:(H-EVID,H-INDIC,H-AMT,H-MODAL,
        H-CHANGE,H-CHANGE-MORE,H-CHANGE-LESS,H-CHANGE-SAME,
        H-RESP [* recovery of function *],
        H-TTGEN,H-TXPROC [pcardi 12/94],H-TXCLIN,H-TXRES,
        H-PTPART [glcb2],H-PTAREA [* SNOMED-region of airflow *],
        H-PTFUNC [* SNOMED-velocity of airflow *],
        H-TMDUR,H-TMREP,H-TMBEG,H-TMEND,H-TRANSP),
        H-PTSPEC:(H-PTSPEC [* specimen of blood *]),
        H-TTGEN:(NUNIT, NTIME1 [* on the day of discharge *]),
        H-TTMED:(H-CHANGE,H-MODAL,H-AMT,NUNIT,H-EVID,H-TRANSP,
        H-CHANGE-MORE,H-CHANGE-LESS,H-CHANGE-SAME,
        H-PTFUNC [* absorption of the po Lasix *],
        H-RESP,H-INDIC,H-TTGEN,H-TTCOMP,H-TTMED,
        NTIME1,H-TMREP,H-TMDUR,H-TMBEG,H-TMEND,H-TMLOC,
        H-VTEST [* titration of Altace *]),
        H-TTMED:(ADJUNCT-TYPE:(H-TXRES)),
        H-TTSURG:(H-PTAREA [* location of his operation *],
        H-TXRES [* results of cath *]),
        H-TTSURG:(ADJUNCT-TYPE:(H-INDIC [* scar of surgery *])),
        H-TTCOMP:(H-MODAL,H-AMT,NUNIT,H-EVID,H-TRANSP,H-CHANGE,
        H-CHANGE-MORE,H-CHANGE-LESS,H-CHANGE-SAME,
        H-TMBEG,H-TMEND,H-TMREP,H-TMDUR, H-TTSURG [pcardi],
        NTIME1 [* 4 days of treatment *],H-RESP [*CABG1*]),
        H-TTCOMP:(CONN-TYPE:([H-RESP,H-INDIC-CABG1-,]H-TTGEN)),
        H-TXPROC:(H-EVID,H-MODAL,H-AMT,NUNIT,H-TXCLIN [* exam of film *],
        H-TXRES [* results of this study *],NTIME1,
        H-TMDUR,H-TMREP,H-TMBEG,H-TMEND),
        H-TXPROC:(CONN-TYPE:(H-TTGEN,H-RECORD,H-RESP,H-TTCOMP)),
        H-TXPROC:(ADJUNCT-TYPE:(H-CHANGE [3/2/98],
        H-CHANGE-MORE,H-CHANGE-LESS,H-CHANGE-SAME)),
        H-TXVAR:(H-TTSURG,H-PTSPEC [* specimen of blood *],
        H-PTFUNC [* metabolism of carbohydrates *],
        H-TXSPEC [* continuing cycling of her CK's *]),
        NUNIT:(H-NEG [* None of the doses *]),NUNIT:(QUANT-ADVERBIAL),
        H-INST:(H-PT,H-INST,H-MODAL,H-DIAG,H-TTGEN),
        NTIME1:(TIME-ADVERBIAL), H-AGE:(NTIME1)),
        H-CONN:(FAIL-SEL), CONJ-LIKE:(FAIL-SEL),
        H-MODAL:(H-INDIC:(CONN-TYPE:(H-INDIC))),
        H-NEG:(H-INDIC:(H-PT [* patient is free of pain *],
        VHAVE [* had XXX without complications *],
        H-RESULT [* regular sinus rhythm without ectopy *],
        H-PTFUNC, H-NORMAL [* normal S2 without MRG *],
        H-CHANGE-SAME [* remained free of pain *],
        H-DIAG [* Chronic bronch RIND without reoccurrence *],
        H-PTAREA [* left mastectomy site free of stenoses *],
        H-PTPART [* coronary artery free of stenoses *],
        H-RESP [* Pt did well without any symptoms *],
        H-TTMED [* switched to Noroxin without changes in symptoms *],
        H-TXRES [* RRR without murmur *],
        H-TMDUR [* both episodes were free of symptoms *]),
        H-INDIC:(CONN-TYPE:(H-INDIC)),
        H-CHEM:(ADJUNCT-TYPE:(H-TXPROC [* CT without contrast *]))),
        H-TMPREP:(H-CHANGE:(TIME-ADVERBIAL),
        H-CHANGE-MORE:(TIME-ADVERBIAL),
        H-CHANGE-LESS:(TIME-ADVERBIAL),H-CHANGE-SAME:(TIME-ADVERBIAL),
        H-DIAG:(TIME-ADVERBIAL), H-INDIC:(TIME-ADVERBIAL),
        H-RESP:(TIME-ADVERBIAL), H-AGE:(TIME-ADVERBIAL),
        H-TRANSP:(TIME-ADVERBIAL), H-INST:(TIME-ADVERBIAL),
        H-PTVERB:(TIME-ADVERBIAL),H-PTFUNC:(TIME-ADVERBIAL),
        H-TXCLIN:(TIME-ADVERBIAL),
        H-TTSURG:(TIME-ADVERBIAL), H-TTCOMP:(TIME-ADVERBIAL),
        H-TTGEN:(TIME-ADVERBIAL), H-TTMED:(TIME-ADVERBIAL),
        H-TMBEG:(TIME-ADVERBIAL), H-TMEND:(TIME-ADVERBIAL),
        H-TMLOC:(TIME-ADVERBIAL), H-TMDUR:(TIME-ADVERBIAL),
        H-TMREP:(TIME-ADVERBIAL),
        H-NULL:(TIME-ADVERBIAL),NTIME1:(TIME-ADVERBIAL)),
        H-TTGEN:(H-INST [* followed_by H-TTGEN her physician *]).
— NOT-CONN-ATT
—       list used to determine whether or not a preposition or a verb
—       (variable X1 in selection grammar) is H-CONN. Argument 1
—       (first one on this list, i.e. variable X2-LIST in the selection
—       grammar) is the object of the preposition in a prepositional
—       phrase, or the object of the sentence. Argument 2 (second
—       one on this list, i.e. variable X3-LIST of the selection grammar)
—       is the host of the prepositional phrase, or the subject of
—       the sentence. They are arguments of the preposition or a
—       verb.

—       If X2-LIST has a member on the first element of this list,
—       and X3-LIST has a member on the second element of this list,
—       then the preposition or a verb in consideration is not an
—       H-CONN. For example, if X1 has an H-TTMED argument and an
—       H-TTCOMP argument, it is not an H-CONN, so that 'treatment
—       with penicillin' will not be broken up into two separate
—       formats (units of information) later on in the database.
LIST NOT-CONN-ATT =
        H-RESP:(H-DIAG,H-INDIC,H-NORMAL,H-RESULT,H-PTMEAS,
        H-PTFUNC),
        H-TXRES:(H-TXVAR,H-TXPROC,H-TXSPEC,H-PTSPEC,H-TXRES,
        H-ORG,H-TXCLIN),
        H-TXSPEC:(H-TXVAR,H-TXPROC,H-ORG,H-TXRES).
— N-ADJ
—       is a list used to determine the allowable co-occurrence
—       of an adjective and its host noun. The adjective can be on
—       the left of the main noun ('broken leg'), or both of them
—       can modify a noun ('left arm injury'), or the adjective is
—       modifying a noun on its left ('arm not injured').

—       An adjective is labelled ADJUNCT-TYPE when it cannot be
—       considered separately from its host noun. It appears in
—       the format (unit of information) next to its host.
—       This adjective+noun combination can be considered a loose
—       idiom.

—       An adjective is labelled CONN-TYPE when it will be
—       built into a separate format from its host, but linked to
—       its host by a grammatical connective. [to be verified]
—       T-CONN-LN-N in XFR (now IGNOREd) splits them into a PN
—       situation with P=[PREP-CONN] (H-CONN).
—       12/30/1997: disable

—       An adjective is labelled FAIL-SEL when it is not compatible
—       with its host noun. This is a case of ungrammatical phrases.
—       [to be verified]
LIST N-ADJ =
        E-LEAD:(ADJUNCT-TYPE:(H-PTPART,H-PTAREA [* inferior leads *])),
        H-CHANGE:(H-AMT,H-EVID,H-MODAL,H-INDIC,H-NORMAL,H-DESCR,
        H-DIAG [* emphysematous change *],
        H-CHANGE-MORE,H-CHANGE-SAME,H-CHANGE, H-CHANGE-LESS,
        H-PTFUNC,H-PTMEAS,H-PTPART,H-PTAREA,H-PTLOC,H-TXRES,
        H-TXPROC,H-TXCLIN,H-TMLOC,NTIME1,H-TMDUR,H-TMREP),
        H-CHANGE:(ADJUNCT-TYPE:(H-NULL,H-TRANSP [7.28.92],
        H-DIET [* dietary modification *])),
        H-CHANGE-MORE:(H-AMT,H-EVID,H-MODAL,H-INDIC,H-NORMAL,H-DESCR,
        H-CHANGE-MORE,H-CHANGE-SAME,H-CHANGE,
        H-CHANGE-LESS [* decreasing elevation ITEND 070D *],
        H-PTFUNC,H-PTMEAS,H-PTPART,H-PTAREA,H-PTLOC,H-TXRES,
        H-TXPROC,H-TXCLIN,H-TMLOC,NTIME1,H-TMDUR,H-TMREP),
        H-CHANGE-MORE:(ADJUNCT-TYPE:(H-NULL,H-TRANSP [7.28.92],
        H-CONN [* resulting increase in joint symptoms *],
        H-TTGEN [* cautious increase *])),
        H-CHANGE-LESS:(H-AMT,H-EVID,H-MODAL,H-INDIC,H-NORMAL,H-DESCR,
        H-CHANGE-MORE,H-CHANGE-SAME,H-CHANGE,H-CHANGE-LESS,
        H-PTFUNC,H-PTMEAS,H-PTPART,H-PTAREA,H-PTLOC,
        H-TTMED [* steroid taper *],H-TXRES,
        H-TXPROC,H-TXCLIN,H-TMLOC,NTIME1,H-TMDUR,H-TMREP),
        H-CHANGE-LESS:(ADJUNCT-TYPE:(H-NULL,H-TRANSP [7.28.92],
        H-CONN [* resulting reduction of a 95% stenosis *])),
        H-CHANGE-SAME:(H-AMT,H-EVID,H-MODAL,H-INDIC,H-NORMAL,H-DESCR,
        H-CHANGE-MORE,H-CHANGE-SAME,H-CHANGE, H-CHANGE-LESS,
        H-PTFUNC,H-PTMEAS,H-PTPART,H-PTAREA,H-PTLOC,H-TXRES,
        H-TXPROC,H-TXCLIN,H-TMLOC,NTIME1,H-TMDUR,H-TMREP),
        H-CHANGE-SAME:(ADJUNCT-TYPE:(H-NULL,H-TRANSP [7.28.92])),
        H-DIAG:(H-AMT,H-MODAL,H-EVID,H-RESP,H-NEG,
        H-TRANSP,H-NULL,H-DESCR [*chpath2*],H-ORG [*cpri*],
        H-DIAG,H-NORMAL,H-INDIC [* pancre1atite oede1mateuse *],
        E-WV [* non-Q-wave myocardial infarction *],
        H-CHANGE [* reversible ischemia *],
        H-CHANGE-SAME [* BBB unchanged *],
        H-CHANGE-LESS [* decreasing ascites *],
        H-CHANGE-MORE [* progressive angina *],
        H-CHEM [* dye-induced ATN *],[H-CHANGE,]
        H-FAMILY [* daughter's abuses *],
        H-OBSERVE [* newly discovered diabetes mellitus *],
        H-PT,H-PTFUNC,H-PTLOC,H-PTPART,H-PTAREA,H-PTVERB,
        H-PTDESCR,H-TTGEN [* admitting diagnosis *],
        H-TTCOMP,H-TTSURG [* postoperative pneumonia *],
        H-TMBEG,H-TMDUR,H-TMREP,NTIME1,H-TMLOC,
        H-SHOW [* confirmed diagnosis 12.30.97 *],
        H-TXVAR [* microcystic anemia *],
        H-TXRES [* unstable angina pectoris/infarction *]),
        H-DIAG:(ADJUNCT-TYPE:(H-TTMODE [* intravenous drug abuse *],
        H-AGE [* old MRI *])),
        [H-DIAG:(CONN-TYPE:(H-TXSPEC,H-TXVAR,H-TXRES)),]
        H-DEVMED:(H-AMT [* multiple catheters *],
        H-DESCR [* assistive devices *],
        H-MODAL [* occasional inhalers *],
        H-TMDUR [* temporary/permanent pacemaker *],
        H-TMREP [* occasional inhalers *],
        H-TMLOC [* first introducer *]),
        H-DEVMED:(ADJUNCT-TYPE:(H-NULL,
        H-CHANGE [* modified Omnflush catheter *],
        H-CHANGE-SAME [* same cutting balloon *],
        H-DEVMED [* angio-guard devices *],
        H-INDIC [* compressive wraps *],
        H-INST [* St Jude Medical defibrillator *],
        H-PT [* patient's chest tube *],H-DESCR [* clear dressings *],
        H-PTAREA [* circumflex stent, concentric catheter *],
        H-PTFUNC [* walking stick *],H-PTPART [* nasal cannula *],
        H-TMEND [* interrupted 3-0 Vicryl suture *],
        H-TTCOMP [* biventricular pacing ICD *],
        H-TTMED [* Afrin-soaked neuropatty *],
        H-TTSURG [* cutting balloon *],
        H-TXRES [* positive dentures *])),
        H-FAMILY:(H-TXRES [* she continued to be stable *]),
        H-FAMILY:(ADJUNCT-TYPE:(H-INDIC,H-DIAG,H-ETHNIC,H-PTDESCR,H-NORMAL,
        H-AMT [* strong family history, multiple family members *],
        H-DESCR [* known/other/non-contributive family history *],
        H-TXRES [* available friends *],
        H-TMLOC [* current partner *],H-TRANSP [* another patient *],
        H-FAMILY,H-NULL,H-PT,H-CONN)),
        H-INDIC:(H-AMT,NUNIT,H-EVID,H-MODAL,
        H-CHANGE,H-CHANGE-MORE,H-CHANGE-LESS,H-CHANGE-SAME,
        H-DEVMED [* in-stent restenosis *],
        H-ORG [dcardi 11/94],H-NEG [cpri 1/95],
        H-RESP [* stable CR *],H-INDIC [3/2/98],H-DIAG,H-NORMAL,
        H-PTPART,H-PTFUNC,H-PTAREA,H-PTLOC,H-TTSURG [glcb2],
        H-TTCOMP [* inducible wall motion abnormality *],
        H-TXRES [* positive thyromegaly *],H-TXCLIN,H-TXPROC,
        H-TRANSP,H-TESTVIEW,H-CONN,
        NTIME1,H-TMLOC,H-TMREP,H-TMDUR,H-TMBEG,H-TMEND),
        [H-INDIC:(CONN-TYPE:(H-TTMED,H-TTCOMP,H-TTGEN,H-TXSPEC,]
        [ H-TXVAR,H-TXRES)),]
        H-INDIC:(ADJUNCT-TYPE:(H-DESCR,H-AGE,H-NULL,
        H-DIET [* dietary indiscretion *],
        H-OBSERVE [* described cyst CHDLM 8930B *],
        H-PT,H-PTDESCR,H-PTVERB [* experienced dyspnea *],
        H-RECORD [* the above problems *],
        H-SHOW [* notable ascites CPRIS 007E--revealed edema *],
        H-TTGEN [* diagnostic abnormality MCSMH 3255A *],
        H-TTMODE [* IV drug use, IV thrombus *],
        H-TXVAR [* lactate acidosis *],H-TXRES)),
        H-INST:(ADJUNCT-TYPE:(H-AMT,H-TRANSP,H-NULL,[H-BEH,]
        H-CONN [* associated CP *],
        H-DIET [* nutritional services *],
        H-PT,H-PTFUNC,H-PTPART,NUNIT,H-INST,H-TXCLIN,
        H-TXRES [* available interpreter *],
        H-TTCOMP [* rehabilitative services *],
        H-TMBEG [* initial pathology *],H-TMDUR,
        H-TMLOC [* previous physician *],
        H-TTSURG,H-TTGEN,H-DESCR)),
        H-INST:(FAIL-SEL),
        H-ORG:(H-AMT [* with minimal bacteria *],
        H-TMLOC [* pending C-Diff *]),
        H-ORG:(ADJUNCT-TYPE:(H-TXRES [* gram-negative rods *],
        H-INDIC [* atypical pathogens *],
        H-MODAL [* possible mycoplasma *],
        H-NULL [* disseminated Salmonella *],
        H-ORG [* acid-fast bacilli *],
        H-PTPART [* oropharyngeal flora *],
        H-DESCR [* ampicilline-resistant bacterium *])),
        H-PT:(H-AGE,H-INDIC [* defensive WM *],H-DIAG,H-ETHNIC,H-NORMAL,
        H-PTPART [* renal patients *],H-NEG [* pt unable... *],
        MASC,FEM,H-PTDESCR,H-PTVERB,H-PTFUNC,H-TTSURG,
        H-TTCOMP [* sedated female *],H-AMT [* great candidate *],
        H-RESP [* Patient stable *],
        H-TXRES [* she continued to be stable *],
        H-TMLOC,H-TMBEG,H-MODAL,H-TTGEN [* triagable patient *]),
        H-PT:(ADJUNCT-TYPE:(H-NULL,H-DESCR [* an unfortunate male *],
        H-TRANSP [* another patient *])),
        H-PTAREA:(H-MODAL,H-INDIC,H-DIAG,H-NORMAL,H-DESCR,
        H-CHANGE,H-CHANGE-MORE,H-CHANGE-LESS,H-CHANGE-SAME,
        H-PTAREA,H-PTLOC,H-PTPART,H-PTFUNC [*chpath2*],
        H-PT [* patient's left *],H-RESP,
        H-TXPROC,H-TXCLIN [glcb2],H-TMDUR [970806]),
        H-PTAREA:(ADJUNCT-TYPE:(H-NULL,H-AMT,H-TRANSP,H-PTDESCR,
        H-TTSURG [* anastomotic site *])),
        H-PTFUNC:(H-RESP,H-INDIC,H-AMT,NUNIT,EMPTY-SET,
        H-DIAG [* atrial fibrillation type rhythm *],
        H-CHANGE,H-CHANGE-MORE,H-CHANGE-LESS,H-CHANGE-SAME,
        H-NEG,H-MODAL,H-EVID,H-NORMAL,H-PT,H-PTAREA,H-PTPART,
        H-PTDESCR [* vigorous swimming *],H-PTLOC,H-PTFUNC,
        H-TMBEG,H-TMDUR,H-TMLOC,H-TMREP,H-TMEND [ -> H-INDIC],
        H-TRANSP [* speech appropriate *],H-DESCR,
        H-TTMED [* an antalgic gait *],
        H-TTGEN,H-TTCOMP [* SNOMED-compensating reflex *],
        H-TXPROC [* echocardiographic ejection fraction *],
        H-TXRES,H-TXCLIN,
        NTIME1 [* pregnant 4 times *]),
        H-PTFUNC:(ADJUNCT-TYPE:(H-NULL,H-PTVERB [glcb2],H-OBSERVE,
        H-SHOW)),
        H-PTMEAS:(H-INDIC,H-RESP,H-AMT,NUNIT,H-MODAL,
        H-DIAG [* obese proportions *],
        H-CHANGE,H-CHANGE-MORE,H-CHANGE-LESS,H-CHANGE-SAME,
        H-PTPART [pcardi 12/94],H-PTAREA,
        H-PTFUNC [* SNOMED-expiratory volume *],
        H-TESTVIEW [*cpri*],H-DESCR [* SNOMED-tidal volume *],
        H-TMLOC [* previous weight *],
        H-TXRES,H-EVID,H-NORMAL,H-NULL),
        H-PTPART:(H-INDIC,H-RESP,H-NORMAL,
        H-CHANGE,H-CHANGE-MORE,H-CHANGE-LESS,H-CHANGE-SAME,
        H-DIET [* fasting lipids *],
        H-DEVMED [* prosthetic right knee *],
        H-NULL [* various hormones *],H-EVID,H-TRANSP,
        H-DIAG,NUNIT,H-TMDUR [*GRI*],H-TMLOC [* previous CVA's *],
        H-PTLOC,H-PTAREA,H-PTPART,H-PTFUNC,
        H-TXVAR [* polymorphonuclear cells *],
        H-TXCLIN [* palpable thyroid *],
        H-TXRES [chpath2],H-TTCOMP [mgh25],
        H-TMREP [* occasional WBCs *]),
        H-PTPART:(ADJUNCT-TYPE:(H-AMT,H-NULL,EMPTY-SET,H-PT,H-PTDESCR,
        H-AGE [* old graft sites *],
        H-DESCR [* small non-dominant R artery *],
        H-MODAL [* optional diagonal was a small vessel *],
        H-TXPROC [* arthroscopic portals were established *],
        H-TTSURG [* transplanted kidney *],
        H-TTGEN [* in the treated breast *])),
        H-PTSPEC:(H-TXRES,H-DESCR [* good samples *],H-TMREP [glcb2],
        H-INDIC [* bloody stool *]),
        H-PTSPEC:(ADJUNCT-TYPE:(H-NULL [* exposed sections of the vein *])),
        H-RESP:(H-AMT,H-EVID,H-DIAG,H-INDIC,H-MODAL,H-NEG,H-NORMAL,
        H-CHANGE,H-CHANGE-MORE,H-CHANGE-LESS,H-CHANGE-SAME,
        H-PT,H-PTAREA,H-PTFUNC,H-PTMEAS,H-PTPART,H-PTLOC,
        H-RESP [* uneventful recovery *],
        H-TXCLIN,H-TTMED [* for better anti-anginal control *],
        H-TMDUR,H-TMREP,H-TMLOC,NTIME1,NUNIT,QNUMBER),
        [H-RESP:(CONN-TYPE:(H-TTCOMP,H-TTSURG,H-TTGEN)),]
        H-RESP:(ADJUNCT-TYPE:(H-NULL,H-DESCR [glcb2],
        H-TRANSP [* medical conditions *],
        H-TTCOMP [* therapeutic benefit *],
        H-PTDESCR [* emotional adjustment *])),
        H-TMEND:(H-PTFUNC,H-MODAL,H-PTMEAS,H-INDIC),
        H-TMEND:(ADJUNCT-TYPE:(H-RESP [* successful completion of... *])),
        [H-TTSURG:(H-TTSURG,H-PTPART),]
        H-TTCOMP:(H-TTMED,H-TTSURG,H-TTCOMP [* low-cholesterol diet *],
        H-TTGEN [* inpatient rehabilitation *],NTH,H-EVID,
        H-CHANGE,H-CHANGE-MORE,H-CHANGE-LESS,H-CHANGE-SAME,
        H-NEG [* refused treatment *],H-AMT,H-NORMAL,H-OBSERVE,
        H-PTPART,H-PTAREA,H-PTFUNC [pcardi 12/94],
        H-MODAL,NTIME1,H-TMLOC,H-TMDUR,H-TMREP,
        H-TMBEG [* emergent catherization *]),
        H-TTCOMP:(ADJUNCT-TYPE:(H-TRANSP,H-NULL,H-DESCR,
        H-DEVMED [* dual chamber pacing *],
        H-INST [* orthopaedic protocol *],
        H-INDIC [* lytic therapy *],H-DIAG [* asthmatic therapy *],
        H-PTDESCR,H-PTVERB [* undergoing dialysis *],
        H-DIET [* pureed diet, dietary regimen *],
        H-RESP [* successful dialysis/cardioversion *],
        H-TXSPEC,H-TXRES [* regular diet *],
        H-TTMODE [* oral contraceptives *])),
        [H-TTCOMP:(CONN-TYPE:(H-INDIC,H-DIAG,H-TTGEN)),]
        H-TTGEN:(H-AMT,H-EVID,H-MODAL,H-NULL [*cpri*],H-RESP,
        H-DEVMED [* dual chamber pacemaker followup *],
        H-INDIC [* non-operative management *],
        H-CHANGE,H-CHANGE-MORE,H-CHANGE-LESS,H-CHANGE-SAME,
        H-NEG [* adjustment of coumadin is unadvisable 1/98 *],
        H-CONN [* prompted admission *],[H-TXPROC,]H-TRANSP,
        H-PT,H-PTPART [pcardi 12/94],
        H-TTFREQ [* qid schedule *],H-TTMODE [* IV access *],
        H-TTGEN,H-TTSURG [* surgical back_up ITEND 043B *],
        H-TMBEG,H-TMEND,H-TMDUR,H-TMREP,H-TMLOC,NTIME1),
        H-TTGEN:(ADJUNCT-TYPE:(H-NORMAL,H-DESCR,
        H-DIAG [* rheumatologic review *],
        H-DIET [* dietary management *],
        H-INST [* orthopedic consultation *],
        H-PTAREA [* local follow-up *],H-PTFUNC [970805],
        H-PTDESCR [* verbal instructions *],
        H-TXRES [* available appointment/follow-up *],
        H-TXPROC [* laparoscopic evaluation *])),
        [H-TTGEN:(CONN-TYPE:(H-TXPROC,H-TXRES)),]
        H-TTMED:(H-MODAL,H-PTAREA,NUNIT,H-TTMODE,H-TTFREQ,
        H-EVID [* Medcin-certain medications *],
        H-PTFUNC [dcardi 11/94],
        H-RESP [* in/effective depakote NMGMG 016A *],
        H-TMDUR,NTIME1,H-TMREP,H-TMBEG,H-TMEND,H-TMLOC [glcb2],
        H-CHANGE,H-CHANGE-MORE,H-CHANGE-LESS,H-CHANGE-SAME,
        H-TTSURG [* peri-procedural glycoprotein 2b3a inhibitor *],
        H-TTMED,H-AMT,H-NORMAL [*GRI*]),
        [H-TTMED:(CONN-TYPE:(H-INDIC,H-DIAG,H-TTCOMP,H-TTMODE)),]
        H-TTMED:(ADJUNCT-TYPE:(H-PTPART,H-NULL,H-PT,H-TRANSP,H-DESCR,
        H-DIAG [* hypoglycemic/immunosuppressive agents *],
        H-PTDESCR [* recreational drugs *],
        H-SHOW [* proven medication *],
        H-TXRES [* regular Albuterol *],
        H-TTCOMP [* nebulised salbutamol *],
        H-TTGEN [* the following medications *],
        H-TTMODE [* oral antibiotics *])),
        H-TXCLIN:(H-PT [* patient's exam *],H-PTLOC,H-PTPART,H-PTAREA,
        H-AMT,H-EVID,H-MODAL,H-NORMAL,H-INDIC,H-DESCR,
        H-CHANGE-LESS [* decreased light touch/pin prick *],
        H-CHANGE-SAME [* exam essentially unchanged *],
        H-TRANSP [* Murphy's punch *],
        H-NEG [* negative compression-distraction test CPRIS 017A *],
        H-TMLOC,H-TMREP,H-TMDUR,H-TMBEG [* initial exam *],
        H-TXRES,H-TXCLIN,H-TXPROC),
        H-TXCLIN:(ADJUNCT-TYPE:(H-TTCOMP,H-CONN [* dictated HandP *],
        H-DEVMED [* fiberoptic exam *],
        H-INST [* resident's workup for his medications *],
        H-PTFUNC [* electrophysiologic testing *],
        H-TTGEN [* programmed stimulation, admitting workup *],
        H-TXSPEC [* microscopical examination *],
        H-SHOW [* examination was notable IDT1Z 027C *],
        H-NULL [* cpri-radiologic exams *])),
        H-TXPROC:(H-EVID,H-MODAL,H-DESCR,H-NULL [p/dcardi 11/94],
        H-DEVMED [* fiberoptic exam *],
        H-DIAG,H-INDIC,H-NORMAL,H-NEG,
        H-PT,H-PTLOC,H-PTPART,H-PTFUNC,H-PTAREA [* PA chest xray *],
        H-SHOW [* EKG was notable *],
        H-TTGEN [* programmed DDDR *],
        H-TXRES,H-TXPROC [glcb2],H-TMBEG [* initial x-rays *],
        H-AMT,NTIME1,H-POST,H-TMLOC,H-TMDUR,H-TMEND,H-TMREP),
        H-TXPROC:(ADJUNCT-TYPE:(H-RESP, [H-PTPART,EMPTY-SET,]
        H-AGE [* adult EEG *],
        H-PTAREA [* pa and lateral chest xray *],
        H-DESCR [* high resolution scan *],
        H-DEVMED [* fiberoptic laryngoscopy *],
        H-TTSURG [* excisional biopsy *],
        H-CHANGE,H-CHANGE-MORE,H-CHANGE-LESS,
        H-CHANGE-SAME [3/2/1998],H-TRANSP)),
        H-TXRES:(H-DESCR,H-AMT,H-NORMAL [*GRI*],H-NEG [* absence of vis. *],
        H-CHANGE,H-CHANGE-LESS,H-CHANGE-SAME,
        H-CHANGE-MORE [* aggravating factor GLCBA 031D *],H-TRANSP,
        H-DIAG [* ischemic changes *],
        H-INDIC [* generalized bursts NMGMG 061A *],
        H-MODAL [* most likely result of MV disease *],
        H-RESP [* improved appearance IDT1Z 015E *],
        H-PTLOC,H-PTPART, H-PTFUNC [*chpath2*],H-PTAREA [glcb2],
        H-PTAREA [* upper zone redistribution *],
        H-TMEND [* final result *],H-TMLOC,H-TMDUR,H-TMREP,
        H-TXRES,H-TXPROC [970701]),
        [H-TXRES:(CONN-TYPE:(H-RESP,H-INDIC,H-DIAG)),]
        H-TXRES:(ADJUNCT-TYPE:(H-NULL,H-OBSERVE [* recorded EEG *],
        H-DIET [* dietary changes *],H-SHOW [* notable EKG *],
        H-PTDESCR [* personal data *],
        H-AGE [* old finding *],H-RECORD [* the above findings *],
        H-TTCOMP [* therapeutic levels *],
        H-TTGEN [* official interpretation *],
        H-TRANSP,H-CONN [glcb2])),
        H-TXSPEC:(H-MODAL,H-EVID,H-RESP [* worsening renal function *],
        H-CHANGE,H-CHANGE-LESS,H-CHANGE-SAME,
        H-CHANGE-MORE [* increased liver function tests *],
        H-TXRES,H-TMLOC,H-PT,H-PTPART,H-PTFUNC,
        H-NORMAL,H-ORG [glcb2],
        H-TMBEG [* initial urinalysis *],
        H-TMREP [* repeat Lipid profile *],
        H-TMDUR [* continued cycling *]),
        H-TXSPEC:(ADJUNCT-TYPE:(H-NULL,H-TRANSP,H-DESCR,
        H-PTVERB [* presenting labs showed ... *],
        H-TXPROC [* monitoring labs *],
        H-DIET [* fasting lipid profile *])),
        [H-TXSPEC:(CONN-TYPE:(H-INDIC,H-DIAG,H-TTCOMP,H-TTGEN,]
        [ H-RESP)),]
        H-TXVAR:(H-AMT,NTH,QNUMBER,H-EVID,H-NULL [cpri],
        H-DIAG [* hypoglycemic sugars *],
        H-CHANGE,H-CHANGE-MORE,H-CHANGE-LESS,H-CHANGE-SAME,
        H-RESP [* CR stable at 0.9 *],
        H-TXRES,H-TXVAR,H-MODAL,H-NEG, [mgh25]
        H-PT,H-PTAREA,H-PTPART,H-PTFUNC,H-NORMAL [GRI],
        H-SHOW [* WBC notable to be 19000 *],H-TRANSP,
        H-TMDUR [* prolonged protime *],
        H-TMBEG,H-TMEND,H-TMLOC,H-TMREP,NUNIT,NTIME1),
        H-TXVAR:(ADJUNCT-TYPE:(H-CHEM,H-DESCR,H-TTMED,H-TTGEN,
        H-DIET [* fasting glucose nonfasting 156 mg/dL *],
        H-TTSURG [* postoperative hemoglobin-supporting cl prob *],
        H-TTMODE [* parenteral iron *],
        H-TTCOMP,H-INDIC [* irregular pap smear *])),
        [H-TXVAR:(CONN-TYPE:(H-INDIC,H-DIAG,H-RESP)),]
        NTIME1:(NTH,H-NULL [* three days are structured *],
        H-RESP [* better night *],H-DESCR [* bad days *],
        H-INDIC [* bad day *],
        H-TMLOC,H-TMBEG [* ensuing few days *],H-TMEND,
        H-TMREP [* additional seven day course *],
        H-TMDUR [* late January *],
        H-TTSURG [* 2 days post op *],
        NTIME1 [* in one year's time *]),
        NTIME1:(ADJUNCT-TYPE:(H-TRANSP [* exact date *],
        H-AMT [* total time, whole/worst/extra day *],
        H-CHANGE-SAME [* same day *],
        H-PTDESCR [* pleasant evening *],H-TTGEN [* coming week *],
        H-OBSERVE [* stated 76 years *])).
— N-NPOS
—       selection between head and prenominal noun (compound noun)
—       in cases like 'head injury' and 'head injury examination',
—       where the head noun is 'injury' and the prenominal noun
—       is 'head'.
—       Used by TSEL-NVAR-NPOS and TSEL-NNN-N.

—       ** NOTE: Multiple prenominal nouns (NNN in NPOS) are treated
—       ** as if they formed "compound" nouns with the noun
—       ** immediately to its right; thus a string NNN is now
—       ** (incorrectly) always treated as if it is [[N N] N]:
—       ** e.g., [[CHEST PAIN] MEDICATION]
—       ** vs [HOSPITAL [MENINGITIS CONSULTANT]]
—       ** The [[N N] N] reading should be represented as N in
—       ** LCDN on NNN. The second reading [N [N N]] then be
—       ** represented by multiple NNN in NPOS, all modifying
—       ** the head noun.

—       The labels ADJUNCT-TYPE, FAIL-SEL and CONN-TYPE are similar
—       to the usages in list N-ADJ above.
LIST N-NPOS =
        E-LEAD:(ADJUNCT-TYPE:(H-PTAREA,H-PTPART [* limb leads *])),
        H-CHANGE:(H-PTMEAS,H-PTFUNC,H-TXVAR,H-TXPROC,H-AMT,H-MODAL,
        H-INDIC [cpri 1/19/95],H-TTMED,
        H-PTPART [* skin change *],H-TRANSP [* mode switching *],
        H-CHANGE,H-CHANGE-MORE,H-CHANGE-LESS,H-CHANGE-SAME,
        NTIME1,H-TMREP,H-TMDUR [* interval change *]),
        H-CHANGE:(ADJUNCT-TYPE:(H-TXRES [* mean gradient *],
        H-NULL [* R to S transition *])),
        H-CHANGE-MORE:(H-PTMEAS,H-PTFUNC,H-TXVAR,H-TXPROC,H-AMT,H-MODAL,
        H-INDIC [cpri 1/19/95],H-TTMED,
        H-TTMED,H-TTSURG [* angioplasty ascending *],
        E-WV,E-INTVL [* st elevations *],
        H-CHANGE,H-CHANGE-MORE,H-CHANGE-LESS,H-CHANGE-SAME,
        NTIME1,H-TMREP,H-TMDUR),
        H-CHANGE-LESS:(H-PTMEAS,H-PTFUNC,H-TXVAR,H-TXPROC,H-AMT,H-MODAL,
        H-INDIC [cpri 1/19/95],H-TTMED,E-WV,
        E-WV,E-INTVL [* ST depressions *],
        H-CHANGE,H-CHANGE-MORE,H-CHANGE-LESS,H-CHANGE-SAME,
        NTIME1,H-TMREP,H-TMDUR),
        H-CHANGE-SAME:(H-PTMEAS,H-PTFUNC,H-TXVAR,H-TXPROC,H-AMT,H-MODAL,
        H-INDIC [cpri 1/19/95],H-TTMED,
        H-CHANGE,H-CHANGE-MORE,H-CHANGE-LESS,H-CHANGE-SAME,
        NTIME1,H-TMREP,H-TMDUR),
        H-DIAG:(H-AMT,H-EVID,H-MODAL,H-INDIC,H-DESCR,E-WV,
        H-CONN [* PCN; causes anaphylaxis *],
        H-CHANGE,H-CHANGE-MORE,H-CHANGE-LESS,H-CHANGE-SAME,
        H-DIET [* food allergies *],
        H-PT,H-FAMILY [* Father accidental death *],
        H-PTAREA,H-PTLOC,H-PTPART,H-PTFUNC,H-DIAG [dcardi 11/94],
        NTIME1,H-TMLOC,H-TMDUR,H-TMREP,H-TMBEG,H-TRANSP,
        H-TMEND [* end-stage disease *],
        H-TTGEN [* for followup CAD *],
        H-TTSURG [* post-pericardiotomy syndromes *],
        H-RESP,H-TTCOMP),
        [H-DIAG:(CONN-TYPE:(H-TXSPEC,H-TXVAR)),]
        H-DIAG:(ADJUNCT-TYPE:(H-ORG,
        H-TTMED [* drug allergies, bacterin sepsis *],
        H-CHEM [* asbetos exposure *],
        H-NULL [* substance abuse *],
        H-INST [* bystander coronary artery disease *])),
        H-DEVMED:(H-DEVMED,H-NULL,H-TRANSP,H-TXPROC [d/pcardi 11/94],
        H-PTFUNC,H-PTPART,H-PTAREA [* loop fistula *],
        H-PTSPEC [* marker catheter *],
        H-TTSURG,H-TTCOMP,H-TTMED),
        H-DEVMED:(ADJUNCT-TYPE:(H-TTMODE,
        H-CHANGE-MORE [* boost tube feeds *],
        H-TXCLIN [* HIV--PPD Mfr *],
        H-INDIC [* aneurysm clip *])),
        H-FAMILY:(ADJUNCT-TYPE:(H-INDIC,H-DIAG,H-FAMILY,H-PTDESCR)),
        H-INDIC:(H-AMT,H-MODAL,H-EVID [aramis],
        E-WV,E-AX [* ECG with left axis deviation *],
        H-CHANGE,H-CHANGE-MORE,H-CHANGE-LESS,H-CHANGE-SAME,
        H-TRANSP,H-CHEM [p/dcardi 11/94],H-INDIC,H-DIAG,
        H-PTLOC [* Decubitus ulcer *],
        H-PTPART,H-PTAREA,H-PTFUNC,H-PTMEAS,
        H-RESP [* rapid response atrial fibrillation *],
        H-TTCOMP,H-TTSURG [glcb2],H-TXRES [mgh25],
        H-TXPROC,H-TXVAR,H-TXCLIN,
        H-TXSPEC [* lipid imbalance *],
        NUNIT,NTIME1,H-TMDUR,H-TMREP,H-TMLOC,H-TMBEG),
        [H-INDIC:(CONN-TYPE:(H-TXPROC,H-TXVAR,H-TXCLIN,H-TXSPEC)),]
        H-INDIC:(ADJUNCT-TYPE:(H-NULL,H-ORG,H-DESCR,H-TTGEN,H-PT,
        H-DEVMED [* stent restenosis, Gore-Tex fistula *],
        H-TTMED [* cocaine abuse *])),
        [H-INST:(FAIL-SEL),]
        H-INST:(NTIME2 [* Tuesday Respiratory Clinic *],
        H-TTMED [* Coudamin clinic *],
        H-TTGEN [* triage area *]),
        H-INST:(ADJUNCT-TYPE:(H-DIAG,NTIME1,H-INST,H-NULL,
        H-DEVMED [* pacemaker clinic *],
        H-INDIC [* chest pain unit *],
        H-PTDESCR [* resource manager *],
        H-PTAREA [* local nursing home *],H-PT,H-PTPART,
        H-PTFUNC [* home health consult *],
        H-TRANSP [* Ms Frey/YYY831 *],
        H-TXSPEC [* in the lipid clinic *],
        H-TTSURG [* cardiac catheterization lab *],H-TTGEN,
        H-TTCOMP [* dialysis unit *],H-FAMILY [* family doctor *])),
        H-PT:(H-INST,H-PT,H-INDIC,H-DIAG,MASC,FEM,H-NORMAL,NTIME1,
        H-AGE,NUNIT [* 86 year old white woman *],
        H-PTDESCR [* Russian-speaking woman *]),
        H-PT:(ADJUNCT-TYPE:(H-TRANSP [* Ms/Mrs XXX *],
        H-TTCOMP [* a anticoagulation candiate *],
        H-TTMED [* a Coudamin candiate *],
        H-TTSURG [* a surgery candiate *])),
        H-PTAREA:(H-PTPART,H-PTAREA,H-PTFUNC,H-INDIC[,H-TTGEN 970627]),
        H-PTAREA:(ADJUNCT-TYPE:(H-TXPROC,NUNIT,
        H-DESCR [* exit site *],
        H-TXCLIN [* HIV--PPD Site *],
        H-DEVMED [* Perma-Cath site, Gore-Tex end *],
        H-TTGEN [* access site *],
        H-TTSURG [* anastomosis site *])),
        H-PTFUNC:(H-TXCLIN,H-TXRES,H-INDIC,H-TTMED,H-TTCOMP [970627],
        H-TTGEN [* for goal BP less than 130/80 *],
        H-DEVMED [* wheelchair ambulation *],
        H-PTFUNC,H-PTPART,H-PTAREA,[H-PTSPEC, glcb2]
        E-INTVL [* ST elevation *], H-NORMAL [* intact sensation *],
        H-AMT,H-MODAL,H-DESCR,H-TRANSP [* position sense *],
        H-CHANGE,H-CHANGE-MORE,H-CHANGE-LESS,H-CHANGE-SAME,
        H-RESP,H-DIET [* salt intake *],
        H-TXPROC [* Electrocardiogram sinus rhythm *],
        H-TXVAR [* sodium intake *],
        NUNIT,NTIME1,H-TMDUR,H-TMREP),
        H-PTFUNC:(ADJUNCT-TYPE:(H-CHEM [* water exercises *],
        H-PTMEAS [* weight bearing *],
        H-PTDESCR [* work capacity *],
        H-TESTVIEW [* lateral bending *],
        H-NULL [* stair climbing *])),
        H-PTPART:(H-DESCR,H-MODAL,H-INDIC,H-NORMAL [glcb2],
        H-CHANGE,H-CHANGE-MORE,H-CHANGE-LESS,H-CHANGE-SAME,
        H-PT,H-PTPART,H-PTAREA,H-PTFUNC [aramis],
        H-TXPROC,H-RESP,
        H-TMEND [* end stage lung disease *],H-TMDUR,H-TMREP,NTIME1),
        H-PTPART:(ADJUNCT-TYPE:(H-AMT,H-NULL,
        H-CHEM [* PTFE graft *],
        H-DEVMED [* 25 % in-stent RCA, Gore-Tex graft *],
        H-TTGEN [* access graft *],
        H-TTSURG [* bypass grafts *])),
        H-PTSPEC:(H-DIAG,H-TXRES,H-PTSPEC [glcb2],
        H-TXVAR [* guaiac stool *]),
        H-PTSPEC:(ADJUNCT-TYPE:(H-DEVMED,H-TXPROC [* biopsy specimen *],
        H-PTPART [* skin markers *])),
        [H-PTVERB:(H-TTMED,H-PT),]
        H-RECORD:(H-INDIC,H-PTFUNC,H-PTMEAS,H-TTGEN,
        H-TTCOMP [* rehabilitation records *],
        H-TXRES,H-TXVAR,H-TXPROC [* Echo report *],
        H-DIAG [* death summary *],
        H-INST [* Resident note *]),
        H-RECORD:(ADJUNCT-TYPE:(H-TMDUR [* interval note *],
        H-TXCLIN [* H&P database *])),
        H-RESP:(H-AMT,H-INDIC,H-DIAG,H-EVID,
        E-WV [* T-wave pseudo normalization *],
        H-CHANGE,H-CHANGE-MORE,H-CHANGE-LESS,H-CHANGE-SAME,
        H-PTAREA,H-PTFUNC,H-PTPART,H-PTLOC,
        H-MODAL,H-NEG,H-TMDUR,H-TMREP,H-TMLOC,
        H-TTMED,H-TTCOMP,H-TTSURG,
        H-ORG,NTIME1,NUNIT,QNUMBER),
        H-RESP:(ADJUNCT-TYPE:(H-TXVAR,H-TXSPEC,H-PT,
        H-DEVMED [* Tourniquet control *],
        H-INST [* consultants help *])),
        [H-RESP:(CONN-TYPE:(H-TTMED,H-TTCOMP,H-TTSURG)),]
        H-TTSURG:(H-DIAG [* hernia surgery *],H-INDIC [* cyst removal *],
        H-DESCR [* odor drainage *],
        H-MODAL [* attempt ultrafiltration *],
        H-PTAREA [* leaflet closure *],
        H-PTPART [* extremity debridement *],
        H-TMLOC [* emergency angioplasty/surgery *],
        H-TTGEN [* outpatient cardiac cath *],
        H-TTSURG [* replacement surgery *],
        H-DEVMED [* pacemaker removal *]),
        H-TTSURG:(ADJUNCT-TYPE:(H-TTMED [* sodium chloride replacement *],
        H-CHEM [* KOH prep *],
        H-TRANSP [* patch angioplasty *],
        H-TMREP [* relook cardiac catheterization *],
        NTIME1 [* for a same day cardiac catheterization *],
        H-TXPROC [* counter incision *],
        H-TTCOMP [* Left VATS talc pleurodesis *])),
        H-TTMED:(H-PTPART,H-PTAREA,H-TTMODE [* prn IV Phenergan *],
        H-DESCR [* dc ACEI *],H-PTFUNC,H-DEVMED [dcardi 11/94],
        H-MODAL,H-EVID,H-AMT,H-TTGEN,H-TTMED,H-TTCOMP,
        H-CHANGE,H-CHANGE-MORE,H-CHANGE-LESS,H-CHANGE-SAME,
        H-TMEND,H-TMBEG,H-TMLOC,H-TMREP,H-TMDUR,NTIME1,NUNIT),
        H-TTMED:(ADJUNCT-TYPE:(H-DIAG,[H-TTMED,]H-INDIC,H-CHEM,H-RESP,
        H-TRANSP [* combination beta blockade *],
        H-TXVAR [* ATC enzyme inhibitor *],H-NULL,
        H-INST [* 1500 calorie Ada diet *])),
        H-TTCOMP:(H-INST,H-AMT,H-MODAL,H-DEVMED [dcardi 11/94],
        H-CHANGE,H-CHANGE-MORE,H-CHANGE-LESS,H-CHANGE-SAME,
        H-INDIC,H-DIAG,H-ORG [* H pylori treatment *],
        H-PTFUNC,H-PTPART,H-PTAREA,
        H-TTMED,H-TTCOMP,H-TTGEN,H-TTSURG,
        NTIME2 [* on Monday; Wed and Friday dialysis *],
        H-TXVAR,NTIME1,H-TMLOC,H-TMDUR,H-TMREP),
        [H-TTCOMP:(CONN-TYPE:(H-INDIC,H-TTGEN,H-DIAG)),]
        H-TTCOMP:(ADJUNCT-TYPE:(H-PTMEAS [* weight; recreation therapy *],
        H-TRANSP [* balloon pump *],H-NULL [* tapwater enemas *],
        H-DESCR [* DC cardioversion *],
        H-DIET [* puree diet *],
        H-TXCLIN [* HIV--PPD Admin *],
        H-TTGEN [* in-patient rehabilitation *],
        H-PT)),
        H-TTGEN:([H-INST,]H-MODAL,H-AMT,H-INDIC,
        H-CHANGE,H-CHANGE-MORE,H-CHANGE-LESS,H-CHANGE-SAME,
        H-DIET [* nutrition consultation *],
        [H-TXPROC, pcardi 12/94]
        H-PTPART,H-TTCOMP,H-TTGEN,H-TTMED,H-RECORD,
        H-RESP [* rate response optimization off *],
        H-TMEND [* smoking cessation consult *],
        NTIME1,H-TMLOC,H-TMDUR,H-TMREP),
        H-TTGEN:(ADJUNCT-TYPE:(H-TXVAR,H-TXPROC,H-INST,H-PT,H-NULL,
        H-FAMILY [* family meeting *],
        H-TXSPEC [* electrolyte clearance *],
        H-DEVMED [* pt's device programming, pacemaker interr *],
        H-DIAG [* arrhythmia evaluation *],
        H-TTSURG [* surgery consultation *],
        H-TRANSP [* lipoprotein profile check *],
        H-PTSPEC [* HIV--specimen handling *],
        H-PTFUNC [* health care *])),
        H-TXCLIN:(H-PTAREA,H-PTFUNC,H-INST,H-NORMAL,
        H-DIAG [* transient ischemic attack workup *],
        H-PT [* pt exam; self examination *],
        H-TXCLIN [* finger-to-nose testing *],
        H-TXRES,H-TXVAR,H-TXPROC [* sestamibi exam *],
        H-DEVMED,H-TRANSP,H-TMLOC [* preadmissions testing *]),
        H-TXCLIN:(ADJUNCT-TYPE:(H-TTGEN [* admission physical exam *],
        H-PTPART [* renal artery duplex examination *],
        H-TTCOMP [* anticoagulation workup *],
        H-TTMED [* Cortrosyn stimulation *],
        H-TTSURG [* transplantation workup/eval *],
        H-ORG [* HIV testing *],
        H-INDIC [* neuropathy/syncope workup *])),
        H-TXPROC:(H-MODAL,H-AMT,H-TXRES,H-TXPROC,
        H-CHANGE,H-CHANGE-MORE,H-CHANGE-LESS,H-CHANGE-SAME,
        H-DEVMED [dcardi 11/94],H-INDIC,H-DIAG,
        H-PTAREA,H-PTFUNC,H-TRANSP,H-TTSURG [pcardi 12/94],
        H-TMREP,H-TMDUR,H-TMEND [* completion arteriogram *],
        NTIME1),
        H-TXPROC:(ADJUNCT-TYPE:(H-CHEM,H-TXVAR,H-PT,H-PTPART,
        H-INST [* vascular radiology procedure *],
        H-TXSPEC [* Chemistry screen shows... *],
        H-DESCR [* high resolution scan *],
        H-TTGEN [* Toomey catheterization 8/12/97 *],
        H-TTMED,H-TTCOMP [970702])),
        H-TXRES:(H-TXPROC,H-TXVAR,H-TXSPEC,H-TXRES,H-INDIC,
        H-DIAG [* mortality data *],
        E-INTVL [* ST changes *],E-WV [* T wave changes *],
        H-TMLOC [* HIV - no interim data *],
        H-PTPART,H-PTAREA,H-PTFUNC,H-TRANSP),
        H-TXRES:(ADJUNCT-TYPE:(H-CHEM,H-AMT,H-DIET [* salt content *],
        H-DEVMED [* Swan changes *],
        H-RESP [* rate response curve *],
        H-TTGEN [* admission data *],H-TTMED [970627],
        H-TTSURG [* cardia catheterization lab *])),
        H-TXSPEC:(H-DEVMED,H-PTPART,H-TXPROC,H-TXVAR,H-TXSPEC,H-TXRES,
        H-DESCR [* room air blood gas *],
        H-PTFUNC [* pregnancy test *],H-ORG,H-INST,H-INDIC,H-DIAG),
        H-TXSPEC:(ADJUNCT-TYPE:( H-TTGEN [* followup lipid profile *],
        H-TTSURG [* catheterization laboratory *],
        H-TTMED [* digitalis toxicology *])),
        [H-TXSPEC:(CONN-TYPE:(H-TTMED)),]
        H-TXVAR:(H-TXPROC,H-TXVAR [* oxygen saturation *],H-TXSPEC,H-TXRES,
        H-INST,NUNIT,NTIME2 [* Today CR 0.9 *],
        H-NORMAL,H-INDIC,H-DIAG,H-PTPART,H-PTFUNC),
        H-TXVAR:(ADJUNCT-TYPE:(H-AMT,H-NULL,H-DESCR [* room air saturation *],
        H-TTSURG [* post-procedure cardiac enzymes *],
        H-ORG [* HIV-1 RNA ultrasensitive *],
        H-DEVMED,H-TTMED,H-TTGEN)),
        NTIME1:(H-DESCR [* rough night *],H-INDIC [* stress time *],
        H-DIAG [* cardiac history date *],
        H-TXPROC [* fluoroscopy time *]),
        NTIME1:(ADJUNCT-TYPE:(H-TTGEN,NTIME1,NTIME2 [* yesterday afternoon *],
        H-DEVMED [* Crossclamp time *],
        H-TTCOMP [* dialysis days *],
        H-TTSURG [* total bypass time *])),
        NTIME2:(FAIL-SEL).
— V-S-O
— or VERB-SUBJECT-OBJECT
—       selection between verb, subject and object.
—       - Special classes and conventions:
—       sentential object (any verb-containing object,
—       e.g. THATS (that + sentence), TOVO (to + verb + object),
—       indicated by 'SENTOBJ'.
—       - FAIL-SEL attribute causes the verb to fail the V-S-O selection;
—       but will undergo selection using a different list:
—       BEREP, H-BECONN, VBE use either BE-S-O (for object=adjective)
—       or CONJ-EQUIV-CLASSES (for connective function);
—       H-CONN, CONJ-LIKE use CONJ-EQUIV-CLASSES;
—       INSTR appears here because certain prepositions (e.g. 'with')
—       uses the verb list and also have subclass INSTR;
—       - Entries which contain a verb class and subject class, but
—       no object class may take any object. To indicate that
—       a sentence having no object use
—       VERB-CLASS SUBJECT-CLASS NULLOBJ
—       - Any verb class not appearing on this list is passed 'benignly',
—       that is, not SELECT-ATT is computed for the subject or
—       object. Any subject or object is accepted.
—       - Verb rules are TSEL-VERB-SUBJ, TSEL-VEN-SUBJ, TSEL-OBJ-VS,
—       TSEL-NULL-OBJ-VS, TSEL-SENTOBJ-VS, TSEL-NULLC-OBJ,
—       TSEL-PASSOBJ, TSEL-NULLWH-NSTGO.
LIST V-S-O =
        BEREP:(FAIL-SEL),
        H-BECONN:(FAIL-SEL),
        VBE:(FAIL-SEL),
        CONJ-LIKE:(FAIL-SEL),
        INSTR:(FAIL-SEL),
        H-CONN:(H-TTMED:(H-INDIC,
        H-RESP [* morphine causes mental state changes *]),
        H-TTGEN:(H-PTPART [* process involving PV apparatus *]),
        H-CONN:(H-PTPART [* process involving PV apparatus *]),
        H-PTLOC [* preparation containing salicylic acid *],
        H-NULL [* This caused less nausea *],
        H-TXPROC:(H-TXRES [* This procedure produced results *]),
        H-TMDUR:(H-TTGEN [* The episode prompting his admission *]),
        H-DEVMED:(H-INDIC [* Seran wrap caused skin irritation *]),
        H-INDIC:(H-PTFUNC [* Medcin-headache causes awakening *],
        H-TXPROC [* symptoms requiring diuretic therapy *],
        H-TTMED [* symptoms requiring antibiotics *]),
        H-DESCR:(H-INDIC [* precipitants causing wheezes *])),
        H-CHANGE:(H-RESULT,H-INDIC,H-DIAG, H-PT,H-INST,
        H-TXVAR:(H-CHANGE,H-CHANGE-MORE,H-CHANGE-LESS,H-CHANGE-SAME),
        H-PTFUNC,H-PTPART,H-PTAREA,H-INST:(H-TTMED),
        H-TTCOMP,H-TTSURG,H-TTMED:(H-TTMED [7.28.92])),
        H-CHANGE-MORE:(H-RESULT,H-INDIC,H-DIAG,
        H-PT:(H-TTMED, H-AMT [* Pt increased dose of her meds *],
        H-INDIC [* He spiked a fever to 38 *],
        H-TTCOMP [* He added physical therapy *],
        H-PTFUNC [* She gained weight/appetite *],
        H-MODAL [* Pt raised the possibilty/her hopes *]),
        H-INST:(H-TTMED, H-AMT [* Dr.YYY increased her meds *],
        H-TTCOMP [* LMD added physical therapy *],
        H-MODAL [* We advanced the possibilty that... *]),
        H-TXVAR:(H-CHANGE,H-CHANGE-MORE,H-CHANGE-LESS,H-CHANGE-SAME),
        H-PTFUNC,H-PTPART,H-PTAREA,H-PTMEAS [* weight increased *],
        H-INST:(H-TTMED),
        H-TTCOMP,H-TTSURG,H-TTMED:(H-TTMED [7.28.92])),
        H-CHANGE-LESS:(H-RESULT,H-INDIC,H-DIAG,H-PT,H-INST,H-TXRES,
        H-TXVAR:(H-CHANGE,H-CHANGE-MORE,H-CHANGE-LESS,H-CHANGE-SAME),
        H-PTFUNC,H-PTPART,H-PTAREA,H-INST:(H-TTMED),
        H-TTCOMP,H-TTSURG,H-TTMED:(H-TTMED [7.28.92])),
        H-CHANGE-SAME:(H-RESULT,H-INDIC,H-DIAG,H-PT,H-INST,
        H-TRANSP:(H-RESP [* volume status remains stable *]),
        H-DESCR:(H-NORMAL [* cardiac size remained wnl *]),
        H-TXVAR:(H-CHANGE,H-CHANGE-MORE,H-CHANGE-LESS,H-CHANGE-SAME,
        H-TXRES [* his CK-MBs remained wnl *]),
        H-PTFUNC,H-PTPART,H-PTAREA,H-INST:(H-TTMED),
        H-TTCOMP,H-TTSURG,H-TTMED:(H-TTMED) [7.28.92]),
        H-EVID:(H-PT:(H-INDIC,H-DIAG,H-RESULT,H-PTFUNC,H-PTMEAS),
        H-INDIC,H-NULL,
        H-INST:(H-INDIC,H-DIAG,H-RESULT,H-PTFUNC,H-PTMEAS),
        H-RECORD:(H-INDIC,H-DIAG,H-RESULT,H-PTFUNC,H-PTMEAS)),
        H-INDIC:(H-PT,H-FAMILY,H-PTPART,H-PTAREA,
        H-TRANSP,H-NULL,H-TTCOMP,
        H-TTMED:(
        H-DIAG [* Orthostatic hypotension exacerbated by medications *]),
        H-RESULT:(
        H-PTPART [* 1 subcl artery compromises his LIMA graft *]),
        H-RESP:(H-PT [* the condition did not kill the patient *]),
        H-INST:(H-INDIC [* nurse noted onset of ur. incontinence *]),
        H-TTSURG:(H-DIAG [* mastectomy infiltratin carcinoma *]),
        H-INDIC [glcb2],H-DIAG [* disease flares *]),
        H-NEG:(H-INST:(H-INDIC [* one could not exclude a small mass *],
        H-TTMED,H-TRANSP [* I avoided the use of ACEI *],
        H-DIAG [* Psychiatry ruled out neuromalignant syndrome *]),
        H-PT:(H-TTSURG [* pt declines surgery *], H-TTCOMP,H-TTGEN,
        H-TTMED [* pt refuses to take her meds *],
        H-PTFUNC [* pt denies substernal chest pressure *],
        H-TXCLIN [* she failed her swallowing test *],
        H-TXRES [* she denies any dietary changes *],
        H-INST [* pt declines ER *],
        H-INDIC [* pt denies weight loss *],
        H-RESULT [* pt denies a temporal association of pressure *],
        H-DIAG [* pt denies scotomata *]),
        H-TXVAR:(H-DIAG [* alkaline phosphate ruling out Paget's *])),
        H-OBSERVE:(H-PT:(H-INDIC,H-DIAG,H-RESULT,H-RECORD,
        H-TMBEG,H-PTMEAS,H-PTVERB,H-PTFUNC,
        H-RESP [* patient noted improvement *],
        H-INST [* she told us *]),
        H-FAMILY,
        H-TXPROC:(H-DIAG [* study in followup found ischemia *],
        H-INDIC [* ECG/MRI found mild nypokinesis *]),
        [ H-PTMEAS,H-RESP,H-TXPROC),]
        H-INST:(H-INDIC,H-DIAG,H-RESULT,H-PTFUNC,
        H-RECORD [* dr see phone notes *],
        H-TXRES [* dr noted EKG changes *],
        H-PT,H-PTMEAS,H-TXPROC [* dr explains procedure *])),
        H-PTFUNC:(H-PT:(H-AMT [* she walks one mile a day *],NUNIT,
        NULLOBJ [* pt unable to conceive *],
        H-MODAL,H-EVID,H-RESULT,H-NULL,H-RESP,H-DESCR,
        H-CHEM [* pt drank water *],
        H-DEVMED,H-DIET [* pt ate fast food *],
        H-PT [* he weighed himself *],
        H-PTFUNC,H-PTPART,H-PTMEAS,
        H-PTSPEC [* specimens produced by the patient *],
        H-CHANGE,H-CHANGE-MORE,H-CHANGE-LESS,H-CHANGE-SAME,
        H-NORMAL,H-INDIC [* she rarely drinks alcolhol *],
        H-TTCOMP [* she walks with supports *],
        H-TTMED [* pt filled the prescription *],
        H-TMBEG,H-TMEND,H-TMDUR,H-TMREP),
        H-INST:(H-RESULT,H-PTFUNC [* I can feel his pulses *]),
        H-PTPART:(H-INDIC,H-NORMAL,H-AMT,NUNIT,H-PTFUNC,
        H-TXVAR [* kidney removes sugar *],
        H-DESCR [* skin puncture site looks good *],
        NULLOBJ,H-RESULT,H-MODAL,H-EVID,
        H-CHANGE-MORE,H-CHANGE-LESS,H-CHANGE-SAME,
        H-CHANGE,H-TMBEG,H-TMEND,H-TMDUR,H-TMREP),
        H-PTAREA:(H-INDIC,H-NORMAL,H-AMT,NUNIT,NULLOBJ,H-RESULT),
        H-PTFUNC, [970805]
        H-INDIC:(NULLOBJ,H-AMT,H-CHANGE,H-TMEND,H-TMBEG,
        H-PT,H-TMDUR,H-TMREP,H-MODAL,H-EVID,H-NEG),
        H-NORMAL:(NULLOBJ,H-AMT,NUNIT,H-TMEND,H-TMBEG,
        H-CHANGE-MORE,H-CHANGE-LESS,H-CHANGE-SAME,
        H-CHANGE,H-MODAL,H-EVID),
        H-TTCOMP,H-TTMED,H-RESP [970805],
        H-TXSPEC:(H-ORG [glcb2]),
        H-RESULT:(NULLOBJ,H-AMT,NUNIT,H-TMEND,H-TMBEG,
        H-CHANGE-MORE,H-CHANGE-LESS,H-CHANGE-SAME,
        H-CHANGE,H-MODAL,H-EVID,H-TMDUR,H-TMREP)),
        H-PTLOC:(H-PTPART:(H-INDIC[,H-PTPART,H-PTAREA *4/2/96]),
        H-PTAREA:(H-INDIC[,H-PTAREA *4/2/96]),
        H-DEVMED:(H-PTPART [* acetabular component affixed with screws *]),
        H-PTFUNC:(H-INDIC [*8/27/96*]),
        H-NULL,H-PTVERB,H-PT:(H-PTPART),
        H-TXSPEC:(H-RESULT,H-PTPART [* urinalysis contained blood *]),
        H-TTMED:(H-PTPART [* no drugs entered the eyes *]),
        H-DIAG:(H-PTPART,H-PTAREA),
        H-INDIC:(H-PTPART,H-PTAREA,
        H-INDIC [* abrasion overlying hematoma *])),
        H-PTVERB:(H-PT:(H-RESULT,H-BECONN,H-FAMILY,H-CHEM,
        H-PTPART [* pt catches her breath *],
        H-DIAG [* pt suffered AMI *],
        H-INDIC [* pt experiences side effects *],
        H-CHANGE,H-CHANGE-MORE,H-CHANGE-LESS,H-CHANGE-SAME,
        H-TMBEG,H-TMEND,H-TMDUR,H-NULL [* pt catches a ball *],
        H-TTCOMP [* he underwent tracheal catheter placement *],
        H-TTGEN [* he underwent neuropsychology evaluation *],
        H-TTSURG,H-TTMED,H-TXRES,H-TXPROC,
        H-TXCLIN [* pt underwent examination *],
        H-TXSPEC [* pt underwent pulmonary function tests *],
        H-VTEST [* pt underwent CPAP titration *]),
        [H-DIAG:(H-INDIC) dcardi 11/94]
        H-INDIC [* smoker glcb2 *],
        H-FAMILY:(H-INDIC,H-DIAG,H-RESULT,H-TMEND,H-CHANGE,
        H-CHANGE-MORE,H-CHANGE-LESS,H-CHANGE-SAME)),
        H-RESP:(H-DESCR:(NULLOBJ),
        H-TRANSP:(NULLOBJ),
        H-RESULT:(NULLOBJ),
        H-NULL:(H-INDIC,NULLOBJ),
        H-INDIC:(NULLOBJ),
        H-DIAG:(NULLOBJ),
        H-INDIC:(H-PTFUNC [* smoking has benefited his health *]),
        H-AMT:(H-INDIC [* an Activan dose resolved the problem *]),
        H-PT:(H-TTMED [* she tolerated salbutamol *],
        H-TXPROC,H-TTSURG,H-TTCOMP [* she tolerated procedure *],
        H-PTPART,H-TRANSP [* pt recovers her usual pulm status *],
        H-PTFUNC [* pt tolerates po intake *],
        H-RESP [* she was pleased with her progress *],
        H-INDIC [* she controlled angina *],NULLOBJ),
        H-PTPART:(NULLOBJ),
        H-PTFUNC:(H-PTFUNC [* pt tolerated po intake *],NULLOBJ,
        H-RESP [* resp status improved with resolution of INDIC *],
        H-INDIC [* Medcin-headache relieved by sleep *]),
        H-PTAREA:(NULLOBJ), H-RESP:(NULLOBJ) [7.28.92],
        H-TTSURG:(H-PT,H-FAMILY,H-INST [* surgery pleased her *]),
        H-RESP:(H-PTFUNC [* resp status improved with resolution... *]),
        H-TTMED [* depakote controls s.g. seizures *],
        H-TXVAR [* his serum creatinine improved *])
        [H-TXVAR:(H-TXVAR),H-TTMED,H-TTCOMP,H-TTSURG)],
        H-SHOW:(E-EKGPROC, H-CHANGE:(H-TXRES [7/29/97]),
        H-CHANGE-MORE:(H-TXRES [7/29/97]),
        H-CHANGE-LESS:(H-TXRES [7/29/97]),
        H-CHANGE-SAME:(H-TXRES [7/29/97]),
        H-INDIC:(H-INDIC [* symptoms revealed Bouchard's nodes *]),
        H-INST:(H-RESULT,H-TXVAR [* Lab shows the HDL 43 *]),
        H-RESP [glcb2],H-VTEST [cpri],
        H-RESULT,H-TRANSP,H-NULL,H-NEG:(H-DIAG [* none showed DJD *]),
        H-RECORD:(H-RESP [* PEFR charts revealed improvement *]),
        H-PTFUNC:(H-INDIC,H-PTMEAS [* vital signs showed weight ... *],
        H-PTFUNC,H-RESULT [* CVS revealed pulse regular *]),
        H-PTSPEC:(H-ORG),
        H-PTPART:(H-INDIC,H-NORMAL [* fundi showed normal disc *],
        H-CHANGE [* femoral component showed no change *],
        H-DIAG [* anterior pelvis showed no fracture *],
        H-EVID,H-RESP [* extremities revealed changes *],
        H-NEG [* Extremities showed no evidence of edema *],
        H-PTPART,H-PTFUNC,H-RESULT),
        H-PTAREA:(H-INDIC,H-NORMAL,H-PTPART,H-PTFUNC,
        H-RESULT [* access site shows minimal amt of bruising *]),
        H-PT:(H-INDIC,H-PTFUNC [* pt tolerates po intake *],
        H-DIAG [* patient showed evidence of slight CHF *],
        H-CHANGE-LESS [* patient showed limitation with ROM *],
        H-CHANGE-MORE [* patient showed elevation of Troponin I *],
        H-NORMAL [* pt showed good motion *],
        H-RESP [* pt showed improvement *]),
        H-TTCOMP:(H-RESULT,H-TXVAR
        [* urine collection showed creatinine clearance *]),
        H-TTGEN:(H-TXRES [* evaluation with MRI showed changes *],
        H-RESULT,H-TXVAR [* panel showed an LDL of 228 *],
        H-MODAL [* evaluation revealed severe aspiration risk *],
        H-INDIC [* evaluation revealed severe risk... *]),
        H-TTSURG,
        H-TXCLIN:(H-INDIC,H-PTPART,H-PTFUNC,H-PTLOC,H-PT [glcb2],
        H-DIAG [* inspection revealed ischemia *],H-TMEND,
        H-PTAREA [* exam revealed bilat cataract removal *],
        H-TXRES [* exam revealed visualized fundi *],
        H-TTMED,H-NORMAL,H-PTDESCR,H-RESULT),
        H-TXRES:(H-TXRES,H-RESULT,H-TXVAR [* data showed WBC *],
        H-TTCOMP [* thalium images revealed perfusions *],
        H-DIAG,H-INDIC [* thalium images show dysfunction *]),
        H-TXVAR:(H-DIAG,H-TXVAR,H-INDIC,H-RESULT,H-ORG,
        NUNIT [* PO2 showed a moderate degree of hypoxia *]),
        H-TXPROC:(H-DESCR,H-NORMAL,H-TXRES,H-RESULT,H-TRANSP,
        H-DIAG [* Dobutamine myoview revealed eschemia *],
        H-INDIC [* angiography revealed lesions *],
        H-AMT [* angiography revealed a 50% normal *],
        H-NEG,H-EVID [* xray showed no evidence of pneum *],
        H-RESP [* xray showed resolution of chf *],
        H-TXVAR [* investigations showed urea *],
        H-CHANGE-MORE,H-CHANGE-LESS,H-CHANGE-SAME,
        H-PTPART,H-PTAREA,H-PTFUNC,H-CHANGE,NTIME1),
        H-TXSPEC:(H-DIAG [* lab revealed LAD disease *],
        H-TXVAR [* arterial blood gas showed PO2 *],
        NUNIT [* blood gases showed mod. degree of hypoxia *],
        H-RESULT [* arterial blood gas showed lowered PO2 *],
        H-INDIC [* arterial blood gas showed CO retention *],
        H-ORG [* sputum cultures show pathogens *])),
        H-TMDUR:(H-DIAG,H-INDIC,
        H-TTMED,H-TTCOMP,H-TTGEN [* counseling session lasted *],
        H-RESULT,H-PT,H-NULL,H-TMDUR,
        H-TXVAR,H-TXPROC,E-EKGPROC [* ECG evolved *],
        H-TRANSP,H-INST [glcb2 mgh],
        H-DEVMED:(H-TTMED [* bronchodilators continued by nebulizer *]),
        H-INST:(H-TTMED)),
        H-TTCOMP:(H-INST:(H-DIAG,H-PT,H-TTMED,H-TTCOMP,H-TXVAR,H-INDIC,H-ORG),
        H-FAMILY:(H-PT [glcb2]),
        H-INDIC:(H-PT [* pt is paced with no irregular beats *]),
        H-PT:(H-TTSURG,H-TTGEN,H-TTCOMP,H-TTMED,H-INST,
        H-INDIC [* she soaked her wound *],
        H-PT [* she oversedated herself *],
        H-TXCLIN,H-TXPROC,H-DEVMED,H-ORG),
        H-TTSURG:(H-PTPART [* CABG which took conduit *]),
        H-TTMED [970702], H-TTCOMP:(H-PT) [970929],
        H-TXSPEC:(H-TXVAR
        [* arterial blook gases #2 intubated 100% oxygen *])),
        H-TTGEN:(H-INST:(H-TTMED [* aspirin was withdrawn *],
        H-TTCOMP [* we may hold the therapy *],
        H-TTGEN [* we may give instructions *],
        H-INST,H-PT,H-FAMILY,H-PTSPEC,H-NULL,
        H-PTMEAS [* we follow her weights daily *],
        H-PTFUNC [* we cautioned activities *],
        H-MODAL [* we may give consideration *],
        H-TXPROC [* Dr has reviewed the films *],
        H-TXSPEC [* Dr will check Chem 7 *],
        H-TXVAR,H-TXRES [* dr oversaw Protimes *]),
        H-FAMILY:(H-PT [* father hospitalized her *],
        H-DIAG, H-TMLOC [* He gives a past history of MI *]),
        H-DIAG:(H-DEVMED [* RAD required occasional inhalers *]),
        H-INDIC:(H-DIAG [* blood loss explained her anemia *],
        H-INDIC [* lesion which gives off 3 obtuse marginals *]),
        H-NULL:(H-PT [mgh]),
        H-PT:(H-TXPROC [* pt received transtelephonic monitoring *],
        H-RESP [* pt received maximum hospital benefits *]),
        H-PTFUNC,
        H-PTPART:(H-TTCOMP [* RCA may require radiation therapy *]),
        H-RECORD:(H-RECORD [* an addendum follows a DS *]),
        H-TTCOMP:(H-DIAG) [970806],
        H-TTGEN:(H-PT [* GRI arrangements to see PT *],
        H-RESP [* goal is to optimize her bp control *],
        H-INDIC [* his cardiac indics returned abnormal *]),
        H-TTMED [97/07/24],
        H-TTSURG:(H-TTMED,
        H-PTPART [* grafting utilizing the mammary artery *]),
        H-PT:(H-TTGEN,H-TTCOMP,H-TTMED,H-INST,H-PT,H-FAMILY [*GRI*],
        H-DIET [* pt should follow a low fat diet *],
        H-DIAG, H-TMLOC [* He gives a past history of MI *],
        H-PTMEAS [* pt is checking her weight *],
        H-PTFUNC [* pt is checking her BP *],
        H-PTPART [* pt is checking her lipids *],
        H-TTSURG [* pt required breast biopsy *],
        H-TXCLIN [* pt met the criteria for ... *],
        H-TXRES [* pt sent tracings/results *],
        H-TXVAR,H-NORMAL,H-INDIC [* pt notices illness *]),
        H-TXVAR [* her creatine kinase came back at 264 *],
        H-TXSPEC:(H-TXRES), [* warnings *]
        H-TXPROC:(H-INDIC,H-PTPART,H-PTAREA [*warnings*],
        H-TTSURG [* incision guided by ultrasonography *]),
        H-FAMILY:(H-TTCOMP,H-TTMED,H-PT)),
        H-TXCLIN:(H-INST:(H-PT [* Dr examined the patient *],
        H-PTFUNC,H-PTPART,H-INDIC),
        H-PT:(H-INDIC [* she palpates lumps *])),
        H-VTEST:(H-TXVAR:(H-AMT,H-TXRES,NUNIT),
        H-DEVMED [* device charged and fired *],
        H-INDIC:(H-EVID,H-TXRES,
        H-AMT [* nodular opacity measuring 1 cm in RLL *]),
        H-INST:(H-PTFUNC [* I measured her peak flow *]),
        H-PT, H-PTFUNC:(NUNIT),
        H-PTPART:(H-ORG [* sputum grew influenza *]),
        H-PTSPEC:(H-TXRES,H-ORG [glcb2]),
        H-TXSPEC:(H-TXRES,NUNIT,H-RESULT [* culture grew flora *],
        H-ORG)).
— V-O-S
— is the reverse of V-S-O list.
— In this way, we capture the verb phrase.
LIST V-O-S =
        BEREP:(FAIL-SEL),
        H-BECONN:(FAIL-SEL),
        VBE:(FAIL-SEL),
        CONJ-LIKE:(FAIL-SEL),
        INSTR:(FAIL-SEL),
        H-CONN:(H-INDIC:(H-TTMED)),
        H-CHANGE:(ANYTHING:(H-RESULT,H-INDIC,H-DIAG,H-PT,H-INST,
        H-PTFUNC,H-PTPART,H-PTAREA,
        H-TTCOMP,H-TTSURG),
        H-CHANGE:(H-TXVAR),
        H-CHANGE-MORE:(H-TXVAR),
        H-CHANGE-LESS:(H-TXVAR),
        H-CHANGE-SAME:(H-TXVAR),
        H-TTMED:(H-INST),
        H-TTMED:(H-TTMED) [7.28.92]),
        H-CHANGE-MORE:(ANYTHING:(H-RESULT,H-INDIC,H-DIAG,H-PT,H-INST,
        H-PTFUNC,H-PTPART,H-PTAREA,
        H-TTCOMP,H-TTSURG),
        H-CHANGE:(H-TXVAR),
        H-CHANGE-MORE:(H-TXVAR),
        H-CHANGE-LESS:(H-TXVAR),
        H-CHANGE-SAME:(H-TXVAR),
        H-TTMED:(H-INST),
        H-TTMED:(H-TTMED) [7.28.92]),
        H-CHANGE-LESS:(ANYTHING:(H-RESULT,H-INDIC,H-DIAG,H-PT,H-INST,
        H-PTFUNC,H-PTPART,H-PTAREA,
        H-TTCOMP,H-TTSURG),
        H-CHANGE:(H-TXVAR),
        H-CHANGE-MORE:(H-TXVAR),
        H-CHANGE-LESS:(H-TXVAR),
        H-CHANGE-SAME:(H-TXVAR),
        H-TTMED:(H-INST),
        H-TTMED:(H-TTMED) [7.28.92]),
        H-CHANGE-SAME:(ANYTHING:(H-RESULT,H-INDIC,H-DIAG,H-PT,H-INST,
        H-PTFUNC,H-PTPART,H-PTAREA,
        H-TTCOMP,H-TTSURG),
        H-CHANGE:(H-TXVAR),
        H-CHANGE-MORE:(H-TXVAR),
        H-CHANGE-LESS:(H-TXVAR),
        H-CHANGE-SAME:(H-TXVAR),
        H-TTMED:(H-INST),
        H-TTMED:(H-TTMED) [7.28.92]),
        H-EVID:(ANYTHING:(H-INDIC,H-NULL),
        H-INDIC:(H-PT,H-INST,H-RECORD),
        H-DIAG:(H-PT,H-INST,H-RECORD),
        H-RESULT:(H-PT,H-INST,H-RECORD),
        H-PTFUNC:(H-PT,H-INST,H-RECORD),
        H-PTMEAS:(H-PT,H-INST,H-RECORD)),
        H-INDIC:(ANYTHING:(H-PT,H-FAMILY,H-PTPART,H-PTAREA,
        H-TRANSP,H-INDIC [glcb2],H-TTCOMP,
        H-DIAG [* disease flares *])),
        H-OBSERVE:(ANYTHING:(H-FAMILY),
        H-INDIC:(H-PT,H-INST),
        H-DIAG:(H-PT,H-INST),
        H-RESULT:(H-PT,H-INST),
        H-RECORD:(H-PT,H-INST),
        H-TMBEG:(H-PT,H-INST),
        H-PTMEAS:(H-PT,H-INST),
        H-PTVERB:(H-PT,H-INST),
        H-PTFUNC:(H-PT,H-INST),
        H-RESP:(H-PT,H-INST),
        H-TXRES:(H-PT,H-INST)[* Pt/We will watch for changes *],
        H-PT:(H-INST)),
        H-PTFUNC:(H-INDIC:(H-PT,H-PTPART,H-PTAREA),
        H-NORMAL:(H-PT,H-PTPART,H-PTAREA),
        H-AMT:(H-PT,H-PTPART,H-PTAREA,H-INDIC,H-NORMAL,H-RESULT),
        NUNIT:(H-PT,H-PTPART,H-PTAREA,H-NORMAL,H-RESULT),
        NULLOBJ:(H-PT,H-PTPART,H-PTAREA,H-INDIC,H-NORMAL,H-RESULT),
        H-DEVMED:(H-PT),
        H-MODAL:(H-PT,H-PTPART,H-INDIC,H-NORMAL,H-RESULT),
        H-EVID:(H-PT,H-PTPART,H-INDIC,H-NORMAL,H-RESULT),
        H-RESULT:(H-PT,H-PTPART,H-PTAREA),
        H-NEG:(H-INDIC),
        H-NULL:(H-PT),
        H-RESP:(H-PT),
        H-CHANGE:(H-PT,H-PTPART,H-INDIC,H-NORMAL,H-RESULT),
        H-CHANGE-MORE:(H-PT,H-PTPART,H-INDIC,H-NORMAL,H-RESULT),
        H-CHANGE-LESS:(H-PT,H-PTPART,H-INDIC,H-NORMAL,H-RESULT),
        H-CHANGE-SAME:(H-PT,H-PTPART,H-INDIC,H-NORMAL,H-RESULT),
        H-PT:(H-PT,H-INDIC),
        H-PTFUNC:(H-PT),
        H-PTPART:(H-PT),
        H-PTMEAS:(H-PT),
        H-TMBEG:(H-PT,H-PTPART,H-INDIC,H-NORMAL,H-RESULT),
        H-TMEND:(H-PT,H-PTPART,H-INDIC,H-NORMAL,H-RESULT),
        H-TMDUR:(H-PT,H-PTPART,H-INDIC,H-RESULT),
        H-TMREP:(H-PT,H-PTPART,H-INDIC,H-RESULT),
        ANYTHING:(H-PTFUNC [970805],
        H-TTCOMP,H-TTMED,H-RESP [970805]),
        H-ORG:(H-TXSPEC [glcb2])),
        H-PTLOC:(H-INDIC:(H-PTPART,H-PTAREA,H-PTFUNC),
        H-PTPART:(H-DIAG,H-INDIC [H-PTPART *4/2/96*]),
        H-PTAREA:(H-DIAG,H-INDIC [H-PTPART,H-PTAREA *4/2/96*]),
        ANYTHING:(H-NULL,H-PTVERB)),
        H-PTVERB:(H-INDIC:(H-PT,H-DIAG [dcardi 941100],H-FAMILY),
        H-DIAG:(H-PT,H-FAMILY),
        H-RESULT:(H-PT,H-FAMILY),
        H-CHANGE:(H-PT,H-FAMILY),
        H-CHANGE-MORE:(H-PT,H-FAMILY),
        H-CHANGE-LESS:(H-PT,H-FAMILY),
        H-CHANGE-SAME:(H-PT,H-FAMILY),
        H-BECONN:(H-PT),
        H-FAMILY:(H-PT),
        H-TMBEG:(H-PT),
        H-TMEND:(H-PT,H-FAMILY),
        H-TMDUR:(H-PT),
        H-TTSURG:(H-PT),
        H-TTMED:(H-PT),
        H-TXRES:(H-PT),
        H-TXPROC:(H-PT),
        H-CHEM:(H-PT),
        ANYTHING:(H-INDIC [* smoker glcb2 *])),
        H-RESP:(NULLOBJ:(H-DESCR,H-TRANSP,H-NULL,
        H-INDIC,H-DIAG,H-RESULT,H-RESP [7.28.92],
        H-PT,H-PTFUNC,H-PTPART,H-PTAREA),
        H-RESP:(H-PT [pt notes improvement]),
        H-TTMED:(H-PT [pt adjusts well to meds]),
        H-TXPROC:(H-PT [pt tolerated the procedure])
        [H-TXVAR:(H-TXVAR),]
        [ANYTHING:(H-TTMED,H-TTCOMP,H-TTSURG),]),
        H-SHOW:(H-INDIC:(H-PT,H-PTFUNC,H-PTPART,H-PTAREA,
        H-TXCLIN,H-TXVAR,H-TXPROC),
        H-DIAG:(H-TXVAR,H-TXPROC,H-TXSPEC [glcb2]),
        H-NORMAL:(H-TXCLIN),
        H-RESULT:(H-TXCLIN,H-PTPART,H-TXVAR),
        H-CHANGE:(H-TXPROC),
        H-CHANGE-MORE:(H-TXPROC),
        H-CHANGE-LESS:(H-TXPROC),
        H-CHANGE-SAME:(H-TXPROC),
        H-PTPART:(H-TXCLIN,H-PTPART,H-PTAREA,H-TXPROC),
        H-PTAREA:(H-TXPROC),
        H-PTFUNC:(H-TXCLIN,H-PTFUNC,H-PTPART,H-PTAREA,H-TXPROC),
        H-PTLOC:(H-TXCLIN),
        H-PTDESCR:(H-TXCLIN),
        H-DESCR:(H-TXPROC),
        H-TTMED:(H-TXCLIN),
        H-ORG:(H-PTSPEC,H-TXVAR),
        H-TXRES:(H-TXRES,H-CHANGE [7/29/97],
        H-CHANGE-MORE,H-CHANGE-LESS,H-CHANGE-SAME,
        H-TXPROC),
        H-TXVAR:(H-TXVAR),
        ANYTHING:(H-RESP [glcb2], H-VTEST [cpri])),
        H-TMDUR:(ANYTHING:(H-DIAG,H-TTMED,H-TTCOMP,H-TXVAR,H-INDIC,
        H-RESULT,H-PT,H-NULL,
        H-TRANSP,H-INST [glcb2 mgh]),
        H-TTMED:(H-INST)),
        H-TTSURG:(H-DEVMED [clips were removed],
        H-INDIC [polyps were removed]),
        H-TTCOMP:(H-DIAG:(H-INST),
        H-INDIC:(H-INST),
        H-DEVMED:(H-PT),
        H-INST:(H-PT),
        H-PT:(H-INST,H-FAMILY [glcb2],H-TTCOMP [970929]),
        H-TTSURG:(H-PT),
        H-TTCOMP:(H-INST,H-PT),
        H-TTGEN:(H-PT),
        H-TTMED:(H-INST,H-PT),
        H-TXCLIN:(H-PT),
        H-TXPROC:(H-PT),
        H-TXVAR:(H-INST),
        ANYTHING:(H-TTMED [970702])),
        H-TTGEN:(H-FAMILY:(H-PT [*GRI*]),
        H-DIAG:(H-TTCOMP [970806]),
        H-INDIC:(H-PT [* pt notices illness *],H-TXPROC [warning]),
        H-NORMAL:(H-PT),
        H-TTCOMP:(H-PT,H-FAMILY),
        H-TTGEN:(H-PT),
        H-TTMED:(H-INST,H-PT,H-TTSURG,H-FAMILY),
        H-INST:(H-PT),
        H-PT:(H-INST,H-NULL [*mgh*],H-FAMILY,
        H-TTGEN [* GRI arrangements to see PT *]),
        H-PTPART:(H-TXPROC [warning]),
        H-PTAREA:(H-TXPROC [warning]),
        H-TXRES:(H-TXSPEC [*warnings*]),
        H-TXVAR:(H-INST [*mgh*],H-PT),
        ANYTHING:(H-INST,H-PTFUNC,H-TTMED [97/07/24])),
        H-TXCLIN:(H-PTFUNC:(H-INST),
        H-INDIC:(H-INST)),
        H-VTEST:(H-AMT:(H-TXVAR),
        H-TXRES:(H-INDIC,H-PTSPEC,H-TXSPEC,H-TXVAR),
        NUNIT:(H-PTFUNC,H-TXSPEC,H-TXVAR),
        ANYTHING:(H-PT),
        H-ORG:(H-PTSPEC [glcb2]),
        H-EVID:(H-INDIC)).
— BE-S-O
—       selection between the subject of BE and the predicate adjective.
—       Used by TSEL-VERB-SUBJ$SEL-ADJ-IN-OBJ.
—       *** Notes:
—       (a) 'N be N' selection is equivalency, and is done using
—       list CONJ-EQUIV-CLASSES;
—       (b) 'N be prep N' selection uses P-NSTGO-HOST LIST.
—       If subject is not on list, selection passes 'benignly', and no
—       SELECT-ATT is computed for subject or object (see rule
—       $ADD-X1-ATT in $CO-OCCUR-CHK).
—       H-SHOW [FAIL-SEL] facilitates handling the case of BESHOW,
—       where missing verb gets the list VBE and H-SHOW (see rule
—       $BE-OR-SHOW IN TSEL-OBJ-VS).
— *** NOTE: this list is largely equivalent to the N-ADJ list. It
— *** is not clear whether these two lists can be collapsed
— *** into a single list.
LIST BE-S-O =
        VBE:(H-PT:(H-PTDESCR, H-NORMAL, H-INDIC), [* pt appeared well *]
        H-PTAREA:(H-NORMAL,H-INDIC,H-DESCR,H-DIAG),
        H-PTMEAS:(QNUMBER,H-RESULT,H-NORMAL,H-INDIC,H-EVID,H-DESCR,
        H-CHANGE,H-CHANGE-MORE,H-CHANGE-LESS,H-CHANGE-SAME,
        H-AMT,NUNIT),
        H-PTFUNC:(H-RESULT,H-NORMAL,H-AMT,NUNIT,H-INDIC,
        H-CHANGE,H-CHANGE-MORE,H-CHANGE-LESS,H-CHANGE-SAME,
        H-EVID,H-RESP,H-DESCR),
        H-PTPART:(H-INDIC,H-NORMAL,H-DESCR, H-DIAG),
        H-DIAG:(H-AMT,H-TXRES,H-DESCR,H-EVID),
        H-PTSPEC:(H-TXRES),
        H-TXCLIN:(H-NORMAL,H-INDIC,H-AMT),
        H-INDIC:(H-DESCR,H-EVID,H-INDIC,
        H-CHANGE,H-CHANGE-MORE,H-CHANGE-LESS,H-CHANGE-SAME),
        H-TXVAR:(QNUMBER,H-RESULT,H-TXRES,
        H-CHANGE,H-CHANGE-MORE,H-CHANGE-LESS,H-CHANGE-SAME,
        H-AMT,H-EVID,NUNIT,H-TMLOC,H-MODAL),
        H-TXSPEC:(QNUMBER,H-RESULT,H-TXRES,H-AMT,H-EVID,
        H-CHANGE,H-CHANGE-MORE,H-CHANGE-LESS,H-CHANGE-SAME,
        NUNIT,H-TMLOC,H-MODAL),
        H-TTGEN:(H-TMDUR,H-TTGEN),
        H-RECORD:(H-NORM,H-INDIC,H-DESCR,H-EVID),
        H-PT:(H-INDIC,H-DIAG,H-NORMAL,H-RESULT,H-PTDESCR,NUNIT,H-AGE,
        H-ETHNIC,H-PTFUNC,H-SHOW),
        H-FAMILY:(H-INDIC,H-DIAG,H-NORMAL,H-RESULT,NUNIT,
        H-AGE,H-PTDESCR),
        H-RESULT:(H-EVID)),
        H-SHOW:(FAIL-SEL).
— END-MAJOR-SELECTION-LISTS
— CONN-ARGS-CLASSES
—       [obsolete]
—       is used in noun+prepositional phrase structure in which
—       P is an H-CONN.
—       Used in WCONJ9-DEFER [TSEL-CONJ-DEFER now obsolete].
LIST CONN-ARGS-CLASSES =
        (H-DIAG, H-PTDESCR, H-INDIC, H-RESULT, H-TXRES,
        [H-ORG, H-STATUS,] H-RESP),
        (H-TXCLIN, H-PTFUNC, H-PTPART),
        (H-TTCOMP, H-TTMED, H-TTSURG, H-TTGEN),
        (H-TTSURG, H-TXPROC).
— END-OF-SELECTION-LISTS USED BY SUBLANGUAGE SELECTION RESTRICTIONS

— TYPE LISTS

TYPE ADJSET = LA, LD, LDATE, LN, LP, LQ, LT, LTIME, LV, LW,
        RA, RD, RDATE, RN, RQ, RT, RV, RW, SA, SA-LAST.
TYPE ADJSET1 = LA, LD, LN, LP, LQ, LT, [LTIME,] LV, LW,
        [ANDSTG, COMMASTG, BUTSTG]
        ADJADJ, NNN, RA, RD, RN, RQ, RT, RV, RW, RWV.
TYPE RNOPTSET = ADJINRN, PDATE, PN, PQUANT, VENPASS, TOVO , TOVO-N,
        PWHS, LDR, [NPWHS,] DS, APPOS, PERUNIT, PDOSE,
        PVINGO, VINGO, WHS-N, WHENS, WHOSES, PAREN-RN, BPART.
TYPE CONJ-NODE = ANDSTG, ANDORSTG, ASWELLASSTG, BUTSTG, COMMASTG,
        INADDITIONTOSTG, INCLUDINGSTG, ORSTG, NORSTG,
        PARTICULARLYSTG, PLUSSTG, WITHSTG, THANSTG,
        [FRENCH] DMQSTG, NISTG, PUISSTG, AINSIQUESTG.
TYPE SP-NODE = ANDSTG, ANDORSTG, ASWELLASSTG, BUTSTG, COMMASTG,
        INADDITIONTOSTG, INCLUDINGSTG, ORSTG, NORSTG, PARTICULARLYSTG,
        PLUSSTG, WITHSTG, THANSTG,
        [FRENCH] DMQSTG, NISTG, PUISSTG, INTSTG, AINSIQUESTG.
TYPE LADJSET = LA, LD, LDATE, LN, LP, LQ, LT, LTIME, LW, LV.
TYPE LXR = LAR, LDATER, LDR, LNR, LQR, LTR, LVR, LVENR, LVINGR,
        VERB, LLEADR [ekg], LWVR [ekg].
TYPE MINLIST = PN, D, SUB1, NSTGT, INT, PDATE, TOVO, PVO.
TYPE N-OBJ-IN-STR = [N OR PN OBJECTS OF TYPE STRING]
        ADJN, DP2, DP3, DP4, DP1PN, DP2PN, DP3PN, DP4PN, NA, NASOBJBE,
        ND, NN, NPDOSE, NPN, NPSNWH, NPSVINGO, NPVINGO, NPVINGSTG,
        NSNWH, NTHATS, PN, PNN, PNSNWH, PNTHATS, PNTHATSVO, PNVINGSTG,
        VINGSTGPN.
TYPE PSTRING = PD, PN, PQUANT.
TYPE RADJSET = RA, RD, RDATE, RN, RNOPTS, RQ, RT, RV, RW, RWV [ekg],
        RWVOPTS [ekg], RLEAD [ekg].
TYPE RECURSIVE = TPOS, ADJADJ, NNN, RN, SA, LDR.
TYPE REPETITIVE = RN, RV.
TYPE STGSEG = ASSERTION, TOVO, VINGO, QN, PVO, SVO.
TYPE STRING =
        ADJINRN, ADJN, APPOS, ASOBJBE, ASSERTION,
        BEINGO, BPART, C1SHOULD, CPDNUMBR,
        DP1, DP2, DP3, DP4, DP1P, DP1PN, DP2PN, DP3PN, DP4PN, DPSN,
        [ETCSTG,] FORTOVO, FORTOVO-N,
        HOWQASTG, HOWQSTG,
        IMPERATIVE,
        LN,
        NA, NASOBJBE, ND, NN, NPN, NPSNWH, NPSVINGO, NPVINGO, NPVINGSTG,
        NQ, NSNWH, NSTGT, NSVINGO, NTHATS,[NTOBE,]NUMBRSTG, NVSA, NTOVO,
        OBES, OBJBESA,
        P1, PA, PD, PDATE, PN, PNN, PNSNWH, PNTHATS, PNTHATSVO, PNVINGSTG,
        PROSENT, PQUANT, PSNWH, PSVINGO, PVINGO, PVINGSTG, PWHERES, PWHNQ,
        PWHNQ-PN, PWHNS, PWHNS-PN, PWHQ, PWHQ-PN, PWHS-PN, PARENSTG,
        Q-ASSERT, Q-CONJ, Q-INVERT, Q-PHRASE, QN, QNS, Q-OF, QPERUNIT,
        PTIME, PAREN-RN [HIV 9/2001],
        S-N, SASOBJBE, SAWHICHSTG, SENTENCE, SOBJBE, SOBJBESA, STOVO-N,
        SUB0, SUB1, SUB2, SUB3, SUB4, SUB5, SUB6, SUB7,
        SVEN, SVINGO, SVO,
        THATS, THATS-N, TOBE, TOVO, TOVO-N, TSUBJVO,
        VENO, VENPASS, VINGO, VINGOFN, VINGSTGPN, VO,
        WHATS-N, WHENS, WHERES, WHETHS, WHETHTOVO, WHEVERS-N, WHNQ-N,
        WHNS-N, WHQ, WHQ-N, WHS-N,
        YESNOQ,
        [*** FRAGMENT GRAMMAR NODES ***]
        ASTGF, ASTGP, NSTGP, [* snopath *]
        BESHOW, FRAGMENT, MEDDOSE, NSTGF, NPDOSE, ONESENT, PDOSE,
        TVO, NPVO, PVO,
        PWHS, SUB8, WHOSES
        [*** FRENCH ***]
        [ENVINGO, FTIME, NPWHS, NVINGO, PNPVO, PNVO, PVO-N, SUB10].
TYPE TRANSMITTING-OBJ-STG =
        ASSERTION, C1SHOULD, DP2, FORTOVO-N, NA, ND, NN, NPN, NPSNWH,
        NPSVINGO, NPVINGO, NPVINGSTG, NTHATS, PN, PNTHATSVO,
        PSVINGO, PVINGO, PVINGSTG, TOVO, SASOBJBE, SOBJBE, SVEN, SVO,
        THATS, VENO, VENPASS, VINGO, WHETHS,
        PVO.
TYPE VERBAL = LVR, LVENR, LVINGR, VERB.
— GRAMMAR SECTION
— Routines are procedures used in restrictions to navigate the
— parse tree, based on Lingustic String Theory. The restrictions
— proper begin with DACONJ13 following the Routines.

— ************************************************** **********
—       *
—       ROUTINES *
—       *
— ************************************************** **********

ROUTINE COEL1-(X) =
        [* GIVEN THAT X AND Y ARE ELEMENTS OF SOME STRING. COEL1- ]
        [* STARTS AT Y AND GOES LEFT OR RIGHT TO X. HOWEVER IF X ]
        [* IS IN A STRING SEGMENT COEL1- WILL NOT GO TO X (COELEMENT ]
        [* ROUTINE DOES IT).IN A SITUATION X1Y1 CONJ X2Y2, COEL1 ]
        [* STARTING AT Y2 WILL GO TO X2. AND IN A SITUATION XY1 CONJ ]
        [* Y2 COEL1- STARTING AT Y2 WILL GO TO X.]
        EITHER $LEFT-OR-RIGHT
        OR ITERATE $TO-PRECONJUNCTION-Y UNTIL $LEFT-OR-RIGHT SUCCEEDS.
   $LEFT-OR-RIGHT =
        EITHER DO L (X) OR DO R (X).
   $TO-PRECONJUNCTION-Y =
        EITHER $PRECONJ OR $ASSIGN-PRECONJELEM. (GLOBAL)
   $PRECONJ =
        THE PRESENT-ELEMENT- HAS NODE ATTRIBUTE PRECONJELEM. (GLOBAL)
   $ASSIGN-PRECONJELEM =
        VERIFY $LOCATE-CONJNODE;
        VERIFY $ASSIGN-PRE-AND-POST [PRE-POST-CONJELEM];
        DO $PRECONJ.
   $LOCATE-CONJNODE =
        ASCEND TO Q-CONJ; GO UP; STORE IN X100.
ROUTINE COEL1(X) =
        [* COEL1(X) IS THE STACKING COUNTERPART OF COEL1-. IN A ]
        [* SITUATION (X1 CONJ X2)Y , STARTING AT Y COEL1 GOES TO ]
        [* X1 AND STACKS X2. IN A SITUATION X1Y1 CONJ X2Y2, COEL1 ]
        [* STARTING AT Y1 WILL GO TO X1 AND WILL NOT STACK X2. IF ]
        [* THE PARSE TREE IS X(Y1 CONJ Y2), STARTING AT EITHER Y1 ]
        [* OR Y2 COEL1 GOES TO X.]
        STORE IN X200;
        EITHER $LEFT-OR-RIGHT
        OR ITERATE $TO-PRECONJUNCTION-Y UNTIL $LEFT-OR-RIGHT SUCCEEDS.
   $LEFT-OR-RIGHT =
        EITHER $LEFT-TO-X OR $RIGHT-TO-X.
   $LEFT-TO-X =
        DO L (X); DO STACK-FOR-LEFT.
   $RIGHT-TO-X =
        DO R (X); DO STACK-FOR-RIGHT.
ROUTINE COELEMENT-(X) =
        [* GIVEN THAT X AND Y ARE ELEMENTS OF SOME STRING COELEMENT- ]
        [* STARTS AT Y AND GOES TO X. IF X IS IN A STRING SEGMENT ]
        [* COELEMENT- WILL GO ONE LEVEL BELOW THE STRING SEGMENT TO ]
        [* FIND X.]
        EITHER DO COEL1-(X) OR $STRING-SEGMENT.
   $STRING-SEGMENT = DO COEL1-(STGSEG); DO ELEMENT-(X).
ROUTINE COELEMENT(X) =
        [* THE STACKING COUNTERPART OF COELEMENT-. IF X IS IN A ]
        [* STRING SEGMENT SEG,COELEMENT WILL FIRST GO TO SEG AND ]
        [* STACK THE CONJUNCTS OF SEG IF THERE ARE ANY. COELEMENT ]
        [* WILL THEN GO TO X ONE LEVEL BELOW SEG. IF X HAS ANY ]
        [* CONJUNCTS THEY WILL BE STACKED. IF X IS NOT IN A STRING ]
        [* SEGMENT THEN COELEMENT IS THE SAME AS COEL1.]
        EITHER DO COEL1(X) OR $STRING-SEGMENT.
   $STRING-SEGMENT = DO COEL1(STGSEG); DO ELEMENT(X).
ROUTINE CORE- =
        [* LOOKS FOR AN ATOMIC NODE OR STRING NODE WHICH IS EITHER ]
        [* THE NODE CURRENTLY BEING 'LOOKED AT' OR ONE THAT LIES ]
        [* BELOW THIS NODE. THE DESCENT DOES NOT PASS THROUGH NODES ]
        [* ON THE LIST ADJSET1.]
        DO $CORE-PATH. (GLOBAL)
   $CORE-PATH =
        ONE OF $AT-ATOM,
   $DESCEND-TO-ATOM,
   $DESCEND-TO-STRING IS TRUE.
   $AT-ATOM = TEST FOR ATOM.
   $DESCEND-TO-ATOM =
        IF PRESENT-ELEMENT- IS APOS OR NPOS
        THEN GO DOWN;
        DESCEND TO ATOM NOT PASSING THROUGH ADJSET1.
   $DESCEND-TO-STRING =
        [* take consideration of N under QN out of core- NVAR:QN *]
        DESCEND TO STRING NOT PASSING THROUGH ADJSET1;
        IF TEST FOR LN
        THEN $RIGHT-TO-CORE.
   $RIGHT-TO-CORE =
        ITERATE GO RIGHT UNTIL TEST FOR CONJ-NODE FAILS;
        DO CORE- .
   $QN-CORE =
        GO DOWN;
        ITERATE GO RIGHT UNTIL TEST FOR N SUCCEEDS.
ROUTINE CORE LOCAL(XX-CORE) =
        [* THE CORE ROUTINE IS THE STACKING COUNTERPART OF CORE-. ]
        [* THE CORE MAY HAVE SEVERAL VALUES BECAUSE OF CONJUNCTION. ]
        [* IF AN ELEMENT X1 OF AN LXR TYPE STRING HAS CONJUNCTS X2, ]
        [* X3, THEN THE CORE OF X2, X3, ETC. IS STACKED.]
        DO $CORE-PATH;
        VERIFY $TO-X-POS-IN-LXR.
   $TO-X-POS-IN-LXR =
        EITHER $ASCNT OR TRUE;
        DO $STACK-CORE-TEST.
   $ASCNT = GO UP;
        TEST FOR AVAR OR NVAR OR QVAR OR VVAR OR LEADVAR
        OR WVVAR OR LEADVAR OR DATEVAR OR LNAMER OR NQ;
        IF PRESENT-ELEMENT- IS LNAMER OR NQ
        THEN IMMEDIATE-NODE OF IMMEDIATE-NODE IS NVAR.
   $STACK-CORE-TEST = IF $POSTCONJ THEN $STACK-CONJUNCTS.
   $POSTCONJ = THE PRESENT-ELEMENT- HAS NODE ATTRIBUTE POSTCONJELEM.
   $STACK-CONJUNCTS = VERIFY ITERATE $STACK-CORES.
   $STACK-CORES = DO $POSTCONJ;
        STORE IN XX-CORE;
        DO $CORE-PATH;
        STACK;
        GO TO XX-CORE.
ROUTINE DOWN1-(X) =
        [* TESTS WHETHER X IS AN ELEMENT WHICH IS ONE LEVEL BELOW THE ]
        [* NODE THE PROGRAM IS CURRENTLY 'LOOKING AT'.]
        GO DOWN;
        ITERATET GO RIGHT UNTIL TEST FOR X SUCCEEDS.
ROUTINE DOWN1(X) =
        [* DOWN1 IS THE STACKING COUNTERPART OF DOWN1-. IF X HAS ]
        [* CONJUNCTS THEY ARE PLACED ON A RE-EXECUTION STACK.]
        DO DOWN1-(X); DO $STACK-TEST.
   $STACK-TEST = IF $POSTCONJ THEN $STACK-CONJUNCTS.
   $STACK-CONJUNCTS = VERIFY ITERATE $STACK-X.
   $STACK-X = DO $POSTCONJ; STACK.
ROUTINE ELEMENT-(X) =
        [* TESTS WHETHER X IS AN ELEMENT ONE LEVEL BELOW THE NODE THE ]
        [* PROGRAM IS CURRENTLY 'LOOKING AT'. IF NOT, AND A STRING ]
        [* SEGMENT IS ONE LEVEL BELOW THE CURRENT NODE THE SEARCH ]
        [* CONTINUES ONE LEVEL BELOW THE STRING SEGMENT NODE.]
        EITHER DO DOWN1-(X) OR $STRING-SEGMENT.
   $STRING-SEGMENT = DO DOWN1-(STGSEG); DO DOWN1-(X).
ROUTINE ELEMENT(X) =
        [* ELEMENT(X) IS THE STACKING COUNTERPART OF ELEMENT-(X). IF ]
        [* ELEMENT X GOES TO X1 AND X1 HAS CONJUNCTS X2,X3,ETC THEN X2, ]
        [* X3, ETC ARE PLACED ON THE RE-EXECUTION STACK.IF X1 IS ]
        [* IN A STRING SEGMENT S AND S HAS CONJUNCTS THEN THEY ]
        [* ARE PLACED IN THE RE-EXECUTION STACK.]
        EITHER DO DOWN1(X) OR $STRING-SEGMENT.
   $STRING-SEGMENT = DO DOWN1(STGSEG); DO DOWN1(X).
ROUTINE FOLLOWING-ELEMENT- =
        [* GOES RIGHT TO THE FIRST NODE WHICH IS NOT SP-NODE.]
        DO $RIGHT-TO-HOST [HOST-ELEMENT].
ROUTINE FOLLOWING-ELEMENT =
        [* FOLLOWING-ELEMENT IS THE STACKING COUNTERPART OF ]
        [* FOLLOWING-ELEMENT-. IT GOES TO THE ]
        [* FOLLOWING-ELEMENT- AND STACKS IT'S CONJUNCTS.]
        STORE IN X200;
        DO $RIGHT-TO-HOST [HOST-ELEMENT];
        DO STACK-FOR-RIGHT.
ROUTINE HOST- =
        [* GOES TO THE CORE OF HOST-ELEMENT ]
        CORE- OF HOST-ELEMENT EXISTS.
ROUTINE HOST =
        EITHER TEST FOR ADJSET OR ASCEND TO ADJSET;
        ONE OF $IN-LADJSET, $IN-RADJSET, $IN-RNSUBJ;
        DO $CORE-PATH .
   $IN-LADJSET =
        DO $AT-LADJ [HOST-ELEMENT];
        DO STACK-FOR-RIGHT.
   $IN-RADJSET =
        DO $AT-RADJ [HOST-ELEMENT];
        DO STACK-FOR-LEFT.
   $IN-RNSUBJ =
        DO $ATRNSUBJ[HOST-ELEMENT];
        DO $STACK-TEST [STARTAT].
ROUTINE HOST-ELEMENT =
        [* STARTS AT OR ASCENDS TO LADJSET OR RADJSET OR RNSUBJ Y. ]
        [* IF Y IS OF TYPE RADJSET OR LADJSET IT GOES TO THE CORE ]
        [* ELEMENT X (TO X IN AN LXR TYPE NODE). IF Y IS RNSUBJ IT ]
        [* ASCENDS TO SA AND THEN GOES TO COELEMENT SUBJECT. ]
        [* ** FRENCH CHANGE IN $AT-RADJ ** *]
        EITHER TEST FOR ADJSET OR ASCEND TO ADJSET PASSING THROUGH ADJINRN;
        ONE OF $AT-LADJ, $AT-RADJ, $ATRNSUBJ IS TRUE.
   $AT-LADJ =
        TEST FOR LADJSET;
        STORE IN X200;
        DO $RIGHT-TO-HOST .
   $RIGHT-TO-HOST =
        EITHER $GO-RIGHT-PAST-C
        OR ITERATE $TO-PRECONJUNCTION-Y [COEL1-]
        UNTIL $GO-RIGHT-PAST-C SUCCEEDS.
   $GO-RIGHT-PAST-C = ITERATE GO RIGHT UNTIL TEST FOR SP-NODE FAILS.
   $AT-RADJ =
        EITHER $IN-RN OR $IN-OTHERS;
        STORE IN X200;
        EITHER $RV-TEST OR $LEFT-TO-HOST.
   $IN-RN =
        TEST FOR RN;
        STORE IN X100;
        GO LEFT;
        IF PRESENT-ELEMENT- IS RNOPTS THEN DO $1;
        GO TO X100.
   $1 = GO UP; DO $IN-RN.
   $IN-OTHERS = TEST FOR RADJSET.
   $RV-TEST =
        TEST FOR RV;
        STORE IN X100;
        ONE OF $L-VVAR, $L-V, $L-VING, $L-VEN.
   $L-VVAR = DO L(VVAR).
   $L-V = DO L(V).
   $L-VING = DO L(VING).
   $L-VEN = DO L(VEN).
   $LEFT-TO-HOST =
        EITHER $LEFT-PAST-C OR ITERATE $TO-PRECONJUNCTION-Y [COEL1]
        UNTIL $LEFT-PAST-C SUCCEEDS.
   $LEFT-PAST-C = ITERATE GO LEFT UNTIL TEST FOR SP-NODE FAILS.
   $ATRNSUBJ =
        BOTH VALUE OF SA IS RNSUBJ
        AND PRESENT-ELEMENT- HAS COELEMENT- SUBJECT OR BESUBJ.
— IMMEDIATE(X) ASCENDS TO X. NODES ON THE STRING LIST ARE NOT
—       PASSED THROUGH.IF THIS ROUTINE STARTS AT Q-CONJ IT WILL GO
—       TO THE HOST NODE(UP TWICE FROM TOP OF Q NEST).

ROUTINE IMMEDIATE (X) =
        DO $UP-THROUGH-Q;
        ASCEND TO X PASSING THROUGH Q-CONJ.
   $UP-THROUGH-Q = ITERATET $GO-UP-TWICE UNTIL
        TEST FOR Q-CONJ FAILS. (GLOBAL)
   $GO-UP-TWICE = GO UP; GO UP.
ROUTINE IMMEDIATE-NODE- = GO UP.
ROUTINE IMMEDIATE-NODE =
        EITHER ITERATE $UP-CONJ [IN LEFT-ADJUNCT ROUTINE] OR TRUE ;
        GO UP.
ROUTINE IMMEDIATE-STRING = ASCEND TO STRING ;
        IF PRESENT-ELEMENT- IS Q-CONJ THEN DO IMMEDIATE-STRING.
ROUTINE INITIALRT =
        [* TESTS THAT THERE IS NO NODE TO THE LEFT OF THE ]
        [* NODE THE PROGRAM IS CURRENTLY 'LOOKING AT'.]
        VERIFY NOT DO PREVIOUS-ELEMENT-.
ROUTINE L (X) = ITERATE GO LEFT UNTIL TEST FOR X SUCCEEDS.
ROUTINE LAST-ELEMENT- =
        [* GOES TO LEVEL BELOW THE NODE THE PROGRAM IS CURRENTLY ]
        [* 'LOOKING AT' AND GOES TO THE RIGHTMOST NODE ON THAT ]
        [* LEVEL. C-NODES ARE IGNORED.]
        GO DOWN;
        EITHER ITERATE GO RIGHT OR TRUE;
        ITERATET GO LEFT UNTIL TEST FOR SP-NODE FAILS.
ROUTINE LAST-ELEMENT =
        [* LAST-ELEMENT IS THE STACKING COUNTERPART OF LAST-ELEMENT-. ]
        [* IT GOES TO THE LAST-ELEMENT- AND STACKS IT'S CONJUNCTS.]
        DO LAST-ELEMENT-;
        DO $STACK-TEST [STARTAT].
ROUTINE LEFT-ADJUNCT =
        EITHER $ASCNT [IN CORE] OR TRUE;
        EITHER $LEFT-TO-LADJ OR $UP-AND-LEFT.
   $LEFT-TO-LADJ =
        DO L (LADJSET); EITHER TEST FOR LN OR DO CORE.
   $UP-AND-LEFT =
        ITERATET $UP-CONJ UNTIL $LEFT-TO-LADJ SUCCEEDS
        [GO UP TO CONJUNCTION AND TRY TO GO LEFT].
   $UP-CONJ =
        IMMEDIATE-NODE- IS Q-CONJ; GO UP [WILL BE AT CONJ-NODE].
ROUTINE LEFT-ADJUNCT-POS =
        [* STARTS AT A CORE NODE Y WHERE Y IS AN ELEMENT OF AN LXR ]
        [* TYPE NODE OR FROM THE CORE ASCENDS TO Y IF Y = AVAR, QVAR ]
        [* OR NVAR. IT THEN GOES LEFT UNTIL IT FINDS A NODE WHICH IS ]
        [* ON THE LADJSET LIST. IF IT FINDS LNAME IN NVAR, IT WILL GO ]
        [* FROM LNAME TO LN.]
        EITHER $ASCNT [CORE] OR TRUE;
        STORE IN X200;
        EITHER DO L(LADJSET) OR ITERATE $TO-PRECONJUNCTION-Y [COEL1-]
        UNTIL DO L(LADJSET) SUCCEEDS.
ROUTINE LOOKAHEAD(X) =
        GO TO THE CURRENT WORD;
        ITERATET GO TO THE NEXT WORD UNTIL DO X SUCCEEDS.
ROUTINE NELEMRT =
        [* CALLED AFTER AN OPERATOR HAS GONE TO THE NTH ELEMENT OF ]
        [* A STRING (IGNORING SPECIAL PROCESS NODES). IT STACKS THE ]
        [* CONJUNCTS OF THAT ELEMENT.]
        DO $STACK-TEST [STARTAT].
ROUTINE NONSEG-IMMSTG =
        DO IMMEDIATE-STRING;
        EITHER $UP-THRU-SEG OR TRUE.
   $UP-THRU-SEG = TEST FOR STGSEG; DO IMMEDIATE-NODE; TEST FOR STRING.
ROUTINE PRESENT-ELEMENT =
        ITERATET $HOST-OF-CONJ UNTIL TEST FOR Q-CONJ FAILS.
   $HOST-OF-CONJ =
        GO UP [TO CONJ-NODE];
        GO UP [TO HOST OF CONJ-NODE].
ROUTINE PRESENT-ELEMENT- = TRUE.
ROUTINE PREVIOUS-ELEMENT- =
        [* PREVIOUS-ELEMENT- SIMPLIFIED THE PREVIOUS-ELEMENT- IN MDPAR6]
        GO LEFT.
ROUTINE R (X) = ITERATE GO RIGHT UNTIL TEST FOR X SUCCEEDS.
ROUTINE RIGHT-ADJUNCT =
        EITHER $ASCNT OR TRUE;
        EITHER $RIGHT-TO-RADJ OR $UP-AND-RIGHT.
   $RIGHT-TO-RADJ=
        DO R(RADJSET); DO CORE.
   $UP-AND-RIGHT =
        ITERATE $UP-CONJ [IN LEFT-ADJUNCT ] UNTIL $RIGHT-TO-RADJ SUCCEEDS.
ROUTINE RIGHT-ADJUNCT-POS =
        EITHER $ASCNT [CORE] OR TRUE;
        STORE IN X200;
        EITHER DO R(RADJSET)
        OR ITERATE $TO-PRECONJUNCTION-Y [ COEL1- ]
        UNTIL DO R(RADJSET) SUCCEEDS;
        IF PRESENT-ELEMENT- IS RNAME
        THEN AT IMMEDIATE NVAR DO RIGHT-ADJUNCT-POS.
ROUTINE STACK-FOR-LEFT =
        [* STACK-FOR-LEFT ROUTINES WHICH GO FROM ONE ELEMENT OF A ]
        [* STRING TO ANOTHER ELEMENT OF THE STRING BY GOING LEFT CALL ]
        [* STACK-FOR-LEFT TO HANDLE STACKING. GIVEN THAT X AND Y ARE ]
        [* ELEMENTS OF A STRING, STACK-FOR-LEFT IS ASSUMED TO START AT ]
        [* X AFTER THE ROUTINE WHICH CALLED IT GOES FROM Y TO X. ]
        [* IN STRUCTURE (X1 CONJ X2) Y, STACK-FOR-LEFT WILL STACK X2. ]
        [* IN STRUCTURE X1 Y1 CONJ X2 Y2, STACK-FOR-LEFT WILL NOT STACK X2.]
        IF $POSTCONJ THEN VERIFY $STACK-IF-NO-Y-RGHT.
   $STACK-IF-NO-Y-RGHT =
        IF $POSTCONJ
        @THEN EITHER ALL OF $NO-Y-TO-RIGHT,
   $DO-STACK,
   $STACK-IF-NO-Y-RGHT
        OR TRUE.
   $NO-Y-TO-RIGHT =
        NOT ITERATE GO RIGHT UNTIL TEST FOR X200 SUCCEEDS.
   $DO-STACK = STACK.
ROUTINE STACK-FOR-RIGHT =
        [* STACK-FOR-RIGHT ROUTINES WHICH GO FROM ONE ELEMENT OF A ]
        [* STRING TO ANOTHER ELEMENT OF THE STRING BY GOING RIGHT ]
        [* CALL STACK-FOR-RIGHT TO HANDLE STACKING. GIVEN THAT X AND ]
        [* Y ARE ELEMENTS OF A STRING, STACK-FOR-RIGHT IS ASSUMED TO ]
        [* START AT Y AFTER THE ROUTINE WHICH CALLED IT GOES FROM X ]
        [* TO Y. IN A SITUATION X1 Y1 CONJ Y2, STACK-FOR-RIGHT ]
        [* STARTING AT Y1 WILL STACK Y2. IN A SITUATION X1 Y1 CONJ X2 ]
        [* Y2, STACK-FOR-RIGHT STARTING AT Y1 WILL NOT STACK Y2.]
        IF $POSTCONJ THEN VERIFY $STACK-IF-NO-Y-LEFT.
   $STACK-IF-NO-Y-LEFT =
        IF $POSTCONJ
        @THEN EITHER ALL OF $NO-Y-TO-LEFT,
   $DO-STACK,
   $STACK-IF-NO-Y-LEFT
        OR TRUE.
   $NO-Y-TO-LEFT =
        NOT ITERATE GO LEFT UNTIL TEST FOR X200 SUCCEEDS.
   $DO-STACK = STACK.
ROUTINE STARTAT (X) = EITHER TEST FOR X OR DO DOWN1-(X).
ROUTINE SUBSUMERT(X) LOCAL(X150) =
        [* SEARCHES FOR A WORD OF GIVEN CLASS (AND SUBCLASS) WHICH ]
        [* IS MATCHED TO ANY ATOMIC NODE ON THE SUBTREE BELOW THE ]
        [* NODE THAT THE PROGRAM IS CURRENTLY 'LOOKING AT', I. E. ]
        [* WHICH IS SUBSUMED BY THE CURRENT NODE.]
        VERIFY $2;
        GO TO THE WORD STARTING THE PRESENT NODE;
        NOT TEST FOR X150;
        ITERATET $1 UNTIL DO X SUCCEEDS.
   $1 = GO TO THE NEXT WORD; NOT TEST FOR X150.
   $2 = GO TO THE WORD FOLLOWING THE PRESENT NODE; STORE IN X150.
— ********** **************************************** **********
—       *
—       EXTENDED SCOPE ROUTINES *
—       *
— ********** **************************************** **********

ROUTINE EXTENDED-CORE- LOCAL(X5) =
        [* goes to the core. If the core is NULLWH, this routine ]
        [* goes up to the RN and from there to the host noun. ]
        [* Simplify the same routine in the MDPAR6]
        DO CORE-;
        IF BOTH PRESENT-ELEMENT- IS NULLWH
        AND $PATH1 [WWH1; X5=WHS-N]
        THEN AT X5 DO HOST-.
   $PATH1 = EITHER NONSEG-IMMSTG X5 IS WHS-N
        OR $NESTED. (GLOBAL)
   $NESTED = NONSEG-IMMSTG IS THATS OR TOVO OR PVO OR ASSERTION
        OR VENO OR VENPASS; DO $PATH1.
ROUTINE EXTENDED-CORE =
        DO CORE;
        IF BOTH PRESENT-ELEMENT- IS NULLWH
        AND PRESENT-ELEMENT- HAS NODE ATTRIBUTE N-OMITSTG
        [GO TO WH-STG] @
        THEN IF PRESENT-ELEMENT- IS WHNS-N OR WHNQ-N
        THEN CORE OF WHN EXISTS
        ELSE IF PRESENT-ELEMENT- IS WHQ-N
        THEN FIRST ELEMENT EXISTS
        ELSE HOST EXISTS
        ELSE IF PRESENT-ELEMENT- IS NULLC
        THEN IF PRESENT-ELEMENT- HAS NODE ATTRIBUTE LINKC @
        THEN EXTENDED-CORE EXISTS.
— ROUTINE NONSEGWH IS A VERSION OF NONSEG-IMMEDSTG USED IN WH
— RESTRICTIONS.

ROUTINE NONSEGWH = ASCEND TO STRING; EITHER $1 OR TRUE .
   $1 = TEST FOR STGSEG;
        GO UP;
        TEST FOR STRING;
        EITHER $1 OR TRUE.
— PRESENT-STRING -SAME AS PRESENT-ELEMENT

ROUTINE PRESENT-STRING = DO $UP-THROUGH-Q [IMMEDIATE(X)] .
— DEEPEST-COVERB
—       STARTS AT ANY ELEMENT EXCEPT THE VERB OF A
—       VERB-CONTAINING STRING (USUALLY AT THE SUBJECT) AND GOES FIRST
—       TO THE VERB IN THE STRING;IF THAT VERB HAS A VERB-CONTAINING
—       OBJECT (OR A PREDICATE CONSISTING OF AN AASP+TOVO) THEN IT
—       GOES TO THE VERB IN THAT OBJECT (OR TOVO), WHERE IT REPEATS
—       THE TEST FOR A VERB-CONTAINING OBJECT. THE ITERATION ENDS ON THE
—       VERB WHICH DOESN'T HAVE A VERB-CONTAINING OBJECT (OR PREDICATE).
—       NOTE RE SN IN $VERBAL: THIS TEST MAKES 'IS' NOT 'SUFFER' THE
—       DEEPEST-COVERB IN 'TO LIVE IS TO SUFFER' AND 'HIS AIM IS NOT TO
—       SUFFER'(1 OF 2 READINGS).
—       USER BEWARE: SHIFT OF SUBJECT-OBJECT RELATION IN THE KERNEL DUE
—       TO PASSIVE MUST BE HANDLED BY THE RESTRICTION USING THE ROUTINE.
ROUTINE DEEPEST-COVERB- LOCAL(X7,XX-COVERB) =
        ITERATE $NEXT-VERB- UNTIL $OBJ-HAS-VERB FAILS.
   $NEXT-VERB- = DO $1; DO $2 . (GLOBAL)
   $1 = THE PRESENT-ELEMENT- HAS COELEMENT- VERB OR LVINGR OR LVENR OR
        LVR OR VERB1 X7 .
   $2 = IF X7 IS VERB1 WHERE VALUE IS NOT LTVR THEN PRESENT-ELEMENT-
        HAS COELEMENT- VERB2 X7 .
   $OBJ-HAS-VERB = BOTH $VERBAL- @ AND PRESENT-STRING HAS ELEMENT-
        OBJECT OR PASSOBJ .
   $VERBAL- =
        IF PRESENT-ELEMENT- HAS COELEMENT- OBJECT OR PASSOBJ@
        THEN EITHER CORE- XX-COVERB IS VO OR VINGO OR TOVO OR TOBE
        OR VENO OR VENPASS OR PVO
        WHERE XX-COVERB IS NOT OCCURRING IN SN,
        OR $ASPECTUAL IS TRUE.
   $ASPECTUAL = BOTH XX-COVERB IS ADJ:AASP
        AND RIGHT-ADJUNCT OF XX-COVERB IS TOVO OR PVO. (GLOBAL)
ROUTINE DEEPEST-COVERB = ITERATE $NEXT-VERB UNTIL $OBJ-HAS-VERB FAILS.
   $NEXT-VERB = DO $1; DO $2. (GLOBAL)
   $1 = PRESENT-ELEMENT- HAS COELEMENT VERB OR LVINGR OR LVENR OR LVR
        OR VERB1 X7.
   $2 = IF X7 IS VERB1 WHERE VALUE IS NOT LTVR
        THEN PRESENT-ELEMENT- HAS COELEMENT VERB2 X7.
   $OBJ-HAS-VERB = BOTH $VERBAL
        @ AND PRESENT-STRING HAS ELEMENT OBJECT OR PASSOBJ.
   $VERBAL =
        IF PRESENT-ELEMENT HAS COELEMENT OBJECT OR PASSOBJ@
        THEN EITHER CORE- XX-COVERB IS VO OR VINGO OR VENO OR TOVO
        OR TOBE OR VENPASS OR PVO
        WHERE XX-COVERB IS NOT OCCURRING IN SN,
        OR $ASPECTUAL [DEEPEST-COVERB-] IS TRUE.
ROUTINE ULTIMATE-HOST = ITERATE $HOSTJUMP UNTIL $PNADJ FAILS.
   $HOSTJUMP = DO HOST; STORE IN X3 .
   $PNADJ = X3 IS OCCURRING IN PN WHERE PN IS OCCURRING AS RN. (GLOBAL)
ROUTINE ULTIMATE-OBJECT =
        EITHER ITERATE $ASCEND OR TEST FOR OBJECT
        OR PASSOBJ; EITHER $ADJUNCT OR TRUE .
   $ASCEND = ASCEND TO OBJECT OR PASSOBJ PASSING THROUGH
        TRANSMITTING-OBJ-STG NOT PASSING THROUGH ADJSET .
   $ADJUNCT = ONE OF $ASP, $SNRA, $SNRN, $SN-IN-RV IS TRUE;
        DO $UPAGAIN.
   $SN-IN-RV = BOTH X6 IS OCCURRING AS SN @ AND SN IS OCCURRING AS
        RV WHERE PREVIOUS-ELEMENT- IS OBJECT OR PASSOBJ X40.
   $ASP= EITHER NONSEGWH X6 IS TOVO WHERE TOVO IS OCCURRING AS RA X40
        OR NONSEGWH X6 IS PVO WHERE PVO IS OCCURRING AS RA X40 .
   $SNRA = X6 IS OCCURRING AS SN X8 WHERE X8 IS OCCURRING AS RA X40.
   $SNRN =
        BOTH X6 IS OCCURRING AS SN X8 WHERE X8 IS OCCURRING AS RN X40
        AND IF X40 IS OCCURRING IN PN @ THEN PN IS OCCURRING AS RN OR
        OBJBE X40.
   $UPAGAIN = GO TO X40; DO ULTIMATE-OBJECT .
ROUTINE ULTIMATE-SUBJECT =
        [* ITERATIVELY ASCENDS TO OBJECT OR PASSOBJ PASSING THROUGH ]
        [* VERB-CONTAINING OBJECT STRINGS UNTIL IT FINDS AN OBJECT ]
        [* THAT HAS A COELEMENT SUBJECT. IT ALSO ASCENDS THROUGH ]
        [* PREDICATE NOUNS AND ADJECTIVES AND THEIR ADJUNCTS AS LONG ]
        [* AS THE ADJUNCTS DO NOT CONTAIN THE NODE SUBJECT. THUS THE ]
        [* ULTIMATE SUBJECT OF X ASCENDS TO THE FIRST NODE SUBJECT ON ]
        [* ANY LEVEL ABOVE X IN THE PARSE TREE. NOTE THAT THE DEEPEST- ]
        [* COVERB DESCENDS MORE NARROWLY, PASSING THROUGH VERB-CONTAINING ]
        [* OBJECT STRINGS AND TOVO AS ADJUNCT OF AASP, BUT NOT THROUGH ]
        [* OTHER PREDICATES OR ADJUNCTS. USE DEEPEST-COVERB (NOT ]
        [* ULTIMATE-SUBJECT) IN SELECTIONAL RESTRICTIONS BECAUSE ]
        [* 'IT' IS THE ULTIMATE SUBJECT OF 'SWIM' IN BOTH ]
        [* 'IT LIKES TO SWIM' AND 'IT IS FUN TO SWIM' ]
        [* USE ULTIMATE SUBJECT FOR 'IT' PERMUTATIONS.]
        ITERATET $UP-TO-OBJ UNTIL $COELSUBJ SUCCEEDS.
   $UP-TO-OBJ =
        EITHER ASCEND TO OBJECT OR PASSOBJ PASSING THROUGH VENO OR
        VENPASS OR TOVO OR PVO OR VO OR Q-CONJ,
        OR ASCEND TO OBJBE PASSING THROUGH VENO OR VENPASS OR TOVO OR
        PVO OR VO OR Q-CONJ.
   $COELSUBJ = PRESENT-ELEMENT HAS COELEMENT SUBJECT OR BESUBJ OR TPOS.
ROUTINE VERB-COELEMENT- = DO $NEXT-VERB- .
   $NEXT-VERB- = DO $1. (GLOBAL)
   $1 = THE PRESENT-ELEMENT- HAS COELEMENT- VERB OR LVINGR OR
        LVENR OR LVR.
ROUTINE VERB-COELEMENT = DO $NEXT-VERB.
   $NEXT-VERB = DO $1. (GLOBAL)
   $1 = THE PRESENT-ELEMENT- HAS COELEMENT VERB OR LVINGR OR
        LVENR OR LVR.
— FIRST-FILLED-ATOM
—       at the present location, look down the substree to find the
—       first atom that is lexically filled.
ROUTINE FIRST-FILLED-ATOM =
        ITERATET $GO-TO-NEXT-NODE
        UNTIL BOTH PRESENT-ELEMENT- IS OF TYPE ATOM
        AND PRESENT-ELEMENT- IS NOT EMPTY SUCCEEDS.
   $GO-TO-NEXT-NODE =
        EITHER GO DOWN
        OR ITERATET GO UP
        UNTIL GO RIGHT SUCCEEDS.
— LAST-FILLED-ATOM
—       at the present location, look down the subtree to find the
—       last atom that is lexically filled.
ROUTINE LAST-FILLED-ATOM =
        ITERATET $GO-TO-NEXT-NODE
        UNTIL BOTH PRESENT-ELEMENT- IS OF TYPE ATOM
        AND PRESENT-ELEMENT- IS NOT EMPTY SUCCEEDS.
   $GO-TO-NEXT-NODE =
        EITHER DO $LAST-NODE
        OR ITERATET GO UP
        UNTIL GO LEFT SUCCEEDS.
   $LAST-NODE =
        GO DOWN;
        EITHER ITERATE GO RIGHT OR TRUE.
— ********** **************************************** **********
—       *
—       CONJUNCTION ROUTINES *
—       *
— ********** **************************************** **********

ROUTINE CO-CONJ(X) LOCAL(X300) =
        STORE IN X200;
        EITHER $COELEMENT OR $STRING-SEGMENT.
   $COELEMENT = DO COEL1-(X); DO $NOT-XY-CONJ-XY.
   $NOT-XY-CONJ-XY =
        ITERATE BOTH PRESENT-STRING- HAS NODE ATTRIBUTE POSTCONJELEM
        @AND NEITHER $Y-TO-RIGHT NOR $Y-TO-LEFT.
   $Y-TO-RIGHT= ITERATE GO RIGHT UNTIL TEST FOR X200 SUCCEEDS.
   $Y-TO-LEFT= ITERATE GO LEFT UNTIL TEST FOR X200 SUCCEEDS.
   $STRING-SEGMENT =
        BOTH $GO-THRU-SEG-TO-X
        @AND EITHER PRESENT-ELEMENT HAS NODE ATTRIBUTE POSTCONJELEM
        OR AT X300 $NOT-XY-CONJ-XY IS TRUE.
   $GO-THRU-SEG-TO-X =
        DO COEL1-(STGSEG);
        STORE IN X300;
        DO ELEMENT-(X).
ROUTINE CONJELEM- LOCAL(X200) =
        [* SIMILAR TO CONJELEM EXCEPT STARTING NODE MUST BE DIRECTLY ]
        [* BELOW Q-CONJ.]
        STORE IN X200;
        ITERATE $UP-2-IF-CONJ UNTIL $FIND-X200 SUCCEEDS.
   $UP-2-IF-CONJ = IMMEDIATE-NODE- IS Q-CONJ; GO UP.
   $FIND-X200 = ITERATE GO LEFT UNTIL TEST FOR X200 SUCCEEDS.
ROUTINE CONJELEM LOCAL(X200,X600) =
        [* CONJELEM: INVERSE OF CORE-CONJUNCT.]
        [* STARTS AT THE CONJUNCT OF X AND GOES TO X. IN A SITUATION ]
        [* X1Y1 CONJ X2Y2, STARTING AT X2 CONJELEM WILL GO TO X1. ]
        [* GIVEN THAT Z2 IS SEVERAL LEVELS BELOW X2,STARTING AT Z2 ]
        [* CONJELEM WILL GO TO Z1,SEVERAL LEVELS BELOW X1. ]
        EITHER $ATQ OR $UPQ;
        DO $TO-PRECONJUNCTION-Y [COEL1-];
        EITHER TEST FOR X600 OR DESCEND TO X600.
   $ATQ =
        TEST FOR Q-CONJ;
        GO DOWN;
        STORE IN X600;
        STORE IN X200.
   $UPQ =
        STORE IN X600;
        STORE IN X200;
        GO UP;
        ITERATET $UPQ1 UNTIL TEST FOR Q-CONJ SUCCEEDS;
        GO TO X200.
   $UPQ1 =
        STORE IN X200;
        NOT TEST FOR STRING;
        GO UP.
ROUTINE CORE-CONJUNCT =
        [* STARTING AT THE GIVEN NODE, CORE-CONJUNCT DESCENDS TO ]
        [* THE CORE AND THEN GOES TO ITS CONJUNCT.]
        DO $CORE-PATH [CORE-];
        EITHER $ASCNT [CORE] OR TRUE;
        DO $POSTCONJ [STARTAT];
        DO $CORE-PATH.
ROUTINE PRE-POST-CONJELEM LOCAL(X100,X500) =
        [* GIVEN THAT STRING Q-CONJ HAS ELEMENTS F1 F2 ... FN ]
        [* WHICH ARE CONJUNCTS OF E1 E2 ... EN, I.E. THE NODES TO ]
        [* THE LEFT OF THE SPECIAL PROCESS NODE ONE LEVEL ABOVE ]
        [* Q-CONJ, THEN TO EACH FI THIS ROUTINE ASSIGNS THE NODE ]
        [* ATTRIBUTE PRECONJELEM WITH VALUE EI AND TO EACH EI ]
        [* THE NODE ATTRIBUTE POSTCONJELEM WITH VALUE FI.]
        STORE IN X100;
        DO ELEMENT- (Q-CONJ); DO LAST-ELEMENT-;
        ITERATE VERIFY $ASSIGN-TEST UNTIL GO LEFT FAILS.
$ASSIGN-TEST =
        EITHER TEST FOR SP-NODE
        OR EITHER $PRECONJ OR
   $ASSIGN-PRE-AND-POST. (GLOBAL)
   $ASSIGN-PRE-AND-POST =
        STORE IN X500; STORE IN X0; GO TO X100;
        ITERATE $GO-LEFT UNTIL TEST FOR X500 SUCCEEDS;
        [* this routine grossly assumes that *]
        [* if X100 has POSTCONJELEMs, then they *]
        [* lie in between X100 and X500 *]
        [* X100 *]
        [* +----- & *]
        [* | *]
        [* +---- Q-CONJ *]
        [* | X500 *]
        [* +---...---+ *]
        [* *]
        EITHER BOTH AT X500, ITERATE GO LEFT
        UNTIL TEST FOR CONJ-NODE SUCCEEDS
        AND AT X100, ITERATE $POSTCONJ
        OR TRUE;
        DO $ASSIGN-POSTCONJELEM; STORE IN X0; GO TO X500;
        DO $ASSIGN-PRECONJELEM. (GLOBAL)
   $GO-LEFT =
        ITERATET $UPCONJ UNTIL GO LEFT SUCCEEDS;
        STORE IN X100.
   $UPCONJ = GO UP; TEST FOR Q-CONJ; GO UP.
   $ASSIGN-POSTCONJELEM =
        ASSIGN THE PRESENT ELEMENT NODE ATTRIBUTE POSTCONJELEM.
   $ASSIGN-PRECONJELEM =
        ASSIGN THE PRESENT ELEMENT NODE ATTRIBUTE PRECONJELEM.
— ********** **************************************** **********
—       *
—       ROUTINES FOR SELECTION *
—       *
— ********** **************************************** **********

ROUTINE COMPLEMENT =
        [* TAKES THE COMPLEMENT OF LIST STORED IN REGISTER X-SUBLIST. ]
        [* THE COMPLETE LIST IS ASSUMED TO BE PRESENT LOCATION. ]
        [* COMPLEMENT CREATES A LIST STORED IN X-COMPLEMENT WHICH ]
        [* CONSISTS OF ALL THOSE ELEMENTS ON CURRENT LIST THAT ARE ]
        [* NOT ON X-SUBLIST. ]
        X-CURRENTLIST:= PRESENT-ELEMENT-;
        X-COMPLEMENT:= NIL;
        ITERATE BOTH X-HEAD2:= HEAD OF X-CURRENTLIST
        AND IF X-SUBLIST DOES NOT HAVE MEMBER X-HEAD2
        THEN $ADD-TO-COMP
        UNTIL X-CURRENTLIST:= SUCCESSORS OF X-CURRENTLIST WHERE
        X-CURRENTLIST IS NIL SUCCEEDS;
        GO TO X-COMPLEMENT.
   $ADD-TO-COMP =
        IF X-ATTL := ATTRIBUTE-LIST OF X-CURRENTLIST
        THEN PREFIX X-HEAD2:X-ATTL TO X-COMPLEMENT
        ELSE PREFIX X-HEAD2 TO X-COMPLEMENT.
ROUTINE CORE-ATT =
        [* RETURNS AN ATTRIBUTE LIST FOR ITS PRESENT LOCATION, ]
        [* LOOKING FOR AN ATTRIBUTE LIST IN THE FOLLOWING ORDER ]
        [* 1. COMPUTED ATTRIBUTE LIST, STORED AS VALUE OF NODE ]
        [* ATTRIBUTE 'COMPUTED-ATT'; ]
        [* 2. SELECTIONAL ATTRIBUTE LIST, STORED AS VALUE OF ]
        [* NODE ATTRIBUTE 'SELECT-ATT'; ]
        [* 3. ATTRIBUTE LIST OF WORD, PRUNED TO CONTAIN ONLY ]
        [* SELECTIONALLY RELEVANT CLASSES, AS DEFINED BY THE ]
        [* LIST SUBLANGUAGE-ATTS (USES INTERSECT, TO OBTAIN ]
        [* INTERSECTION OF SUBLANGUAGE-ATTS AND ATTRIBUTE LIST). ]
        [* 4. IF INTERSECTION IS NIL AND WORD HAS ATTRIBUTE NHUMAN ]
        [* OR NAME, LIST HUMAN-LIST IS RETURNED. ]
        EITHER PRESENT-ELEMENT- HAS NODE ATTRIBUTE COMPUTED-ATT
        OR EITHER PRESENT-ELEMENT- HAS NODE ATTRIBUTE SELECT-ATT
        OR EITHER ATTRIBUTE-LIST X-NEWLIST EXISTS
        WHERE BOTH X-SUBLANGUAGE-ATTS := LIST SUBLANGUAGE-ATTS
        AND INTERSECT OF X-SUBLANGUAGE-ATTS IS NOT NIL
        OR $NHUMAN-CHK.
   $NHUMAN-CHK =
        BOTH PRESENT-ELEMENT- HAS ATTRIBUTE NHUMAN OR NAME
        AND X-INTERSECT := LIST HUMAN-LIST.
ROUTINE CORE-SELATT =
        [* RETURNS AN ATTRIBUTE LIST FOR ITS PRESENT LOCATION, LOOKING ]
        [* FOR AN ATTRIBUTE LIST IN THE FOLLOWING ORDER ]
        [* 1. SELECT ATTRIBUTE LIST, STORE AS VALUE OF NODE ATTRIBUTE ]
        [* 'SELECT-ATT'. ]
        [* 2. ATTRIBUTE LIST OF WORD, PRUNED TO CONTAIN ONLY ]
        [* SELECTIONALLY RELEVANT CLASSES, AS DEFINED BY THE LIST ]
        [* SUBLANGUAGE-ATTS (USES ROUTINE INTERSECT TO OBTAIN) ]
        [* INTERSECTION OF SUBLANGUAGE-ATTS AND ATTRIBUTE LIST. ]
        [* 3. IF WORD HAS NO ATTRIBUTES ON SUBLANGUAGE-ATTS, AND ]
        [* HAS CLASS NHUMAN, THEN LIST HUMAN-LIST IS RETURN AS VALUE ]
        [* OF CORE-SELATT. ]
        EITHER PRESENT-ELEMENT- HAS NODE ATTRIBUTE SELECT-ATT
        OR EITHER ATTRIBUTE-LIST X-NEWLIST EXISTS WHERE
        BOTH X-SUBLANGUAGE-ATTS:= LIST SUBLANGUAGE-ATTS
        AND INTERSECT OF X-SUBLANGUAGE-ATTS IS NOT NIL
        OR $NHUMAN-CHK [CORE-ATT]. (GLOBAL)
— CORE-SUPPORT-ATT
—       This routine works like a selection list.
—       INPUT: Node
—       OUTPUT: support SUBLANGUAGE-ATTS is stored in
—       the Node's SUPPORT-ATT:MAIN-ATT
—       while it is removed from SELECT-ATT.
ROUTINE CORE-SUPPORT-ATT =
        CORE-SELATT X-SELATT OF PRESENT-ELEMENT- X100 EXISTS;
        IF BOTH SUCCESSORS OF X-SELATT IS NOT NIL
        AND X-NEWLIST := LIST SUPPORT-CLASSES-LIST
        THEN IF ALL OF $GET-SUPPORT-ATT, $GET-MAIN-ATT, $BUILD-SUPPORT-ATT
        THEN AT X100,
        BOTH ASSIGN NODE ATTRIBUTE SELECT-ATT WITH VALUE X-SELATT
        AND ASSIGN NODE ATTRIBUTE SUPPORT-ATT WITH VALUE X-SUPATT.
   $GET-SUPPORT-ATT =
        [* check if a class from SELECT-ATT is in the SUPPORT-CLASSES-LIST *]
        INTERSECT X-SUPPORT-ATTS OF X-SELATT IS NOT NIL.
   $GET-MAIN-ATT =
        [* check if a class from SELECT-ATT is the MAIN class *]
        ATTRIBUTE-LIST X-NEWLIST OF X-SUPPORT-ATTS IS NOT NIL;
        INTERSECT X-MAIN-ATTS OF X-SELATT IS NOT NIL.
   $BUILD-SUPPORT-ATT =
        [* taking X-SUPATT out of SELECT-ATT *]
        X-SUBLIST := X-SUPPORT-ATTS;
        X-SELATT := COMPLEMENT OF X-SELATT;
        [* store X-SUPPORT-ATT:X-MAIN-ATT to X-SUPATT *]
        X-SUPATT := NIL;
        X-MAIN-ATT := HEAD OF X-MAIN-ATTS;
        X-SUPPORT-ATT := HEAD OF X-SUPPORT-ATTS;
        PREFIX X-MAIN-ATT:X-SUPPORT-ATT TO X-SUPATT.
ROUTINE INTERSECT =
[* Takes intersection of list in current location with list stored ]
[* in register X-NEWLIST, and creates the list representing the ]
[* intersection (including attribute lists of the intersecting ]
[* elements). the new list representing the intersection is stored ]
[* in register X-INTERSECTION; the routine finishes located at this]
[* list (X-INTERSECTION). ]
[* ** note that it is the list stored in x-newlist whose members ]
[* ** (and possible attribute lists) are copied. ]
[* ]
[*** warning ]
[* if register X-NEWLIST does not point to a list, the routine ]
[* will fail; if the routine does not start at an atom or a list,]
[* the intersection will be empty. ]
        X-CURRENTLIST:= PRESENT-ELEMENT-;
INTERSECT X-NEWLIST WITH X-CURRENTLIST INTO X-INTERSECTION.
ROUTINE RINTERSECT =
        X-CURRENTLIST := PRESENT-ELEMENT-;
        INTERSECT X-NEWLIST WITH X-CURRENTLIST INTO X-INTERSECTION;
        INTERSECT X-CURRENTLIST WITH X-INTERSECTION INTO X-CURRENTLIST;
        GO TO X-INTERSECTION.
ROUTINE UNION =
[* computes the set-theoretic union of two sets;]
[* one set is passed in ]
[* stored in the register X-UNION; ]
[* the routine must begin from the ]
[* second list (set); it checks that ]
[* each element from the current list ]
[* (stored in X-ADD-TO-UNION) is either ]
[* already on list X-UNION or if ]
[* not, it is prefixed to X-UNION. ]
[* the union is returned in register ]
[* X-UNION, which is also where the ]
[* routine leaves you. if the initial ]
[* list is nil (empty), union will ]
[* return whatever list is stored ]
[* in X-UNION. ]
        IF PRESENT-ELEMENT- IS NOT NIL
        THEN $ADD-TO-UNION
        ELSE GO TO X-UNION.
   $ADD-TO-UNION =
        X-ADD-TO-UNION := PRESENT-ELEMENT-;
        ITERATE BOTH X-ADD-EL-TO-UNION := HEAD OF X-ADD-TO-UNION
        AND IF X-UNION DOES NOT HAVE MEMBER X-ADD-EL-TO-UNION
        THEN IF ATTRIBUTE-LIST X-ATTRB-UNION
        OF X-ADD-TO-UNION EXISTS
        THEN PREFIX X-ADD-EL-TO-UNION: X-ATTRB-UNION
        TO X-UNION
        ELSE PREFIX X-ADD-EL-TO-UNION TO X-UNION
        UNTIL SUCCESSORS X-ADD-TO-UNION OF X-ADD-TO-UNION IS NIL SUCCEEDS;
        GO TO X-UNION.
— NEW-HOST
—       FINDS POTENTIAL NEW HOST FOR RIGHT-ADJUNCTS OR SA-
—       1- IF OLD HOST IS IN A NEST OF PN'S, THEN NEW HOST WILL BE THE
—       N IN THE NEXT LEVEL UP, IF THERE IS ONE; OTHERWISE
—       2- IF HOST IS NOT IN A NEST OF PN'S THEN NEW HOST WILL BE
—       THE NEXT LEVEL VERB OF THE IMMEDIATE-STRING.
—       [X-START,X-HOST]

ROUTINE NEW-HOST =
        AT X-START, IT IS NOT THE CASE THAT FOLLOWING-ELEMENT- EXISTS
        WHERE PRESENT-ELEMENT- IS NOT EMPTY;
        NEITHER X-START IS [NOT] OCCURRING IN OBJECT OR OBJBE
        NOR IMMEDIATE-NODE- OF X-START IS SA;
        X-CONJ := X-HOST [old host];
        BOTH X-CONJ := NIL
        [* RA contains PN, PQUANT *]
        [* RN contains ADJINRN, PD, PDATE, PN, PQUANT, PVO, *]
        [* VENPASS, WHENS *]
        [* RV contains PD, PDATE, PN, PQUANT *]
        [* SA contains FTIME, INT, LDR, NSTGT PDATE, PN *]
        AND IF X-START IS ADJINRN OR NSTGT OR PN [OR QN] OR PD OR
        PDATE OR PQUANT OR PVO OR VENPASS
        @THEN DO $UP-TO-RADJ [$NEXT-CORE]
        ELSE NOT TRUE [CANNOT FIND NEW HOST].
   $UP-TO-RADJ =
        AT X-HOST, ITERATE GO UP UNTIL $UP-LIMIT SUCCEEDS.
   $UP-LIMIT =
        [* Limits of search for new RADJSET are: *]
        [* (1) found new RADJSET or SA *]
        [* (2) the immediate node has lexically *]
        [* filled right coelement *]
        [* (3) the immediate node has right SA *]
        BOTH BOTH IMMEDIATE-NODE- IS NOT SA
        AND NOT $RIGHT-NOT-EMPTY
        AND BOTH ITERATET GO UP
        UNTIL BOTH PRESENT-ELEMENT- X-NEWADJ EXISTS
        AND $SEARCH-FOR-RADJ SUCCEEDS
        AND IF X-IMM IS SA
        THEN BOTH X-START IS NOT ADJINRN
        AND CORE- X-HOST OF COELEMENT VERBAL OF X-IMM EXISTS
        ELSE AT X-NEWADJ, HOST- X-HOST EXISTS.
   $SEARCH-FOR-RADJ =
        EITHER IMMEDIATE-NODE- X-IMM IS OF TYPE RADJSET
        OR EITHER X-IMM IS SA
        OR EITHER AT X-IMM DO $RIGHT-NOT-EMPTY
        OR AT X-IMM DO $RIGHT-IS-SA.
   $RIGHT-NOT-EMPTY =
        ITERATE GO RIGHT UNTIL PRESENT-ELEMENT- IS NOT EMPTY SUCCEEDS.
   $RIGHT-IS-SA =
        ITERATE GO RIGHT
        UNTIL BOTH PRESENT-ELEMENT- X-IMM IS SA
        AND VALUE X-NEWADJ OF X-IMM EXISTS SUCCEEDS.
   $NEXT-CORE =
        IF X-HOST IS OCCURRING IN PN OR FTIME OR NSTGT OR PDATE
        @THEN IF BOTH PRESENT-ELEMENT- IS OCCURRING IN SA X-NEWADJ
        AND X-START IS NOT ADJINRN
        THEN AT X-NEWADJ CORE- X-HOST OF COELEMENT VERBAL EXISTS
        ELSE IF PRESENT-ELEMENT- IS OCCURRING IN RADJSET X-NEWADJ
        @THEN HOST- X-HOST EXISTS
        ELSE IF X-START IS NOT ADJINRN
        THEN $NEXT-STRING-V
        ELSE NOT TRUE
        ELSE $NEXT-STRING-V.
   $NEXT-STRING-V =
        IMMEDIATE STRING EXISTS;
        ITERATE GO UP
        UNTIL EITHER CORE X-HOST OF COELEMENT VERBAL IS NOT EMPTY
        OR PRESENT-ELEMENT- IS OF TYPE RADJSET
        WHERE HOST X-HOST IS NOT EMPTY SUCCEEDS.
T-WRITE7 = IN SENTENCE:
        [WRITE ON TAPE7;]
        WRITE ON INFO '********************';
        WRITE ON INFO '********************';
        WRITE ON INFO END OF LINE;
        WRITE ON INFO '********************';
        WRITE ON INFO '********************';
        WRITE ON INFO END OF LINE;
        WRITE ON INFO '*SID=';
        WRITE ON INFO IDENTIFICATION;
        WRITE ON INFO END OF LINE;
        WRITE ON INFO SENTEXT [SOURCE];
        WRITE ON INFO END OF LINE;
        WRITE ON DIAG '********************';
        WRITE ON DIAG '********************';
        WRITE ON DIAG END OF LINE;
        WRITE ON DIAG '********************';
        WRITE ON DIAG '********************';
        WRITE ON DIAG END OF LINE;
        WRITE ON DIAG '*SID=';
        WRITE ON DIAG IDENTIFICATION;
        WRITE ON DIAG END OF LINE;
        WRITE ON DIAG SENTEXT [SOURCE];
        WRITE ON INFO END OF LINE.
   $RARE = THE RARE SWITCH IS ON.
— T-WORD-POS
—       assigns word position.
T-WORD-POS = IN SENTENCE:
        BOTH X-WORD-POS := LIST WORD-POS-LIST
        AND ITERATE BOTH $PROCESS-NODE AND $GO-TO-NEXT-NODE.
   $PROCESS-NODE =
        IF EITHER BOTH PRESENT-ELEMENT- X-PRE IS OF TYPE ATOM
        AND PRESENT-ELEMENT- IS NOT EMPTY
        OR PRESENT-ELEMENT- IS ':' OR '-' OR '--'
        THEN ALL OF $ASSIGN-WORD-POS, $ASSIGN-SUPPORT-ATT;
        IF BOTH BOTH X-PRE IS PRO
        AND BOTH X-PRE IS NOT PRO:PROSELF
        AND X-PRE DOES NOT HAVE NODE ATTRIBUTE PLACE-HOLDER
        AND EITHER CORE-ATT X-SAVE-ATT OF X-PRE HAS MEMBER H-NULL
        OR X-SAVE-ATT IS NIL
        THEN DO $ASSIGN-HCLASSES.
   $ASSIGN-SUPPORT-ATT =
        AT X-PRE, EITHER DO CORE-SUPPORT-ATT OR TRUE.
   $ASSIGN-WORD-POS =
        X-WORD := HEAD OF X-WORD-POS;
        X-WORD-POS := SUCCESSORS OF X-WORD-POS;
        AT X-PRE, ASSIGN NODE ATTRIBUTE WORD-POS WITH VALUE X-WORD.
   $GO-TO-NEXT-NODE =
        EITHER GO DOWN
        OR ITERATET GO UP UNTIL GO RIGHT SUCCEEDS.
   $ASSIGN-HCLASSES =
        X-SUBLANG-ATT := LIST SUBLANGUAGE-ATTS;
        X-SUBLIST := LIST NON-PRONOUN-CLASSES;
        X-SUBLANG-ATT := COMPLEMENT OF X-SUBLANG-ATT;
        IF X-SAVE-ATT IS NIL
        THEN BOTH X-NULL := SYMBOL H-NULL
        AND PREFIX X-NULL TO X-SAVE-ATT;
        IF X-PRE IS PRO:NHUMAN
        THEN X-PRO-ATT := LIST HUMAN-LIST
        ELSE BOTH X-SUBLIST := LIST HUMAN-LIST
        AND X-PRO-ATT := COMPLEMENT OF X-SUBLANG-ATT;
        AT X-PRE, ASSIGN NODE ATTRIBUTE SAVE-SELECT-ATT WITH
        VALUE X-SAVE-ATT;
        AT X-PRE, ASSIGN NODE ATTRIBUTE SELECT-ATT WITH VALUE X-PRO-ATT.
— TREE-ADJUSTMENTS SECTION
—       adjusts parse trees to standard LXR MLP parse trees.
— T-WHOSEG
—       transforms WHOSEG to ASSERTION
—       with WHO replaced by SUBJECT of previous ASSERTION
T-WHOSEG = IN CENTER:
        AT VALUE [FRAGMENT OR ASSERTION]
        IF BOTH BOTH ITERATET IF ELEMENT- WHOSEG X-WHO EXISTS
        THEN STORE IN X-POST
        UNTIL PRESENT-ELEMENT- HAS NODE ATTRIBUTE
        POSTCONJELEM FAILS
        AND AT X-POST
        ITERATET IF CORE- OF VALUE OF ELEMENT- SUBJECT
        X-SUBJ IS NHUMAN
        THEN STORE IN X-PRE
        UNTIL PRESENT-ELEMENT- HAS NODE ATTRIBUTE
        PRECONJELEM FAILS
        AND X-SUBJ EXISTS
        THEN ALL OF $SAVE-CONJELEMS, $MOVE-SUBJECT.
   $SAVE-CONJELEMS =
        X-POST HAS NODE ATTRIBUTE PRECONJELEM X-PRE.
   $MOVE-SUBJECT =
        REPLACE VALUE OF X-WHO BY X-SUBJ;
        AT X-POST
        BOTH IF ELEMENT- SA-LAST X-SAORG IS NOT EMPTY
        THEN IF ELEMENT- SA-LAST X-SALAST OF X-WHO IS EMPTY
        THEN REPLACE X-SALAST BY X-SAORG
        ELSE AFTER LAST-ELEMENT- OF X-SALAST
        INSERT ALL ELEMENTS OF SA-LAST
        AND REPLACE PRESENT-ELEMENT- BY
        <ASSERTION> X-ASSN (FIRST SA OF X-POST
        +ALL ELEMENTS OF X-WHO);
        AT X-ASSN, ASSIGN NODE ATTRIBUTE PRECONJELEM WITH VALUE X-PRE;
        AT X-PRE, ASSIGN NODE ATTRIBUTE POSTCONJELEM WITH VALUE X-ASSN.
— T-SEGADJ
—       transforms SEGADJ to FRAGMENT
T-SEGADJ = IN CENTER:
        IF BOTH EITHER VALUE X-SEG IS SEGADJ
        OR VALUE OF PRESENT-ELEMENT- HAS NODE ATTRIBUTE
        POSTCONJELEM WHERE PRESENT-ELEMENT- X-SEG IS SEGADJ
        AND BOTH AT X-SEG DO R(CONJ-NODE) WHERE STORE IN X-CONJ
        AND X-SEG HAS NODE ATTRIBUTE POSTCONJELEM X-ASSN
        THEN DO $MOVE-SEGADJ.
   $MOVE-SEGADJ =
        IF X-SEG HAS NODE ATTRIBUTE PRECONJELEM X-C1
        THEN BOTH AT X-C1, ASSIGN NODE ATTRIBUTE POSTCONJELEM WITH
        VALUE X-ASSN
        AND AT X-ASSN, ASSIGN NODE ATTRIBUTE PRECONJELEM
        WITH VALUE X-C1;
        AFTER X-CONJ INSERT X-ASSN, X-CTR;
        REPLACE ELEMENT- Q-CONJ OF X-CONJ BY <NULL>;
        REPLACE VALUE OF X-CTR BY
        <SA> (<SAOPTS> (ALL ELEMENTS OF X-SEG)
        +VALUE OF X-CTR)
        +X-CONJ, X-PUNCT;
        BOTH DELETE X-SEG
        AND DELETE X-CONJ.
— T-PAD-INTRO
—       4.1994 turns ++":"
—       into +":" structure.
—       in current epar8* BNF.
—       INT-PHRASE: note, allergies, adj and nstg.
T-PAD-INTRO = IN CENTER:
        IF COELEMENT- INTRODUCER X-PRE IS NOT EMPTY
        THEN IF BOTH X-PRE HAS ELEMENT- LN X-LN
        AND X-PRE HAS ELEMENT N X-N
        THEN BOTH REPLACE X-PRE BY
        <INTRODUCER> (<LNR> X-LNR (X-LN
        +<NVAR> (X-N)
        +<RN> (<NULL>))
        +':')
        AND TRANSFORM X-LNR
        ELSE IF X-PRE HAS ELEMENT- INT-PHRASE X-INT
        THEN ONE OF $LAR, $LDATER, $NSTG, $ALLERGIES,
   $NOUN, $OTHERS.
   $LAR =
        VALUE OF X-INT IS ADJ X-N;
        BOTH REPLACE X-PRE BY
        <INTRODUCER> (<LAR> X-LNR (<LA> (<NULL>)
        +<AVAR> (X-N)
        +<RA> (<NULL>))
        +':')
        AND TRANSFORM X-LNR.
   $LDATER =
        VALUE OF X-INT IS DT X-N;
        REPLACE X-PRE BY
        <INTRODUCER> (<LDATER> X-LNR (<LDATE> (<NULL>)
        +<DATEVAR> (X-N)
        +<RDATE> (<NULL>))
        +':');
        X-INS := SYMBOL TIME-PHRASE;
        X-TIME := NIL;
        PREFIX X-INS TO X-TIME;
        AT X-LNR, ASSIGN NODE ATTRIBUTE PHRASE-ATT WITH VALUE X-TIME;
        TRANSFORM X-LNR.
   $NSTG =
        VALUE OF X-INT IS NSTG X-NSTG;
        IF EITHER VALUE OF X-NSTG IS N X-N
        OR VALUE X-LNR IS LNR WHERE CORE- IS N X-N
        THEN REPLACE X-PRE BY
        <INTRODUCER>
        (<LNR> X-LNR (<LN> (<NULL>)
        +<NVAR> (X-N)
        +<RN> (<NULL>))
        +':')
        ELSE REPLACE X-INT BY ALL ELEMENTS OF X-INT;
        TRANSFORM X-LNR.
   $ALLERGIES =
        VALUE OF X-INT IS 'ALLERGIES' OR 'allergies' X-N;
        BOTH REPLACE X-PRE BY
        <INTRODUCER>
        (<LNR> X-LNR (<LN> (<NULL>)
        +<NVAR> (X-N)
        +<RN> (<NULL>))
        +':')
        AND TRANSFORM X-LNR.
   $NOUN =
        IF VALUE OF X-INT IS N X-N
        THEN REPLACE X-INT BY
        <LNR> X-LNR (<LN> (<NULL>)
        +<NVAR> (X-N)
        +<RN> (<NULL>));
        TRANSFORM X-LNR.
   $OTHERS =
        REPLACE X-INT BY <NSTG> (ALL ELEMENTS OF X-INT).
— T-INTRO-FRAG
—       turns INTRODUCER:NSTG + FRAGMENT:ASTGF/NSTGF into
—       BESHOW:BESUBJ OBJBE
T-INTRO-FRAG = IN CENTER:
        IF BOTH COELEMENT- INTRODUCER X-INT IS NOT EMPTY
        WHERE BOTH VALUE IS NSTG X-SUBJ
        AND CORE-ATT OF CORE- OF VALUE HAS MEMBER H-PTPART
        AND BOTH VALUE IS FRAGMENT X-FRAGMENT
        AND EITHER ELEMENT- ASTGF X-XSTGF OF X-FRAGMENT EXISTS
        OR ELEMENT- NSTGF X-XSTGF OF X-FRAGMENT EXISTS
        THEN DO $CONVERT-TO-BESHOW.
   $CONVERT-TO-BESHOW =
        BEFORE X-XSTGF INSERT
        <BESHOW> (<PROC> (<NULL>)
        +<BESUBJ> (X-SUBJ, X-NEWSUBJ)
        +SECOND ELEMENT OF X-INT
        +<OBJBE> (ALL ELEMENTS OF X-XSTGF)
        +<SA-LAST> (<NULL>));
        REPLACE X-INT BY <INTRODUCER> (<NULL>);
        DELETE X-XSTGF.
— T-ADD-ENDMARK
—       add a check endmark to a recovery tree
—       (result of partial recovery measure in parsing)
T-ADD-ENDMARK = IN TEXTLET:
        IF ELEMENT- ONESENT DOES NOT HAVE ELEMENT- ENDMARK
        THEN AFTER LAST-ELEMENT- OF ELEMENT- ONESENT
        INSERT <ENDMARK> ('#').
— T-ASSIGN-SOURCE-PHRASE
—       assigns SOURCE-PHRASE to SUB1 with SUBJECT NHUMAN or H-INST
—       and VERB is VSENT3 with empty OBJECT.
—       Ex: No evidence of a tendon injury as she thought.
T-ASSIGN-SOURCE-PHRASE = IN SUB1:
        IF BOTH IMMEDIATE SA OF PRESENT-ELEMENT- X-SUB1 EXISTS
        WHERE IMMEDIATE-NODE- IS ASSERTION OR FRAGMENT X-ASSN
        AND ALL OF $NHUMAN-SUBJECT, $VSENT3-SUB1VERB, $EMPTY-OBJECT
        THEN BOTH AT X-ASSN, ASSIGN NODE ATTRIBUTE SOURCE-ATT WITH VALUE X-SUB1
        AND $ASSIGN-SOURCE-PHRASE.
   $NHUMAN-SUBJECT =
        ELEMENT- SUBJECT X-SUBJECT OF ELEMENT- ASSERTION OF X-SUB1 EXISTS
        WHERE CORE- IS NHUMAN OR H-INST.
   $VSENT3-SUB1VERB =
        ELEMENT- VERBAL OF ELEMENT- ASSERTION OF X-SUB1 EXISTS
        WHERE CORE- IS VSENT3.
   $EMPTY-OBJECT =
        ELEMENT- OBJECT OF ELEMENT- ASSERTION OF X-SUB1 EXISTS
        WHERE CORE- IS NULLOBJ.
   $ASSIGN-SOURCE-PHRASE =
        X-SOURCE := NIL;
        X-PHRASE := SYMBOL SOURCE-PHRASE;
        PREFIX X-PHRASE TO X-SOURCE;
        AT X-SUB1, ASSIGN NODE ATTRIBUTE PHRASE-ATT WITH VALUE X-SOURCE;
        AT X-SUBJECT, ASSIGN NODE ATTRIBUTE PHRASE-ATT WITH VALUE X-SOURCE.
— T-MODAL-TO-VERB
—       adjusts parsing.
—       E.g. He did extremely well postoperatively.
T-MODAL-TO-VERB = IN ASSERTION:
        AT PRESENT-ELEMENT- X-PRE
        IF BOTH ELEMENT- TENSE X-TENSE IS NOT EMPTY
        AND ELEMENT- VERB X-VERB IS EMPTY
        THEN BOTH ALL OF $BUILD-VERB, $MOVE-ADJUNCTS, $RESTORE-ATTS
        AND TRANSFORM X-PRE.
   $BUILD-VERB =
        REPLACE X-VERB BY
        <VERB> (<LV> X-LV (<NULL>)
        +<VVAR> (CLASS V OF CORE- OF X-TENSE)
        +<RV> X-RV (<NULL>)).
   $MOVE-ADJUNCTS =
        IF RW X-RW OF X-TENSE IS NOT EMPTY
        THEN BOTH REPLACE X-RV BY <RV> (ALL ELEMENTS OF X-RW)
        AND REPLACE X-RW BY <RW> (<NULL>)
        [IF LW X-LW OF X-TENSE IS NOT EMPTY]
        [THEN REPLACE X-LV BY <LV> (ALL ELEMENTS OF X-LW)].
   $RESTORE-ATTS =
        CORE- OF X-TENSE HAS NODE ATTRIBUTE WORD-POS X-WPOS;
        CORE- OF X-TENSE HAS NODE ATTRIBUTE SELECT-ATT X-SELATT;
        AT CORE- OF ELEMENT- VERB OF X-PRE,
        BOTH ASSIGN NODE ATTRIBUTE WORD-POS WITH VALUE X-WPOS
        AND ASSIGN NODE ATTRIBUTE SELECT-ATT WITH VALUE X-SELATT.
— T-MOVE-SOURCE-PHRASE
—       moves ASSERTION SOURCE-PHRASE down to first SA of
—       its main phrase, e.g.
—       The patient said she's doing better
—       The family has found that patient is withdrawn
—       Family says patient is withdrawn...
—       And when the logical subject is understood, such as
—       The patient was noted to have a carotid bruit
T-MOVE-SOURCE-PHRASE = IN ASSERTION, Q-CONJ:
        EITHER ONE OF $INFO-SOURCE-PRESENT, $INFO-SOURCE-UNDERSTOOD
        OR TRUE.
   $INFO-SOURCE-UNDERSTOOD =
        IF ALL OF $VERB-VBE, $OBJBE-VENPASS, $PASSOBJ-TOVO, $SUBJ-PT,
        THEN $MAKE-INFOSOURCE.
   $VERB-VBE =
        PRESENT-ELEMENT- X-PRE HAS ELEMENT- VERB X-VERB
        WHERE CORE- IS VBE.
   $OBJBE-VENPASS =
        X-PRE HAS ELEMENT- OBJECT;
        PRESENT-ELEMENT- HAS VALUE OBJECTBE
        WHERE VALUE IS VENPASS X-VENPASS;
        CORE- OF ELEMENT- LVENR IS [VSENT3] H-OBSERVE.
   $PASSOBJ-TOVO =
        X-VENPASS HAS ELEMENT- PASSOBJ
        WHERE VALUE IS TOVO;
        ELEMENT- VO X-VO EXISTS.
   $SUBJ-PT =
        BOTH X-PRE HAS ELEMENT- SUBJECT X-SUBJ
        AND CORE- OF X-SUBJ IS H-PT.
   $MAKE-INFOSOURCE =
        AFTER X-PRE INSERT X-VO, X-NEWVO;
        DELETE X-VO;
        AFTER LAST-ELEMENT- OF ELEMENT- SA OF X-PRE INSERT X-PRE, X-INFO;
        AT VALUE OF X-INFO,
        ITERATE
        BOTH IF PRESENT-ELEMENT- IS SA OR SUBJECT
        THEN REPLACE VALUE BY <NULL>
        AND GO RIGHT
        UNTIL PRESENT-ELEMENT- IS VERB SUCCEEDS;
        REPLACE X-VERB
        BY <VERB> X-NEWVERB
        (ALL ELEMENTS OF ELEMENT- LVR OF X-NEWVO);
        REPLACE ELEMENT- OBJECT OF X-PRE
        BY ELEMENT- OBJECT OF X-NEWVO;
        DELETE X-NEWVO;
        AT X-NEWVERB, ELEMENT- LV X-LV EXISTS;
        AT X-INFO,
        ITERATE BOTH IF PRESENT-ELEMENT- X-ATOM IS OF TYPE ATOM
        THEN AFTER LAST-ELEMENT- OF X-LV INSERT X-ATOM
        AND EITHER GO DOWN
        OR ITERATET GO UP
        WHERE PRESENT-ELEMENT- IS NOT IDENTICAL TO X-INFO
        UNTIL GO RIGHT SUCCEEDS;
        DELETE X-INFO;
        X-SOURCE-PHRASE := SYMBOL SOURCE-PHRASE;
        X-SOURCE := NIL;
        PREFIX X-SOURCE-PHRASE TO X-SOURCE;
        AT X-LV, ASSIGN NODE ATTRIBUTE PHRASE-ATT WITH VALUE X-SOURCE.
   $INFO-SOURCE-PRESENT =
        IF BOTH PRESENT-ELEMENT- X-PRE HAS ELEMENT- SUBJECT X-SUBJ
        AND BOTH EITHER X-SUBJ HAS NODE ATTRIBUTE POSTCONJELEM
        OR TRUE
        AND X-SUBJ HAS NODE ATTRIBUTE PHRASE-ATT
        WHERE PRESENT-ELEMENT- HAS MEMBER SOURCE-PHRASE
        THEN AT X-SUBJ
        EITHER ITERATE PRESENT-ELEMENT- HAS NODE ATTRIBUTE POSTCONJELEM
        OR TRUE [* go to the last conjunct *];
        ITERATE IF IMMEDIATE-NODE- X-PRE IS ASSERTION OR Q-CONJ
        THEN AT PRESENT-ELEMENT- X-SUBJ DO $BUILD-INFOSOURCE
        [* and build INFO-SOURCE backward to the top conjunct *]
        UNTIL X-SUBJ HAS NODE ATTRIBUTE PRECONJELEM FAILS.
   $BUILD-INFOSOURCE =
        IF BOTH X-PRE HAS ELEMENT- SUBJECT X-SUBJ
        AND EITHER X-SUBJ HAS NODE ATTRIBUTE PHRASE-ATT X-SOURCE
        WHERE PRESENT-ELEMENT- HAS MEMBER SOURCE-PHRASE
        OR BOTH VALUE OF X-SUBJ HAS NODE ATTRIBUTE LINKC X-LINKC
        AND X-LINKC HAS NODE ATTRIBUTE PHRASE-ATT X-SOURCE
        WHERE PRESENT-ELEMENT- HAS MEMBER SOURCE-PHRASE
        THEN IF AT X-PRE, DO $LOOK-FOR-MAIN-PHRASE
        THEN ALL OF $MOVE-SOURCE-PHRASE, $TRANSFORM-ASSN
        ELSE IF DO $INDIC-N
        THEN ALL OF $MAKE-FRAGMENT, $MOVE-SOURCE, $TRANSFORM-ASSN
        ELSE TRUE.
   $INDIC-N = [Patient noticed some swelling]
        [BOTH IF X-PRE IS Q-CONJ X-QCONJ]
        [ THEN REPLACE X-QCONJ]
        [ BY X-QCONJ (<ASSERTION> X-PRE (ALL ELEMENTS OF X-QCONJ))]
        [AND]AT ELEMENT- OBJECT X1 DO DEEPEST-COVERB-;
        [AT X1 DO DEEPEST-COVERB-;]
        STORE IN X-COVERB;
        AT COELEMENT- OBJECT
        EITHER VALUE IS NSTGO X-OBJ
        OR VALUE IS PN WHERE ELEMENT- NSTGO X-OBJ EXISTS;
        CORE-ATT OF CORE- OF X-OBJ HAS MEMBER H-INDIC;
        CORE- OF X-COVERB IS H-OBSERVE OR VSENT3.
   $MAKE-FRAGMENT =
        [X-OBJ IS NSTGO;]
        AFTER X-PRE INSERT
        <FRAGMENT> X-ASSERT (<SA> X-SA (<NULL>)
        +X-OBJ
        +<SA> (ALL ELEMENTS OF SA-LAST OF X-PRE));
        IF ELEMENT- RV X-SAPRE OF X-PRE IS NOT EMPTY
        THEN REPLACE X-SA BY <SA> (ALL ELEMENTS OF X-SAPRE).
   $LOOK-FOR-MAIN-PHRASE =
        [BOTH IF X-PRE IS Q-CONJ X-QCONJ]
        [ THEN REPLACE X-QCONJ]
        [ BY X-QCONJ (<ASSERTION> X-PRE (ALL ELEMENTS OF X-QCONJ))]
        [AND]AT ELEMENT- OBJECT X1 DO DEEPEST-COVERB-;
        EITHER
        AT COELEMENT- OBJECT
        EITHER EITHER VALUE XVAL IS NTOVO OR ASSERTION X-OBJ
        OR XVAL IS THATS OR C1SHOULD OR WHETHS
        WHERE ELEMENT- ASSERTION X-OBJ EXISTS
        OR XVAL IS OBJECTBE
        WHERE BOTH VALUE IS VENPASS @
        AND CORE OF ELEMENT- PASSOBJ IS THATS OR ASSERTION X-OBJ
        OR BOTH $GOTO-LASTSA
        AND BOTH VALUE OF X-SA IS SUB1 X-SUB1
        AND ELEMENT- ASSERTION X-OBJ OF X-SUB1 EXISTS;
        [* Test whether this is the right node *]
        X-OBJ HAS NODE ATTRIBUTE SOURCE-ATT X-SOURCE-PHRASE;
        X-SOURCE-PHRASE IS IDENTICAL TO X-SUBJ.
   $GOTO-LASTSA =
        EITHER ITERATE GO RIGHT OR TRUE;
        IF PRESENT-ELEMENT- IS OF TYPE CONJ-NODE
        THEN EITHER ITERATE GO LEFT
        UNTIL PRESENT-ELEMENT- IS SA OR SA-LAST SUCCEEDS
        OR TRUE;
        PRESENT-ELEMENT- IS SA OR SA-LAST X-SA.
   $MOVE-SOURCE-PHRASE =
        BOTH ONE OF $THATS, $NTOVO, $ASSERTION
        AND $MOVE-SOURCE.
   $ASSERTION =
        BOTH X-OBJ IS ASSERTION
        AND IF X-PRE IS Q-CONJ
        THEN AFTER X-PRE INSERT <Q-CONJ> (X-OBJ, X-ASSERT)
        ELSE AFTER X-PRE INSERT X-OBJ, X-ASSERT.
   $THATS =
        X-OBJ IS THATS OR C1SHOULD OR WHETHS X-SHOULD;
        ELEMENT- ASSERTION X-OBJ EXISTS;
        IF X-SHOULD IS C1SHOULD OR WHETHS
        THEN BOTH IF ELEMENT- TENSE X-TENSE OF X-OBJ IS EMPTY
        THEN REPLACE X-TENSE
        BY <TENSE> X-TENSE (<LW> (<NULL>)
        +<W> = '[SHOULD]':(H-MODAL)
        +<RW> (<NULL>))
        AND AT CORE- X-IF OF X-TENSE DO $ASSIGN-MODAL
        ELSE IF ELEMENT- TENSE OF X-PRE IS NOT EMPTY
        THEN IF ELEMENT- TENSE X-TENSE OF X-OBJ IS EMPTY
        THEN REPLACE X-TENSE BY ELEMENT- TENSE OF X-PRE
        ELSE BEFORE VALUE OF ELEMENT- LW OF X-TENSE
        INSERT ELEMENT- TENSE OF X-PRE;
        IF X-SHOULD IS WHETHS
        THEN REPLACE X-IF BY VALUE OF X-SHOULD;
        IF X-PRE IS Q-CONJ
        THEN AFTER X-PRE INSERT <Q-CONJ> (X-OBJ, X-ASSERT)
        ELSE AFTER X-PRE INSERT X-OBJ, X-ASSERT.
   $ASSIGN-MODAL =
        X-MOD := SYMBOL H-MODAL;
        X-MODAL := NIL; PREFIX X-MOD TO X-MODAL;
        AT X-IF ASSIGN NODE ATTRIBUTE SELECT-ATT WITH VALUE X-MODAL.
   $NTOVO =
        X-OBJ IS NTOVO;
        ELEMENT- VO X-VO OF ELEMENT- TOVO X-TOVO OF X-OBJ EXISTS;
        AFTER X-PRE INSERT
        <ASSERTION> X-ASSERT (<SA> (<NULL>)
        +<SUBJECT> (ELEMENT- NSTGO OF X-OBJ)
        +<SA> (ALL ELEMENTS OF ELEMENT- LP OF X-TOVO)
        +TENSE X-TENSE OF X-VO
        +SA OF X-VO
        +<VERB> (ELEMENT- LVR OF X-VO)
        +SECOND SA OF X-VO
        +OBJECT OF X-VO
        +<SA> (ALL ELEMENTS OF SA-LAST OF X-VO)
        +<RV> (<NULL>)
        +<SA> (<NULL>));
        IF ELEMENT- TENSE OF X-PRE IS NOT EMPTY
        THEN IF X-TENSE IS EMPTY
        THEN REPLACE X-TENSE BY ELEMENT- TENSE OF X-PRE
        ELSE BEFORE VALUE OF ELEMENT- LW OF X-TENSE
        INSERT ELEMENT- TENSE OF X-PRE;
        IF ELEMENT- VERB X-VERB OF X-PRE IS NOT EMPTY
        THEN IF ELEMENT- RV X-VERB-RV OF X-VERB IS EMPTY
        THEN REPLACE X-VERB-RV BY SECOND ELEMENT ['to'] OF X-TOVO
        ELSE AFTER LAST-ELEMENT- OF X-VERB-RV
        INSERT SECOND ELEMENT OF X-TOVO.
   $MOVE-SOURCE =
        [* from X1, go right and clean all *]
        LAST-ELEMENT- X-LAST OF X-ASSERT EXISTS;
        AT X1, ITERATET
        IF BOTH PRESENT-ELEMENT- X-RIGHT IS NOT EMPTY
        AND X-RIGHT IS NOT OF TYPE CONJ-NODE
        THEN REPLACE X-RIGHT BY X-RIGHT (<NULL>)
        ELSE IF PRESENT-ELEMENT- X-RIGHTCONJ IS OF TYPE CONJ-NODE
        THEN AFTER X-LAST INSERT X-RIGHTCONJ, X-NEWCONJ
        UNTIL GO RIGHT FAILS;
        DELETE X-OBJ;
        IF X-RIGHTCONJ EXISTS THEN DELETE X-RIGHTCONJ;
        [* determine if X-PRE is an ASSERTION or FRAGMENT in a Q-CONJ *]
        IF X-PRE IS Q-CONJ
        THEN DO $HOST-OF-CONJ;
        IF ELEMENT- SA X-SA OF X-ASSERT IS EMPTY
        THEN REPLACE X-SA BY
        <SA> (X-PRE, X-NEWPRE)
        ELSE BEFORE VALUE OF X-SA INSERT X-PRE, X-NEWPRE;
        IF X-PRE IS Q-CONJ
        THEN BOTH IF X-PRE-HOST IS ASSERTION
        THEN REPLACE X-NEWPRE
        BY <ASSERTION> X-PRE-1 (ALL ELEMENTS OF X-NEWPRE)
        ELSE REPLACE X-NEWPRE
        BY <FRAGMENT> X-PRE-1 (ALL ELEMENTS OF X-NEWPRE)
        AND AT X-PRE-1, STORE IN X-NEWPRE;
        AT X-NEWPRE, ASSIGN NODE ATTRIBUTE PHRASE-ATT WITH VALUE X-SOURCE;
        DELETE X-PRE.
   $HOST-OF-CONJ =
        AT VALUE OF X-PRE
        EITHER ITERATE PRESENT-ELEMENT- HAS NODE ATTRIBUTE PRECONJELEM
        OR TRUE;
        GO UP; STORE IN X-PRE-HOST;
        X-PRE-HOST IS ASSERTION OR FRAGMENT.
   $TRANSFORM-ASSN =
        [DO $ASSIGN-SOURCE;]
        IF X-QCONJ EXISTS
        THEN [ALL OF] DO $REMOVE-ASSERT [, $PRE-POST-CONJ]
        ELSE IF BOTH X-ASSERT IS ASSERTION OR FRAGMENT
        AND $GOUP-TO-CONJ-NODE
        THEN ALL OF $MOVE-CONJ-UP,[$PRE-POST-CONJ,]$TRANSFORM-ASSERT
        ELSE TRANSFORM X-ASSERT.
   $GOUP-TO-CONJ-NODE =
        AT X-ASSERT, GO UP; STORE IN X-QCONJ; GO UP;
        PRESENT-ELEMENT- IS OF TYPE CONJ-NODE;
        IMMEDIATE-NODE IS ASSERTION OR FRAGMENT.
   $MOVE-CONJ-UP =
        BOTH REPLACE X-ASSERT BY ALL ELEMENTS OF X-ASSERT
        AND AT X-QCONJ, STORE IN X-ASSERT.
   $ASSIGN-SOURCE =
        AT X-PRE, ASSIGN NODE ATTRIBUTE PHRASE-ATT WITH VALUE X-SOURCE.
   $REMOVE-ASSERT =
        REPLACE X-QCONJ BY X-QCONJ (ALL ELEMENTS OF X-ASSERT).
   $PRE-POST-CONJ =
        AT IMMEDIATE-NODE- OF X-QCONJ, DO PRE-POST-CONJELEM.
T-PASSIVE-SOURCE = IN ASSERTION:
        AT PRESENT-ELEMENT- X-PRE,
        IF BOTH CORE- X1 OF ELEMENT- VERB X-VBE IS VBE
        AND BOTH CORE- X-VENPASS OF OBJECT X-OBJECT IS VENPASS
        AND CORE- X-TOVO OF PASSOBJ OF X-VENPASS IS TOVO
        THEN ALL OF $MOVE-TOVO, $MOVE-SOURCE, $BUILD-SOURCE-PHRASE.
   $MOVE-TOVO =
        BOTH AFTER X-OBJECT
        INSERT <OBJECT> (X-TOVO, X-NEWTOVO)
        AND DELETE X-TOVO.
   $MOVE-SOURCE =
        AT X-OBJECT, GO LEFT;
        PRESENT-ELEMENT- IS SA X-SA;
        IF X-SA IS EMPTY
        THEN REPLACE X-SA
        BY <SA> (<FRAGMENT> X-SOURCE (ALL ELEMENTS OF X-OBJECT))
        ELSE AFTER LAST-ELEMENT- OF X-SA
        INSERT <FRAGMENT> X-SOURCE (ALL ELEMENTS OF X-OBJECT);
        DELETE X-OBJECT.
   $BUILD-SOURCE-PHRASE =
        X-TEMP := SYMBOL SOURCE-PHRASE;
        X-INFO := NIL; PREFIX X-TEMP TO X-INFO;
        AT X-SOURCE, ASSIGN NODE ATTRIBUTE PHRASE-ATT WITH VALUE X-INFO;
        TRANSFORM X-PRE.
— T-ADJUST-SA-LAST
—       changes SA-LAST to standard SA.
T-ADJUST-SA-LAST = IN QUISEG, ASSERTION, FRAGMENT, BESHOW, OBES,
        VENO, VINGO, VENPASS, TOVO, TVO, VO:
        IF ELEMENT [981109 TEST: ELEMENT] SA-LAST X-SALAST EXISTS
        THEN REPLACE X-SALAST BY
        <SA> (ALL ELEMENTS OF X-SALAST).
— T-MOVE-SACONJ
—       moves the content of SACONJ down to its argument.
—       Eg: The pt had abdominal pressure but not pain on 07/15/00.
T-MOVE-SACONJ = IN ASSERTION, FRAGMENT, Q-CONJ [CONJ-NODES]:
        IF BOTH ELEMENT- CONJ-NODE X-CONJNODE EXISTS
        WHERE ELEMENT- SACONJ X-SACONJ IS NOT EMPTY
        AND ELEMENT- SA X-SA OF ELEMENT- Q-CONJ OF X-CONJNODE EXISTS
        THEN DO $INSERT-SACONJ.
   $INSERT-SACONJ =
        AT VALUE OF X-SACONJ,
        ITERATET ELEMENT- SA EXISTS
        UNTIL PRESENT-ELEMENT- IS EMPTY SUCCEEDS;
        REPLACE PRESENT-ELEMENT- BY X-SA;
        BOTH REPLACE X-SA BY ALL ELEMENTS OF X-SACONJ
        AND REPLACE X-SACONJ BY <SACONJ> (<NULL>).
— T-MOVE-TSUBJVO
—       converts the string into an ASSERTION.
T-MOVE-TSUBJVO = IN TSUBJVO [Q-CONJ]:
        BOTH DO $SETUP-SUBJVO
        AND ONE OF $SUBJVO, $SUBJ-VENO.
   $SETUP-SUBJVO =
        AT PRESENT-ELEMENT- X-SUBJVO,
        BOTH EITHER VALUE OF X-SUBJVO IS 'NOR' OR 'NEITHER' X-NOR
        OR TRUE
        AND BOTH VALUE OF X-SUBJVO IS 'HAS' OR 'DOES' OR 'DID' X-HAS
        AND BOTH ELEMENT- SUBJECT X-SUBJECT EXISTS
        AND LAST-ELEMENT- X-VO EXISTS.
   $SUBJVO =
        X-VO IS VO;
        AFTER X-SUBJVO INSERT
        <ASSERTION> X-ASSN (<SA> X-SA (<NULL>)
        +X-SUBJECT
        +<SA> (<NULL>)
        +TENSE OF X-VO
        +FIRST SA OF X-VO
        +<VERB> (ALL ELEMENTS OF LVR OF X-VO)
        +SECOND SA OF X-VO
        +OBJECT OF X-VO
        +SA-LAST OF X-VO);
        BOTH ELEMENT- TENSE X-TENSE OF X-ASSN EXISTS
        AND REPLACE X-TENSE BY
        <TENSE> X-TENSE (<LW> (<NULL>)
        +<W> = 'DID' : (VDO, PAST)
        +<RW> (<NULL>));
        IF X-HAS IS 'DOES'
        THEN REPLACE CORE- OF X-TENSE
        BY <W> = 'DOES' : (VDO, SINGULAR);
        AT CORE- OF X-TENSE,
        BOTH BOTH X-HAS HAS NODE ATTRIBUTE WORD-POS X-WPOS
        AND AT PRESENT-ELEMENT-
        ASSIGN NODE ATTRIBUTE WORD-POS WITH VALUE X-WPOS;
        BOTH EITHER X-HAS HAS NODE ATTRIBUTE SELECT-ATT X-SELATT
        OR CORE-ATT X-SELATT OF PRESENT-ELEMENT- EXISTS
        AND AT PRESENT-ELEMENT-
        ASSIGN NODE ATTRIBUTE SELECT-ATT WITH VALUE X-SELATT;
        IF X-NOR EXISTS
        THEN DO $INSERT-NOR;
        BOTH TRANSFORM X-ASSN
        AND DELETE X-SUBJVO.
   $SUBJ-VENO =
        X-VO IS VENO;
        AFTER X-SUBJVO INSERT
        <ASSERTION> X-ASSN
        (<SA> X-SA (<NULL>)
        +X-SUBJECT
        +<SA> (<NULL>)
        +<TENSE> (<NULL>)
        +<SA> (<NULL>)
        +<VERB> X-VERB (<LV> (<NULL>)
        +<VVAR> (<TV> X-TV = 'HAS' : (VHAVE))
        +<RV> (<NULL>))
        +<SA> (<NULL>)
        +<OBJECT> (VENO OF X-VO)
        +<SA> (<NULL>));
        BOTH X-HAS HAS NODE ATTRIBUTE WORD-POS X-WPOS
        AND AT X-TV,
        ASSIGN NODE ATTRIBUTE WORD-POS WITH VALUE X-WPOS;
        BOTH EITHER X-HAS HAS NODE ATTRIBUTE SELECT-ATT X-SELATT
        OR CORE-ATT X-SELATT OF PRESENT-ELEMENT- EXISTS
        AND AT X-TV,
        ASSIGN NODE ATTRIBUTE SELECT-ATT WITH VALUE X-SELATT;
        IF X-NOR EXISTS
        THEN DO $INSERT-NOR;
        BOTH TRANSFORM X-ASSN
        AND DELETE X-SUBJVO.
   $INSERT-NOR =
        IF X-VO IS VO
        THEN BOTH BEFORE VALUE OF ELEMENT- LW OF X-TENSE
        INSERT <LDR> X-LDR (<LD> (<NULL>)
        +<D> = 'NEITHER' : (H-NEG)
        +<RD> (<NULL>))
        AND IF X-NOR IS 'NOR'
        THEN REPLACE CORE- OF X-NOR BY <D> = 'NOR' : (H-NEG)
        ELSE BOTH BEFORE VALUE OF ELEMENT- LV OF X-VERB
        INSERT <LDR> X-LDR (<LD> (<NULL>)
        +<D> = 'NEITHER' : (H-NEG)
        +<RD> (<NULL>))
        AND IF X-NOR IS 'NOR'
        THEN REPLACE CORE- OF X-NOR BY <D> = 'NOR' : (H-NEG);
        AT CORE- OF X-LDR,
        BOTH X-NOR HAS NODE ATTRIBUTE WORD-POS X-WPOS
        AND AT PRESENT-ELEMENT-
        ASSIGN NODE ATTRIBUTE WORD-POS WITH VALUE X-WPOS;
        BOTH EITHER X-NOR HAS NODE ATTRIBUTE SELECT-ATT X-SELATT
        OR CORE-ATT X-SELATT OF PRESENT-ELEMENT- EXISTS
        AND AT PRESENT-ELEMENT-
        ASSIGN NODE ATTRIBUTE SELECT-ATT WITH VALUE X-SELATT.
— T-TESTENV-PHRASE-ARGS
—       a PN or VINGO marked with TESTENV-PHRASE
—       may contain an RN which is not a TESTENV phrase.
—       This transformation lifts everything under the RN
—       up and puts them on the same level with the PN.
T-TESTENV-PHRASE-ARGS = IN PN, VINGO:
        IF BOTH PRESENT-ELEMENT- X-PRE HAS NODE ATTRIBUTE PHRASE-ATT
        WHERE PRESENT-ELEMENT- HAS MEMBER TESTENV-PHRASE
        AND ONE OF $PN-TAIL, $VINGO-TAIL
        THEN IF X-RN IS NOT EMPTY
        THEN AT LAST-ELEMENT- OF X-RN
        ITERATE $MOVE-RN-UP UNTIL GO LEFT FAILS.
   $PN-TAIL =
        ELEMENT- RN X-RN OF ELEMENT- LNR OF ELEMENT- NSTG OF
        ELEMENT- NSTGO OF X-PRE EXISTS.
   $VINGO-TAIL =
        BOTH VALUE OF ELEMENT- OBJECT OF X-PRE IS NSTGO X-NSTGO
        AND ELEMENT- RN X-RN OF ELEMENT- LNR OF ELEMENT-
        NSTG OF X-NSTGO EXISTS.
   $MOVE-RN-UP =
        IF BOTH VALUE X-PN OF PRESENT-ELEMENT- EXISTS
        AND $NOT-TESTENV-PHRASE
        THEN BOTH AFTER X-PRE INSERT X-PN, X-NEWPN
        AND DELETE X-PN.
   $NOT-TESTENV-PHRASE =
        X-PN HAS NODE ATTRIBUTE PHRASE-ATT
        WHERE PRESENT-ELEMENT- DOES NOT HAVE MEMBER TESTENV-PHRASE.
— T-ADJUST-DATES
—       changes BEDATE:LDATER to
—       standard SA:PDATE
T-ADJUST-DATES = IN LDATER:
        BOTH IF BOTH ELEMENT- LQ X-LQ OF PRESENT-ELEMENT- X-PRE EXISTS
        AND ELEMENT- DT X-DT EXISTS
        THEN BOTH REPLACE X-LQ BY <LDATE> (ALL ELEMENTS OF X-LQ)
        AND REPLACE X-DT BY <DATEVAR> (X-DT)
        AND IF IMMEDIATE-NODE IS BEDATE X-BEDATE
        THEN REPLACE X-BEDATE BY
        <SA> (<PDATE> (<P> = '[]' : (H-TMPREP)
        +X-PRE)).
— T-ASSIGN-TIME-OBJ
—       assigns TIME-ADVERBIAL to QUANT OF OBJECT:NSTGO:QUANT NTIME1/2
—       and moves QUANT to SA, leaving OBJECT:NULLOBJ.
T-ASSIGN-TIME-OBJ = IN OBJECT:
        IF BOTH VALUE OF PRESENT-ELEMENT- X-OBJ IS NSTGO
        WHERE VALUE IS QUANT X-QN
        AND BOTH ELEMENT- N OF VALUE OF X-QN HAS NODE ATTRIBUTE
        SELECT-ATT X-ATT
        AND X-ATT HAS MEMBER NTIME1 OR NTIME2
        THEN BOTH AT X-OBJ GO RIGHT
        WHERE STORE IN X-SA [* SA or SA-LAST *]
        AND BOTH BEFORE VALUE OF X-SA
        INSERT VALUE OF X-QN [X-OBJ]
        AND BOTH $ASSIGN-TIME
        AND REPLACE VALUE OF X-OBJ BY <NULLOBJ>.
   $ASSIGN-TIME =
        X-TIME-ADV := NIL;
        X-ADV := SYMBOL TIME-ADVERBIAL;
        PREFIX X-ADV TO X-TIME-ADV;
        AT VALUE OF X-SA ASSIGN NODE ATTRIBUTE ADVERBIAL-TYPE
        WITH VALUE X-TIME-ADV.
— T-LWVR-TO-LNR
—       turns EKGSTG:(LWVR) into EKGSTG:(LNR).
T-LWVR-TO-LNR = IN LWVR, PN:
        IF BOTH PRESENT-ELEMENT- X-PN IS PN
        WHERE ELEMENT- EKGSTG X-EKG OF ELEMENT- NSTGO EXISTS
        AND VALUE X-PRE OF X-EKG IS LWVR
        THEN BOTH DO $SEARCH-FOR-LWVR
        AND TRANSFORM X-PN
        ELSE IF PRESENT-ELEMENT- X-PRE IS LWVR
        THEN BOTH DO $SEARCH-FOR-LWVR
        AND TRANSFORM X-LNR [* the new X-PRE *].
   $SEARCH-FOR-LWVR =
        AT X-PRE,
        BOTH IF ELEMENT- CONJ-NODE X-CONJNODE EXISTS
        WHERE ELEMENT- Q-CONJ IS NOT EMPTY
        THEN ALL OF $WVVAR-ITERATION, $RWV-ITERATION
        [* Both $WVVAR-ITERATION and $RWV-ITERATION *]
        [* do not use PRE-POST-CONJELEM because the *]
        [* IN-LEADS does not follow the LXR perfect *]
        [* conjunction formulism. *]
        ELSE BOTH AT ELEMENT- RWV X-RWV, DO $CHANGE-RWV
        AND AT ELEMENT- WVVAR X-WV, DO $CHANGE-WVVAR
        AND DO $CHANGE-LWVR.
   $WVVAR-ITERATION =
        AT ELEMENT- WVVAR
        ITERATE BOTH PRESENT-ELEMENT- X-WV EXISTS
        AND BOTH ALL OF $SAVE-CONJELEMS, $CHANGE-WVVAR
        AND BOTH AT X-WV, DO $RESTORE-CONJELEMS
        AND GO TO X-POSTCONJ
        UNTIL X-POSTCONJ IS NIL SUCCEEDS.
   $RWV-ITERATION =
        AT ELEMENT- RWV
        ITERATE BOTH PRESENT-ELEMENT- X-RWV EXISTS
        AND BOTH ALL OF $SAVE-CONJELEMS, $CHANGE-RWV
        AND BOTH AT X-RWV, DO $RESTORE-CONJELEMS
        AND GO TO X-POSTCONJ
        UNTIL X-POSTCONJ IS NIL SUCCEEDS.
   $SAVE-CONJELEMS =
        BOTH EITHER PRESENT-ELEMENT- HAS NODE ATTRIBUTE
        PRECONJELEM X-PRECONJ
        OR X-PRECONJ := NIL
        AND EITHER PRESENT-ELEMENT- HAS NODE ATTRIBUTE
        POSTCONJELEM X-POSTCONJ
        OR X-POSTCONJ := NIL.
   $RESTORE-CONJELEMS =
        IF X-PRECONJ IS NIL
        THEN TRUE
        ELSE ASSIGN NODE ATTRIBUTE PRECONJELEM WITH VALUE X-PRECONJ;
        IF X-POSTCONJ IS NIL
        THEN TRUE
        ELSE ASSIGN NODE ATTRIBUTE POSTCONJELEM WITH VALUE X-POSTCONJ.
   $CHANGE-RWV =
        IF X-RWV IS NOT EMPTY
        THEN AT X-RWV ITERATE $TURN-INTO-RN
        UNTIL ELEMENT- RWV EXISTS FAILS
        ELSE BOTH REPLACE X-RWV BY <RN> X-NEWWV (<NULL>)
        AND AT X-NEWWV, STORE IN X-RWV.
   $TURN-INTO-RN =
        BOTH IF ELEMENT- RWVOPTS X-IRWV EXISTS
        THEN REPLACE X-IRWV [* eliminate RWVOPTS *]
        BY [<RNOPTS>] ALL ELEMENTS OF X-IRWV
        AND BOTH IF ELEMENT- RWV X-IRWV EXISTS
        THEN IF X-IRWV IS NOT EMPTY
        THEN REPLACE X-IRWV [* eliminate RWV *]
        BY ALL ELEMENTS OF X-IRWV
        ELSE DELETE X-IRWV
        ELSE TRUE
        AND BOTH REPLACE PRESENT-ELEMENT-
        BY <RN> X-RWV (ALL ELEMENTS OF PRESENT-ELEMENT-)
        AND GO TO X-RWV.
   $CHANGE-WVVAR =
        BOTH REPLACE X-WV
        BY <NVAR> X-NEWWV (ALL ELEMENTS OF X-WV)
        AND AT X-NEWWV, STORE IN X-WV.
   $CHANGE-LWVR =
        REPLACE PRESENT-ELEMENT-
        BY <LNR> X-LNR (ALL ELEMENTS OF X-PRE).
— FORMAT ENVIRONMENT SELECTIONS
—       Following is a series of transformations which create
—       information formats that phrase selections cannot decide.

— T-PSEUDO-CONJ-WITH
— - RULES FOR EXPANDING AROUND PSEUDO-CONJUNCTION 'WITH'
— -
— - Rule 1
— - If N1 and N2 are in the same WITH-EQUIV-CLASSES that contains
— - H-INDIC and H-DIAG [call this the DIAG-INDIC-LIST]
— - Then
— - SUBJ VERB N1 with N2 --> SUBJ VERB N1 with [SUBJ VERB] N2
— - H-SHOW H-SHOW
— - Examples:
— - *SID=GLCBA 012C.1.03
— - CHEST EXAMINATION REVEALED EXTENSIVE WHEEZING *with* PROLONGED
— - EXPIRATORY PHASE .
— - *SID=GLCBA 012C.1.04
— - CENTRAL NERVOUS SYSTEM EXAMINATION REVEALED RIGHT HEMIPARESIS
— - AND RIGHT SIDED FACIAL WEAKNESS *with* RIGHT HEMIANOPIA .
T-PSEUDO-CONJ-WITH = IN PN:
        IF BOTH ELEMENT- P X-P OF PRESENT-ELEMENT- X-PN IS 'WITH'
        AND ALL OF $GET-CONJ-ARGS, $IN-OBJECT, $GET-SUBJECT, $GET-VERB
        THEN IF BOTH ONE OF $VERB-SHOW [* Rule 1: verb=H-SHOW *],
   $PT-HAVE [* Rule 2: PT/HUMAN PTVERB/VHAVE *]
        AND $CONJ-EQUIV-SS
        THEN DO $CONJ-WITH-LXR
        ELSE IF ALL OF $BPART-PRED, $BPART-PRED-EQUIV
        [* Rule 3: PTPART VBE PRED *]
        THEN DO $CONJ-WITH-OBJECT
        ELSE TRUE.
   $GET-SUBJECT =
        AT X-OBJECT, COELEMENT- SUBJECT X-SUBJECT EXISTS;
        X-SUBJECT IS NOT EMPTY;
        EITHER CORE- X-SUBJ-CORE OF ELEMENT- LNR OF ELEMENT- NSTG EXISTS
        OR EITHER CORE- X-SUBJ-CORE OF ELEMENT- LWVR OF ELEMENT- EKGSTG EXISTS
        OR CORE- X-SUBJ-CORE OF ELEMENT- LNR OF ELEMENT- EKGSTG EXISTS.
   $GET-VERB =
        AT X-OBJECT, COELEMENT- VERB X-VERB EXISTS
        WHERE CORE- X-VERB-CORE EXISTS.
   $VERB-SHOW =
        [* SUBJ VERB N1 with N2 --> SUBJ VERB N1 with SUBJ VERB N2 *]
        [* H-SHOW H-SHOW H-SHOW *]
        CORE-ATT OF X-VERB-CORE HAS MEMBER H-SHOW.
   $PT-HAVE =
        [* SUBJ has CORE-ATT = H-PT or SUBJ has CORE = NHUMAN *]
        [* and VERB is H-PTVERB or VHAVE *]
        EITHER CORE-ATT OF X-SUBJ-CORE HAS MEMBER H-PT
        OR X-SUBJ-CORE IS NHUMAN;
        CORE-ATT OF X-VERB-CORE HAS MEMBER H-PTVERB OR VHAVE.
   $BPART-PRED = [* not sure how to deal with ADJ with SS *]
        [* SUBJ VERB OBJ *]
        [* H-PTPART VBE ADJ/N1 with N2 *]
        BOTH CORE-ATT OF X-SUBJ-CORE HAS MEMBER H-PTPART
        AND CORE-ATT OF X-VERB-CORE HAS MEMBER VBE.
   $IN-OBJECT =
        IMMEDIATE LXR OF X1 EXISTS;
        ASCEND TO OBJECT PASSING THROUGH ADJSET;
        STORE IN X-OBJECT.
   $GET-CONJ-ARGS =
        HOST- X1 OF X-PN EXISTS;
        CORE-ATT X1-ATT OF X1 IS NOT NIL;
        EITHER AT ELEMENT- LNR X-LNR2 OF NSTG OF ELEMENT- NSTGO OF X-PN,
        CORE- X2 EXISTS
        OR EITHER AT ELEMENT- LWVR X-LNR2 OF EKGSTG OF ELEMENT- NSTGO OF X-PN,
        CORE- X2 EXISTS
        OR AT ELEMENT- LNR X-LNR2 OF EKGSTG OF ELEMENT- NSTGO OF X-PN,
        CORE- X2 EXISTS;
        CORE-ATT X2-ATT OF X2 IS NOT NIL.
   $BPART-PRED-EQUIV =
        X-EQUIV-LIST:= LIST WITH-EQUIV-CLASSES;
        DO $COLLECT-ARG-PATTERNS.
   $CONJ-EQUIV-SS =
        X-EQUIV-LIST:= LIST WITH-EQUIV-CLASSES [CONJ-EQUIV-CLASSES];
        DO $COLLECT-ARG-PATTERNS.
   $COLLECT-ARG-PATTERNS =
        [* 1. collect all groups in CONJ-EQUIV-CLASSES *]
        [* that contains members of X1-ATT -- call *]
        [* this list X1-EQUIV-LIST. It is not nil. *]
        X1-EQUIV-LIST := NIL;
        ITERATE $COLLECT-X1-PATTERNS
        UNTIL SUCCESSORS X-EQUIV-LIST OF X-EQUIV-LIST IS NIL SUCCEEDS;
        X1-EQUIV-LIST IS NOT NIL;
        [* 2. collect all groups in X1-EQUIV-LIST *]
        [* that contains members of X2-ATT -- call *]
        [* this list X2-EQUIV-LIST. It is not nil. *]
        X2-EQUIV-LIST := NIL;
        ITERATE $COLLECT-X2-PATTERNS
        UNTIL SUCCESSORS X1-EQUIV-LIST OF X1-EQUIV-LIST IS NIL SUCCEEDS;
        X2-EQUIV-LIST IS NOT NIL;
        [* 3. collect all groups in X2-EQUIV-LIST *]
        [* that contains members of LIST SYN-SYM -- *]
        [* call this list X3-EQUIV-LIST. It is not nil. *]
        X3-EQUIV-LIST := NIL;
        X-SIGN-SYMP := LIST SIGN-SYMP;
        ITERATE $COLLECT-X3-PATTERNS
        UNTIL SUCCESSORS X2-EQUIV-LIST OF X2-EQUIV-LIST IS NIL SUCCEEDS;
        X3-EQUIV-LIST IS NOT NIL.
   $COLLECT-X1-PATTERNS =
        X-HEAD := HEAD OF X-EQUIV-LIST;
        IF X-HEAD HAS MEMBER X1-ATT
        THEN PREFIX X-HEAD TO X1-EQUIV-LIST.
   $COLLECT-X2-PATTERNS =
        X-HEAD := HEAD OF X1-EQUIV-LIST;
        IF X-HEAD HAS MEMBER X2-ATT
        THEN PREFIX X-HEAD TO X2-EQUIV-LIST.
   $COLLECT-X3-PATTERNS =
        X-HEAD := HEAD OF X2-EQUIV-LIST;
        IF X-HEAD HAS MEMBER X-SIGN-SYMP
        THEN PREFIX X-HEAD TO X3-EQUIV-LIST.
   $CONJ-WITH-LXR =
        AFTER IMMEDIATE-NODE- [RX] OF X-PN INSERT
        <WITHSTG> X-WITHSTG (X-P, X-PREP
        +<SACONJ> (<NULL>)
        +<Q-CONJ> (ALL ELEMENTS OF X-LNR2));
        AT X-WITHSTG, DO PRE-POST-CONJELEM;
        DELETE X-PN;
        AT X-WITHSTG, TRANSFORM Q-CONJ.
   $CONJ-WITH-OBJECT =
        AFTER [LAST-ELEMENT- OF] X-OBJECT INSERT
        <WITHSTG> X-WITHSTG (X-P, X-PREP
        +<SACONJ> (<NULL>)
        +<Q-CONJ> (<OBJECT> X-NEWPN
        (ALL ELEMENTS OF X-PN)));
        AT X-WITHSTG, DO PRE-POST-CONJELEM;
        DELETE X-PN;
        TRANSFORM X-NEWPN.
— T-PSEUDO-CONJ-WITHOUT
—       turns 'without' in OBJBE into CONJ
—       E.g.
—       *SID=980120 098.001C.01.04
—       Heart regular rate without skip or murmur .
—       *SID=980208_ 098.02C.04.01
—       NECK : Supple without lymphadenopathy , thyromegaly or bruits .
—       *SID=980421 098.08C.01.07
—       NECK : Supple without significant adenopathy or thyromegaly .
—       *SID=980421 098.08C.01.13
—       BREASTS : Left mastectomy site is without evidence of recurrence .
—       *SID=980911 098.12C.01.06
—       Heart regular rate without skip or murmur .
—       *SID=981029 098.14C.01.17
—       Abdomen : soft , nontender without mass or hepatosplenomegaly .
—       *SID=981110 098.15C.01.09
—       Heart regular rate without skips or murmurs .
—       *SID=990318P2 098.20C.01.11
—       The lungs are entirely clear without any focal rales ,
—       egophony , or wheezing .
—       *SID=990318P2 098.20C.01.12
—       On cardiovascular exam there is a regular rate and rhythm
—       without murmur or rub .
—       *SID=990318P2 098.20C.01.14
—       The patient is s / p left modified radical mastectomy
—       without local or chest wall recurrence .
—       *SID=990318P2 098.20C.01.22
—       The abdomen is soft and nontender without mass or hepatosplenomegaly .
—       *SID=990604 098.30B.01.04
—       Incision intact w / o drainage or any signs or symptoms of infection .
T-PSEUDO-CONJ-WITHOUT = IN PN:
        IF BOTH EITHER ELEMENT- P X-P OF PRESENT-ELEMENT- X-PN IS 'WITHOUT'
        OR 'SANS' OR 'W'_'/'_'O' OR 'WITHOUT'_'EVIDENCE'_'OF',
        OR BOTH CORE-ATT X-P-ATT OF X-P HAS MEMBER H-NEG
        AND X-P-ATT HAS MEMBER H-CONN
        AND ALL OF $IN-OBJBE-OR-FRAG, $GET-OBJ-LNR
        THEN ALL OF $CONJ-WITH-LXR, $CHANGE-TO-AND.
   $IN-OBJBE-OR-FRAG =
        AT X-PN, IMMEDIATE-NODE- X-RX IS RA OR RN;
        X-PN IS OCCURRING IN OBJBE OR ASTGF OR NSTGF X-OBJBE;
        EITHER IMMEDIATE-NODE- IS BESHOW
        OR EITHER IMMEDIATE-NODE- IS OBJECTBE
        OR IMMEDIATE-NODE- IS FRAGMENT.
   $GET-OBJ-LNR =
        EITHER ELEMENT- LNR X-LNR2 OF NSTG OF ELEMENT- NSTGO OF X-PN EXISTS
        OR EITHER ELEMENT- LWVR X-LNR2 OF EKGSTG OF ELEMENT- NSTGO OF X-PN EXISTS
        OR ELEMENT- LNR X-LNR2 OF EKGSTG OF ELEMENT- NSTGO OF X-PN EXISTS.
   $CONJ-WITH-LXR =
        IF X-RX IS RN
        THEN DO $CONJ-WITH-LNR
        ELSE DO $CONJ-WITH-LAR.
   $CONJ-WITH-LNR =
        AFTER X-RX INSERT
        <WITHSTG> X-WITHSTG (X-P, X-PREP
        +<SACONJ> (<NULL>)
        +<Q-CONJ> (ALL ELEMENTS OF X-LNR2));
        REPLACE X-PN BY <NULL>;
        AT X-WITHSTG, DO PRE-POST-CONJELEM.
   $CONJ-WITH-LAR =
        IF IMMEDIATE-NODE- OF X-OBJBE IS BESHOW X-BESHOW
        THEN DO $COPY-BESHOW
        ELSE IF IMMEDIATE-NODE- OF X-OBJBE IS OBJECTBE
        WHERE IMMEDIATE-NODE- IS OBJECT X-OBJECT
        THEN AT IMMEDIATE-NODE- X-ASSN OF X-OBJECT,
        DO $COPY-ASSN
        ELSE IF X-OBJBE IS ASTGF
        THEN DO $COPY-FRAGMENT.
   $COPY-ASSN =
        [* save target X-LNR2 *]
        AFTER X-ASSN INSERT X-P, X-NEWP + X-LNR2, X-NEWLNR;
        [* delete PN='without' *]
        REPLACE X-PN BY <NULL>;
        [* copy entire ASSERTION *]
        AFTER LAST-ELEMENT- OF X-ASSN
        INSERT <WITHSTG> X-WITHSTG (X-NEWP, X-PREP
        +<SACONJ> (<NULL>)
        +<Q-CONJ> X-QCONJ
        (ALL ELEMENTS OF X-ASSN));
        [* copy X-LNR2 to new ASSERTION *]
        REPLACE VALUE OF ELEMENT- OBJBE OF OBJECTBE OF OBJECT OF X-QCONJ
        BY <NSTG> (X-NEWLNR, X-LNR2);
        EITHER ELEMENT- RN X-RX OF X-LNR2 EXISTS
        OR ELEMENT- RWV X-RX OF X-LNR2 EXISTS;
        [* delete saved X-LNR2 *]
        DELETE X-NEWP; DELETE X-NEWLNR;
        [* assign PRE-POSTCONJELEM *]
        AT X-WITHSTG, DO PRE-POST-CONJELEM.
   $COPY-BESHOW =
        [* save target X-LNR2 *]
        AFTER X-BESHOW INSERT X-P, X-NEWP + X-LNR2, X-NEWLNR;
        [* delete PN='without' *]
        REPLACE X-PN BY <NULL>;
        [* copy entire BESHOW *]
        AFTER LAST-ELEMENT- OF X-BESHOW
        INSERT <WITHSTG> X-WITHSTG (X-NEWP, X-PREP
        +<SACONJ> (<NULL>)
        +<Q-CONJ> X-QCONJ
        (ALL ELEMENTS OF X-BESHOW));
        [* copy X-LNR2 to new BESHOW *]
        REPLACE VALUE OF ELEMENT- OBJBE OF X-QCONJ
        BY <NSTG> (X-NEWLNR, X-LNR2);
        EITHER ELEMENT- RN X-RX OF X-LNR2 EXISTS
        OR ELEMENT- RWV X-RX OF X-LNR2 EXISTS;
        [* delete saved X-LNR2 *]
        DELETE X-NEWP; DELETE X-NEWLNR;
        [* assign PRE-POSTCONJELEM *]
        AT X-WITHSTG, DO PRE-POST-CONJELEM.
   $COPY-FRAGMENT =
        [* build new FRAGMENT:NSTGF's *]
        AFTER IMMEDIATE-NODE- [FRAGMENT] OF X-OBJBE INSERT
        <WITHSTG> X-WITHSTG (X-P, X-PREP
        +<SACONJ> (<NULL>)
        +<Q-CONJ> X-QCONJ
        (<FRAGMENT>
        (<SA> (<NULL>)
        +<NSTGF>
        (<NSTG>
        (<LNR> X-NEWLNR
        (ALL ELEMENTS OF X-LNR2)))
        +<SA> (<NULL>))));
        REPLACE X-PN BY <NULL>;
        ELEMENT- RN X-RX OF X-NEWLNR EXISTS;
        IF X-RX DOES NOT HAVE NODE ATTRIBUTE POSTCONJELEM
        THEN BOTH EITHER ITERATE GO RIGHT OR TRUE
        @AND IF PRESENT-ELEMENT- IS COMMASTG OR ORSTG X-ORSTG
        THEN AT X-ORSTG, DO PRE-POST-CONJELEM;
        [* assign PRE-POSTCONJELEM *]
        AT X-WITHSTG, DO PRE-POST-CONJELEM.
   $CHANGE-TO-AND =
        AT X-RX,
        ITERATE $ASSIGN-WITHOUT
        UNTIL PRESENT-ELEMENT- HAS NODE ATTRIBUTE POSTCONJELEM FAILS.
   $ASSIGN-WITHOUT =
        IF [BOTH] AT PRESENT-ELEMENT- X-RX1 [IS NOT IDENTICAL TO X-RX]
        [AND] BOTH EITHER ITERATE GO RIGHT OR TRUE
        @AND PRESENT-ELEMENT- IS COMMASTG OR ORSTG X-ORSTG
        @THEN BOTH VALUE OF X-ORSTG HAS NODE ATTRIBUTE WORD-POS X-WORDPOS
        AND BOTH REPLACE VALUE BY X-PREP ['AND']
        AND AT VALUE, ASSIGN NODE ATTRIBUTE WORD-POS WITH
        VALUE X-WORDPOS;
        GO TO X-RX1.
— T-ADJUST-PATIENT
—       adds H-PT to noun MASC or FEM.
T-ADJUST-PATIENT = IN LNR:
        IF BOTH CORE- X-CORE IS N
        AND BOTH CORE-SELATT X-SEL OF X-CORE HAS MEMBER MASC OR FEM
        AND X-SEL DOES NOT HAVE MEMBER H-PT OR H-FAMILY
        THEN DO $ADD-H-PT.
   $ADD-H-PT =
        X-PT := SYMBOL H-PT;
        PREFIX X-PT TO X-SEL;
        AT X-CORE, ASSIGN NODE ATTRIBUTE SELECT-ATT WITH VALUE X-SEL.
— T-ADJUST-SELECT-ATT
—       check consistency between SELECT-ATT and COMPUTED-ATT
—       of a node. If they are identical, then there must be
—       something wrong, take ATTRIBUTE-LIST of the word and
—       assign SELECT-ATT to the node with ATTRIBUTE-LIST value.
— -- except for H-TRANSP
T-ADJUST-SELECT-ATT = IN LNR:
        IF BOTH BOTH CORE-SELATT X-SEL OF CORE- X-CORE IS NOT NIL
        AND X-CORE HAS NODE ATTRIBUTE COMPUTED-ATT X-COMP
        WHERE ATTRIBUTE-LIST X-COMP-ATT EXISTS
        AND BOTH BOTH X-COMP HAS MEMBER X-SEL
        AND BOTH X-SEL HAS MEMBER X-COMP
        AND X-COMP HAS MEMBER X-COMP-ATT
        AND BOTH X-COMP DOES NOT HAVE MEMBER H-TRANSP
        AND X-SEL DOES NOT HAVE MEMBER H-TRANSP
        THEN [FALSE]
        AT X-CORE, ALL OF $ERASE-COMPATT, $ASSIGN-SELATT.
   $ERASE-COMPATT =
        BOTH ERASE NODE ATTRIBUTE COMPUTED-ATT
        AND EITHER ERASE NODE ATTRIBUTE N-TO-LN-ATT
        OR ERASE NODE ATTRIBUTE N-TO-RN-ATT.
   $ASSIGN-SELATT =
        ASSIGN NODE ATTRIBUTE SELECT-ATT WITH VALUE X-SEL.
— T-ALLERGY-TO-TX
—       special transformation dealing with allergies as
—       a special case of H-INDIC for
—       allergies/allergy/allergic to H-TX*
T-ALLERGY-TO-TX = IN LXR:
        IF BOTH CORE- IS 'ALLERGY' OR 'ALLERGIES' OR 'ALLERGIC' OR
        'allergy' OR 'allergies' OR 'allergic' OR
        [FRENCH] 'ALLERGIE' OR 'ALLERGIQUE'
        AND LAST-ELEMENT- [RX] IS NOT EMPTY
        WHERE DO $TEST-PN-TX
        THEN BOTH X-ADJUNCT := SYMBOL ADJUNCT-TYPE
        AND AT X-PN ASSIGN NODE ATTRIBUTE ADVERBIAL-TYPE
        WITH VALUE X-ADJUNCT.
   $TEST-PN-TX =
        ELEMENT- PN X-PN EXISTS;
        ELEMENT- P IS 'TO' OR 'to' OR [FRENCH] 'A2';
        CORE-ATT OF CORE- OF ELEMENT- NSTGO HAS MEMBER
        H-TXPROC OR H-TXCLIN OR H-TXVAR OR H-CHEM OR
        H-TRANSP ['feather' or 'dust'].
— T-FILLIN-CONJ-RN
—       fills in LNR structure for LNR ( LN NVAR RN & RN )
—       recomputes PRE-POST-CONJELEM
—       and assigns LINKC pointer.
T-FILLIN-CONJ-RN = IN LNR:
        IF $LOOK-FOR-QCONJ-RN
        THEN ALL OF $COPY-LN-NVAR, $RETHREAD-CONJELEM,
   $REDO-NEXT-CONJS.
   $LOOK-FOR-QCONJ-RN =
        AT VALUE OF PRESENT-ELEMENT- X-LNR
        EITHER ITERATE GO RIGHT OR TRUE;
        BOTH PRESENT-ELEMENT- X-CONJ IS OF TYPE CONJ-NODE
        AND VALUE OF ELEMENT- Q-CONJ X-QCONJ IS RN.
   $COPY-LN-NVAR =
        AT X-CONJ, COELEMENT- NVAR X-NVAR EXISTS;
        BEFORE VALUE OF X-QCONJ INSERT X-NVAR;
        AT X-CONJ, COELEMENT- LN X-LN EXISTS;
        BEFORE VALUE OF X-QCONJ INSERT X-LN.
   $RETHREAD-CONJELEM =
        AT X-QCONJ, DO $ERASE-PRE-POST;
        AT X-LNR, DO $ERASE-PRE-POST;
        AT X-CONJ, DO PRE-POST-CONJELEM.
   $REDO-NEXT-CONJS =
        AT X-QCONJ,
        ITERATET IF PRESENT-ELEMENT- X-QCONJ EXISTS
        WHERE VALUE IS RN
        THEN BOTH ALL OF $COPY-LN-NVAR, $ERASE-PRE-POST
        AND DO PRE-POST-CONJELEM
        UNTIL ELEMENT- CONJ-NODE X-CONJ EXISTS
        WHERE ELEMENT- Q-CONJ EXISTS FAILS.
   $ERASE-PRE-POST =
        AT VALUE,
        ITERATE BOTH IF PRESENT-ELEMENT- HAS NODE ATTRIBUTE PRECONJELEM
        THEN ERASE NODE ATTRIBUTE PRECONJELEM
        AND IF PRESENT-ELEMENT- HAS NODE ATTRIBUTE POSTCONJELEM
        THEN ERASE NODE ATTRIBUTE POSTCONJELEM
        UNTIL GO RIGHT FAILS.
— T-RAISE-LNR
—       *** Temporary measure
—       This should be done in parsing, i.e. WCONJ9
—       E.g. 6-8 full episodes of loss of consciousness
—       and many of the presyncopal spells...
—       E.g. He has been followed closely for some hypertension,
—       history of chronic atrial fibrillation, history of
—       pulmonary hypertension, and a history of some mild
—       obstructive pulmonary disease.
T-RAISE-LNR = IN LNR:
        AT PRESENT-ELEMENT- X-LNR
        IF BOTH ELEMENT- CONJ-NODE X-CONJNODE EXISTS
        AND ONE OF $HISTORY-GROUP, $EPISODE-GROUP, $STATUS-POST
        THEN DO $RAISE-POSTCONJ.
   $HISTORY-GROUP =
        AT X-CONJNODE ALL OF $PRECONJUNCT-IN-PN,
   $PAIRING-HISTORIES.
   $PAIRING-HISTORIES =
        [* for part of the phrase: *]
        [* ... history of X and history ... *]
        X-HOST IS 'HISTORY';
        CORE- OF ELEMENT- NVAR OF ELEMENT- Q-CONJ
        OF X-CONJNODE IS 'HISTORY'.
   $STATUS-POST =
        [* Ex: with a history of ischemic cardiomypathy, *]
        [* congestive heart failure, status post *]
        [* previous coronary artery bypass surgery. *]
        AT X-CONJNODE ALL OF $PRECONJUNCT-IN-PN,
   $STATUS-POSTCONJUNCT.
   $STATUS-POSTCONJUNCT =
        AT ELEMENT- LN OF X-LNR
        PRESENT-ELEMENT- HAS NODE ATTRIBUTE POSTCONJELEM;
        EITHER ITERATE
        PRESENT-ELEMENT- HAS NODE ATTRIBUTE POSTCONJELEM
        OR TRUE;
        STORE IN X1-LN;
        X1-LN IS NOT EMPTY;
        GO UP; PRESENT-ELEMENT- IS Q-CONJ;
        GO UP; PRESENT-ELEMENT- X-CONJNODE IS OF TYPE CONJ-NODE;
        BOTH CORE-ATT X1-ATT OF CORE- OF ELEMENT- NVAR OF X-LNR IS NOT EMPTY
        AND AT X1-LN, WORD STARTING PRESENT NODE IS 'STATUS'_'POST'
        OR 'STATUS-POST' OR 'S'_'/'_'P'.
   $EPISODE-GROUP =
        AT X-CONJNODE ALL OF $PRECONJUNCT-IN-PN,
   $COMPLEX-POSTCONJUNCT,
   $CORE-ATTS-MATCH.
   $PRECONJUNCT-IN-PN =
        X-LNR IS OCCURRING IN PN X-PN;
        HOST- X-HOST EXISTS;
        BOTH CORE-ATT X0-ATT IS NOT NIL
        AND PRESENT-ELEMENT- HAS NODE ATTRIBUTE N-TO-RN-ATT X-RNATT;
        X-RNATT IS IDENTICAL TO X-LNR.
   $COMPLEX-POSTCONJUNCT =
        ELEMENT- LN OF X-LNR HAS NODE ATTRIBUTE POSTCONJELEM X1-LN;
        X1-LN IS NOT EMPTY;
        CORE-ATT X1-ATT OF CORE- OF ELEMENT- NVAR OF X-LNR IS NOT EMPTY;
        AT X1-LN, ONE OF $TPOS-HAS-AMT, $QPOS-HAS-AMT, $APOS-HAS-AMT.
   $TPOS-HAS-AMT =
        AT ELEMENT- TPOS, DO $HAS-AMT.
   $QPOS-HAS-AMT =
        AT ELEMENT- QPOS, DO $HAS-AMT.
   $APOS-HAS-AMT =
        AT ELEMENT- APOS, DO $HAS-AMT.
   $HAS-AMT =
        AT PRESENT-ELEMENT- X-LN-ELEM,
        ITERATE $GO-TO-NEXT-NODE
        UNTIL $CHK-AMT SUCCEEDS.
   $GO-TO-NEXT-NODE =
        EITHER GO DOWN
        OR ITERATET $GO-UP UNTIL GO RIGHT SUCCEEDS.
   $GO-UP =
        GO UP;
        PRESENT-ELEMENT- IS NOT IDENTICAL TO X-LN-ELEM.
   $CHK-AMT =
        PRESENT-ELEMENT- IS OF TYPE ATOM
        WHERE CORE-ATT HAS MEMBER H-AMT.
   $CORE-ATTS-MATCH =
        X-NEWLIST := X0-ATT;
        INTERSECT OF X1-ATT IS NOT NIL.
   $RAISE-POSTCONJ =
        RIGHT-ADJUNCT-POS OF X-HOST EXISTS;
        AFTER PRESENT-ELEMENT- INSERT X-CONJNODE, X-NEWCONJ;
        AT X-CONJNODE, DO $ERASE-PRE-POST;
        DELETE X-CONJNODE;
        AT X-NEWCONJ, DO PRE-POST-CONJELEM;
        AT IMMEDIATE-NODE OF X-NEWCONJ, TRANSFORM PRESENT-ELEMENT-.
   $ERASE-PRE-POST =
        AT VALUE OF X-LNR,
        ITERATE
        IF PRESENT-ELEMENT- HAS NODE ATTRIBUTE POSTCONJELEM X-POST
        THEN BOTH AT X-POST, ERASE NODE ATTRIBUTE PRECONJELEM
        AND ERASE NODE ATTRIBUTE POSTCONJELEM
        UNTIL GO RIGHT FAILS.
— T-RN-BPART
—       transforms RN:BPART:LNR to RN:PN:P()+NSTGO
—       transforms RN:BPART:ADJ to RN:ADJINRN:LAR:ADJ
T-RN-BPART = IN LNR:
        AT ELEMENT- RN
        ITERATE BOTH $CHANGE-BPART
        AND IF PRESENT-ELEMENT- HAS ELEMENT- RNOPTS
        THEN GO DOWN
        UNTIL GO RIGHT FAILS.
   $CHANGE-BPART =
        IF BOTH PRESENT-ELEMENT- IS RN
        WHERE PRESENT-ELEMENT- IS NOT EMPTY
        AND EITHER PRESENT-ELEMENT- HAS ELEMENT- RNOPTS
        WHERE VALUE IS BPART X-BPART
        OR VALUE IS BPART X-BPART
        THEN DO $REPLACE-BPART.
   $REPLACE-BPART =
        IF VALUE OF X-BPART IS LNR
        THEN REPLACE X-BPART BY
        <PN> (<LP> (<NULL>)
        +<P> = '[]' : ('OF')
        +<NSTGO> (<NSTG> (ALL ELEMENTS OF X-BPART)))
        ELSE IF VALUE OF X-BPART IS ADJ
        THEN REPLACE X-BPART BY
        <ADJINRN> (<LAR> (<LA> (<NULL>)
        +<AVAR> (VALUE OF X-BPART)
        +<RA> (<NULL>))).
— T-ADJUST-LN-CONJ
—       changes COMMASTG in LN to separator.
T-ADJUST-LN-CONJ = IN LN:
        IF BOTH ELEMENT- COMMASTG X-COMMA OF PRESENT-ELEMENT- X-PRE EXISTS
        WHERE ELEMENT- Q-CONJ X-QCONJ EXISTS
        AND AT X-COMMA DO $CHECK-LN
        THEN $MOVE-COMMA.
   $CHECK-LN =
        GO LEFT;
        PRESENT-ELEMENT- IS APOS X-APOS-1;
        NOT $MAJOR-LN-CONJS.
   $MAJOR-LN-CONJS =
        X-APOS-1 HAS NODE ATTRIBUTE POSTCONJELEM X-APOS-2;
        EITHER $NON-ADJS
        OR $CONJOINED-ADJS.
   $NON-ADJS =
        EITHER EITHER X-APOS-2 IS EMPTY
        OR EITHER CORE- OF X-APOS-2 IS NOT ADJ
        OR VALUE OF VALUE OF X-APOS-2 IS QN
        OR EITHER X-APOS-1 IS EMPTY
        OR EITHER CORE- OF X-APOS-1 IS NOT ADJ
        OR VALUE OF VALUE OF X-APOS-1 IS QN.
   $CONJOINED-ADJS =
        CORE-ATT X-ATT1 OF CORE- OF X-APOS-1 IS NOT NIL;
        CORE-ATT X-ATT2 OF CORE- OF X-APOS-2 IS NOT NIL;
        X-MAJOR-CLASS := LIST MAJOR-SEL-CLASS;
        X-MAJOR-CLASS HAS MEMBER X-ATT1;
        X-MAJOR-CLASS HAS MEMBER X-ATT2.
   $MOVE-COMMA =
        ELEMENT- ADJADJ X-ADJ1 OF X-APOS-1 EXISTS;
        ELEMENT- ADJADJ X-ADJ2 OF X-APOS-2 EXISTS;
        AT X-QCONJ, DO $ERASE-PRE-POST;
        AT X-PRE, DO $ERASE-PRE-POST;
        REPLACE X-APOS-1 BY
        <APOS> (<ADJADJ> (X-ADJ1
        +VALUE OF X-ADJ2, X-NEWADJ2));
        DELETE X-QCONJ;
        AFTER LAST-ELEMENT- OF VALUE OF X-ADJ1
        INSERT X-COMMA, X-NEWCOMMA;
        DELETE X-COMMA.
   $ERASE-PRE-POST =
        AT VALUE,
        ITERATE BOTH IF PRESENT-ELEMENT- HAS NODE ATTRIBUTE PRECONJELEM
        THEN ERASE NODE ATTRIBUTE PRECONJELEM
        AND IF PRESENT-ELEMENT- HAS NODE ATTRIBUTE POSTCONJELEM
        THEN ERASE NODE ATTRIBUTE POSTCONJELEM
        UNTIL GO RIGHT FAILS.
— T-ADJUST-CONJ-LAR
—       changes COMMASTG in LAR of LN of singular NCOUNT core noun
—       into comma separator.
—       E.g. 'a pleasant , elderly , white male'
T-ADJUST-CONJ-LAR = IN LAR:
        IF BOTH PRESENT-ELEMENT- X-LAR HAS ELEMENT- COMMASTG X-COMMA
        AND $HOST-SINGULAR
        THEN ITERATE $RAISE-LAR
        UNTIL PRESENT-ELEMENT- X-LAR HAS ELEMENT- COMMASTG X-COMMA
        FAILS.
   $HOST-SINGULAR =
        IMMEDIATE-NODE- OF X-LAR IS ADJADJ X-ADJADJ;
        ASCEND TO APOS;
        BOTH HOST- IS N:NCOUNT1
        AND HOST- IS N:SINGULAR.
   $RAISE-LAR =
        AT X-LAR, DO $ERASE-PRE-POST;
        AT ELEMENT- Q-CONJ X-QCONJ OF X-COMMA, DO $ERASE-PRE-POST;
        REPLACE X-ADJADJ BY
        <ADJADJ> (X-ADJADJ
        +<LAR> X-NEWLAR (ALL ELEMENTS OF X-QCONJ));
        REPLACE X-COMMA BY <COMMASTG> (',' + <NULL>);
        IMMEDIATE-NODE- OF X-NEWLAR IS ADJADJ X-ADJADJ;
        GO TO X-NEWLAR.
   $ERASE-PRE-POST =
        AT VALUE,
        ITERATE BOTH IF PRESENT-ELEMENT- HAS NODE ATTRIBUTE PRECONJELEM
        THEN ERASE NODE ATTRIBUTE PRECONJELEM
        AND IF PRESENT-ELEMENT- HAS NODE ATTRIBUTE POSTCONJELEM
        THEN ERASE NODE ATTRIBUTE POSTCONJELEM
        UNTIL GO RIGHT FAILS.
— ****** ********************************************************
—       *
—       PREPROCESSING SECTION *
—       *
— ****** ********************************************************
— PREPROCESSING TRANSFORMATIONS REGULARIZE SOME STRUCTURES:
—       1. T-CENTER-CONJ TRANSFORMS CONJOINED CENTERS INTO CONJOINED
—       ASSERTIONS OR FRAGMENTS,
—       2. T-RNOPTS ELIMINATES ALL RNOPTS NODES,
—       3. T-SAOPTS ELIMINATES ALL SAOPTS NODES.
— T-CENTER-CONJ
—       transforms conjoined CENTER's into conjoined ASSERTIONs
—       or FRAGMENTs.
T-CENTER-CONJ = IN SENTENCE:
        AT ELEMENT- ONESENT OF ELEMENT- TEXTLET
        IF ELEMENT- CONJ-NODE EXISTS
        THEN BOTH $TRANSF-CENTER
        AND AT X-NEWC ITERATE DO $PRE-POST
        UNTIL AT X500 DO R(CONJ-NODE) FAILS.
   $TRANSF-CENTER =
        IF DESCEND TO CENTER PASSING THROUGH Q-CONJ
        @THEN BOTH DO $REPLACE-CTR
        AND IF AT X1, DO R(CONJ-NODE)
        @THEN DO $TRANSF-CENTER
        ELSE AT X-NEWC, DO $TRANSF-CENTER.
   $REPLACE-CTR =
        PRESENT-ELEMENT- X-CTR EXISTS;
        IF IMMEDIATE-NODE- IS Q-CONJ
        THEN BOTH REPLACE X-CTR BY ALL ELEMENTS OF X-CTR
        @AND STORE IN X1
        ELSE BOTH AT X-CTR DO R(CONJ-NODE) WHERE STORE IN X-C
        AND BOTH DO $LOWER-CENTER-CONJ
        AND DELETE X-C.
   $LOWER-CENTER-CONJ =
        AT LAST-ELEMENT- OF X-CTR,
        EITHER ITERATE $POSTCONJ OR TRUE;
        AFTER PRESENT-ELEMENT- INSERT X-C, X-NEWC.
   $PRE-POST =
        STORE IN X100;
        DO ELEMENT- (Q-CONJ);
        AT VALUE EITHER ITERATE GO RIGHT OR TRUE [DO LAST-ELEMENT-];
        ITERATE VERIFY $ASSIGN-TEST UNTIL GO LEFT FAILS.
   $ASSIGN-TEST =
        EITHER TEST FOR SP-NODE
        OR EITHER $PRECONJ OR $ASSIGN-PRE-POST.
   $ASSIGN-PRE-POST =
        STORE IN X500; STORE IN X0; GO TO X100;
        DO $GOLEFT;
        EITHER ITERATE $POSTCONJ OR TRUE;
        DO $ASSIGN-POST; STORE IN X0; GO TO X500;
        DO $ASSIGN-PRE.
   $GOLEFT =
        ITERATET $UPCONJ UNTIL GO LEFT SUCCEEDS;
        STORE IN X100.
   $UPCONJ = GO UP; TEST FOR Q-CONJ; GO UP.
   $ASSIGN-POST =
        ASSIGN THE PRESENT ELEMENT NODE ATTRIBUTE POSTCONJELEM.
   $ASSIGN-PRE =
        ASSIGN THE PRESENT ELEMENT NODE ATTRIBUTE PRECONJELEM.
— T-SIMPLIFY-CONJS
—       The structure +
—       is reduced to
T-SIMPLIFY-CONJS = IN LNR:
        AT PRESENT-ELEMENT- X-PRE
        IF BOTH ITERATET EITHER PRESENT-ELEMENT- IS COMMASTG X-COMMA
        WHERE BOTH GO RIGHT
        @AND PRESENT-ELEMENT- X-PRE IS ORSTG
        OR ELEMENT- Q-CONJ X-PRE EXISTS
        UNTIL X-PRE HAS ELEMENT- CONJ-NODE FAILS
        AND X-PRE IS ORSTG
        THEN [BOTH REPLACE VALUE OF X-PRE BY ', OR']
        [AND] DELETE X-COMMA.
— T-FILLIN-SUBJ-LINKC
—       [ *GRI*TEMP ]
—       fills in understood subject in conjunction structure.
T-FILLIN-SUBJ-LINKC = IN ASSERTION, FRAGMENT:
        AT VALUE,
        ITERATE
        IF BOTH PRESENT-ELEMENT- IS OF TYPE CONJ-NODE
        WHERE ELEMENT- Q-CONJ X-QCONJ EXISTS
        AND AT X-QCONJ, ELEMENT- SUBJECT X-SUBJ EXISTS
        THEN AT X-SUBJ, DO $FILLIN-SUBJS
        UNTIL GO RIGHT FAILS.
   $FILLIN-SUBJS =
        ITERATE IF VALUE IS NULLC
        WHERE PRESENT-ELEMENT- HAS NODE ATTRIBUTE LINKC X-LINK
        THEN REPLACE X-SUBJ
        BY X-SUBJ (ALL ELEMENTS OF X-LINK)
        UNTIL $CHECK-POSTCONJ-LINKS FAILS.
   $CHECK-POSTCONJ-LINKS =
        X-SUBJ HAS NODE ATTRIBUTE POSTCONJELEM X-NSUBJ;
        IF X-NSUBJ IS IDENTICAL TO X-SUBJ
        THEN BOTH AT X-SUBJ ERASE NODE ATTRIBUTE POSTCONJELEM
        AND FALSE
        ELSE X-SUBJ := X-NSUBJ.
— T-FILLIN-ASSN-NULLC
—       fills in NULLC for conjoined ASSERTION.
T-FILLIN-ASSN-NULLC = IN ASSERTION:
        AT VALUE,
        ITERATE
        IF BOTH PRESENT-ELEMENT- IS OF TYPE CONJ-NODE
        WHERE ELEMENT- Q-CONJ X-QCONJ EXISTS
        AND AT X-QCONJ, ELEMENT- SUBJECT X-SUBJ EXISTS
        THEN AT X-SUBJ, DO $FILLIN-NULLC
        UNTIL GO RIGHT FAILS.
   $FILLIN-NULLC =
        ITERATE
        BOTH ITERATE
        IF VALUE IS NULLC
        THEN IF PRESENT-ELEMENT- X-PRE HAS NODE ATTRIBUTE
        PRECONJELEM X-PC WHERE X-PC IS NOT EMPTY
        THEN REPLACE X-PRE
        BY X-PRE (ALL ELEMENTS OF X-PC)
        ELSE REPLACE X-PRE BY X-PRE (<NULL>)
        ELSE TRUE
        UNTIL GO RIGHT FAILS
        AND GO TO X-SUBJ
        UNTIL X-SUBJ HAS NODE ATTRIBUTE POSTCONJELEM X-SUBJ FAILS.
— T-RELINK-LNR-NULLC
—       reconstructs NULLC structure in conjunction:
—       FOR STRUCTURES SUCH AS 'MY GREEN HAT AND (MY) BLUE
—       COAT ARE IN THE CLOSET'.
—       Note: duplication of QPOS is marked AMBIG.
T-RELINK-LNR-NULLC = IN LNR:
        BOTH PRESENT-ELEMENT- X-QCONJ EXISTS
        AND ITERATET IF VALUE OF X-QCONJ IS LN X1
        THEN AT LAST-ELEMENT- OF X1
        ITERATE $RELINK UNTIL GO LEFT FAILS
        UNTIL ELEMENT- CONJ-NODE OF X-QCONJ EXISTS
        WHERE ELEMENT- Q-CONJ X-QCONJ EXISTS FAILS.
   $RELINK =
        PRESENT-ELEMENT- X4 EXISTS;
        CONJELEM OF X1 EXISTS;
        DESCEND TO X4;
        IF BOTH PRESENT-ELEMENT- X0 IS NOT EMPTY
        AND $TEST
        THEN BOTH REPLACE X-PRE BY X0, X-NEW
        AND $ASSIGN-AMBIG.
   $ASSIGN-AMBIG =
        IF X0 IS QPOS
        THEN AT X-NEW ASSIGN NODE ATTRIBUTE AMBIG.
   $TEST = ONE OF $TPOS, $QPOS, $APOS, $NPOS.
   $TPOS =
        BOTH X0 IS TPOS
        AND ELEMENT- TPOS X-PRE OF X1 IS EMPTY.
   $QPOS =
        BOTH BOTH X0 IS QPOS
        AND ELEMENT- QPOS X-PRE OF X1 IS EMPTY
        AND $TPOS-EMPTY.
   $APOS =
        BOTH BOTH X0 IS APOS
        AND ELEMENT- APOS X-PRE OF X1 IS EMPTY
        AND ALL OF $TPOS-EMPTY, $QPOS-EMPTY.
   $NPOS =
        BOTH BOTH X0 IS NPOS
        AND ELEMENT- NPOS X-PRE OF X1 IS EMPTY
        AND ALL OF $TPOS-EMPTY, $QPOS-EMPTY, $APOS-EMPTY.
   $TPOS-EMPTY = COELEMENT- TPOS OF X-PRE IS EMPTY .
   $QPOS-EMPTY = COELEMENT- QPOS OF X-PRE IS EMPTY .
   $APOS-EMPTY = COELEMENT- APOS OF X-PRE IS EMPTY .
— T-LINKC
—       copies value of node attribute LINKC to a node
—       recalculates the new structure.
—       removes node attribute LINKC
T-LINKC = IN LNR:
        AT ELEMENT- LN,
        ITERATET BOTH STORE IN X-PRE
        AND DO $LNR-LINKC
        UNTIL $GET-POSTCONJ FAILS.
   $GET-POSTCONJ =
        PRESENT-ELEMENT- X-PEC HAS NODE ATTRIBUTE POSTCONJELEM X-POST;
        IF X-POST IS IDENTICAL TO X-PEC
        THEN BOTH BOTH AT X-PEC, ERASE NODE ATTRIBUTE POSTCONJELEM
        AND IF BOTH X-PEC HAS NODE ATTRIBUTE PRECONJELEM X-PRECJ
        AND X-PRECJ IS IDENTICAL TO X-PEC
        THEN AT X-PEC, ERASE NODE ATTRIBUTE PRECONJELEM
        AND FALSE
        ELSE GO TO X-POST.
   $LNR-LINKC =
        BOTH BOTH STORE IN X-LNI
        AND DO $LN-LINKC
        AND IF COELEMENT- RN X-PRE HAS NODE ATTRIBUTE PRECONJELEM
        @THEN DO $MAKE-LINK;
        GO TO X-LNI.
   $LN-LINKC =
        AT VALUE, ITERATE $MAKE-LINK
        UNTIL GO RIGHT FAILS.
   $MAKE-LINK =
        IF PRESENT-ELEMENT- X-NODE HAS NODE ATTRIBUTE LINKC X-LINKC
        THEN ALL OF $CHK-NAS, $COPY-LINKC, $RECALCULATE-LINKC,
   $RESTORE-NAS.
   $CHK-NAS =
        IF X-PRE HAS NODE ATTRIBUTE POSTCONJELEM
        @THEN STORE IN X-POSTCONJ;
        IF X-PRE HAS NODE ATTRIBUTE PRECONJELEM
        @THEN STORE IN X-PRECONJ;
        IF BOTH HOST- X-N2 OF X-LINKC EXISTS
        AND X-N2 HAS NODE ATTRIBUTE N-TO-RN-ATT
        @THEN STORE IN X-COMP2.
   $RESTORE-NAS =
        IF BOTH X-POSTCONJ EXISTS
        AND X-NEWNODE EXISTS
        THEN AT X-NEWNODE, ASSIGN NODE ATTRIBUTE POSTCONJELEM
        WITH VALUE X-POSTCONJ;
        IF BOTH X-PRECONJ EXISTS
        AND X-NEWNODE EXISTS
        THEN AT X-NEWNODE, ASSIGN NODE ATTRIBUTE PRECONJELEM
        WITH VALUE X-PRECONJ;
        IF X-COMP2 EXISTS [* N-TO-RN-ATT is now pointing at *]
        [* LNR of upper RN because of the *]
        [* node attribute readjustment. *]
        THEN AT X-N2, ASSIGN NODE ATTRIBUTE N-TO-RN-ATT
        WITH VALUE X-COMP2.
   $COPY-LINKC =
        IF X-NODE IS RN
        THEN IF X-NODE IS EMPTY
        THEN REPLACE VALUE OF X-NODE
        BY ALL ELEMENTS OF X-LINKC
        ELSE BOTH EITHER ITERATE ELEMENT- RN EXISTS
        WHERE PRESENT-ELEMENT- IS NOT EMPTY
        OR TRUE
        @AND REPLACE PRESENT-ELEMENT- BY X-LINKC
        ELSE IF X-NODE IS EMPTY
        THEN REPLACE X-NODE BY X-LINKC, X-NEWNODE.
   $RECALCULATE-LINKC =
        TRUE.
— T-ADJUST-NNN
—       expands NNN:ADJ into full LXR NNN:LAR
T-ADJUST-NNN = IN NNN:
        IF PRESENT-ELEMENT- X-NNN HAS ELEMENT- ADJ X-ADJ
        THEN REPLACE X-ADJ BY
        <LAR> (<LA> (<NULL>)
        +<AVAR> (X-ADJ)
+<RA> (<NULL>)).
— T-FILLIN-NULLC
—       T-FILLIN-NULLC FILLS IN NULLC IN TPOS, QPOS AND APOS WITH
—       THE VALUE OF LINKC, A POINTER WHICH POINTS FROM THE NULLC
—       TO THE HIGHER XPOS NODE TO WHICH NULLC IS RELATED.

— NOTE: It does not check H-PTPART subtree in APOS, nor
—       does it execute agreement checks.
T-FILLIN-NULLC = IN LNR:
        AT ELEMENT- NVAR X-NVAR
        ITERATET IF COELEMENT- LN X-LN OF X-NVAR EXISTS
        THEN ALL OF $TPOS, $QPOS, $APOS
        UNTIL X-NVAR HAS NODE ATTRIBUTE POSTCONJELEM X-NVAR FAILS.
   $TPOS = AT TPOS OF X-LN DO $NULLC.
   $QPOS = AT QPOS OF X-LN DO $NULLC.
   $APOS = AT APOS OF X-LN DO $NULLC.
   $NULLC =
        IF PRESENT-ELEMENT- X-POS HAS NODE ATTRIBUTE LINKC X-LINKC
        THEN REPLACE X-POS BY X-LINKC.
— T-REDUCE-PAREN
—       removes PAREN-FRAG and PAREN-RN nodes from parse tree. Moves
—       parentheses down to the first word and the last word of the
—       parenthesized phrase.
—       CENTER -> (ASSERTION | SEGADJ | QUISEG | FRAGMENT | OBES) PAREN-FRAG
—       1. PAREN-FRAG -> '(' FRAGMENT ')' | '(' ASSERTION ')' | NULL
—       2. RNSUBJ -> WHS-N | PWHS | VENPASS | PAREN-RN
—       RNOPTS -> PAREN-RN | ... | PAREN-NSTG | ...
—       3. PAREN-RN -> '(' RNOPTS RN ')'
—       4. PAREN-NSTG -> NSTG.
—       RA -> ENOUGH | PAREN-ADJ | PQUANT | ...
—       5. PAREN-ADJ -> '(' *ADJ ')'
T-REDUCE-PAREN = IN CENTER, RN, RA, RNSUBJ [not working]:
        IF PRESENT-ELEMENT- HAS ELEMENT PAREN-FRAG OR PAREN-RN [OR PAREN-NSTG]
        OR PAREN-ADJ X-PAREN
        THEN IF X-PAREN [* case PAREN-FRAG ??? *] IS EMPTY
        THEN DELETE X-PAREN
        ELSE ONE OF $REDUCE-PAREN-FRAG, $REDUCE-RNPAREN,
   $REDUCE-PAREN-ADJ
        ELSE TRUE.
   $REDUCE-RNPAREN =
        X-PAREN IS PAREN-RN;
        REPLACE X-PAREN BY VALUE OF SECOND ELEMENT OF X-PAREN.
   $REDUCE-PAREN-FRAG =
        X-PAREN IS PAREN-FRAG;
        REPLACE X-PAREN BY
        <ANDSTG> X-CONJ (<P> = '[PARENSTG]'
        +<SACONJ> (<NULL>)
        +<Q-CONJ> (SECOND ELEMENT OF X-PAREN))
        [AT X-CONJ, DO PRE-POST-CONJELEM].
   $REDUCE-PAREN-ADJ =
        X-PAREN IS PAREN-ADJ;
        REPLACE X-PAREN BY <ASTG> (<LAR> (<LA> (<NULL>)
        +<AVAR> (SECOND ELEMENT OF X-PAREN)
        +<RA> (<NULL>))).
   $MOVE-LEFT-PAREN =
        DO FIRST-FILLED-ATOM;
        IF DO LEFT-ADJUNCT
        @THEN IF PRESENT-ELEMENT- IS NULL
        THEN REPLACE PRESENT-ELEMENT- BY '('
        ELSE IF VALUE IS NULL
        THEN REPLACE VALUE BY '('
        ELSE AFTER LAST-ELEMENT- INSERT '('
        ELSE BEFORE PRESENT-ELEMENT- INSERT '('.
   $MOVE-RIGHT-PAREN =
        DO LAST-FILLED-ATOM;
        EITHER DO $ASCNT OR TRUE; STORE IN X1;
        AFTER X1 INSERT ')'.
— T-SIMPLIFY-MORERA
T-SIMPLIFY-MORERA = IN RA, RV:
        IF PRESENT-ELEMENT- HAS ELEMENT- MORE-RA OR MORE-RV X-MORE
        THEN REPLACE X-MORE BY ALL ELEMENTS OF X-MORE.
— T-RNOPTS
—       flattens the structure of recursive RN by eliminating RNOPT's
—       and moves all elements of RN under RN.
T-RNOPTS = IN LNR, LWVR, PAREN-RN, Q-CONJ:
        IF EITHER BOTH EITHER ELEMENT- RN X-RN IS NOT EMPTY
        WHERE STORE IN X-ORIG-RN
        OR ELEMENT- RWV X-RN IS NOT EMPTY
        WHERE STORE IN X-ORIG-RN
        AND VALUE OF X-RN IS RNOPTS OR RWVOPTS
        OR ITERATE X-RN HAS NODE ATTRIBUTE POSTCONJELEM X-RN
        WHERE STORE IN X-ORIG-RN
        UNTIL X-RN IS NOT EMPTY SUCCEEDS
        THEN BOTH X-RN1 := X-ORIG-RN
        AND ITERATE BOTH X-RN := X-RN1 AND AT X-RN DO $FLATTEN-RN
        UNTIL X-RN1 HAS NODE ATTRIBUTE POSTCONJELEM X-RN1 FAILS.
   $FLATTEN-RN =
        IF X-RN IS EMPTY
        THEN DELETE X-RN
        ELSE IF EITHER BOTH ELEMENT- RNOPTS X-OPTS EXISTS
        AND ELEMENT- RN X-RN EXISTS
        OR BOTH ELEMENT- RWVOPTS X-OPTS EXISTS
        AND ELEMENT- RWV X-RN EXISTS
        THEN BOTH AT X-OPTS DO $ELIMINATE-RNOPTS
        AND AT X-RN DO $FLATTEN-RN.
   $ELIMINATE-RNOPTS =
        IF BOTH IMMEDIATE-NODE- X1 EXISTS
        AND IMMEDIATE-NODE- OF X1 IS RN OR RWV
        THEN BOTH AFTER LAST-ELEMENT- OF X-OPTS INSERT X-RN, X-RN
        AND REPLACE X1 BY ALL ELEMENTS OF X-OPTS
        ELSE REPLACE X-OPTS BY ALL ELEMENTS OF X-OPTS.
— T-SIMPLIFY-QUANT-TIME
—       'until two days prior to admission]'
T-SIMPLIFY-QUANT-TIME = IN RN:
        IF ALL OF $QUANT-TIME, $PN-TIME
        THEN BOTH IF ELEMENT- RQ X-RQ OF X-QN IS NOT EMPTY
        THEN AFTER LAST-ELEMENT- OF X-RQ INSERT X-PN, X-NEWPN
        ELSE REPLACE X-RQ BY <RQ> (X-PN, X-NEWPN)
        AND DELETE X-PN.
   $QUANT-TIME =
        EITHER ELEMENT- PQUANT X-QUANT EXISTS
        WHERE ELEMENT- QUANT EXISTS
        OR ELEMENT- QUANT X-QUANT EXISTS;
        BOTH PRESENT-ELEMENT- HAS NODE ATTRIBUTE PHRASE-ATT
        WHERE PRESENT-ELEMENT- HAS MEMBER TIME-PHRASE
        AND ELEMENT- QN X-QN EXISTS.
   $PN-TIME =
        THE FOLLOWING-ELEMENT- OF X-QUANT IS PN X-PN;
        EITHER X-PN HAS NODE ATTRIBUTE PHRASE-ATT
        WHERE PRESENT-ELEMENT- HAS MEMBER TIME-PHRASE
        OR X-PN HAS NODE ATTRIBUTE ADVERBIAL-TYPE
        WHERE PRESENT-ELEMENT- HAS MEMBER TIME-ADVERBIAL.
— T-SAOPTS
—       FLATTENS THE STRUCTURE OF SA BY ELIMINATING ALL SAOPTS NODES.
T-SAOPTS = IN SA, LXR:
        IF BOTH PRESENT-ELEMENT- IS SA X-SA
        AND BOTH X-SA IS NOT EMPTY
        AND IMMEDIATE-NODE- X-ASSN IS NOT SA
        THEN AT X-SA DO $FLATTEN-SA
        ELSE IF PRESENT-ELEMENT- HAS ELEMENT- CONJ-NODE X-CONJ-SA
        THEN DO $FLATTEN-SACONJ.
   $FLATTEN-SACONJ =
        ITERATE IF ELEMENT- SACONJ X-SACONJ OF X-CONJ-SA IS NOT EMPTY
        THEN AT VALUE X-SA OF X-SACONJ DO $FLATTEN-SA
        UNTIL ELEMENT- Q-CONJ OF X-CONJ-SA HAS ELEMENT- CONJ-NODE X-CONJ-SA
        FAILS.
   $FLATTEN-SA =
        IF X-SA IS EMPTY
        THEN DELETE X-SA
        ELSE IF BOTH ELEMENT- SAOPTS X-OPTS EXISTS
        AND ELEMENT- SA X-SA EXISTS
        THEN BOTH AT X-OPTS DO $ELIMINATE-SAOPTS
        AND AT X-SA DO $FLATTEN-SA.
   $ELIMINATE-SAOPTS =
        IF BOTH IMMEDIATE-NODE- X1 EXISTS
        AND IMMEDIATE-NODE- OF X1 IS SA
        THEN BOTH AFTER LAST-ELEMENT- OF X-OPTS INSERT X-SA, X-SA
        AND REPLACE X1 BY ALL ELEMENTS OF X-OPTS
        ELSE REPLACE X-OPTS BY VALUE OF X-OPTS.
— T-RELINK-RN
—       The effect of this transformation is to
—       change the decision made earlier -- i.e. copy
—       the RN in a conjunction to its conjelem (X1) even
—       though the RN (X2) has a node attribute
—       NOT-DISTR-RN-ATT pointing to its conjelem (X1).
— -- Do not know the rationale for this move.
T-RELINK-RN = IN LNR:
        IF BOTH ELEMENT- NVAR XN OF PRESENT-ELEMENT- X-QCONJ EXISTS
        WHERE PRESENT-ELEMENT- HAS NODE ATTRIBUTE NO-RN-ATT
        AND ELEMENT- RN X1 EXISTS
        WHERE PRESENT-ELEMENT- HAS NODE ATTRIBUTE POSTCONJELEM X2
        THEN IF BOTH X2 IS NOT EMPTY
        AND X2 HAS NODE ATTRIBUTE NOT-DISTR-RN-ATT X3
        WHERE X3 IS IDENTICAL TO XN
        THEN REPLACE X1 BY X1 (ALL ELEMENTS OF X2).
— T-LT-D
—       expands LT:D into full LXR LT:LDR
—       [980928] moves D:NEG or D-MODAL to RV of VBE verb.
T-LT-D = IN LT:
        IF ELEMENT- D X-D OF PRESENT-ELEMENT- X-PRE EXISTS
        THEN REPLACE X-D BY
        <LDR> X-LDR (<LD> (<NULL>)
        + X-D
        +<RD> (<NULL>));
        IF BOTH X-D IS H-NEG OR H-MODAL
        AND BOTH AT X-PRE, ASCEND TO OBJECTBE
        WHERE IMMEDIATE-NODE- OBJECT X-OBJ EXISTS
        AND CORE- OF COELEMENT- VERB X-VERB OF X-OBJECT IS VBE
        THEN BOTH AFTER LAST-ELEMENT- OF ELEMENT- RV OF ELEMENT-
        LVR OF X-VERB INSERT X-LDR, X-NEWLDR
        AND DELETE X-LDR.
— T-TIME-PHRASE-ARG
—       a PN marked with TIME-PHRASE or TIME-ADVERBIAL
—       may contain an RN which is not a TIME phrase.
—       With exceptions such as 'status_pos' or 's/p'
—       where the phrase will be formatted in a separate IF,
—       this transformation lifts everything under the RN
—       up and puts them on the same level with the PN.
T-TIME-PHRASE-ARGS = IN PN:
        IF BOTH EITHER PRESENT-ELEMENT- X-PRE HAS NODE ATTRIBUTE PHRASE-ATT
        WHERE PRESENT-ELEMENT- HAS MEMBER TIME-PHRASE
        OR PRESENT-ELEMENT- X-PRE HAS NODE ATTRIBUTE ADVERBIAL-TYPE
        WHERE PRESENT-ELEMENT- HAS MEMBER TIME-ADVERBIAL
        AND NOT $EXCEPTIONS
        THEN BOTH EITHER ELEMENT- RN X-RN OF ELEMENT- LNR OF ELEMENT-
        NSTG X-NSTG OF ELEMENT- NSTGO OF X-PRE EXISTS
        OR EITHER ELEMENT- RWV X-RN OF ELEMENT- LWVR OF ELEMENT-
        EKGSTG X-NSTG OF ELEMENT- NSTGO OF X-PRE EXISTS
        OR EITHER ELEMENT- RWV X-RN OF ELEMENT- LNR OF ELEMENT-
        EKGSTG X-NSTG OF ELEMENT- NSTGO OF X-PRE EXISTS
        [* the above two options are no longer true *]
        [* due to T-LWVR-TO-LNR executed before this *]
        OR ELEMENT- RN X-RN OF ELEMENT- LNR OF ELEMENT-
        EKGSTG X-NSTG OF ELEMENT- NSTGO OF X-PRE EXISTS
        AND IF X-RN IS NOT EMPTY
        THEN AT LAST-ELEMENT- OF X-RN
        ITERATE $MOVE-RN-UP UNTIL GO LEFT FAILS.
   $EXCEPTIONS = [* time phrase in a separate HIU *]
        ELEMENT- P IS 'STATUS'_'POST' OR 'S'_'/'_'P'.
   $MOVE-RN-UP =
        IF BOTH VALUE X-PN OF PRESENT-ELEMENT- IS PN
        WHERE NOT $TIME-PHRASE-PN
        AND DO $MAJOR-CLASS
        THEN BOTH BOTH AFTER X-PRE INSERT X-PN, X-NEWPN
        AND BOTH TRANSFORM X-NEWPN
        AND DELETE X-PN
        AND IF VALUE X-RNVAL OF X-RN IS RN OR RWV
        THEN REPLACE X-RNVAL BY ALL ELEMENTS OF X-RNVAL.
   $TIME-PHRASE-PN =
        EITHER PRESENT-ELEMENT- HAS NODE ATTRIBUTE PHRASE-ATT
        WHERE PRESENT-ELEMENT- HAS MEMBER TIME-PHRASE
        OR PRESENT-ELEMENT- HAS NODE ATTRIBUTE ADVERBIAL-TYPE
        WHERE PRESENT-ELEMENT- HAS MEMBER TIME-ADVERBIAL.
   $MAJOR-CLASS =
        CORE-ATT X-NEWLIST OF CORE- OF X-NSTG IS NOT NIL;
        X-MAJOR-CLASS := LIST MAJOR-SEL-CLASS;
        INTERSECT OF X-MAJOR-CLASS IS NOT NIL.
— T-STATUS-POST-SEL
—       The preposition STATUS_POST (and all its variations)
—       can be understood as a connective. Thus, the
—       transformation:
—       1. copies "STATUS POST" as an H-TMLOC to TPOS of
—       the object of preposition STATUS_POST; and
—       2. assigns node attribute SELECT-ATT with value
—       H-CONN to the preposition STATUS_POST.
T-STATUS-POST-SEL = IN PN:
        IF BOTH ELEMENT- P X-P IS 'S'_'/'_'P' OR 'STATUS'_'POST'
        AND CORE- OF NSTG OF ELEMENT- NSTGO EXISTS
        WHERE LEFT-ADJUNCT-POS X-LN EXISTS
        THEN BOTH X-CONN := LIST CONN-LIST
        AND BOTH $INSERT-TIME
        AND AT X-P, ASSIGN NODE ATTRIBUTE SELECT-ATT
        WITH VALUE X-CONN.
   $INSERT-TIME =
        IF ELEMENT- TPOS X-TPOS OF X-LN IS EMPTY
        THEN REPLACE X-TPOS BY
        <TPOS> (<LTR> (<LT> (<NULL>)
        +X-P, X-T
        [+<T> X-T = 'S_/_P':(H-TMLOC)]
        +<RT> (<NULL>)))
        ELSE BEFORE VALUE OF X-TPOS INSERT
        <LTR> (<LT> (<NULL>)
        +X-P, X-T
        [+<T> X-T = 'S_/_P':(H-TMLOC)]
        +<RT> (<NULL>));
        BOTH CORE-ATT X-TIME-ATT OF X-T EXISTS
        AND AT X-T, ASSIGN NODE ATTRIBUTE SELECT-ATT
        WITH VALUE X-TIME-ATT.
— ****** ********************************************************
—       *
—       SEQUENCING TRANSFORMATIONS *
—       *
— ****** ********************************************************
TSEQ-STRING = IN STRING, CENTER:
        EITHER $EXCEPTION [DO NOT TRANSFORM]
        OR BOTH IF DO DOWN1-(VERBAL)
        WHERE PRESENT-ELEMENT- IS NOT EMPTY
        @THEN TRANSFORM PRESENT-ELEMENT-
        [* put VERB in transform stack first *]
        [* It will be transformed last. *]
        AND ALL OF $TRANSFORM-ELEMENTS, $TRANSFORM-INTRO.
   $TRANSFORM-INTRO =
        IF BOTH PRESENT-ELEMENT- IS SENTENCE
        AND VALUE OF ELEMENT SPECIMEN OF INTRODUCER X-INTRO
        OF ONESENT OF TEXTLET IS NOT EMPTY
        @THEN BOTH TRANSFORM VALUE [LNR, ADJ]
        AND IF COELEMENT MORESPEC IS NOT EMPTY
        @THEN TRANSFORM VALUE
        ELSE TRUE
        ELSE IF BOTH PRESENT-ELEMENT- IS SENTENCE
        AND ELEMENT- LNR X-LNR OF X-INTRO EXISTS
        @THEN TRANSFORM X-LNR.
   $TRANSFORM-ELEMENTS =
        AT VALUE EITHER ITERATE GO RIGHT OR TRUE;
        IF PRESENT-ELEMENT- IS EMPTY
        THEN IF $LEFT-NOT-MTY
        @THEN ITERATE VERIFY $WHAT-TO-DO
        UNTIL $LEFT-NOT-MTY FAILS
        ELSE TRUE
        ELSE ITERATE VERIFY $WHAT-TO-DO
        UNTIL $LEFT-NOT-MTY FAILS.
   $LEFT-NOT-MTY =
        ITERATE GO LEFT
        UNTIL BOTH PRESENT-ELEMENT- IS NOT OF TYPE VERBAL
        AND PRESENT-ELEMENT- IS NOT EMPTY SUCCEEDS.
   $WHAT-TO-DO =
        IF ONE OF $VERBAL-TYPE, $ATOM-TYPE, $IS-TEXTLET
        THEN TRUE [DO NOT TRANSFORM]
        ELSE IF $TRANSFORM-TYPE
        @THEN TRANSFORM PRESENT-ELEMENT-.
   $EXCEPTION = EITHER PRESENT-ELEMENT- IS EMPTY
        OR EITHER PRESENT-ELEMENT- HAS ELEMENT- Q-CONJ,
        OR PRESENT-ELEMENT- IS LN [TRANSFORMED IN TSEQ-LXR].
   $TRANSFORM-TYPE =
        ONE OF $STRING-TYPE, $LXR-TYPE, $ADJSET-TYPE,
   $CONJ-TYPE, $OBJ-TYPE, $IS-CENTER, $DESCENT-TYPE.
   $IS-TEXTLET =
        PRESENT-ELEMENT- IS TEXTLET X-TXT;
        ITERATE $TRANS-TEXT
        UNTIL VALUE OF COELEMENT MORESENT OF X-TEMP IS TEXTLET
        X-TXT FAILS.
   $TRANS-TEXT =
        AT ONESENT X-TEMP OF X-TXT TRANSFORM ELEMENT CENTER.
   $IS-CENTER = PRESENT-ELEMENT- IS CENTER.
   $VERBAL-TYPE = PRESENT-ELEMENT- IS OF TYPE VERBAL.
   $ATOM-TYPE = PRESENT-ELEMENT- IS OF TYPE ATOM.
   $STRING-TYPE = PRESENT-ELEMENT- IS OF TYPE STRING.
   $ADJSET-TYPE = PRESENT-ELEMENT- IS OF TYPE ADJSET.
   $LXR-TYPE = PRESENT-ELEMENT- IS OF TYPE LXR.
   $CONJ-TYPE =
        PRESENT-ELEMENT- HAS ELEMENT- Q-CONJ X1;
        IF COELEMENT SACONJ IS NOT EMPTY
        @THEN TRANSFORM VALUE;
        X1 EXISTS.
   $OBJ-TYPE =
        PRESENT-ELEMENT- IS OBJECT OR OBJBE OR PASSOBJ
        WHERE PRESENT-ELEMENT- IS NOT EMPTY.
   $DESCENT-TYPE =
        EITHER DESCEND TO STRING NOT PASSING THROUGH LXR
        OR DESCEND TO LXR.
— TSEQ-OBJ
—       TRANSFORMS STRING OR LXR IN OBJECT-LIKE.
TSEQ-OBJ = IN OBJECT, OBJBE, PASSOBJ:
        IF PRESENT-ELEMENT- IS NOT EMPTY
        THEN EITHER PRESENT-ELEMENT- IS OBJBE
        WHERE PRESENT-ELEMENT- IS OCCURRING IN OBJECT
        [TRANSFORMED ALREADY]
        OR IF $DESCENT-TYPE [GLOBAL IN TSEQ-STRING]
        @THEN TRANSFORM PRESENT-ELEMENT-.
— TSEQ-ADJUNCT
—       TRANSFORMS STRING, LXR AND NNN UNDER AN ADJSET NODE.
TSEQ-ADJUNCT = IN ADJSET:
        IF PRESENT-ELEMENT- IS NOT EMPTY
        THEN AT VALUE
        ITERATE VERIFY IF BOTH $NOT-EMPTY
        AND ONE OF $STRING-TYPE, $LXR-TYPE,
   $DESCENT-TYPE, $NNN-TYPE
        @THEN TRANSFORM PRESENT-ELEMENT-
        UNTIL GO RIGHT FAILS.
   $NOT-EMPTY = PRESENT-ELEMENT IS NOT EMPTY.
   $NNN-TYPE = DESCEND TO NNN NOT PASSING THROUGH LXR.
— TSEQ-LXR
—       TRANSFORMS RADJSET AND LADJSET
TSEQ-LXR = IN LXR:
        BOTH IF ELEMENT RADJSET IS NOT EMPTY
        @THEN TRANSFORM PRESENT-ELEMENT
        AND BOTH IF ELEMENT LADJSET IS NOT EMPTY
        @THEN TRANSFORM PRESENT-ELEMENT
        AND AT VALUE
        ITERATE IF TEST FOR PARENSTG OR DASHSTG
        @THEN TRANSFORM PRESENT-ELEMENT
        UNTIL GO RIGHT FAILS.
— T-CONVERT-PUNCT
—       Turns a hanging punctuation comma from an RX structure into
—       a conjunction comma if the supposed conjuncts are compatible.
— --- NTN 11/11/96 turn off
— ***** This is a crude version with respect to compatibility test.
T-CONVERT-PUNCT = IN LNR, LAR:
        AT LAST-ELEMENT- [RN, RA],
        IF PRESENT-ELEMENT- IS NOT EMPTY
        THEN AT LAST-ELEMENT-, ITERATET $READJUST-RX
        UNTIL GO LEFT FAILS.
   $READJUST-RX =
        IF EITHER FOLLOWING-ELEMENT- X-PN IS ADJINRN
        WHERE AT CORE- OF ELEMENT- LAR, DO $CHK-FOR-PTDATA
        OR X-PN IS PN
        WHERE AT CORE- OF ELEMENT- NSTGO, DO $CHK-FOR-PTDATA
        THEN IF EITHER PRESENT-ELEMENT- X-PRE IS ADJINRN
        WHERE AT ELEMENT- AVAR X-ADJ OF ELEMENT- LAR
        DO $HAS-PUNCT-COMMA
        OR BOTH X-PRE IS PN
        WHERE AT CORE- OF ELEMENT- NSTGO, DO $CHK-FOR-PTDATA
        AND DO $LOOK-FOR-PUNCT
        THEN DO $RAISE-CONJUNCT.
   $CHK-FOR-PTDATA =
        EITHER CORE-ATT HAS MEMBER H-INDIC OR H-DIAG OR H-RESULT OR
        H-TXRES OR H-RESP OR H-NORMAL,
        OR ATTRIBUTE-LIST HAS MEMBER MORPH OR H-POST OR NEG-PREFIX.
   $HAS-PUNCT-COMMA =
        [* Loop down to last comma *]
        IF BOTH AT CORE-, DO $CHK-FOR-PTDATA
        AND X-ADJ HAS NODE ATTRIBUTE POSTCONJELEM X-ADJ
        THEN AT X-ADJ, DO $HAS-PUNCT-COMMA
        ELSE [* Reach last comma *]
        EITHER AT RIGHT-ADJUNCT-POS, DO $LOOK-FOR-PUNCT
        OR DO R(COMMASTG)
        WHERE BOTH PRESENT-ELEMENT- DOES NOT HAVE ELEMENT- Q-CONJ
        AND STORE IN X-COMMA.
   $LOOK-FOR-PUNCT =
        [* Look for the last punctuation by traversing *]
        [* the right edge of the parse tree. *]
        DESCEND TO COMMASTG PASSING THROUGH STRING;
        BOTH PRESENT-ELEMENT- DOES NOT HAVE ELEMENT- Q-CONJ
        AND STORE IN X-COMMA.
   $RAISE-CONJUNCT =
        AFTER IMMEDIATE-NODE- OF X-PRE INSERT X-COMMA, X-PUNCT;
        DELETE X-COMMA;
        IF IMMEDIATE-NODE- OF X-PRE IS RN
        THEN AFTER VALUE OF X-PUNCT INSERT
        <Q-CONJ> (<RN> (X-PN, X-NEWPN))
        ELSE AFTER VALUE OF X-PUNCT INSERT
        <Q-CONJ> (<RA> (X-PN, X-NEWPN));
        DELETE X-PN;
        AT X-PUNCT, DO $PRE-POST;
        DO $ASSIGN-SHARED-CONN;
        GO TO X-PRE.
   $ASSIGN-SHARED-CONN =
        [* If a punctuation comma is raised, which is now having *]
        [* PN under it, and P of PN is H-CONN, then mark P as *]
        [* sharing the connective slot with the comma. *]
        IF X-NEWPN IS PN
        WHERE ELEMENT- P X-P IS H-CONN
        THEN BOTH VALUE X-COMMA OF X-PUNCT EXISTS
        AND AT X-P ASSIGN NODE ATTRIBUTE SHARED-CONNECTIVE
        WITH VALUE X-COMMA.
   $PRE-POST =
        STORE IN X100;
        DO ELEMENT- (Q-CONJ); DO LAST-ELEMENT-;
        ITERATE VERIFY $ASSIGN-TEST UNTIL GO LEFT FAILS.
   $ASSIGN-TEST =
        EITHER TEST FOR SP-NODE
        OR EITHER $PRECONJ OR $ASSIGN-PRE-POST.
   $ASSIGN-PRE-POST =
        STORE IN X500; GO TO X100;
        DO $GOLEFT;
        EITHER ITERATE $POSTCONJ OR TRUE;
        ASSIGN PRESENT ELEMENT NODE ATTRIBUTE POSTCONJELEM WITH VALUE X500;
        AT X500, ASSIGN NODE ATTRIBUTE PRECONJELEM WITH VALUE X100.
   $GOLEFT =
        ITERATET $UPCONJ UNTIL GO LEFT SUCCEEDS;
        STORE IN X100.
   $UPCONJ = GO UP; TEST FOR Q-CONJ; GO UP.
— ******* *********************************************************
—       *
—       S E L E C T I O N A L C O M P O N E N T *
—       *
— ******* *********************************************************
TSEL-GLOBAL = IN SENTENCE:
        [* A DUMMY RESTRICTION, WHICH CONTAINS THE GLOBAL SUBSTATEMENTS]
        [* FOR SELECTION, IN ALPHABETICAL ORDER:]
        [*- $ADD-TO-LIST]
        [*- ASSIGN-COMP-AND-SEL]
        TRUE.
   $ADD-TO-LIST =
        [* adds X-SELs to X-SEL-SAVEs, using UNION *]
        IF X1-SEL IS NOT NIL
        THEN IF BOTH X1-SEL-SAVE EXISTS
        AND X1-SEL-SAVE IS NOT NIL
        THEN BOTH X-UNION:= X1-SEL
        AND X1-SEL-SAVE:= UNION OF X1-SEL-SAVE [X1-SEL]
        ELSE X1-SEL-SAVE:= X1-SEL;
        IF X2-SEL IS NOT NIL
        THEN IF BOTH X2-SEL-SAVE EXISTS
        AND X2-SEL-SAVE IS NOT NIL
        THEN BOTH X-UNION:= X2-SEL
        AND X2-SEL-SAVE:= UNION OF X2-SEL-SAVE [X2-SEL]
        ELSE X2-SEL-SAVE:= X2-SEL;
        IF X3-SEL IS NOT NIL
        THEN IF BOTH X3-SEL-SAVE EXISTS
        AND X3-SEL-SAVE IS NOT NIL
        THEN BOTH X-UNION := X3-SEL
        AND X3-SEL-SAVE:= UNION OF X3-SEL-SAVE [X3-SEL]
        ELSE X3-SEL-SAVE:= X3-SEL.
   $ASSIGN-COMP-AND-SEL =
        [* ASSIGN NEW SELECT-ATT AND IF NECCY A NEW COMPUTED ATT FOR USING ]
        [* XN-SEL AS THE LIST CREATED BY SELECTION ]
        [* INPUT: X-N, ATOM TO RECEIVE SELECT-ATT AND COMPUTED-ATT]
        [* OUTPUT: SELECT-ATT, COMPUTED-ATT (RECOMPUTED) ASSIGNED TO X-N.]
        IF XN-SEL IS NOT NIL
        THEN IF X-N HAS NODE ATTRIBUTE COMPUTED-ATT X-NEWLIST
        THEN EITHER $LEAVE OR $NEW-COMP-AND-SEL
        [* Assign new COMPUTED-ATT and new SELECT-ATT *]
        ELSE $ASSIGN-XN-SEL [* New SELECT-ATT only *].
   $ASSIGN-XN-SEL =
        AT X-N,
        IF XN-SEL IS NOT NIL
        THEN IF EITHER PRESENT-ELEMENT- DOES NOT HAVE ATTRIBUTE
        SELECT-ATT
        OR BOTH PRESENT-ELEMENT- HAS NODE ATTRIBUTE
        SELECT-ATT X-SEL-ATT
        AND X-SEL-ATT DOES NOT HAVE MEMBER XN-SEL
        THEN BOTH $RECOVER-ATTRBS
        AND ASSIGN PRESENT ELEMENT NODE ATTRIBUTE SELECT-ATT
        WITH VALUE XN-SELS.
   $RECOVER-ATTRBS =
        [* Recover subattributes of a node lost in selection *]
        EITHER BOTH X-N IS PRO:NHUMAN OR NAME
        AND X-NEWLIST := LIST HUMAN-LIST
        OR EITHER X-NEWLIST := ATTRIBUTE-LIST OF X-N
        OR BOTH X-N IS TVO
        AND X-NEWLIST := NIL;
        IF X-NEWLIST HAS MEMBER XN-SEL
        THEN [BOTH] XN-SELS := INTERSECT OF XN-SEL
        [AND XN-SELS IS NOT NIL]
        ELSE XN-SELS := XN-SEL.
   $LEAVE = [* LEAVE THOSE WITH SEL OF H-CHANGE, COMPUTED H-INDIC]
        EITHER $CHANGE-INDIC OR $IS-NULLN.
   $CHANGE-INDIC =
        X-NEWLIST HAS MEMBER H-INDIC;
        XN-SEL HAS MEMBER H-CHANGE OR H-CHANGE-MORE OR H-CHANGE-LESS
        OR H-CHANGE-SAME.
   $IS-NULLN = X-N IS NULLN.
   $NEW-COMP-AND-SEL =
        X-COMP-ATT := INTERSECT OF XN-SEL [* and COMPUTED-ATT of X-N *];
        [* XN-SEL WAS CREATED BASED ON THE COMPUTED-ATT LIST OF X-N *]
        [* XN-SEL IS EQUIVALENT TO A SUBSET OF THE COMPUTED-ATT LIST *]
        [* HOWEVER, THE STRUCTURE OF XN-SEL IS NOT CORRECT BECUASE *]
        [* THE ROUTINE INTERSECT CREATED THIS LIST FROM THE GRAMMAR *]
        [* LIST, SUCH AS V-S-O, AND NOT FROM THE COMPUTED-ATT LIST *]
        [* OF X-N, WHICH HAS FOR EACH COMPUTED ATTRIBUTE AN ATTRIBUTE*]
        [* CONSISTING OF THE CORRESPONDING SELECT ATTS. BY GETTING *]
        [* THE INTERSECTION OF XN-SEL AND THE COMPUTED-ATT LIST OF *]
        [* X-N, WE GET X-COMP-ATT, A PROPER SUBSET OF COMPUTED-ATT. *]
        [* SELECT-ATT IS THEN CREATED FROM THIS NEW CORRECT COMP-ATT *]
        XN-COMP-ATT := X-COMP-ATT [SAVE LOC OF BEGINNING OF LIST];
        XN-SEL := NIL;
        ITERATE $CREATE-SEL-ATT
        UNTIL SUCCESSORS X-COMP-ATT OF X-COMP-ATT IS NIL SUCCEEDS;
        DO $ASSIGN-XN-SEL;
        AT X-N, ASSIGN PRESENT ELEMENT NODE ATTRIBUTE COMPUTED-ATT
        WITH VALUE XN-COMP-ATT [ASSIGN COMPUTED-ATT] .
   $OLD-ASSIGN = [ TEMP REMOVED - NEEDS GOING OVER ? ]
        XN-SEL := NIL [INITIALIZE FOR SELECT-ATT];
        [XN-COMP-ATT IS THE NEW COMPUTED-ATT LIST]
        ITERATE $CREATE-SEL-ATT
        [CREATE NEW SELECT-ATT LIST FROM ATT-LIST OF MEMBERS OF COMP-ATT]
        UNTIL BOTH X-COMP-ATT := SUCCESSORS OF X-COMP-ATT
        AND X-COMP-ATT IS NIL
        SUCCEEDS;
        DO $ASSIGN-XN-SEL;
        AT X-N, ASSIGN NODE ATTRIBUTE COMPUTED-ATT WITH VALUE
        XN-COMP-ATT.
   $CREATE-SEL-ATT =
        IF ATTRIBUTE-LIST X-HEAD OF X-COMP-ATT EXISTS
        [ COMPUTED-ATT SUBCLASS HAS NO ATTRIBUTE IF SUBCLASS IS NOT ON ]
        [ LIST N-TO-LN-ATT OR N-TO-RN-ATT. IN THAT CASE THE SUBCLASS IS ]
        [ ADDED TO BOTH THE COMPUTED-ATT LIST AND SELECT-ATT LIST ]
        THEN IF XN-SEL DOES NOT HAVE MEMBER X-HEAD
        THEN PREFIX X-HEAD TO XN-SEL.
[*- ASSIGN-FAIL-SEL]
[* ASSIGN NODE ATTRIBUTE FAIL-SEL TO CURRENT NODE. THIS IS ASSIGNED]
[* TO CORE OF LEFT-ADJUNCTS WHICH CAUSE SELECTION TO FAIL; IT IS ]
[* ALSO ASSIGNED TO CERTAIN RIGHT-ADJUNCTS OR SA'S WHICH FAIL ]
[* SELECTION WHEN NO OTHER POTENTIAL NEW HOST CAN BE FOUND FOR ]
[* IT THAT WILL SATISFY SELECTION. ]
[* Notes: *GRI* assign FAIL-SEL if one of the words is not a major *]
[* class, i.e. those which participate in the format types. *]
   $ASSIGN-FAIL-SEL =
        BOTH DO $PRINT-FAIL-SEL
        AND IF BOTH X-MAJOR-CLASS := LIST MAJOR-SEL-CLASS
        AND ONE OF $X1-IS-MINOR-CLASS,
   $X2-IS-MINOR-CLASS,
   $X3-IS-MINOR-CLASS
        THEN ASSIGN NODE ATTRIBUTE FAIL-SEL
        ELSE DO $REJECT. (GLOBAL)
   $REJECT =
        WRITE ON DIAG ' *major class reject*';
        WRITE ON DIAG END OF LINE;
        FALSE.
   $X1-IS-MINOR-CLASS =
        IF BOTH X1-LIST EXISTS AND X1-LIST IS NOT NIL
        THEN BOTH X-NEWLIST := X1-LIST
        AND INTERSECT OF X-MAJOR-CLASS IS NIL.
   $X2-IS-MINOR-CLASS =
        IF BOTH X2-LIST EXISTS AND X2-LIST IS NOT NIL
        THEN BOTH X-NEWLIST := X2-LIST
        AND INTERSECT OF X-MAJOR-CLASS IS NIL.
   $X3-IS-MINOR-CLASS =
        IF BOTH X3-LIST EXISTS AND X3-LIST IS NOT NIL
        THEN BOTH X-NEWLIST := X3-LIST
        AND INTERSECT OF X-MAJOR-CLASS IS NIL.
   $PRINT-FAIL-SEL =
        X-SEL-NAME := HEAD OF X-NAME-LIST;
        WRITE ON DIAG ' fails ';
        AT X-SEL-NAME, WRITE ON DIAG WORD; WRITE ON DIAG ':';
        ONE OF $SVO-PRINT, $NPN-PRINT, $TIME-PRINT, $OTHER-PRINT;
        WRITE ON DIAG END OF LINE.
   $SVO-PRINT =
        BOTH X-TSEL := SYMBOL 'V-S-O'
        AND X-SEL-NAME IS X-TSEL;
        IF XW1 EXISTS
        THEN BOTH AT XW1, DO $PRINT-WORD
        AND AT X2-LIST, WRITE ON DIAG LIST;
        IF XW2 EXISTS
        THEN BOTH AT XW2, DO $PRINT-WORD
        AND AT X1-LIST, WRITE ON DIAG LIST;
        IF XW3 EXISTS
        THEN BOTH AT XW3, DO $PRINT-WORD
        AND AT X3-LIST, WRITE ON DIAG LIST.
   $NPN-PRINT =
        BOTH X-TSEL := SYMBOL 'P-NSTGO-HOST'
        AND X-SEL-NAME IS X-TSEL;
        IF XW1 EXISTS
        THEN BOTH AT XW1, DO $PRINT-WORD
        AND AT X3-LIST, WRITE ON DIAG LIST;
        IF XW2 EXISTS
        THEN BOTH AT XW2, DO $PRINT-WORD
        AND AT X1-LIST, WRITE ON DIAG LIST;
        IF XW3 EXISTS
        THEN BOTH AT XW3, DO $PRINT-WORD
        AND AT X2-LIST, WRITE ON DIAG LIST.
   $TIME-PRINT =
        BOTH X-TSEL := SYMBOL 'TIME-ADVERBIAL'
        AND X-SEL-NAME IS X-TSEL;
        IF XW1 EXISTS
        THEN BOTH AT XW1, DO $PRINT-WORD
        AND AT X1-LIST, WRITE ON DIAG LIST;
        IF XW2 EXISTS
        THEN BOTH AT XW2, DO $PRINT-WORD
        AND AT X2-LIST, WRITE ON DIAG '(ADVERBIAL-TYPE-LIST)';
        IF XW3 EXISTS
        THEN BOTH AT XW3, DO $PRINT-WORD
        AND AT X3-LIST, WRITE ON DIAG LIST.
   $OTHER-PRINT =
        IF XW1 EXISTS
        THEN BOTH AT XW1, DO $PRINT-WORD
        AND AT X2-LIST, WRITE ON DIAG LIST;
        IF XW2 EXISTS
        THEN BOTH AT XW2, DO $PRINT-WORD
        AND AT X1-LIST, WRITE ON DIAG LIST;
        IF XW3 EXISTS
        THEN BOTH AT XW3, DO $PRINT-WORD
        AND AT X3-LIST, WRITE ON DIAG LIST.
[*- ASSIGN-X2-TYPE *]
[* ASSIGN X2 NODE ATTRIBUTE ADVERBIAL-TYPE WITH *]
[* VALUE X-TYPE-LIST SET BY $CO-OCCUR-CHK . *]
   $ASSIGN-X2-TYPE =
        IF X-TYPE-LIST IS NOT NIL
        THEN AT X2
        IF EITHER PRESENT-ELEMENT- DOES NOT HAVE ATTRIBUTE
        ADVERBIAL-TYPE
        OR PRESENT-ELEMENT- HAS NODE ATTRIBUTE ADVERBIAL-TYPE
        WHERE PRESENT-ELEMENT- DOES NOT HAVE MEMBER X-TYPE-LIST
        THEN ASSIGN NODE ATTRIBUTE ADVERBIAL-TYPE WITH
        VALUE X-TYPE-LIST;
        X-TYPE-LIST:= NIL.
[*- ASSIGN-NA-X2-X3]
[* ASSIGN SELECT-ATT AND COMPUTED ATT (IF NECCY) PROVIDED THAT]
[* X1-SEL IS NOT NIL, I.E. THAT THERE HAS BEEN POSITIVE SELECTION]
[* ALSO X2 AND X3 NODE ATTRIBUTES SET ONLY IF X-COMPSW IS NIL,]
[* THAT IS, ALL ELEMENTS ON X1-LIST WERE ALSO ON THE SELECTION]
[* LIST, SO THAT THERE WAS NO BENIGN PASS FOR X2 AND X3 LISTS.]
[* ** INPUT: X2, X3, X-COMPSW, X1-SEL, X2-SEL, X3-SEL;]
[* ** OUTPUT: ASSIGNS X2 AND X3 SELECT-ATT AND COMPUTED-ATT, USING]
[* $ASSIGN-COMP-AND-SEL - GLOBAL.]
   $ASSIGN-NA-X2-X3 =
        IF X1-SEL IS NOT NIL WHERE EITHER X-COMPSW IS NIL
        OR X-LABSW IS NOT NIL
        THEN $ATTS-NA-X2-X3.
   $ATTS-NA-X2-X3 =
        AT X2, PRESENT-ELEMENT- X-N EXISTS;
        XN-SEL:= X2-SEL [* use X-N and XN-SEL as temporary registers *];
        DO $ASSIGN-COMP-AND-SEL
        [* assign SELECT-ATT and COMPUTED-ATT for X2 *];
        IF X3 EXISTS WHERE PRESENT-ELEMENT- X-N EXISTS
        THEN BOTH XN-SEL:= X3-SEL
        AND $ASSIGN-COMP-AND-SEL
        [ASSIGN SELECT-ATT AND COMPUTED-ATT FOR X3]. (GLOBAL)
[*- ASSIGN-X1-SEL]
[* ASSIGNS NODE ATTRIBUTE SELECT-ATT TO X1, WITH VALUE X1-SEL.]
   $ASSIGN-X1-SEL =
        IF X1-SEL IS NOT NIL [due to fact HOST is not on N-ADJ list]
        THEN BOTH $RECOVER-X1-ATTRBS
        AND AT X1,
        ASSIGN PRESENT ELEMENT NODE ATTRIBUTE SELECT-ATT
        WITH VALUE X1-SELS. (GLOBAL)
   $RECOVER-X1-ATTRBS =
        [* Recover subattributes of a node lost in selection *]
        EITHER BOTH X1 IS PRO:NHUMAN OR NAME
        AND X-NEWLIST := LIST HUMAN-LIST
        OR EITHER X-NEWLIST := ATTRIBUTE-LIST OF X1
        OR EITHER BOTH EITHER X1 IS QN OR X2 IS N [* 990930 *]
        AND X-NEWLIST := X1-LIST
        OR X-NEWLIST := NIL [*20030127*];
        IF X-NEWLIST HAS MEMBER X1-SEL
        THEN [BOTH] X1-SELS := INTERSECT OF X1-SEL
        [AND X1-SELS IS NOT NIL]
        ELSE X1-SELS := X1-SEL.
[*- ASSIGN-X2-SEL]
[* ASSIGNS NODE ATTRIBUTE SELECT-ATT TO X2, WITH VALUE X2-SEL.]
   $ASSIGN-X2-SEL =
        IF X2-SEL IS NOT NIL WHERE EITHER X-COMPSW IS NIL
        OR X-LABSW IS NOT NIL
        THEN BOTH $RECOVER-X2-ATTRBS
        AND AT X2,
        ASSIGN PRESENT ELEMENT NODE ATTRIBUTE SELECT-ATT
        WITH VALUE X2-SELS. (GLOBAL)
   $RECOVER-X2-ATTRBS =
        [* Recover subattributes of a node lost in selection *]
        EITHER BOTH X2 IS PRO:NHUMAN OR NAME
        AND X-NEWLIST := LIST HUMAN-LIST
        OR EITHER X-NEWLIST := ATTRIBUTE-LIST OF X2
        OR BOTH EITHER X2-SEL HAS MEMBER H-NULL [* by WCOMP-ATT0 *]
        OR X2 IS DS OR DT [* assigned by parser *]
        AND X-NEWLIST := X2-SEL;
        IF X-NEWLIST HAS MEMBER X2-SEL
        THEN [BOTH] X2-SELS := INTERSECT OF X2-SEL
        [AND X2-SELS IS NOT NIL]
        ELSE X2-SELS := X2-SEL.
[*- CONN-CHK]
[* CHECKS PRESENT ELEMENT FOR AN ELEMENT ON CONNECTIVE-LIST;]
[* SUCCEEDS IF PRESENT ELEMENT HAS ONE, FAILS OTHERWISE.]
   $CONN-CHK = [* 2000/06/15 remove H-CHANGE *]
        AT CORE-ATT [EITHER] PRESENT-ELEMENT- HAS MEMBER CONNECTIVE-LIST
        [OR PRESENT-ELEMENT- HAS MEMBER H-CHANGE].
[*- CO-OCCUR-CHK]
[* IS USED BY THE SELECTION RESTRICTIONS. IT ASSUMES THAT]
[* X-CO-OCCUR-LIST IS THE GRAMMAR LIST TO BE USED TO CHECK FOR THE]
[* CO-OCCURRENCE OF THE WORD CLASSES THAT ARE IN X1-LIST, X2-LIST]
[* AND X3-LIST. X-CO-OCCUR-LIST IS STRUCTURED AS FOLLOWS:]
[* A1: (B11: (C111,C112,...),... )) .]
[* TO SUCCEED $CO-OCCUR-CHK MUST FIND A BIJ AND A CIJK SUCH THAT FOR]
[* AN AI IN X1-LIST THERE IS A BIJ IN X2-LIST AND A CIJK IN X3-LIST.]
[* FOR EXAMPLE TSEL-OBJ-VS USES LIST V-S-O. IN THE SUBJ-VERB-OBJ]
[* SEQUENCE 'THE DOCTOR OBSERVED STIFFNESS...', X1-LIST]
[* HAS H-OBSERVE FOR SUBCLASS OF VERB 'OBSERVED', X2-LIST HAS NHUMAN]
[* FOR SUBCLASS OF SUBJECT 'DOCTOR', X3-LIST HAS H-INDIC FOR]
[* OBJECT 'STIFFNESS' . LIST V-S-O HAS ON IT]
[* H-OBSERVE:(NHUMAN:(H-INDIC,...),...), SO THAT $CO-OCCUR-CHK WILL]
[* SUCCEED FOR THIS SEQUENCE.]
[* $CO-OCCUR-CHK PRODUCES LISTS X1-SEL, X2-SEL, AND X3-SEL CONTAINING]
[* THE ATTRIBUTES MEETING SELECTION ACCORDING TO X-CO-OCCUR-LIST.]
[* IF X1-SEL IS NIL, $CO-OCCUR-CHK FAILS.]
[* ** INPUT: X1, X2, X3 (IF IT IS INVOVLED IN SELECTION)]
[* X1-LIST, X2-LIST, X3-LIST]
[* X-CO-OCCUR-LIST = PROPER SELECTION LIST]
[* ** OUTPUT: X1-SEL, X2-SEL, X3-SEL ARE COMPUTED;]
[* X-COMPSW = NON-NIL for a benign pass]
[* due to element on operator list not on select list.]
   $CO-OCCUR-CHK =
        IF X3 EXISTS [* initialize X3 if it is needed *]
        THEN X3-SEL:= NIL;
        X-NEWLIST:= X-CO-OCCUR-LIST;
        X-ADV-TYPE:= NIL;
        DO $CHK-X1X2X3.
   $CHK-X1X2X3 =
        IF INTERSECT OF X1-LIST IS NOT NIL
        [* Occurrences of X1 on X-CO-OCCUR-LIST *]
        THEN $CHK-X2-SUBCLASS
        ELSE X1-SEL:= X1-LIST
        WHERE BOTH X-COMPSW:= LIST CONN-LIST
        AND $REMOVE-CONN
        [* DO NOT FAIL- DO NOT ASSIGN X2-SEL, X3-SEL *].
   $CHK-X2-SUBCLASS =
        X1-ATT:= X-INTERSECTION [* of X1-LIST with SELECTION LIST *];
        X-SUBLIST:= X1-ATT;
        X1-LIST-COMP:= COMPLEMENT OF X1-LIST;
        DO $UNIT-TIME-CHK [remove NUNIT from X-LIST if has NTIME1];
        [check each member of X1-LIST in INTERSECTION for selection]
        ITERATE IF $HAS-ATT-LIST
        [* if has attr on SELECTION LIST, check X2 attr *]
        THEN $TEST-FOR-X2CHK
        ELSE $ADD-X1-SEL
        [* If not on SELECTION LIST, then accept it *]
        [* benignly; no X2 or X3 computed in this case *]
        UNTIL BOTH X1-ATT:= SUCCESSORS OF X1-ATT
        AND X1-ATT IS NIL SUCCEEDS;
        DO $ADD-X1-ATT
        [* add subclasses of X1-LIST not on X-CO-OCCUR-LIST *];
        DO $WRITE-MESSAGE.
   $UNIT-TIME-CHK = X-SUBLIST:= LIST NUNIT-LIST;
        IF X1-LIST HAS MEMBER NTIME1
        THEN X1-LIST := COMPLEMENT OF X1-LIST;
        IF X2-LIST HAS MEMBER NTIME1
        THEN X2-LIST:= COMPLEMENT OF X2-LIST;
        IF X3-LIST HAS MEMBER NTIME1
        THEN X3-LIST:= COMPLEMENT OF X3-LIST.
   $WRITE-MESSAGE =
        DO $PRINT-SEL-INFO [GLOBAL];
        X1-SEL IS NOT NIL.
   $HAS-ATT-LIST = X-NEWLIST:= ATTRIBUTE-LIST OF X1-ATT.
   $TEST-FOR-X2CHK =
        EITHER X-NEWLIST HAS MEMBER FAIL-SEL
        [DO NOT PUT X1-ATT ON X1-SEL]
        OR IF X2-LIST IS NIL
        [X2 IS NULLN AND HAS NO SELECT-ATT OR COMPUTED-ATT]
        THEN $ANY-X2-CHK-X3 [ALLOW ANY X2,CHECK X3]
        ELSE $CHK-X2-THEN-X3.
   $CHK-X2-THEN-X3 =
        X-ATTLIST:= X-NEWLIST [GET READY FOR $CHK-FOR-TYPE];
        DO $CHK-FOR-TYPE [* See if attribute is a type on *]
        [* list ADVERBIAL-TYPE-LIST *];
        IF EITHER X-NEWLIST HAS MEMBER PASS-SEL [AUTO PASS]
        WHERE X-INTERSECTION:= X2-LIST [ALL SUBCLASSES]
        OR INTERSECT OF X2-LIST IS NOT NIL
        [* INTERSECTION OF X2-LIST AND ATTRIBUTE-LIST OF X1-ATT *]
        THEN $CHK-X3-FOR-XS [X1 PASSED WITH X2.CHECK X3]
        ELSE BOTH X-ADV-TYPE:= NIL [CANNOT BE TYPE]
        AND IF X1-LIST HAS MEMBER VBE
        [* X1 WITH X2 FAILED; DO NOT ADD TO SELECTION LIST *]
        [* MAKE EXCEPTION IF X1 IS VBE OR BEREP OR P *]
        THEN X1-SEL:= LIST VBE-LIST
        ELSE IF X1-LIST HAS MEMBER BEREP
        THEN X1-SEL:= LIST BEREP-LIST
        ELSE IF BOTH X1 IS P AND X1-SEL IS NIL
        THEN $REMOVE-CONN.
   $REMOVE-CONN = [DO NOT ASSIGN H-CONN UNLESS PASSES DO-EQUIV-TST]
        BOTH X-SUBLIST:= LIST CONN-LIST
        AND X1-SEL:= COMPLEMENT OF X1-LIST [X1-LIST WITHOUT H-CONN].
   $ADD-X1-ATT =
        IF X1-LIST-COMP IS NOT NIL
        THEN BOTH X-UNION:= X1-LIST-COMP
        AND BOTH X1-SEL := UNION OF X1-SEL
        [ADD TO X1-SEL THOSE SUBCL. NOT ON X-CO-OCCUR-LIST]
        AND X-COMPSW := LIST CONN-LIST
        [SET TO NON-NIL TO SHOW THAT THERE IS A COMPLEMENT]
        [LIST; X2-SEL AND X3-SEL WILL NOT BE COMPUTED ].
   $ANY-X2-CHK-X3 =
        X2-ATT := X-NEWLIST
        [USE COMPLETE ATTRIBUTE LIST FROM GRAMMAR LIST INSTEAD OF ]
        [FROM WORD SUBCLASS LIST FOR X2-ATT; GRAMMAR LIST HAS ]
        [SELECTION FOR X3 ON IT ];
        DO $CHECK-X3.
   $CHK-X3-FOR-XS =
        X2-ATT:= X-INTERSECTION;
        [INTERSECTION OF X2-LIST WITH ATTRIBUTE-LIST FROM ]
        [SELECTION LIST FOR CURRENT X2-ATT ]
        DO $CHECK-X3.
   $CHECK-X3 =
        IF X3 EXISTS [IS THERE A TRIPLE TO CHECK]
        THEN $CHECK-X3-SUBCLASS
        ELSE BOTH $ADD-X1X2-SEL
        [THERE IS NO X3; ADD TO X1-SEL AND X2-SEL]
        AND IF X-ADV-TYPE IS NOT NIL [ASSIGN TYPE]
        THEN $ADD-TO-TYPE-LIST.
   $ADD-X1X2-SEL =
        IF X1-LIST-COMP IS NIL[DO NOT COMPUTE X2-SEL AND X3-SEL]
        THEN ITERATE $ADD-X2-SEL
        UNTIL BOTH X2-ATT:= SUCCESSORS OF X2-ATT
        AND X2-ATT IS NIL
        SUCCEEDS;
        DO $ADD-X1-SEL .
   $ADD-X1-SEL =
        X-HEAD := HEAD OF X1-ATT;
        IF X1-SEL DOES NOT HAVE MEMBER X-HEAD
        THEN PREFIX X-HEAD TO X1-SEL.
   $ADD-X2-SEL =
        X-HEAD:= HEAD OF X2-ATT;
        IF X2-SEL DOES NOT HAVE MEMBER X-HEAD
        THEN PREFIX X-HEAD TO X2-SEL.
   $CHECK-X3-SUBCLASS =
        [FOR EACH MEMBER OF X2-ATT MEETING SELECTION, CHECK X3'S]
        ITERATE IF ATTRIBUTE-LIST X-ATTLIST OF X2-ATT EXISTS
        WHERE DO $CHK-FOR-TYPE
        [SET X-NEWLIST TO LIST OF POSSIBLE ATTS FOR X3]
        THEN IF X3-LIST IS NIL
        [X3 IS NULLN & HAS NO SELECT-ATT OR ]
        [COMP-ATT ALLOW ANY X3 SUBCLASS; ]
        [COPY SUBCLASS FROM ATT LIST OF ]
        [X2-ATT ONTO X3-SEL ]
        THEN $ANY-X3
        ELSE IF EITHER X-NEWLIST HAS MEMBER PASS-SEL
        WHERE X-INTERSECTION:= X3-LIST
        OR INTERSECT OF X3-LIST IS NOT NIL
        THEN $ADD-TO-X1X2X3-SEL
        ELSE X-ADV-TYPE:= NIL [NO TYPE IF NO MATCH]
        ELSE
        [IF X2-ATT HAS NO ATTRIBUTE LIST, THERE ]
        [IS NOTHING TO CHECK; SELECTION PASSES ]
        BOTH $ADD-X1-SEL
        AND IF X1-LIST-COMP IS NIL
        THEN $ADD-X2-SEL
        UNTIL BOTH X2-ATT:= SUCCESSORS OF X2-ATT
        AND X2-ATT IS NIL
        SUCCEEDS.
   $CHK-FOR-TYPE = [* Check if attribute is a TYPE *]
        X-NEWLIST:= LIST ADVERBIAL-TYPE-LIST;
        IF INTERSECT OF X-ATTLIST IS NIL
        THEN X-NEWLIST:= X-ATTLIST
        ELSE BOTH X-ADV-TYPE:= X-INTERSECTION [IS A TYPE- SAVE IT]
        AND EITHER X-NEWLIST:= ATTRIBUTE-LIST OF X-ATTLIST
        [FOR A TYPE FIRST TRY TO PICK UP ITS ]
        [ATTRIBUTE LIST FROM X-CO-OCCUR-LIST ]
        OR X-NEWLIST:= ATTRIBUTE-LIST OF X-INTERSECTION
        [IF TYPE HAS NO ATTRIBUTE LIST ON X-CO-OCCUR-]
        [LIST, PICK IT UP FROM ATTRIBUTE LIST OF TYPE]
        [IN ADVERBIAL-TYPE LIST].
   $ANY-X3 =
        X-INTERSECTION := X-NEWLIST
        [ADD COMPLETE ATT. LIST OF X2-ATT TO X3-SEL];
        DO $ADD-TO-X1X2X3-SEL.
   $ADD-TO-X1X2X3-SEL =
        IF X1-LIST-COMP IS NIL
        THEN BOTH ITERATE $ADD-TO-X3-SEL [ADD TO X2-SEL AND X3-SEL]
        UNTIL [ X-INTERSECTION CONTAINS SELECTED ATTRIBUTES ]
        [ FOR X3 GIVEN ATTRIBUTE FOR X1 AND X2 ]
        BOTH X-INTERSECTION := SUCCESSORS OF X-INTERSECTION
        AND X-INTERSECTION IS NIL SUCCEEDS
        AND $ADD-X2-SEL;
        DO $ADD-X1-SEL.
   $ADD-TO-X3-SEL =
        X-HEAD:= HEAD OF X-INTERSECTION;
        IF X3-SEL DOES NOT HAVE MEMBER X-HEAD
        THEN PREFIX X-HEAD TO X3-SEL;
        IF X-ADV-TYPE [* WAS TYPE ON LIST ADVERBIAL-TYPE-LIST *]
        [* USED FOR COMPUTING X3-SEL *] IS NOT NIL
        THEN $ADD-TO-TYPE-LIST.
   $ADD-TO-TYPE-LIST =
        X-ADV-TYPE:= HEAD OF X-ADV-TYPE;
        IF X-TYPE-LIST DOES NOT HAVE MEMBER X-ADV-TYPE
        THEN PREFIX X-ADV-TYPE TO X-TYPE-LIST;
        X-ADV-TYPE:= NIL.
   $DO-EQUIV-TST =
        X2-LIST IS NOT NIL;
        EITHER DO $CHECK-MORE OR TRUE;
        X-SAVE-NAME := X-NAME-LIST;
        X-NAME-LIST := LIST NAME-CONNECTIVE;
        DO $PRINT-SEL;
        X-NAME-LIST := X-SAVE-NAME.
   $SAVE-SEL =
        IF EITHER X1 IS VBE OR BEREP OR H-BECONN
        OR $SOBJBE-X1
        THEN X1-SEL:= LIST BECONN-LIST
        ELSE $X1-H-CONN;
        DO $ADD-TO-LIST [* SAVE XSELS *].
   $FINISH-XSELS = IF X2-SEL IS NOT NIL
        THEN BOTH $PRINT-SUCC AND $SAVE-SEL [SUCCESS]
        ELSE $PRINT-FAIL.
   $CHECK-MORE =
        [* See if X2 and X3 are on attribute list of CONN-TYPE *]
        X-EQUIV-LIST := LIST ADVERBIAL-TYPE-LIST;
        X-EQUIV-LIST HAS MEMBER CONN-TYPE;
        X-NEWLIST := ATTRIBUTE-LIST;
        IF X3-LIST IS NIL
        THEN BOTH $DO-X2-INTERSECT
        AND EITHER $EXCEPT-CHK
        OR X2-SEL := NIL
        ELSE EITHER $DO-BOTH OR $BECONN-IN-VERB;
        IF X2-SEL IS NOT NIL [* found CONN *]
        THEN $SAVE-SEL.
   $BECONN-IN-VERB =
        [* H-BECONN in VERB is actually VBE *]
        BOTH X1-LIST HAS MEMBER H-BECONN
        AND X1 IS OCCURRING IN VERBAL;
        X3-SEL := X3-LIST;
        X2-SEL := X2-LIST.
   $DO-X2-INTERSECT =
        X2-SEL := INTERSECT OF X2-LIST WHERE X2-SEL IS NOT NIL;
        X-POTENT := X2-SEL [* IS A POTENTIAL CONNECTIVE *].
   $DO-X3-INTERSECT =
        X3-SEL:= INTERSECT OF X3-LIST WHERE X3-SEL IS NOT NIL.
   $DO-BOTH=
        DO $DO-X2-INTERSECT;
        IF $DO-X3-INTERSECT
        THEN EITHER $EXCEPT-CHK [* CHECK IF X1 IS ALWAYS AN OPERATOR *]
        OR $CHK-NOT-CONN
        ELSE $EXCEPT-CHK.
   $EXCEPT-CHK =
        [* Literals should be removed when P has proper attributes *]
        EITHER X1-LIST HAS MEMBER
        [ENGLISH] 'EXCEPT' OR 'EXCEPT FOR' OR 'DUE TO'
        OR 'SECONDARY TO' OR 'BECAUSE OF'
        OR [FRENCH] 'SAUF' OR 'HORMIS' OR 'LORS' OR 'LORS DE',
        OR X1 IS
        [ENGLISH] 'EXCEPT' OR 'EXCEPT'_'FOR' OR 'DUE' OR 'SECONDARY'
        OR [FRENCH] 'SAUF' OR 'HORMIS' OR 'LORS' OR 'LORS'_'DE'.
   $CHK-NOT-CONN =
        X-LIST := LIST NOT-CONN-ATT;
        ITERATE $CHK-X-LIST
        UNTIL SUCCESSORS X-LIST OF X-LIST IS NIL SUCCEEDS.
   $CHK-X-LIST =
        X-NEWLIST:= HEAD OF X-LIST;
        X-2NDLIST:= ATTRIBUTE-LIST OF X-LIST;
        IF X2-SEL HAS MEMBER X-NEWLIST
        THEN X3-SEL DOES NOT HAVE MEMBER X-2NDLIST;
        IF X3-SEL HAS MEMBER X-NEWLIST
        THEN X2-SEL DOES NOT HAVE MEMBER X-2NDLIST.
   $SOBJBE-X1 =
        X1 IS SOBJBE OR BESHOW.
   $X1-H-CONN =
        X1-SEL := LIST CONN-LIST [X1-SEL = (H-CONN)].
   $X1-CONJ-LIKE =
        X-CONJ-LIKE := LIST CONJSEL;
        X1 HAS ATTRIBUTE X-CONJ-LIKE;
        X1-SEL := LIST CONJSEL [X1-SEL = (CONJ-LIKE)].
   $PRINT-SUCC =
        WRITE ON INFO 'succeeded';
        DO $PRINT-CONN;
        WRITE ON INFO END OF LINE.
   $PRINT-FAIL =
        WRITE ON DIAG '--- Failed';
        DO $PRINT-CONN;
        WRITE ON DIAG END OF LINE.
   $PRINT-CONN =
        WRITE ON DIAG ' for X1 = ';
        WRITE ON DIAG 'H-CONN or ';
        WRITE ON DIAG 'CONJ-LIKE or ';
        WRITE ON DIAG 'H-BECONN.'.
[* GET-SUBCLASS-LIST]
[* GETS SUBCLASS LIST OF PRESENT ELEMENT AS FOLLOWS: ]
[* IF IT IS NULLN, GETS CORE-SELATT (WHEN IT IS NOT NULLNCLASS);]
[* OTHERWISE TRIES IN ORDER CORE-ATT, CORE-SELATT, OR IF IT IS]
[* PRO SETS LIST TO NIL. OTHERWISE IT FAILS.]
   $GET-SUBCLASS-LIST =
        IF PRESENT-ELEMENT- XNN IS NULLN
        THEN $NULLN-SETUP
        ELSE EITHER CORE-ATT XNN-LIST OF XNN EXISTS
        OR EITHER CORE-SELATT XNN-LIST OF XNN EXISTS
        OR XNN IS PRO WHERE XNN-LIST:= NIL. (GLOBAL)
   $NULLN-SETUP =
        EITHER CORE-SELATT XNN-LIST OF XNN EXISTS
        WHERE PRESENT-ELEMENT- DOES NOT HAVE MEMBER NULLNCLASS
        OR XNN-LIST:= NIL.
[*- TESTRES-TEST]
[* CHECKS FOR CO-OCCURRENCE OF SUBCLASS H-TXRES WITH H-TEST *]
[* /TESTYPE. IF IT FINDS SUCH A PATTERN IN ANY COMBINATION OF *]
[* X1,X2,X3. THE SUBCLASS LIST OF WORD WITH H-TXRES IS SET *]
[* TO H-TXRES ONLY AND THE SUBCLASS OF WORD WITH H-TEST/ *]
[* TESTYPE IS SET TO H-TEST/TESTYPE. THIS HELPS RESOLVE *]
[* SUBCLASS AMBIGUITY WHEN WORD HAS ANOTHER SUBCLASS (OTHER *]
[* THAN H-TXRES). IF IT OCCURS WITH H-TEST/TESTYPE *]
[* THEN IT IS LIKELY THAT IT SHOULD BE H-TXRES. *]
[* X-LABSW IS SET TO NON-NIL IF SUCH A PATTERN IS FOUND *]
   $TESTRES-TEST = X-LABSW:= NIL;
        IF ONE OF $TESTRES-X1, $TESTRES-X2, $TESTRES-X3
        THEN BOTH X-LABSW:= X1 [NON-NIL SIGNAL]
        AND $ADD-TO-LIST [ADD TO SEL LISTS]. (GLOBAL)
   $TESTRES-X1 = X1-LIST HAS MEMBER H-TXRES;
        DO $TEST-X2-X3.
   $TEST-X2-X3 = EITHER $TEST-X2-TEST OR $TEST-X3-TEST;
        X1-SEL:= LIST TESTRES-LIST.
   $TEST-X2-TEST = AT X2-LIST DO $CHECK-H-TEST;
        X2-LIST:= NIL;
        PREFIX X-TEMP TO X2-LIST;
        X2-SEL:= X2-LIST.
   $TEST-X3-TEST = AT X3-LIST DO $CHECK-H-TEST;
        X3-LIST:= NIL; PREFIX X-TEMP TO X3-LIST;
        X3-SEL:= X3-LIST.
   $TEST-X1-TEST = AT X1-LIST DO $CHECK-H-TEST;
        X1-LIST:= NIL; PREFIX X-TEMP TO X1-LIST;
        X1-SEL:= X1-LIST.
   $CHECK-H-TEST =
        PRESENT-ELEMENT- HAS MEMBER H-TXVAR OR H-TXSPEC OR
        H-PTSPEC X-TEMP;
        X-TEMP:= HEAD OF X-TEMP.
   $TESTRES-X2 = X2-LIST HAS MEMBER H-TXRES;
        DO $TEST-X1-X3.
   $TESTRES-X3 = X3-LIST HAS MEMBER H-TXRES;
        DO $TEST-X1-X2.
   $TEST-X1-X3 = EITHER $TEST-X1-TEST OR $TEST-X3-TEST;
        X2-SEL:= LIST TESTRES-LIST.
   $TEST-X1-X2 = EITHER $TEST-X1-TEST OR $TEST-X2-TEST;
        X3-SEL:= LIST TESTRES-LIST.
[*- PRINT-SEL-INFO]
[* PRINTS OUT SELECTION INFORMATION ON TAPE 7]
[* ** INPUT: X1, X2, X3 (IF EXISTS)]
[* X1-LIST, X2-LIST, X3-LIST]
[* X1-SEL, X2-SEL, X3-SEL]
[* X-NAME-LIST (WITH NAME OF LIST USED IN SELECTION)]
[* X-COMPSW (NON-ENIL MARKS BENIGN PASS)]
[*]
   $PRINT-SEL-INFO = [* print message for active selection *]
        IF X1-LIST HAS MEMBER VBE OR BEREP
        THEN IF X2-SEL IS NOT NIL [ACTIVE SELECTION]
        THEN $PRINT-SEL
        ELSE TRUE
        ELSE IF BOTH X1 IS P AND BOTH X2-SEL IS NIL
        AND X-COMPSW IS NOT NIL [* no P + N on list *]
        THEN TRUE [DO NOT FAIL-DO NOT PRINT]
        ELSE $PRINT-SEL.
   $PRINT-SEL = DO $PRINT-SEL-MESSGE;
        DO $PRINT-RESULT.
   $PRINT-SEL-MESSGE =
        DO $PRINT-SEL-WORDS;
        [* write for HTML table *]
        DO $PRINT-FOR-TABLE;
        DO $PRINT-X1;
        IF X2 EXISTS THEN $PRINT-X2;
        IF X3 EXISTS THEN $PRINT-X3. (GLOBAL)
   $PRINT-WORD =
        BOTH WRITE ON DIAG ' "'
        AND WRITE ON DIAG WORDS SUBSUMED;
        WRITE ON DIAG '" '.
   $PRINT-SEL-WORDS = [* print main words involved in selection *]
        WRITE ON INFO ' >>> Selection for "';
        IF XW1 EXISTS
        @THEN BOTH WRITE ON INFO WORDS SUBSUMED AND WRITE ON INFO ' ';
        IF XW2 EXISTS
        @THEN WRITE ON INFO WORDS SUBSUMED;
        IF XW3 EXISTS
        @THEN BOTH WRITE ON INFO ' ' AND WRITE ON INFO WORDS SUBSUMED;
        WRITE ON INFO '" ';
        IF X1-SEL IS NIL THEN WRITE ON INFO '-'
        ELSE WRITE ON INFO '+';
        WRITE ON INFO END OF LINE.
   $PRINT-NEW-HOST =
        WRITE ON INFO ' Selection will be ';
        WRITE ON INFO 'tried where HOST = ';
        AT X-HOST DO $PRINT-NODE-INFO;
        WRITE ON INFO END OF LINE. (GLOBAL)
   $PRINT-RESULT =
        IF X1-SEL IS NIL
        THEN WRITE ON INFO ' --- Failure '
        ELSE WRITE ON INFO ' +++ Success ';
        WRITE ON INFO 'indicated using LIST ';
        AT X-NAME-LIST WRITE ON INFO LIST [ELEMENT];
        WRITE ON INFO END OF LINE;
        IF X-COMPSW IS NOT NIL [* write automatic success *]
        THEN $PRINT-MESSGE;
        [WRITE ON INFO END OF LINE;]
        WRITE ON INFO END OF LINE. (GLOBAL)
   $PRINT-MESSGE =
        WRITE ON INFO ' <<< Automatic success: ';
        WRITE ON INFO 'Subclass(es) of X1 not on ';
        WRITE ON INFO 'list >>>';
        WRITE ON INFO END OF LINE.
   $PRINT-RESTR-INFO =
        DO $PRINT-RESTR;
        DO $PRINT-X1;
        IF X2 EXISTS THEN $PRINT-X2;
        IF X3 EXISTS THEN $PRINT-X3;
        WRITE ON INFO END OF LINE.
   $PRINT-RESTR =
        WRITE ON INFO ' *** Executing restriction';
        AT X-NAME-LIST WRITE ON INFO LIST [WORD];
        WRITE ON INFO ' in ';
        AT X-PRE DO $PRINT-NODE-INFO;
        WRITE ON INFO END OF LINE;
        WRITE ON INFO 'IMMEDIATE-NODE- is ';
        AT IMMEDIATE-NODE- OF X-PRE DO $PRINT-NODE-INFO;
        WRITE ON INFO END OF LINE. (GLOBAL)
   $PRINT-X1 =
        WRITE ON INFO ' X1 = ';
        AT X1, DO $PRINT-NODE-INFO;
        WRITE ON INFO ' -> X1-LIST = ';
        AT X1-LIST, DO $PRINT-LIST-INFO;
        WRITE ON INFO ' X1-SEL = ';
        IF X1-SEL IS NIL THEN WRITE ON INFO 'NIL'
        ELSE AT X1-SEL DO $PRINT-LIST-INFO;
        WRITE ON INFO END OF LINE. (GLOBAL)
   $PRINT-X2 =
        WRITE ON INFO ' X2 = ';
        AT X2, DO $PRINT-NODE-INFO;
        WRITE ON INFO ' -> X2-LIST = ';
        AT X2-LIST DO $PRINT-LIST-INFO;
        WRITE ON INFO ' X2-SEL = ';
        IF X2-SEL IS NIL THEN WRITE ON INFO 'NIL'
        ELSE AT X2-SEL DO $PRINT-LIST-INFO;
        WRITE ON INFO END OF LINE.
   $PRINT-X3 =
        WRITE ON INFO ' X3 = ';
        AT X3, DO $PRINT-NODE-INFO;
        WRITE ON INFO ' -> X3-LIST = ';
        AT X3-LIST, DO $PRINT-LIST-INFO;
        WRITE ON INFO ' X3-SEL = ';
        IF X3-SEL IS NIL THEN WRITE ON INFO 'NIL'
        ELSE AT X3-SEL DO $PRINT-LIST-INFO;
        WRITE ON INFO END OF LINE.
   $PRINT-LIST-INFO =
        WRITE ON INFO LIST ELEMENT
        [WRITE ON INFO '.'].
   $PRINT-NODE-INFO =
        VERIFY WRITE ON INFO NODE NAME;
        VERIFY WRITE ON INFO ' which subsumes "';
        WRITE ON INFO WORDS SUBSUMED;
        WRITE ON INFO '" '.
   $PRINT-FOR-TABLE =
        [* Write successful/benign-passed selections *]
        [* to build a selection table with examples. *]
        IF X1-SEL IS NIL
        THEN WRITE ON INFO ' #- '
        ELSE IF X-COMPSW IS NIL
        THEN WRITE ON INFO ' #+ '
        ELSE WRITE ON INFO ' #? ' [* automatic success *];
        AT X-NAME-LIST, WRITE ON INFO LIST;
        WRITE ON INFO '@';
        IF X1 EXISTS
        @THEN BOTH WRITE ON INFO WORDS SUBSUMED
        AND BOTH BOTH AT X1, DO $PRINT-NODE-FOR-TABLE
        AND IF X1-SEL IS NIL
        THEN IF X1-LIST IS NIL
        THEN WRITE ON INFO '(NIL)'
        ELSE AT X1-LIST WRITE ON INFO LIST
        ELSE AT X1-SEL WRITE ON INFO LIST
        AND WRITE ON INFO '@';
        IF X2 EXISTS
        @THEN BOTH BOTH $WRITE-N-TO-LN
        AND BOTH WRITE ON INFO WORDS SUBSUMED
        AND $WRITE-N-TO-RN
        AND BOTH AT X2, DO $PRINT-NODE-FOR-TABLE
        AND IF X2-SEL IS NIL
        THEN IF X2-LIST IS NIL
        THEN WRITE ON INFO '(NIL)'
        ELSE AT X2-LIST WRITE ON INFO LIST
        ELSE AT X2-SEL WRITE ON INFO LIST;
        IF BOTH X3 EXISTS
        AND $NOT-PRED-ADJ [* eliminate subject-pred situation *]
        THEN BOTH WRITE ON INFO '@'
        AND BOTH AT X3, BOTH $WRITE-N-TO-LN
        AND BOTH WRITE ON INFO WORDS SUBSUMED
        AND $WRITE-N-TO-RN
        AND BOTH AT X3, DO $PRINT-NODE-FOR-TABLE
        AND IF X3-SEL IS NIL
        THEN IF X3-LIST IS NIL
        THEN WRITE ON INFO '(NIL)'
        ELSE AT X3-LIST WRITE ON INFO LIST
        ELSE AT X3-SEL WRITE ON INFO LIST;
        WRITE ON INFO '@';
        WRITE ON INFO IDENTIFICATION;
        WRITE ON INFO ' #'; [* mark the end of the tbl line *]
        WRITE ON INFO END OF LINE.
   $WRITE-N-TO-RN =
        IF PRESENT-ELEMENT- HAS NODE ATTRIBUTE N-TO-RN-ATT
        @THEN BOTH WRITE ON INFO ' '
        AND WRITE ON INFO WORDS SUBSUMED.
   $WRITE-N-TO-LN =
        IF PRESENT-ELEMENT- HAS NODE ATTRIBUTE N-TO-LN-ATT
        @THEN BOTH WRITE ON INFO WORDS SUBSUMED
        AND WRITE ON INFO ' '.
   $NOT-PRED-ADJ =
        X-N-ADJ := SYMBOL 'N-ADJ';
        X-NAME-LIST DOES NOT HAVE MEMBER X-N-ADJ;
        X2 IS NOT IDENTICAL TO X3
        [EITHER X3-SEL IS NOT NIL] [* predicate adjective *]
        [OR X3-LIST IS NOT NIL].
   $PRINT-NODE-FOR-TABLE =
        BOTH WRITE ON INFO '#'
        AND VERIFY WRITE ON INFO NODE NAME;
        WRITE ON INFO ':'.
   $PRINT-NOCHNGE =
        WRITE ON INFO ' <<< Could not find ';
        WRITE ON INFO 'successful match for ';
        WRITE ON INFO 'any NEW HOST >>>';
        WRITE ON INFO END OF LINE;
        WRITE ON INFO ' <<< Original structure';
        WRITE ON INFO ' not changed >>>';
        WRITE ON INFO END OF LINE;
        WRITE ON INFO END OF LINE.
[*- SELECT-ON]
[* USED AS A SWITCH TO CHECK IF SELECTION HAS BEEN TURNED]
[* ON OR OFF. ON = TRUE; OFF = FALSE.]
[*]
   $SELECT-ON = TRUE.
[*- SET-X2-LIST]
[* SETS X2-LIST FOR NON-EMPTY CORE OR CORE = NULLN OR PRO]
[* (X2-LIST = NIL IN THESE CASES).]
[* INITIALIZES X-COMPSW TO NIL.]
   $SET-X2-LIST =
        VERIFY X-COMPSW:= NIL;
        CORE- X2 OF NSTGO OF X-PN EXISTS;
        AT X2 DO $GET-SUBCLASS-LIST [GLOBAL IN TSEL-GLOBAL];
        X2-LIST := XNN-LIST [SET IN GET-SUBCLASS]. (GLOBAL)
[*- SET-SEL]
[* INITIALIZES X1/2/3-SEL TO NIL]
   $SET-SEL =
        X1-SEL := NIL;
        X2-SEL := NIL;
        X3-SEL := NIL. (GLOBAL)
— TSEL-NVAR-TPOS
—       *ad hoc*
—       selects H-INST in NVAR for TPOS H-INST,
—       e.g. your (H-INST) facility (H-INST H-PTFUNC)...
TSEL-NVAR-TPOS = IN LNR:
        PRESENT-ELEMENT- X-PRE EXISTS;
        IF ALL OF $TPOS-H-INST, $NVAR-H-INST
        THEN $ASSIGN-H-INST-SEL.
   $TPOS-H-INST =
        CORE- X2 OF ELEMENT- TPOS OF ELEMENT- LN IS T:H-INST.
   $NVAR-H-INST =
        CORE-ATT OF CORE- X1 HAS MEMBER H-INST.
   $ASSIGN-H-INST-SEL =
        X-INST := SYMBOL H-INST;
        X-SEL-INST := NIL;
        PREFIX X-INST TO X-SEL-INST;
        AT X1, ASSIGN NODE ATTRIBUTE SELECT-ATT WITH VALUE X-SEL-INST.
— TSEL-NVAR-NPOS
—       computes selection between compound nouns, namely NVAR (X1)
—       and NPOS (X2) using LIST N-NPOS. Restriction is done only
—       if both nounds have SUBLANGUAGE SELECTION ATTRIBUTES;
—       Note: if NPOS caused COMPUTED ATTRIBUTE, no selection is checked.
— -- Feb 4, 1997, add conjuncts
TSEL-NVAR-NPOS = IN LNR:
        PRESENT-ELEMENT- X-PRE EXISTS;
        ITERATE
        IF ALL OF $NPOS-NOT-EMPTY, $CORE-NOT-NULLN, $GET-X1-LIST,
   $GET-NPOS, $SET-LIST-REG
        THEN IF BOTH $TESTRES-TEST AND $CO-OCCUR-CHK
        THEN ALL OF $ASSIGN-X1-SEL,
   $ASSIGN-X2-SEL,
   $ASSIGN-X2-TYPE [TSEL-GLOBAL]
        ELSE AT X2 DO $ASSIGN-FAIL-SEL [GLOBAL- failed selection]
        UNTIL X-PRE HAS ELEMENT- CONJ-NODE
        WHERE ELEMENT- Q-CONJ X-PRE IS NOT EMPTY
        FAILS.
   $NPOS-NOT-EMPTY =
        ELEMENT- LN EXISTS WHERE ELEMENT NPOS X5 IS NOT EMPTY.
   $CORE-NOT-NULLN =
        THE CORE- X1 IS NOT NULLN;
        DO $NO-N-TO-LN-ATT.
   $NO-N-TO-LN-ATT =
        [* If COMPUTED ATTRIBUTE from NPOS present, do not redo *]
        [* selection. Do selection for compound nouns if *]
        [* COMPUTED ATTRIBUTE from TPOS, QPOS, OR APOS. *]
        IF X1 [CORE OF NVAR] HAS NODE ATTRIBUTE N-TO-LN-ATT
        @THEN NOT ASCEND TO NPOS.
   $GET-X1-LIST = CORE-SELATT X1-LIST OF X1 EXISTS.
   $GET-NPOS =
        CORE X2 OF X5 EXISTS WHERE CORE-SELATT X2-LIST EXISTS .
   $SET-LIST-REG =
        X1-SEL:= NIL; X2-SEL:=NIL;
        XW1:=X2; XW2:=X1 [* Words for selection printout *];
        X-NAME-LIST:= LIST NAME-N-NPOS;
        X-CO-OCCUR-LIST:= LIST N-NPOS;
        X-TYPE-LIST:= NIL;
        X-COMPSW:= NIL.
— TSEL-NNN-N
—       COMPUTE SELECTION BETWEEN N OR VING (X1) AND NNN IN NPOS (X2)
—       USING COMPOUND-NOUN LIST N-NPOS; DONE ONLY IF BOTH X1 AND X2
—       HAVE SUBLANGUAGE CLASSES.
—       ** NOTE: MULTIPLE NNN IN NPOS ARE TREATED AS IF THEY FORMED COMPOUND
—       ** NOUNS WITH THE NOUN IMMEDIATELY TO ITS RIGHT; THUS A
—       ** STRING NNN IS NOW (INCORRECTLY) ALWAYS TREATED AS IF IT IS:
—       ** ((NN)N),E.G., ((CHEST PAIN) MEDICATION) VS (HOSPITAL
—       ** (MENINGITIS CONSULTANT)). THE ((NN)N) READING SHOULD BE
—       ** REPRESENTED AS N IN LCDN ON NNN; THE SECOND READING WOULD
—       ** THEN BE REPRESENTED BY MULTIPLE NNN IN NPOS, ALL MODIFYING
—       ** THE HEAD NOUN.
TSEL-NNN-N = IN NNN:
        X1-SEL:= NIL;
        IF PRESENT-ELEMENT- X-PRE HAS ELEMENT NNN X5
        @THEN BOTH PRESENT-ELEMENT- HAS COELEMENT- N OR VING X1
        AND BOTH LAST-ELEMENT- OF X5 IS N OR VING X2
        AND $SEL-NNN-N.
   $SEL-NNN-N =
        X2-SEL:= NIL;
        X-NAME-LIST:= LIST NAME-N-NPOS;
        X-CO-OCCUR-LIST:= LIST N-NPOS;
        X-COMPSW:= NIL;
        X-TYPE-LIST:= NIL;
        IF CORE-SELATT X1-LIST OF X1 EXISTS
        THEN IF CORE-SELATT X2-LIST OF X2 EXISTS
        WHERE BOTH XW1:= X2 AND XW2:=X1 [FOR SEL PRINTOUT]
        THEN IF BOTH $TESTRES-TEST AND $CO-OCCUR-CHK
        THEN ALL OF $ASSIGN-X1-SEL, $ASSIGN-X2-SEL,
   $ASSIGN-X2-TYPE [TSEL-GLOBAL]
        ELSE AT X2 DO $ASSIGN-FAIL-SEL [GLOBAL- FAILED SELECT].
— TSEL-NVAR-APOS
—       compute selection between N (X1) in NVAR and LAR1 (X2) in APOS,
—       using LIST N-ADJ. LQNR in APOS is not checked for selection,
—       but it should be ('A 102 DEGREE TEMPERATURE').
—       Selection done only if both HOST and ADJECTIVE have a sublanguage
—       class.
— *** NOTE: IF THERE IS A COMPUTED ATTRIBUTE FROM NPOS OR APOS,
— *** SELECTION IS NOT DONE AT THE MOMENT;
TSEL-NVAR-APOS = IN LNR:
        DO $SEL-NVAR-APOS.
   $SEL-NVAR-APOS =
        PRESENT-ELEMENT- X-PRE EXISTS;
        IF ALL OF $APOS-EXISTS, $APOS-IN-PRECONJ, $APOS-NOT-EMPTY,
   $GET-X1-LIST
        THEN IF X1 IS NULLN
        THEN IF CORE-SELATT X1-LIST HAS MEMBER NULLNCLASS
        THEN EITHER $APOS-QN-CHK OR TRUE
        ELSE TRUE
        ELSE BOTH $SET-N-ADJ-REG
        AND $SEL-APOS.
   $APOS-EXISTS =
        ELEMENT- APOS X5 OF ELEMENT LN EXISTS.
   $APOS-NOT-EMPTY =
        X5 IS NOT EMPTY.
   $APOS-IN-PRECONJ =
        [* To make sure that APOS X5 is not in POSTCONJELEM *]
        AT ELEMENT- LN
        EITHER PRESENT-ELEMENT- HAS NODE ATTRIBUTE PRECONJELEM
        OR ITERATET BOTH EITHER ELEMENT- APOS X-APOS IS EMPTY
        OR X-APOS IS NOT IDENTICAL TO X5
        AND GO TO X-LN
        UNTIL PRESENT-ELEMENT- HAS NODE ATTRIBUTE POSTCONJELEM X-LN FAILS.
   $GET-X1-LIST =
        CORE- X1 EXISTS;
        CORE-SELATT X1-LIST OF X1 EXISTS.
   $APOS-QN-CHK =
        ITERATE VALUE X5 OF X5 IS ADJADJ
        UNTIL $CHECK-QN SUCCEEDS.
   $CHECK-QN =
        CORE- OF LAST-ELEMENT- OF X5 IS QN;
        BOTH N IS NTIME1
        AND CORE OF SCALESTG IS 'OLD';
        X1-SEL:= LIST HUMAN-LIST;
        DO $ASSIGN-X1-SEL.
   $SET-N-ADJ-REG =
        X-NAME-LIST:= LIST NAME-N-ADJ;
        X-TYPE-LIST:= NIL;
        X-CO-OCCUR-LIST := LIST N-ADJ
        [* Selection between NOUN and ADJECTIVE in LN].
   $SEL-APOS =
        X1-SEL:= NIL [INITIALIZE SELECT LIST FOR X1];
        ITERATET $ADJ-QNPOS
        UNTIL VALUE X5 OF X5 IS ADJADJ FAILS [TEST ALL ADJECTIVES];
        DO $ASSIGN-X1-SEL.
   $ADJ-QNPOS =
        AT LAST-ELEMENT- OF X5,
        IF CORE X2 IS ADJ OR VEN OR VING OR DS [*1/27/2003*]
        WHERE CORE-SELATT X2-LIST EXISTS
        THEN ALL OF $EDIT-X2-LIST, $ADJ.
   $EDIT-X2-LIST =
        [* Dealing with H-PTPART and H-PTAREA: *]
        [* This makes sure that both are *]
        [* H-PTPART or both are H-PTAREA. *]
        IF BOTH X1-LIST HAS MEMBER H-PTPART OR H-PTAREA
        AND X2-LIST HAS MEMBER H-PTPART OR H-PTAREA
        THEN ONE OF $BOTH-BPART, $PTPART, $PTAREA
        ELSE [* a TMEND adjective on a PTFUNC is an INDIC *]
        IF BOTH X1-LIST HAS MEMBER H-PTFUNC
        AND X2-LIST HAS MEMBER H-TMEND
        THEN DO $ASSIGN-INDIC.
   $ASSIGN-INDIC =
        X-NEW := NIL;
        X-INDIC := SYMBOL H-INDIC;
        X-PTFUNC := SYMBOL H-PTFUNC;
        ITERATE BOTH X-HEAD := HEAD OF X1-LIST
        AND IF X-HEAD IS IDENTICAL TO X-PTFUNC
        THEN PREFIX X-INDIC TO X-NEW
        ELSE PREFIX X-HEAD TO X-NEW
        UNTIL X1-LIST := SUCCESSORS OF X1-LIST
        WHERE X1-LIST IS NIL SUCCEEDS;
        X1-LIST := X-NEW;
        AT X1, ASSIGN NODE ATTRIBUTE SELECT-ATT WITH VALUE X1-LIST.
   $BOTH-BPART =
        X-NEWLIST := X2-LIST;
        INTERSECT OF X1-LIST IS NOT NIL;
        STORE IN X2-LIST.
   $PTPART =
        X-NEWLIST := NIL;
        X-PTP := SYMBOL H-PTPART;
        PREFIX X-PTP TO X-NEWLIST;
        INTERSECT OF X2-LIST IS NOT NIL;
        STORE IN X2-LIST.
   $PTAREA =
        X-NEWLIST := NIL;
        X-PTP := SYMBOL H-PTAREA;
        PREFIX X-PTP TO X-NEWLIST;
        INTERSECT OF X2-LIST IS NOT NIL;
        STORE IN X2-LIST.
   $ADJ =
        VERIFY X2-SEL:= NIL;
        VERIFY X-COMPSW:= NIL;
        VERIFY BOTH XW1:=X2 AND XW2:=X1 [for selection printout];
        IF BOTH $TESTRES-TEST AND $CO-OCCUR-CHK
        THEN ALL OF $ASSIGN-X2-SEL,$ASSIGN-X2-TYPE,$RESET-X1-LIST
        ELSE $APOS-NPOS-SEL.
   $RESET-X1-LIST =
        IF X1-SEL IS NOT NIL THEN X1-LIST:= X1-SEL. (GLOBAL)
   $APOS-NPOS-SEL =
        [* Try selection between ADJ and N in NPOS *]
        IF COELEMENT NPOS X4 OF IMMEDIATE APOS OF X5 IS NOT EMPTY
        WHERE CORE X1 [new host for ADJ] EXISTS
        THEN IF CORE-SELATT X1-LIST OF X1 EXISTS
        WHERE BOTH XW2:=X1 AND X-HOST:= X1
        THEN IF BOTH $PRINT-NEW-HOST [TSEL-GLOBAL]
        AND $CO-OCCUR-CHK [SEL WITH ADJ AND N IN NPOS]
        THEN $CHANGE-ADJ [MOVE ADJ TO LEFT OF NPOS]
        ELSE BOTH $PRINT-NOCHNGE [NEW HOST DID NOT SUCC]
        AND AT X2 DO $ASSIGN-FAIL-SEL
        ELSE ALL OF $PRINT-NEW-HOST, $PRINT-MESSGE [TSEL-GLOBAL],
   $CHANGE-ADJ
        ELSE AT X2 DO $ASSIGN-FAIL-SEL.
   $CHANGE-ADJ =
        [MOVE ADJ TO LCDN OF NNN IN NPOS]
        IF ELEMENT- LCDN OF NNN OF X4 EXISTS
        THEN REPLACE VALUE OF LCDN OF NNN OF X4 BY X2
        ELSE BEFORE VALUE OF NNN OF X4 INSERT <LCDN> (X2);
        REPLACE X2 BY <NULL>.
— TSEL-NNN-LCDN
—       selections between left NNN and its ADJ in LCDN.
TSEL-NNN-LCDN = IN NNN:
        IF LCDN X4 IS NOT EMPTY WHERE CORE X2 IS ADJ
        THEN IF ALL OF $CHK-X1-LIST, $CHK-X2-LIST, $SET-NNN-REG
        THEN IF BOTH $TESTRES-TEST AND $CO-OCCUR-CHK
        THEN ALL OF $ASSIGN-X1-SEL, $ASSIGN-X2-SEL,
   $ASSIGN-X2-TYPE
        ELSE AT X2, DO $ASSIGN-FAIL-SEL.
   $CHK-X1-LIST =
        CORE-SELATT X1-LIST OF CORE X1 OF COELEMENT N OF X4 IS NOT NIL.
   $CHK-X2-LIST =
        CORE-SELATT X2-LIST OF X2 IS NOT NIL.
   $SET-NNN-REG =
        PRESENT-ELEMENT- X-PRE EXISTS;
        X1-SEL:=NIL; X2-SEL:=NIL;
        XW1:=X2; XW2:=X1;
        X-NAME-LIST:= LIST NAME-N-ADJ;
        X-CO-OCCUR-LIST := LIST N-ADJ;
        X-TYPE-LIST:= NIL;
        X-COMPSW:=NIL.
— TSEL-CONJ9-DEFER
TSEL-CONJ9-DEFER = IN RN:
        IF PRESENT-ELEMENT- X-RN IS NOT EMPTY
        THEN BOTH DO $LOOK-FOR-NVAR
        AND AT X-NVR DO $WCONJ9-DEFER-CHK.
   $LOOK-FOR-NVAR =
        ITERATE GO UP UNTIL TEST FOR LNR SUCCEEDS;
        ELEMENT- NVAR X-NVR EXISTS.
   $WCONJ9-DEFER-CHK =
        BOTH AT CORE- DO $CHECK-COMP-ATT
        AND IF X-RN-COMP EXISTS [@]
        THEN EITHER IT IS NOT THE CASE THAT XN-DEFER EXISTS
        OR $PRINT-DEFER-FAIL.
   $PRINT-DEFER-FAIL =
        AT VALUE DO $FIND-CONJELEM;
        DO $PRINT-FAILC [WCONJ9].
   $CHECK-COMP-ATT =
        ITERATE IF RIGHT-ADJUNCT-POS IS NOT EMPTY
        THEN STORE IN X-RN-COMP
        ELSE IF PRESENT-ELEMENT- HAS NODE ATTRIBUTE DEFERRED
        THEN STORE IN XN-DEFER
        UNTIL DO CORE-CONJUNCT FAILS.
   $RECALC-CONJ =
        ITERATET VERIFY AT X2
        IF $SHARE-RN
        THEN EITHER ALL OF $EXACT-MATCH [WCONJ9],
   $RN-NOT-BODYPART,
   $PRINT-MATCH [WCONJ9],
   $MATCH-FLAG,
   $N-TO-RN-FLAG,
        OR EITHER ALL OF $LOCAL-RN,
   $EQUIV-SUBCLASS [WCONJ9]
        OR $PRINT-FAILC [WCONJ9]
        ELSE BOTH $NOT-DEFERRED
        AND IF NOT $UNCHANGED
        THEN $EQUIV-SUBCLASS [WCONJ9]
        UNTIL $FIND-CONJELEM FAILS.
   $RN-NOT-BODYPART =
        CORE OF X-RN EXISTS;
        IF PRESENT-ELEMENT- IS PN
        THEN CORE OF NSTGO EXISTS;
        PRESENT-ELEMENT- IS NOT H-PTPART OR H-PTAREA OR H-PTLOC.
   $FIND-CONJELEM =
        BOTH IMMEDIATE-NODE- OF IMMEDIATE-NODE- IS Q-CONJ OR LNR
        WHERE CORE- X2 EXISTS
        AND CORE- X1 OF CONJELEM OF IMMEDIATE-NODE- EXISTS;
        DO $PRINT-WCONJ [WCONJ9].
   $SHARE-RN =
        BOTH EITHER PRESENT-ELEMENT- HAS NODE ATTRIBUTE N-TO-RN-ATT X-SAVE
        OR RIGHT-ADJUNCT-POS X-RN IS NOT EMPTY
        WHERE X-SAVE := NIL
        AND BOTH AT IMMEDIATE NVAR NOT DO R(RN)
        AND IF X-SAVE IS NOT NIL
        THEN AT X-SAVE ASCEND TO RN PASSING THROUGH PSTRING
        WHERE DO $NOT-DISTRB-RN
        ELSE AT X-RN DO $NOT-DISTRB-RN.
   $NOT-DISTRB-RN =
        PRESENT-ELEMENT- DOES NOT HAVE NODE ATTRIBUTE NOT-DISTR-RN-ATT.
   $LOCAL-RN =
        AT X1 BOTH $NOT-DEFERRED
        AND AT IMMEDIATE-NODE- X-NVAR
        ASSIGN NODE ATTRIBUTE NO-RN-ATT WITH VALUE X-SAVE;
        AT X-RN ASSIGN NODE ATTRIBUTE NOT-DISTR-RN-ATT
        WITH VALUE X-NVAR.
   $NOT-DEFERRED =
        EITHER PRESENT-ELEMENT- [X1 UPPER CONJ] DOES NOT HAVE NODE
        ATTRIBUTE DEFERRED
        OR $PRINT-FAILC [WCONJ9].
   $UNCHANGED =
        X-REST1 := X1-ATT;
        ITERATE $ON-LIST UNTIL X-REST1 IS NIL SUCCEEDS.
   $ON-LIST =
        X-HEAD1 := HEAD OF X-REST1;
        X-REST1 := SUCCESSORS OF X-REST1;
        X1-SELECT HAS ATTRIBUTE X-HEAD1.
   $MATCH-FLAG =
        AT X2 ASSIGN NODE ATTRIBUTE MATCHED WITH VALUE X1.
   $N-TO-RN-FLAG =
        EITHER X-SAVE IS NIL
        OR AT X1 ASSIGN NODE ATTRIBUTE N-TO-RN-ATT WITH VALUE X-SAVE.
   $PRINT-WCONJ = [GLOBAL]
        WRITE ON DIAG ' **** Executing ';
        WRITE ON DIAG 'CONJUNCTION ';
        WRITE ON DIAG 'EQUIVALENCY';
        WRITE ON DIAG ' test for WCONJ9, ';
        WRITE ON DIAG 'WCONJ9-DEFER, ';
        WRITE ON DIAG 'WCONJ9-NPOS-LAR.';
        WRITE ON DIAG END OF LINE;
        WRITE ON DIAG ' Word 1 = ';
        AT X2 DO $PRINT-NODE-INFO;
        WRITE ON DIAG ' Word 2 = ';
        AT X1 DO $PRINT-NODE-INFO;
        WRITE ON DIAG END OF LINE [TRUE].
   $EXACT-MATCH-CHK = [GLOBAL]
        ALL OF $EXACT-MATCH, $LN-NOT-BODYPART,
   $PRINT-MATCH, $MATCH-FLAG1. (GLOBAL)
   $LN-NOT-BODYPART =
        X-LN DOES NOT SUBSUME N OR ADJ:H-PTPART OR H-PTAREA OR H-PTLOC.
   $EXACT-MATCH = [GLOBAL]
        AT X1 DO $GET-NVAR-CORE [GLOBAL IN WCOMP-ATT-LN]
        WHERE STORE IN X1-ATT;
        [DISREGARD COMPUTED-ATT AND TAKE SELECT-ATT]
        CORE-SELATT X2-ATT OF X2 EXISTS;
        X-NEWLIST := X2-ATT;
        INTERSECT OF X1-ATT [WITH X2-ATT IN X-NEWLIST] IS NOT NIL;
        X1-SELECT := X-INTERSECTION;
        X2-SELECT := X-INTERSECTION;
        IF X2 HAS NODE ATTRIBUTE COMPUTED-ATT X-TEMP
        THEN $READJUST-COMP-ATT;
        AT X1 ASSIGN NODE ATTRIBUTE SELECT-ATT WITH VALUE X1-SELECT;
        AT X2 ASSIGN NODE ATTRIBUTE SELECT-ATT WITH VALUE X2-SELECT.
   $READJUST-COMP-ATT =
        ITERATE $CHECK-SEL-OF-COMP
        UNTIL SUCCESSORS X-TEMP OF X-TEMP IS NIL SUCCEEDS;
        IF X-COMP-ATT IS NIL
        THEN AT X2 ERASE NODE ATTRIBUTE COMPUTED-ATT
        ELSE AT X2 ASSIGN NODE ATTRIBUTE COMPUTED-ATT
        WITH VALUE X-COMP-ATT.
   $CHECK-SEL-OF-COMP =
        IF ATTRIBUTE-LIST OF X-TEMP HAS MEMBER X2-SELECT
        THEN $ADD-THIS-COMP.
   $ADD-THIS-COMP =
        X1-HEAD := HEAD OF X-TEMP;
        EITHER X-COMP-ATT HAS MEMBER X-HEAD
        WHERE ATTRIBUTE-LIST HAS MEMBER X2-SELECT
        OR PREFIX X1-HEAD:X2-SELECT TO X-COMP-ATT.
   $ASSIGN-SELECTATT =
        AT X1 IF PRESENT-ELEMENT- HAS NODE ATTRIBUTE COMPUTED-ATT
        THEN BOTH ASSIGN NODE ATTRIBUTE COMPUTED-ATT
        WITH VALUE X1-COMP-ATT
        AND ASSIGN NODE ATTRIBUTE SELECT-ATT
        WITH VALUE X1-SELECT;
        AT X2 IF PRESENT-ELEMENT- HAS NODE ATTRIBUTE COMPUTED-ATT
        THEN BOTH ASSIGN NODE ATTRIBUTE COMPUTED-ATT
        WITH VALUE X2-COMP-ATT
        AND ASSIGN NODE ATTRIBUTE SELECT-ATT
        WITH VALUE X2-SELECT
        ELSE ASSIGN NODE ATTRIBUTE SELECT-ATT WITH VALUE X2-SELECT.
   $NO-SUBCLASS = [GLOBAL]
        X1 IS NOT NULLN;
        X2 IS NOT NULLN;
        EITHER X1 DOES NOT HAVE ATTRIBUTE SUBLANGUAGE-ATTS
        OR X2 DOES NOT HAVE ATTRIBUTE SUBLANGUAGE-ATTS;
        DO $PRINT-NOSUBCLASS.
   $EQUIV-SUBCLASS = [GLOBAL]
        AT X1 DO $GET-NVAR-CORE WHERE STORE IN X1-ATT;
        AT X2 DO $GET-NVAR-CORE WHERE STORE IN X2-ATT;
        X1-REST := X1-ATT;
        DO $INITIALIZE-SELECT;
        ITERATE $MATCH-ATTS
        UNTIL SUCCESSORS X1-REST OF X1-REST IS NIL SUCCEEDS;
        X1-SELECT IS NOT NIL [FOUND MATCH];
        BOTH $ASSIGN-SELECTATT AND $MATCH-FLAG1;
        DO $PRINT-EQUIV.
   $PRINT-NOSUBCLASS =
        WRITE ON INFO ' +++ Success ';
        WRITE ON INFO 'due to lack of';
        WRITE ON INFO ' approp. subclasses ';
        WRITE ON INFO 'for both words' [TRUE].
   $PRINT-MATCH = [GLOBAL]
        WRITE ON INFO ' MATCHING ';
        WRITE ON INFO 'SUBCLASSES =';
        AT X1-SELECT DO $PRINT-LIST-INFO;
        DO $PRINT-SUCCESS [TRUE].
   $PRINT-EQUIV =
        WRITE ON INFO ' CONJ equivalent ';
        WRITE ON INFO 'subclasses';
        WRITE ON INFO ' found for:';
        WRITE ON INFO END OF LINE;
        WRITE ON INFO ' Word 1 = ';
        IF X2-COMP-ATT EXISTS @
        THEN $PRINT-LIST-INFO
        ELSE AT X2-SELECT DO $PRINT-LIST-INFO;
        WRITE ON INFO ' and for word 2 = ';
        IF X1-COMP-ATT EXISTS @
        THEN DO $PRINT-LIST-INFO
        ELSE AT X1-SELECT DO $PRINT-LIST-INFO;
        DO $PRINT-SUCCESS [TRUE].
   $PRINT-SUCCESS =
        WRITE ON INFO END OF LINE;
        WRITE ON INFO ' +++ Success ';
        WRITE ON INFO 'indicated ++++';
        WRITE ON INFO END OF LINE;
        WRITE ON INFO END OF LINE [TRUE].
   $PRINT-NO-MATCH =
        WRITE ON DIAG ' --- No CONJ equivalent ';
        WRITE ON DIAG 'subclasses found for:';
        WRITE ON DIAG END OF LINE;
        DO $PRINT-SUBCLASSES;
        WRITE ON DIAG END OF LINE [TRUE].
   $PRINT-FAILC = [GLOBAL]
        DO $PRINT-NO-MATCH;
        WRITE ON DIAG ' --- Failure';
        WRITE ON DIAG ' indicated ---';
        WRITE ON DIAG END OF LINE;
        WRITE ON DIAG END OF LINE;
        NOT TRUE.
   $PRINT-SUBCLASSES =
        WRITE ON DIAG ' Word 1 = ';
        AT X2-ATT WRITE ON DIAG LIST [ELEMENT];
        WRITE ON DIAG 'and for Word 2 = ';
        AT X1-ATT WRITE ON DIAG LIST [ELEMENT] [TRUE].
   $INITIALIZE-SELECT =
        X1-SELECT := NIL;
        X2-SELECT := NIL;
        IF X1 HAS NODE ATTRIBUTE COMPUTED-ATT
        THEN X1-COMP-ATT := NIL;
        IF X2 HAS NODE ATTRIBUTE COMPUTED-ATT
        THEN X2-COMP-ATT := NIL.
   $MATCH-ATTS =
        X-EQUIV-LIST := LIST CONN-ARGS-CLASSES
        [* not CONJ-EQUIV-CLASSES *];
        X1-HEAD := HEAD OF X1-REST;
        EITHER $MATCH-SUBCLASSES OR TRUE.
   $MATCH-SUBCLASSES =
        EITHER $HAS-EQUIV-CLASS OR $SET-EQUIV-CLASS;
        DO $MATCH-X2-ATT.
   $HAS-EQUIV-CLASS =
        ITERATET $THROUGH-EQUIV-LIST
        UNTIL $AT-EQUIV-CLASS SUCCEEDS.
   $THROUGH-EQUIV-LIST =
        SUCCESSORS X-EQUIV-LIST OF X-EQUIV-LIST IS NOT NIL.
   $AT-EQUIV-CLASS =
        HEAD X-EQUIV-CLASS OF X-EQUIV-LIST HAS MEMBER X1-HEAD.
   $SET-EQUIV-CLASS =
        X-EQUIV-CLASS := NIL;
        PREFIX X1-HEAD TO X-EQUIV-CLASS;
        X-EQUIV-LIST := NIL;
        PREFIX X-EQUIV-CLASS TO X-EQUIV-LIST.
   $MATCH-X2-ATT =
        X-NEWLIST := X2-ATT;
        ITERATET $FIND-NEXT-EQUIV UNTIL $FOUND-MATCH SUCCEEDS.
   $FOUND-MATCH =
        INTERSECT X-EQUIV OF X-EQUIV-CLASS IS NOT NIL;
        X-SAVE-PLACE := X-REST;
        DO $MARK-ATTS.
   $FIND-NEXT-EQUIV =
        ITERATE $THROUGH-EQUIV-LIST UNTIL $AT-EQUIV-CLASS SUCCEEDS.
   $MARK-ATTS =
        IF X1 HAS NODE ATTRIBUTE COMPUTED-ATT
        THEN IF X1-COMP-ATT DOES NOT HAVE MEMBER X1-HEAD
        THEN BOTH X-SAVE-PLACE HAS ATTRIBUTE-LIST X-HEAD-ATTRB
        AND BOTH PREFIX X1-HEAD:X-HEAD-ATTRB TO X1-COMP-ATT
        AND IF X1-SELECT DOES NOT HAVE MEMBER X-HEAD-ATTRB
        THEN PREFIX X-HEAD-ATTRB TO X1-SELECT
        ELSE TRUE
        ELSE TRUE
        ELSE IF X1-SELECT DOES NOT HAVE MEMBER X1-HEAD
        THEN PREFIX X1-HEAD TO X1-SELECT;
        X-REST-INT := X-INTERSECTION;
        ITERATET $ADD-X2 UNTIL X-REST-INT IS NIL SUCCEEDS.
   $ADD-X2 =
        X-HEAD-INT := HEAD OF X-REST-INT;
        X-SAVE-PLACE := X-REST-INT;
        X-REST-INT := SUCCESSORS OF X-REST-INT;
        IF X2 HAS NODE ATTRIBUTE COMPUTED-ATT
        THEN IF X2-COMP-ATT DOES NOT HAVE MEMBER X-HEAD-INT
        THEN BOTH X-SAVE-PLACE HAS ATTRIBUTE-LIST X-HEAD-ATTRB
        AND BOTH PREFIX X-HEAD-INT:X-HEAD-ATTRB TO
        X2-COMP-ATT
        AND IF X2-SELECT DOES NOT HAVE MEMBER X-SAVE-PLACE
        THEN PREFIX X-HEAD-ATTRB TO X2-SELECT
        ELSE TRUE
        ELSE TRUE
        ELSE IF X2-SELECT DOES NOT HAVE MEMBER X-HEAD-INT
        THEN PREFIX X-HEAD-INT TO X2-SELECT.
   $MATCH-FLAG1 =
        AT X1 ASSIGN NODE ATTRIBUTE MATCHED WITH VALUE X2.
   $GET-NVAR-CORE =
        EITHER CORE-ATT EXISTS
        OR $NULLN;
        STORE [ATTRIBUTE LIST] IN XN-ATT.
   $NULLN =
        PRESENT-ELEMENT- IS NULLN;
        XN-ATT:= LIST NULLN-LIST.
— TSEL-ADJ-IN-RN
—       CHECKS SELECTION BETWEEN ADJ (X2) IN RN AND ITS HOST (X1);
—       THIS RESTRICTION USES THE SAME N-ADJ LIST AS THE NVAR-APOS
—       SELECTIONAL RESTRICTION.
—       IF LN CAUSES COMPUTED ATTRIBUTE, THIS IS USED IN SELECTION.
—       IF ADJ IS H-CONN (E.G., 'SIMILAR') AND RA = PN, WHERE P = PVAL
—       FOR ADJ (E.G., 'TO' FOR 'SIMILAR'), THEN EQUIVALECNCY TEST IS
—       APPLIED BETWEEN HOST (NOW RESET TO X2) AND NSTGO OF PN IN RA
—       (N IN NSGTO IS STORED IN X3, AND SELECTION IS RECORDED ON IT).
—       ** NOTE:
—       IF ANY ELEMENT IN RN CAUSES A COMPUTED-ATTRIBUTE, NO SELECTION
—       IS DONE.

TSEL-ADJINRN = IN ADJINRN:
        PRESENT-ELEMENT- X-ADJINRN EXISTS;
        IF AT HOST- X1 ALL OF $RN-SEL-TEST, $NO-N-TO-RN-ATT,
   $GET-X2-LIST
        THEN BOTH $SET-N-ADJ-REG [GLOBAL IN TSEL-NVAR-APOS]
        AND BOTH X1-SEL:= NIL
        AND $ADJ-IN-RN.
   $RN-SEL-TEST =
        BOTH PRESENT-ELEMENT- IS NOT NULLN AND $GET-X1-LIST. (GLOBAL)
   $GET-X1-LIST =
        AT X1, CORE-SELATT X1-LIST EXISTS.
   $NO-N-TO-RN-ATT =
        IF PRESENT-ELEMENT- [HOST] HAS NODE ATTRIBUTE N-TO-RN-ATT
        @THEN NOT $IN-THIS-ADJINRN.
   $IN-THIS-ADJINRN =
        ASCEND TO ADJINRN WHERE PRESENT-ELEMENT- IS IDENTICAL TO X-ADJINRN.
   $GET-X2-LIST =
        [* ASSUME ADJINRN HAS NO COMPUTED-ATT, THEREFORE USE CORE-SELATT *]
        CORE-SELATT X2-LIST OF CORE X2 OF X-ADJINRN EXISTS.
   $ADJ-IN-RN =
        VERIFY X-COMPSW:= NIL;
        VERIFY X2-SEL:= NIL;
        VERIFY X3-SEL:= NIL;
        VERIFY BOTH XW1:=X1 AND XW2:=X2 [* for selection printout *];
        BOTH $SELECT-CHK AND $RESET-X1-LIST [* Global in TSEL-NVAR-APOS *].
   $SELECT-CHK =
        EITHER $TEST-FOR-CONN
        OR EITHER ALL OF $TESTRES-TEST, $CO-OCCUR-CHK,
   $ASSIGN-X2-SEL, $ASSIGN-X2-TYPE
        OR $NEW-HOST-CHK.
   $TEST-FOR-CONN =
        ALL OF $ATT-CONN,
   $RIGHT-ADJ-PN,
   $PVAL-X2,
   $COMPSW-NIL,
   $GET-X3,
   $SWITCH-REGS [SWITCH HOST INTO X2 FOR $DO-EQUIV-TEST],
   $PRINT-RESTR-INFO [GLOBAL IN TSEL-GLOBAL-MESSAGE],
   $DO-EQUIV-TST [GLOBAL IN TSEL-GLOBAL-TEST FOR CONNECTIVE],
   $SWITCH-BACK [RESTORE HOST TO X1, ADJ TO X2],
   $ASSIGN-NA-X2-X3 [IS A CONNECTIVE-ASSIGN SELECT-ATT].
   $ATT-CONN =
        AT X2, DO $CONN-CHK [GLOBAL; CHECKS FOR CONNECTIVE].
   $RIGHT-ADJ-PN =
        RIGHT-ADJUNCT OF X2 IS PN X-PN.
   $PVAL-X2 =
        ELEMENT- P OF X-PN HAS NODE ATTRIBUTE PVAL-ATT
        [ASSIGNED IN TSEL-PN].
   $COMPSW-NIL = X-COMPSW IS NIL.
   $GET-X3 =
        AT X-PN, CORE X3 OF NSTGO EXISTS;
        DO $SET-X3-LIST [TSEL-P-N].
   $SWITCH-REGS =
        DO $SWITCH-X1-X2 [SWITCH X1 AND X2 FOR $DO-EQUIV-TST];
        [* BEFORE: HOST X1 AFTER: HOST X2 *]
        [* ADJ X2 ADJ X1 *]
        [* IN PN N X3 *]
        X1-SEL-SAVE := X2-SEL [X1-SEL-SAVE = ADJ ATTS];
        X3-SEL-SAVE:= NIL [X3-SEL-SAVE = ATTS OF N IN PN OF RA];
        X2-SEL-SAVE:= X1-SEL [X2-SEL-SAVE = HOST N ATTRIBUTES].
   $SWITCH-X1-X2 =
        X-TEMP:= X1;
        X-TEMP-LIST:= X1-LIST;
        X1:= X2;
        X1-LIST:= X2-LIST;
        X2:= X-TEMP;
        X2-LIST:= X-TEMP-LIST.
   $SWITCH-BACK =
        DO $SWITCH-X1-X2
        [* SWITCH X1 AND X2 BACK TO ORIGINAL STATE; *]
        [* X1 = HOST ATTS; X2 = ADJ ATTRIBUTES *];
        DO $SWITCH-XSELSAVE
        [$EQUIV-TST ADDS SELECTIONAL ATTRIBUTES TO X-SAVE-SELS].
   $SWITCH-XSELSAVE =
        X1-SEL:= X2-SEL-SAVE;
        X2-SEL:= X1-SEL-SAVE;
        X3-SEL:= X3-SEL-SAVE.
   $NEW-HOST-CHK =
        X-START:= X-ADJINRN;
        X-HOST:= X1;
        EITHER ITERATE DO NEW-HOST WHERE DO $PRINT-NEW-HOST [TSEL-GLOBAL]
        UNTIL $SELECT-FOR-NEW SUCCEEDS
        OR BOTH AT X2 DO $ASSIGN-FAIL-SEL
        AND AT X-ADJINRN DO $ASSIGN-FAIL-SEL.
   $SELECT-FOR-NEW =
        X1:=X-HOST; XW1:=X1;
        IF CORE-SELATT X1-LIST OF X1 EXISTS
        THEN $DO-SELECT
        ELSE ALL OF $PRINT-SEL-MESSGE [IN TSEL-GLOBAL],
   $PRINT-MESSGE [TSEL-GLOBAL-AUTOMATIC SUCESS],
   $ASSIGN-NEW [IF NO MED SUBCLASSES].
   $DO-SELECT =
        IF BOTH $TESTRES-TEST AND $CO-OCCUR-CHK
        THEN EITHER $AUTO-SUCC [SUBCLASS NOT ON SEL LIST]
        OR BOTH $ASSIGN-SEL
        AND $ASSIGN-NEW [ASSIGN NEW HOST ATTRIBUTE]
        ELSE NOT TRUE.
   $ASSIGN-SEL = [GLOBAL]
        DO $RESET-XSELS;
        IF X1-SEL IS NOT NIL WHERE NOT $BENIGN-CHK
        THEN BOTH $ASSIGN-X1-SEL [GLOBAL]
        AND $ASSIGN-NA-X2-X3 [GLOBAL]
        ELSE BOTH $BENIGN-CHK AND $WRITE-BENIGN-PASS.
   $RESET-XSELS = [GLOBAL]
        IF X1-SEL-SAVE IS NOT NIL THEN X1-SEL:= X1-SEL-SAVE
        ELSE X1-SEL:= NIL;
        IF X2-SEL-SAVE IS NOT NIL THEN X2-SEL:= X2-SEL-SAVE
        ELSE X2-SEL:= NIL;
        IF X3-SEL-SAVE IS NOT NIL THEN X3-SEL:= X3-SEL-SAVE
        ELSE X3-SEL:= NIL.
   $BENIGN-CHK =
        BOTH X2-SEL IS NIL
        AND X1-LIST HAS MEMBER VBE OR BEREP.
   $WRITE-BENIGN-PASS =
        WRITE ON INFO ' >>> Benign ';
        WRITE ON INFO 'pass for VBE ';
        WRITE ON INFO 'or BEREP <<<';
        WRITE ON INFO END OF LINE.
   $AUTO-SUCC =
        X2-SEL IS NIL;
        DO $PRINT-SEL-MESSGE [TSEL-GLOBAL -SEL MESSAGE].
   $ASSIGN-NEW =
        EITHER X-NEW EXISTS [a new host was found already]
        OR EITHER $RN-NULL-AND-MOVE OR $RN-MOVE. [GLOBAL]
   $RN-NULL-AND-MOVE =
        X-CONJ IS NOT NIL;
        IMMEDIATE RADJSET X-RADJ OF X-START EXISTS[RN TO BE MOVED DOWN];
        AT X-HOST EITHER $ASCNT [IN CORE--GO TO NVAR,AVAR,ETC IF POSS.]
        OR TRUE;
        EITHER ITERATE GO RIGHT [GO TO RIGHTMOST NODE]
        OR TRUE [AT RIGHTMOST ALREADY];
        AFTER PRESENT-ELEMENT- INSERT X-RADJ [MOVE RADJ DOWN];
        DELETE X-RADJ [DELETE ORIGINAL RADJ];
        AT X-CONJ EITHER $ASCNT OR TRUE;
        AFTER PRESENT-ELEMENT- INSERT <RN> X-NEW (<NULL>);
        AT X-NEW DO R(CONJ-NODE);
        DO PRE-POST-CONJELEM [RESET CONJ POINTERS];
        X-CONJ := NIL.
   $RN-MOVE =
        BOTH IF X-NEWADJ [new position of X-START] IS NULL
        THEN REPLACE X-NEWADJ BY X-START, X-NEW
        ELSE AFTER X-NEWADJ INSERT X-START, X-NEW
        AND REPLACE X-START BY <NULL>.
— TSEL-SPEC-A2
—       A2 in the context: A2 SORTIE, A2 L'ENTRE1E,... [TIME EXPRESSION]
—       and A2 LE STATUS... [EVOLUTION]
—       is not H-CONN and H-CONN should be removed.
TSEL-SPEC-A2 = IN PN:
        IF BOTH EITHER ELEMENT- P X1 IS 'A2'
        WHERE CORE-ATT OF X1 HAS MEMBER H-CONN
        OR EITHER CORE-ATT OF X1 HAS MEMBER H-TMPREP
        OR X1 IS 'ON' OR 'AFTER' OR 'BEFORE'
        AND CORE-ATT X-ATT OF CORE- X-CORE OF ELEMENT- NSTG OF
        ELEMENT- NSTGO HAS MEMBER H-TXCLIN OR H-TTGEN
        THEN ALL OF $ADJUST-P, $ADJUST-PN-CORE.
   $ADJUST-P =
        AT X1, BOTH $GET-P
        AND ASSIGN NODE ATTRIBUTE SELECT-ATT WITH VALUE X1-LIST.
   $GET-P = [GLOBAL]
        EITHER $MED-ATT-CHK OR $GET-ATT.
   $MED-ATT-CHK =
        CORE-ATT X1-LIST OF X1 EXISTS [* MED subclasses *];
        X-SUBLIST:= LIST CONNECTIVE-LIST [*remove CONNECTIVE attributes*];
        COMPLEMENT X1-LIST OF X1-LIST IS NOT NIL [* any MED ATTS left? *].
   $GET-ATT =
        X1-LIST:= NIL;
        HEAD X1-HEAD OF ATTRIBUTE-LIST OF X1 EXISTS;
        [IF X1-HEAD IS 'D''' ]
        [THEN X1-HEAD := SYMBOL 'DE']
        PREFIX X1-HEAD TO X1-LIST.
   $ADJUST-PN-CORE =
        IF EITHER X-ATT HAS MEMBER H-TMLOC [sortie]
        OR X-CORE IS 'ENTRE1E' OR 'DE1PART'
        THEN BOTH BOTH BOTH X-ATT := SYMBOL H-TMLOC
        AND X-SEL := NIL
        AND PREFIX X-ATT TO X-SEL
        AND AT X-CORE
        ASSIGN NODE ATTRIBUTE SELECT-ATT WITH VALUE X-SEL.
— TSEL-RESP-AVEC
—       'AVEC' or 'SANS' in the context:
—       SANS/AVEC POSITION ANTALGIQUE...
—       is not H-CONN and H-CONN should be removed of this as such.
TSEL-RESP-AVEC = IN PN:
        IF BOTH ELEMENT- P X1 IS 'AVEC' OR 'SANS' OR '[AVEC]'
        OR 'WITH' OR 'WITHOUT' OR 'FREE'_'OF'
        OR 'WITHOUT'_'EVIDENCE'_'OF'
        WHERE CORE-ATT OF X1 HAS MEMBER H-CONN
        AND CORE-ATT X-ATT OF CORE- X-CORE OF ELEMENT- NSTG OF
        ELEMENT- NSTGO HAS MEMBER H-RESP
        THEN DO $ADJUST-P.
   $ADJUST-P =
        AT X1, BOTH $GET-P [Global in T-SPEC-A2]
        AND ASSIGN NODE ATTRIBUTE SELECT-ATT WITH VALUE X1-LIST.
— TSEL-RN-OTHER
—       selections between HOST and other RN objects, other than those
—       mentioned in TSEL-PN or TSEL-ADJINRN.
TSEL-RN-OTHER = IN NSTGT, LQR, QN, NQ, PDATE, PQUANT:
        PRESENT-ELEMENT- X2 EXISTS;
        IF BOTH EITHER IMMEDIATE RN EXISTS
        OR IMMEDIATE RA EXISTS
        AND X-START:= X2 WHERE XW2:= X2
        THEN IF AT HOST- X1 BOTH $RN-SEL-TEST AND XW1:=X1
        THEN ONE OF $SEL-TIME, $SEL-QN, $SEL-LQR,
   $SEL-NQ, $SEL-PQUANT.
   $SEL-TIME =
        EITHER BOTH X2 HAS NODE ATTRIBUTE PHRASE-ATT X-PHRASE-ATT
        AND X-PHRASE-ATT HAS MEMBER TIME-PHRASE
        OR DO $SEL-TIME-ADVERBIAL.
   $SEL-TIME-ADVERBIAL =
        X2 IS NSTGT OR PDATE;
        [* Get ATTRIBUTE-LIST of the TIME-ADVERBIAL from *]
        [* ADVERBIAL-TYPE-LIST *]
        X2-LIST := LIST ADVERBIAL-TYPE-LIST;
        X2-LIST HAS MEMBER TIME-ADVERBIAL;
        ATTRIBUTE-LIST X-NEWLIST EXISTS;
        X1-SEL:= INTERSECT OF X1-LIST;
        X-NAME-LIST:= LIST NAME-TIME-ADVERBIAL;
        DO $PRINT-ASSIGN-X1.
   $PRINT-ASSIGN-X1 =
        DO $PRINT-SEL-WORDS;
        DO $PRINT-X1 [TSEL-GLOBAL];
        DO $PRINT-RESULT [TSEL-GLOBAL];
        IF X1-SEL IS NOT NIL
        THEN $ASSIGN-X1-SEL [SELECTION PASSED]
        ELSE IF $GET-NEW-HOST1
        THEN BOTH $NEW-SEL AND $ASSIGN-NEW
        ELSE AT X2 DO $ASSIGN-FAIL-SEL.
   $GET-NEW-HOST1 =
        X-START:= X2; DO $GET-NEW.
   $GET-NEW =
        X-HOST:= X1;
        DO NEW-HOST [FIND NEW HOST FOR ADJUNCT];
        DO $PRINT-NEW-HOST [TSEL-GLOBAL];
        X1:= X-HOST;
        XW1:=X1.
   $NEW-SEL =
        IF CORE-SELATT X1-LIST OF X1 IS NOT NIL
        THEN BOTH X1-SEL:= INTERSECT OF X1-LIST
        AND $PRINT-ASSIGN-X1.
   $SEL-QN =
        X2 IS QN;
        ELEMENT N X2 EXISTS;
        CORE-SELATT X2-LIST OF X2 EXISTS;
        X-COMPSW:= NIL;
        BOTH $SET-N-ADJ-REG AND $SET-SEL;
        IF $CO-OCCUR-CHK
        THEN ALL OF $ASSIGN-X2-SEL, $ASSIGN-X1-SEL, $ASSIGN-X2-TYPE
        ELSE EITHER ITERATE $GET-NEW-HOST
        UNTIL $NEW-HOST-OF-QN SUCCEEDS
        OR AT IMMEDIATE QN OF X2 DO $ASSIGN-FAIL-SEL.
   $GET-NEW-HOST = DO $GET-NEW.
   $NEW-HOST-OF-QN =
        IF CORE-SELATT X1-LIST OF X1 IS NOT NIL
        THEN ALL OF $CO-OCCUR-CHK, $ASSIGN-NEW, $ASSIGN-X2-SEL,
   $ASSIGN-X1-SEL
        ELSE ALL OF $PRINT-SEL-MESSGE [IN TSEL-GLOBAL],
   $PRINT-MESSGE [TSEL-GLOBAL-AUTOMATIC SUCCESS],
   $ASSIGN-NEW.
   $SEL-NQ =
        X2 IS NQ;
        ELEMENT N X2 EXISTS;
        X2-LIST := LIST NUNIT-LIST;
        X-NAME-LIST := LIST NAME-N-NQ;
        X-NEWLIST := LIST N-NQ-LIST;
        X1-SEL := INTERSECT OF X1-LIST;
        DO $PRINT-ASSIGN-X1.
   $SEL-LQR =
        X2 IS LQR;
        X2-LIST := LIST QNUMBER-LIST;
        X-NAME-LIST := LIST NAME-N-LQR;
        X-NEWLIST := LIST N-LQR;
        X1-SEL := NIL;
        X1-SEL := INTERSECT OF X1-LIST;
        DO $PRINT-ASSIGN-X1.
   $SEL-PQUANT =
        X2 IS PQUANT;
        [ELEMENT- P IS *ENGLISH* 'OF' OR 'FROM' OR 'TO' OR 'AT' OR 'IN' OR]
        [ 'ON' OR 'WITH' OR 'BETWEEN' OR 'THAN' OR ]
        [ 'UP' OR *FRENCH* 'DE' OR 'D''' OR 'A2' OR 'EN'; ]
        EITHER ELEMENT N X2 OF ELEMENT QN OF ELEMENT- QUANT EXISTS
        OR CORE- X2 OF ELEMENT- LQR OF ELEMENT- QPERUNIT
        OF ELEMENT- QUANT EXISTS;
        CORE-SELATT X2-LIST OF X2 EXISTS;
        X-NAME-LIST := LIST NAME-N-PQUANT;
        X1-SEL := X1-LIST;
        DO $PRINT-ASSIGN-X1.
— TSEL-P-N
—       SELECTION BETWEEN P, N [IN PN], AND HOST N
—       USES LIST P-NSTGO-HOST FOR SELECTION; IF A PREPOSITION
—       IS NOT ON LIST P-NSTGO-HOST, THE PN PASSES 'BENIGNLY',
—       THAT IS, WITHOUT ANY SELECTION BEING CHECKED ON IT.
—       TSEL-P-N WILL ALSO PASS BENIGNLY IF EITHER NSTGO (X2) OR
—       HOST (X3) HAS NO SUBLANGUAGE ATTRIBUTE (CORE-ATT FAILS).
—       IF PN HAS PARTICIPATED IN A COMPUTED ATTRIBUTE
—       CONSTRUCTION, THEN NO SELECTION IS DONE; THE RESTRICTION
—       ALSO CHECKS TO MAKE SURE HOST IS IN SCOPE OF RN, THAT IS
—       THAT THERE IS NOT A NOT-DISTR-RN-ATT SET ($CHECK-SCOPE).
—       X1 = PREPOSITION
—       X2 = HEAD N OF PN
—       X3 = HOST OF PN
TSEL-PN = IN PN, PD, PVINGO, IN-LEADS, PVINGSTG:
        IF IMMEDIATE RADJSET OF PRESENT-ELEMENT- X-PRE EXISTS
        THEN $PSEL-RADJ
        ELSE $PSEL-SA.
   $PSEL-RADJ =
        IF BOTH NOT $SPECIAL-PHRASE
        AND ALL OF $GET-P-X1, $GET-HOST-X3, $GET-X2, $SET-SEL,
   $INITIALIZE
        THEN $DO-P-SEL.
   $SPECIAL-PHRASE =
        [* INFLUENCE-PHRASE cannot be broken up: *]
        [* exertional chest pain with minimal exercise *]
        PRESENT-ELEMENT- X-PN HAS NODE ATTRIBUTE PHRASE-ATT
        WHERE PRESENT-ELEMENT- HAS MEMBER DOSE-PHRASE OR
        INFLUENCE-PHRASE OR PTPART-PHRASE OR
        RADIATE-PHRASE OR SOURCE-PHRASE.
   $INITIALIZE =
        X1-SEL-SAVE := NIL;
        X2-SEL-SAVE := NIL;
        X3-SEL-SAVE := NIL.
   $GET-P-X1 =
        PRESENT-ELEMENT- X-PN EXISTS;
        X-PN HAS ELEMENT- P X1.
   $GET-HOST-X3 =
        AT X-PN HOST X3 EXISTS;
        DO $CHECK-P;
        EITHER $SET-X3-LIST OR X3-LIST:= NIL.
   $CHECK-P =
        EITHER X1 IS H-CONN [* If CONN. do test regardless of COMPUT-ATT *]
        OR IF PRESENT-ELEMENT- HAS NODE ATTRIBUTE N-TO-RN-ATT
        [* not in COMPUTED-ATT *]
        @THEN NOT $IN-THIS-PN.
   $SET-X3-LIST =
        AT X3 DO $GET-SUBCLASS-LIST [TSEL-GLOBAL];
        X3-LIST:= XNN-LIST.
   $IN-THIS-PN =
        ASCEND TO PN WHERE PRESENT-ELEMENT- IS IDENTICAL TO X-PN.
   $GET-X2 =
        IF X-PN IS PN
        THEN DO $SET-X2-LIST
        ELSE IF X-PN IS PD
        THEN AT ELEMENT- LDR DO $GET-X2-LIST
        ELSE IF X-PN IS PVINGO
        THEN AT LVINGR OF ELEMENT- VINGO DO $GET-X2-LIST
        ELSE IF VINGO X-VINGO OF ELEMENT- VINGSTG EXISTS
        THEN AT ELEMENT- LVINGR OF X-VINGO DO $GET-X2-LIST
        ELSE AT ELEMENT- LVINGR OF VINGSTG DO $GET-X2-LIST;
        X2-LIST IS NOT NIL.
   $GET-X2-LIST =
        CORE- X2 EXISTS;
        VERIFY X-COMPSW:= NIL;
        CORE-ATT X2-LIST EXISTS.
   $DO-P-SEL =
        XW2:= X1; XW3:= X2 [* for SEL printout *];
        IF X3 EXISTS
        THEN XW1:= X3
        ELSE XW1:= NIL [LIST EMPTY-LIST];
        IF X3 IS OCCURRING IN VERBAL
        THEN ONE OF $SECTION-TITLE,
   $SEL-FOR-CONN,
   $PVAL,
   $BY-PASSIVE,
   $OTHER
        ELSE ONE OF $DOSES, $GENERIC-OF, $OTHER.
   $DOSES = [* for dose expression *]
        X1 IS 'OF';
        X2-LIST HAS MEMBER H-TTMED WHERE X2-SEL := X2-LIST;
        X3 IS DS.
   $GENERIC-OF =
        [* Pass the structure 'antibiotique de roche1phine' *]
        [* and assign ADJUNCT-TYPE to 'de roche1phine'. *]
        X-PRE IS PN;
        X1 [P] IS 'OF' OR 'DE' OR 'D''';
        X3-LIST IS NOT NIL;
        X2-LIST IS NOT NIL;
        [* Set up GENERIC *]
        X2-GEN-LIST := X2-LIST;
        X-GENERIC := NIL;
        X-ADD-GEN := SYMBOL GENERIC;
        PREFIX X-ADD-GEN TO X-GENERIC;
        [* Test X:generic and X exists *]
        ITERATE X2-GEN-HEAD := HEAD OF X2-GEN-LIST
        UNTIL EITHER BOTH X3 HAS ATTRIBUTE X2-GEN-HEAD:X-GENERIC
        AND X-ADJ-TYPE := NIL
        OR BOTH X2-GEN-LIST := COMPLEMENT OF X2-GEN-LIST
        AND X2-GEN-LIST IS NIL
        SUCCEEDS;
        X-ADD-ADJ := SYMBOL ADJUNCT-TYPE;
        [* This fails if X-ADJ-TYPE does not exist *]
        PREFIX X-ADD-ADJ TO X-ADJ-TYPE;
        AT X-PRE ASSIGN NODE ATTRIBUTE ADVERBIAL-TYPE WITH VALUE
        X-ADJ-TYPE.
   $SECTION-TITLE =
        CORE-SELATT OF X2 HAS MEMBER H-TXCLIN.
   $SEL-FOR-CONN =
        [* All prepositions are potential connectives *]
        X1 IS NOT 'OF' OR 'DE' OR 'D''';
        X1-LIST DOES NOT HAVE MEMBER H-TMPREP
        [ TIME PREP has precedence over CONN - in 'fever after ]
        [ cough', 'after cough' is a REF-PT time relation and ]
        [ is treated specially ];
        X-POTENT:= NIL [* PREP is not yet a potential CONNECTIVE *];
        IF BOTH X1-LIST HAS MEMBER H-CONN
        AND $SEL-CONN [* X-POTENT is set to NON-NIL for potential CONN *]
        THEN TRUE
        ELSE BOTH X-POTENT IS NOT NIL [* PREP is a potential CONN *]
        AND $NEW-HOST-FOR-CONN [* see if CONN with new HOST *].
   $SEL-CONN =
        IF X3 IS OCCURRING IN VERBAL
        @THEN STORE IN X-VERB;
        DO $DO-EQUIV-TST [GLOBAL in TSEL-GLOBAL];
        X1-SEL IS NOT NIL [is an H-CONN];
        DO $MARK-P [assign SELECT-ATT for CONN];
        DO $ASSIGN-SEL [GLOBAL in TSEL-VERB-SUBJ].
   $MARK-P =
        IF X-TYPE-LIST IS NOT NIL
        THEN AT X-PN
        IF EITHER PRESENT-ELEMENT- DOES NOT HAVE NODE ATTRIBUTE
        ADVERBIAL-TYPE
        OR PRESENT-ELEMENT- HAS NODE ATTRIBUTE ADVERBIAL-TYPE
        WHERE PRESENT-ELEMENT- DOES NOT HAVE MEMBER X-TYPE-LIST
        THEN ASSIGN NODE ATTRIBUTE ADVERBIAL-TYPE
        WITH VALUE X-TYPE-LIST;
        X-TYPE-LIST:=NIL
        [ASSIGNS LIST OF PN-TYPES COMPUTED DURING SELECTION].
   $NEW-HOST-FOR-CONN =
        X-START:= X-PN;
        X-STARTL:= X3-LIST [SAVE X3 LIST];
        X-HOST:= X3;
        ITERATE $NEW-CONN-HOST UNTIL BOTH $SET-NEW-REG
        AND $SEL-CONN SUCCEEDS;
        DO $ASSIGN-SEL [* Global in TSEL-ADJINRN *];
        DO $ASSIGN-NEW.
   $NEW-CONN-HOST =
        EITHER $SUBJ-IS-HOST
        OR DO NEW-HOST WHERE PRESENT-ELEMENT- IS NOT IDENTICAL TO X3;
        DO $PRINT-NEW-HOST.
   $SUBJ-IS-HOST =
        ONE OF $NEW-HOST-IS-OBJ, $NEW-HOST-IS-VERB, $NEW-HOST-IS-SUBJ.
   $NEW-HOST-IS-OBJ =
        X-SA EXISTS [IN SA PN];
        AT X3 ASCEND TO VERBAL [try OBJECT for CONNECTIVE];
        COELEMENT- OBJECT EXISTS WHERE DEEPEST-COVERB EXISTS;
        CORE- X-HOST OF COELEMENT- OBJECT EXISTS;
        IF X-VERB DOES NOT HAVE NODE ATTRIBUTE TRY-ATT
        THEN AT X-VERB ASSIGN NODE ATTRIBUTE TRY-ATT;
        AT X-HOST EITHER PRESENT-ELEMENT- IS OF TYPE ATOM,
        OR $COMPOUND-N;
        PRESENT-ELEMENT- IS NOT IDENTICAL TO X3.
   $COMPOUND-N =
        PRESENT-ELEMENT- IS NPN OR PNN OR NPDOSE OR NN;
        IF PRESENT-ELEMENT- IS NN
        THEN CORE- X-HOST OF LAST-ELEMENT- IS NOT EMPTY
        ELSE CORE- X-HOST OF ELEMENT- NSTGO EXISTS.
   $NEW-HOST-IS-VERB =
        IMMEDIATE OBJECT EXISTS
        WHERE BOTH IF FOLLOWING-ELEMENT- IS RV OR SA
        @THEN LAST-ELEMENT- X-NEWADJ EXISTS [*GRI*]
        AND COELEMENT VERBAL EXISTS;
        PRESENT-ELEMENT- DOES NOT HAVE NODE ATTRIBUTE TRY-ATT;
        CORE- X-HOST EXISTS;
        X-HOST IS NOT IDENTICAL TO X3.
   $NEW-HOST-IS-SUBJ =
        EITHER ASCEND TO OBJBE OR VENPASS OR VINGO
        OR BOTH PRESENT-ELEMENT- IS NOT OCCURRING IN VERBAL
        AND ASCEND TO VERBAL;
        EITHER EITHER CORE- X-HOST OF COELEMENT SUBJECT EXISTS
        OR CORE- X-HOST OF COELEMENT BESUBJ EXISTS
        OR HOST- X-HOST OF IMMEDIATE STRING EXISTS
        [* X-START is in VENPASS, VINGO *];
        X-HOST IS NOT IDENTICAL TO X3.
   $SET-NEW-REG =
        AT X-HOST BOTH XW1:= X-HOST [FOR SEL PRINTOUT]
        AND PRESENT-ELEMENT- X3 EXISTS WHERE DO $SET-X3-LIST.
   $PVAL =
        [* If P is on PVAL list of adjective or noun (INNOVATION TO WD) *]
        [* then selection should not be checked and the P is marked *]
        [* with a node attribute PVAL-ATT from P to the host with PVAL *]
        X3 HAS ATTRIBUTE PVAL OR OBJLIST:PN:PVAL X-PVAL;
        LISTS X-PVAL AND X1 HAVE A COMMON ATTRIBUTE [namely the P];
        AT X1 ASSIGN NODE ATTRIBUTE PVAL-ATT WITH VALUE X3 [HOST w/ PVAL].
   $BY-PASSIVE = [* 6/2/88 BYPASS PASSIVE *]
        BOTH X1 IS 'BY' OR 'PAR'
        AND X3 IS VEN.
   $OTHER =
        [* handles normal prepositional selection using P-NSTGO-HOST *]
        [* list or potential connective prepositional phrase *]
        EITHER $LEXICAL-CONN [* a lexical CONN bypassing all selection *]
        OR ALL OF $GET-P,
   $SET-P-REG,
   $TESTRES-TEST [* global in TSEL-GLOBAL *],
   $SELECT-FOR-PN.
   $LEXICAL-CONN =
        CORE-ATT X1-LIST OF X1 EXISTS;
        X1-LIST HAS MEMBER H-CONN.
   $SET-P-REG =
        X-NAME-LIST := LIST NAME-P-NSTGO-HOST;
        X-TYPE-LIST := NIL;
        X-CO-OCCUR-LIST := LIST P-NSTGO-HOST.
   $SELECT-FOR-PN =
        EITHER $SEL-FOR-CONN [test whether P is declared H-CONN first]
        OR EITHER $SEL-FOR-PREP
        OR TRUE [but do not fail].
   $SEL-FOR-PREP =
        IF X-START IS NOT IDENTICAL TO X-PN [X3] [RESTORE ORIGINAL HOST]
        THEN X3 := X-START WHERE X3-LIST := X-STARTL;
        IF BOTH $CHK-FOR-CONN [ X1 IS CONN ]
        AND $SEL-FOR-CONN
        THEN TRUE
        ELSE IF $CHK-SEL-LIST
        THEN $MARK-P
        ELSE ONE OF $SEL-FOR-CONN [potential H-CONN],
   $NO-PREP-CLASS,
   $NEW-HOST-CHK;
        DO $ASSIGN-SEL [GLOBAL IN TSEL-ADJINRN].
   $NO-PREP-CLASS = [* PREPOSITION IS NOT ON P-NSTGO-HOST LIST *]
        X-NEWLIST:= X-CO-OCCUR-LIST;
        INTERSECT OF X1-LIST IS NIL.
   $CHK-FOR-CONN =
        AT X1 EITHER PRESENT-ELEMENT- IS VBE OR BEREP
        OR $CONN-CHK [GLOBAL IN TSEL-GLOBAL].
   $CHK-SEL-LIST =
        X3-LIST IS NOT NIL;
        BOTH $CO-OCCUR-CHK [global in TSEL-GLOBAL]
        AND $ADD-TO-LIST [global in TSEL-GLOBAL].
   $NEW-HOST-CHK =
        X-START:= X-PN;
        X-HOST:= X3;
        X3-ORIG := X3;
        X3-SEL-ORIG := X3-SEL;
        EITHER ITERATE DO $NEW-CONN-HOST WHERE DO $SET-NEW-REG
        UNTIL $SELECT-FOR-NEW SUCCEEDS
        OR BOTH BOTH X3 := X3-ORIG
        AND X3-SEL := X3-SEL-ORIG
        AND AT X-PN ALL OF $ASSIGN-FAIL-SEL, $MARK-P, $PRINT-NOCHNGE.
   $SELECT-FOR-NEW =
        IF AT X-HOST BOTH XW1:= X-HOST [FOR SEL PRINTOUT]
        AND PRESENT-ELEMENT- X3 EXISTS WHERE DO $SET-X3-LIST
        THEN ALL OF $SEL-P, $MARK-P, $ASSIGN-NEW
        ELSE ALL OF $PRINT-SEL-MESSGE [in TSEL-GLOBAL],
   $PRINT-MESSGE [TSEL-GLOBAL-automatic success],
   $ASSIGN-NEW, $MARK-P.
   $SEL-P =
        DO $TESTRES-TEST [TSEL-GLOBAL];
        DO $CHK-SEL-LIST;
        [IF $CHK-FOR-CONN THEN $DO-EQUIV-TST;]
        DO $ASSIGN-SEL [* Global in TSEL-ADJINRN *].
   $PSEL-SA =
        IF IMMEDIATE SA X-SA EXISTS
        THEN $SA-P-SEL
        ELSE $OTHER-P-SEL.
   $SA-P-SEL =
        IF ALL OF $GET-P-X1, $SEL-SA-CHK, $GET-X2, $SET-SEL,
   $INITIALIZE
        THEN IF $PT-RESPONSE
        THEN $MARK-CHANGER-PHRASE
        ELSE $DO-P-SEL.
   $PT-RESPONSE =
        X1 IS 'PAR' OR 'A2' OR 'SOUS' OR 'AVEC';
        BOTH X3 EXISTS WHERE IMMEDIATE VERBAL EXISTS
        AND CORE-ATT OF X3 HAS MEMBER H-CHANGE OR H-CHANGE-MORE OR
        H-CHANGE-LESS OR H-CHANGE-SAME OR H-TMBEG OR H-TMEND;
        AT IMMEDIATE VERBAL OF X3,
        IMMEDIATE-NODE- IS VENPASS OR VINGO X-CHG-PHR;
        X2-ATT HAS MEMBER H-PTFUNC OR H-INDIC OR H-DIET.
   $MARK-CHANGER-PHRASE =
        X-CHGER := SYMBOL H-CHANGE;
        AT X-CHG-PHR, ASSIGN NODE ATTRIBUTE TFORM-ATT WITH VALUE X-CHGER.
   $SEL-SA-CHK =
        ONE OF $IN-FRAG-NSTG,
   $IN-NULLFRAG-NSTG,
   $IN-BESHOW,
   $ALLOW-ANY-HOST.
   $IN-FRAG-NSTG =
        AT X-SA IMMEDIATE-NODE IS FRAGMENT
        WHERE EITHER ELEMENT NSTGF EXISTS
        OR ELEMENT NSTGP EXISTS;
        AT CORE X3 DO $SET-X3-LIST.
   $IN-NULLFRAG-NSTG =
        COELEMENT VERBAL OF X-SA HAS VALUE NULLFRAG;
        AT CORE X3 OF COELEMENT SUBJECT OF X-SA DO $SET-X3-LIST.
   $IN-BESHOW =
        AT X-SA BOTH IMMEDIATE-NODE IS BESHOW
        AND DO L(BESUBJ) WHERE AT CORE X3 DO $SET-X3-LIST.
   $ALLOW-ANY-HOST =
        EITHER AT X-SA DO $HOST-IS-VERB OR $UP-TO-VERB;
        IF AT XX3 DO $SET-XX3-LIST
        THEN X3:= XX3 WHERE X3-LIST:= XX3-LIST
        ELSE TRUE [do selection for X1, X2 only - do not set X3].
   $SET-XX3-LIST =
        AT XX3 DO $GET-SUBCLASS-LIST;
        XX3-LIST:= XNN-LIST [set in $GET-SUBCLASS-LIST].
   $HOST-IS-VERB =
        CORE XX3 OF COELEMENT VERBAL EXISTS.
   $UP-TO-VERB =
        ITERATE ASCEND TO OBJECT OR OBJBE PASSING THROUGH N-OBJ-IN-STR
        UNTIL $HOST-IS-VERB SUCCEEDS.
   $OTHER-P-SEL =
        IF [EITHER] BOTH PRESENT-ELEMENT- IS OCCURRING IN OBJECT
        AND $VERB-HOST
        [OR BOTH PRESENT-ELEMENT- IS OCCURRING IN NPN OR PNN]
        [ AND $NSTGO-HOST]
        THEN IF ALL OF $GET-P-X1, $GET-X2, $SET-SEL
        THEN $DO-P-SEL.
   $VERB-HOST =
        IMMEDIATE OBJECT EXISTS;
        EITHER CORE-ATT X3-LIST OF CORE- X3 OF COELEMENT VERBAL EXISTS
        WHERE X3-LIST DOES NOT HAVE MEMBER VBE OR BEREP
        OR CORE-ATT X3-LIST OF CORE- X3 OF COELEMENT SUBJECT EXISTS.
   $NSTGO-HOST =
        CORE-ATT X3-LIST OF CORE- X3 OF COELEMENT NSTGO IS NOT NIL.
— TSEL-PN-ADJUNCT
—       raises non-ADJUNCT-TYPE RADJSET out of PN:ADJUNCT-TYPE.
— -- a complex situation: if there exists a free right adjunct
—       in a bound right PN adjunct, then because the free adjunct
—       must be formatted freely of the bound PN adjunct, it is
—       necessary to lift it out of the bound PN adjunct.
TSEL-PN-ADJUNCT = IN PN, IN-LEADS:
        IF PRESENT-ELEMENT- X-PRE HAS NODE ATTRIBUTE ADVERBIAL-TYPE
        WHERE PRESENT-ELEMENT- HAS MEMBER ADJUNCT-TYPE
        THEN DO $RAISE-CONTAINED-NODES.
   $RAISE-CONTAINED-NODES =
        DESCEND TO LXR;
        IF ELEMENT- RADJSET X-RADJ IS NOT EMPTY
        THEN BOTH AFTER X-RADJ INSERT <RN> X-NEW-RN (<NULL>)
        AND BOTH AT LAST-ELEMENT- ITERATE VERIFY $NON-ADJUNCTS
        UNTIL GO LEFT FAILS
        AND DELETE X-RADJ.
   $NON-ADJUNCTS =
        IF PRESENT-ELEMENT- X-ADJ-PN HAS NODE ATTRIBUTE ADVERBIAL-TYPE
        WHERE PRESENT-ELEMENT- HAS MEMBER ADJUNCT-TYPE
        THEN IF X-NEW-RN IS EMPTY
        THEN REPLACE VALUE OF X-NEW-RN BY X-ADJ-PN
        ELSE BEFORE VALUE OF X-NEW-RN INSERT X-ADJ-PN
        ELSE AFTER X-PRE INSERT X-ADJ-PN.
— TSEL-AGE-QUANT-QTENS
—       for PN phrase that has Q10S
—       e.g. in his 70's, in the 70's...
TSEL-AGE-QUANT-QTENS = IN PN:
        PRESENT-ELEMENT X-PRE EXISTS;
        IF ALL OF $NO-PHRASE-ATT, $CHECK-PREPS, $QTENS
        THEN DO $HOST-TYPE.
   $NO-PHRASE-ATT = X-PRE DOES NOT HAVE NODE ATTRIBUTE PHRASE-ATT.
   $CHECK-PREPS =
        CORE- OF ELEMENT- P IS 'IN' OR 'AT'.
   $QTENS =
        DESCEND TO LNR;
        VALUE OF ELEMENT- NVAR IS Q10S.
   $HOST-TYPE =
        IF EITHER HOST- X1 EXISTS
        OR $SUBJECT-OF-VBE
        THEN IF ATTRIBUTE-LIST OF X1 HAS MEMBER NHUMAN OR MASC OR FEM
        OR H-PT OR H-FAMILY [OR H-DOCTOR]
        THEN $ASSIGN-AGE-PHRASE
        ELSE IF CORE-ATT OF X1 HAS MEMBER H-PTFUNC OR H-TXVAR
        THEN $ASSIGN-QUANT-PHRASE
        ELSE $ASSIGN-TIME-PHRASE
        ELSE TRUE.
   $SUBJECT-OF-VBE =
        IMMEDIATE-NODE- OF X-PRE IS OBJBE;
        ULTIMATE-SUBJECT EXISTS;
        CORE- X1 EXISTS.
   $ASSIGN-TIME-PHRASE =
        X-PHRASE := SYMBOL TIME-PHRASE;
        DO $ASSIGN-PHRASE-ATT.
   $ASSIGN-AGE-PHRASE =
        X-PHRASE := SYMBOL AGE-PHRASE;
        DO $ASSIGN-PHRASE-ATT.
   $ASSIGN-QUANT-PHRASE =
        X-PHRASE := SYMBOL QUANT-PHRASE;
        DO $ASSIGN-PHRASE-ATT.
   $ASSIGN-PHRASE-ATT =
        AT X-PRE, ASSIGN NODE ATTRIBUTE PHRASE-ATT WITH VALUE X-PHRASE.
— T-FORMAT-PN-CONN
—       if a format is filled, then the next P=with is
—       an H-CONN.
—       This is a crude version for FORMAT + FORMAT separation
—       section.
T-FORMAT-PN-CONN = IN PN:
        AT PRESENT-ELEMENT- X-PN,
        IF BOTH ELEMENT- P IS 'WITH'
        AND ONE OF $PN-IN-OBJBE-RA, $VHAVE-PN-IN-PN, $PN-IN-SA
        THEN BOTH X-CONN := LIST CONN-LIST
        AND AT ELEMENT- P
        ASSIGN NODE ATTRIBUTE SELECT-ATT WITH VALUE X-CONN.
   $VHAVE-PN-IN-PN =
        [* Recurring chest pain in a man with known coronary artery disease *]
        X-PN HAS NODE ATTRIBUTE ADVERBIAL-TYPE
        WHERE PRESENT-ELEMENT- HAS MEMBER VHAVE-TYPE;
        HOST- OF X-PN IS OCCURRING IN PN
        WHERE CORE-ATT OF HOST- HAS MEMBER H-INDIC OR H-DIAG OR H-NORMAL.
   $PN-IN-OBJBE-RA =
        IMMEDIATE-NODE IS RA;
        BOTH CORE-ATT OF HOST- HAS MEMBER H-NORMAL OR H-CHANGE OR
        H-CHANGE-MORE OR H-CHANGE-LESS OR H-CHANGE-SAME
        AND AT IMMEDIATE LAR, ASCEND TO ASTG;
        ULTIMATE-SUBJECT EXISTS;
        ELEMENT- LNR OF ELEMENT- NSTG EXISTS;
        CORE-ATT OF CORE- HAS MEMBER H-PTFUNC.
   $PN-IN-SA =
        IMMEDIATE-NODE IS SA OR SA-LAST;
        BOTH CORE-ATT OF CORE- OF COELEMENT- VERB HAS MEMBER VBE
        AND CORE-ATT OF CORE- OF ELEMENT- NSTG OF ULTIMATE-SUBJECT
        HAS MEMBER H-PTFUNC.
— TSEL-CONDITION
—       for LXR which has H-PT, H-FAMILY, H-PTPART, or
—       H-PTAREA subclass, which is in PN where HOST is an H-CHANGE
—       'improvement in arm': LXR is assigned COMPUTED-ATT H-INDIC.
—       Later in Transformation phase, 'arm' > 'CONDITION OF arm'.
TSEL-CONDITION = IN LNR:
        AT CORE X-CORE OF PRESENT-ELEMENT- X-LNR
        IF ALL OF $CHK-SUBCLASS, $CHK-RN, $CHK-LN, $CHK-HOST
        THEN $ASSIGN-COMP-ATT.
   $CHK-SUBCLASS =
        CORE-SELATT X-SEL OF X-CORE HAS MEMBER H-PTPART OR H-PTAREA OR H-PT
        OR H-FAMILY.
   $CHK-RN =
        IF X-CORE HAS NODE ATTRIBUTE N-TO-RN-ATT
        @THEN $NO-CONDITION.
   $NO-CONDITION =
        CORE-SELATT OF CORE DOES NOT HAVE MEMBER H-INDIC OR H-DIAG.
   $CHK-LN =
        IF X-CORE HAS NODE ATTRIBUTE N-TO-LN-ATT
        @THEN $NO-CONDITION.
   $CHK-HOST =
        X-LNR IS OCCURRING IN PN
        WHERE BOTH CORE-SELATT X-TEMP OF HOST HAS MEMBER H-CHANGE
        OR H-CHANGE-MORE OR H-CHANGE-LESS OR H-CHANGE-SAME
        AND X-TEMP DOES NOT HAVE MEMBER H-STATUS
        [Do not need CONDITION; it is implied by STATUS].
   $ASSIGN-COMP-ATT =
        X-COMP-ATT:= X-SEL;
        X-ADD:= LIST INDIC-LIST;
        X-ADD:= HEAD OF X-ADD;
        PREFIX X-ADD TO X-SEL;
        AT X-CORE ASSIGN NODE ATTRIBUTE COMPUTED-ATT WITH VALUE
        X-COMP-ATT.
— TSEL-VERB-SUBJ
—       SELECTION BETWEEN VERB (X1), SUBJECT (X2)
—       USING LIST V-S-O
—       - $VERB-SUBJ IS GLOBAL, AND IS USED FOR V-S-O SELECTION
—       WHEN OBJECT HAS BEEN COMPLETED.
—       - ALSO SELECTION FOR RN CONTAINING VERBAL ELEMENT (TOVO, VINGO,
—       AND VENPASS [DONE AS VERB-OBJECT SELECTION BY TSEL-VEN-SUBJ]).
—       FOR VERBAL ELEMENT IN RN, SUBJECT IS TAKEN TO BE HOST.
—       - IN FRAGMENT = TVO, TOVO, VINGSTG:
—       THE VALUE OF FRAGMENT IS SET TO X2, SINCE THERE IS NO SUBJECT,
—       AND X2-LIST IS INITIALIZED TO NIL; X2 WILL THEN GET A LIST OF
—       POSSIBLE SUBJECTS CONSISTENT WITH SELECTION FOR THE VERB AND ITS
—       OBJECT.
—       - IF IN A PASSIVE, TSEL-VERB-SUBJ IS NOT EXECUTED [THE SELECTION
—       IS CHECKED BY TSEL-VEN-SUBJ INSTEAD]; ALSO IF OBJECT IS NOT
—       COMPLETED (X3 NOT SET), THEN NO VERB-SUBJ SELECTION IS DONE
—       IF VERB IS AN AUXILIARY VERB (BE OR HAVE), OR IF IT IS A
—       CONNECTIVE, WHICH REQUIRES EQUIVALENCE BETWEEN SUBJ AND OBJ.

TSEL-VERB-SUBJ = IN VERBAL:
        BOTH $WRITE-SEL-ID AND
        DO $VERB-SUBJ-CHK.
   $WRITE-SEL-ID =
        BOTH BOTH WRITE ON INFO '*** Starting TSEL-VERB-SUBJ:'
        AND WRITE ON INFO END OF LINE
        AND AT PRESENT-ELEMENT- WRITE ON INFO WORDS SUBSUMED;
        WRITE ON INFO END OF LINE.
   $VERB-SUBJ-CHK =
        IF EITHER PRESENT-ELEMENT- IS LVENR WHERE IMMEDIATE-NODE IS VENPASS
        OR BOTH IT IS NOT THE CASE THAT X3 EXISTS [* no OBJ yet *]
        AND AT EXTENDED-CORE,
        EITHER PRESENT-ELEMENT- IS VBE OR VHAVE OR BEREP
        OR EITHER $CONN-CHK [* GLOBAL-check for CONN subclass *]
        OR CORE-ATT HAS MEMBER VBE [SOBJBE-SOBJESHOW CASE]
        THEN TRUE [* Do not do selection if in passive, or *]
        [* have auxiliary or connective verbs. *]
        ELSE IF ALL OF $CO-OCCUR-SUBJ [SUBJ of VERB or HOST of RN],
   $GET-VERB [set up X1-LIST],
   $GET-OBJECT [* 10/19/96 *],
   $SETUP-PR-REG
        THEN BOTH $SELECT-FOR-VERB
        [* X-SEL-SAVE will have selection info *]
        AND EITHER $ASSIGN-SEL [* selection passed *]
        OR AT X1 DO $ASSIGN-FAIL-SEL [* mark failure *].
   $CO-OCCUR-SUBJ =
        ITERATET $UP-TO-OBJ-OR-RN UNTIL $COEL-N SUCCEEDS
        [* Keep ascending until find coelement OBJECT or HOST N *];
        DO $CHECK-NVN;
        AT X2 ONE OF $REG-SUBCLASS, $WH-X2, $FRAG-NO-SUBJ.
   $GET-OBJECT =
        COELEMENT- OBJECT X-OBJ [OF X1] EXISTS
        WHERE CORE- X-CORE EXISTS;
        AT X-CORE, ONE OF $OBJ-FOR-SEL [* in TSEL-NULLC-OBJ *],
   $NULLOBJ-SEL.
   $NULLOBJ-SEL =
        X-CORE IS NULLOBJ;
        X3-LIST := LIST NULLOBJ-LIST.
   $UP-TO-OBJ-OR-RN =
        [* SWITCH SIGNALS SEL. BETW. RN AND HOST- WHEN X-TEMP ]
        [* IS NOT NIL; BETW. SUBJ AND VERB WHEN X-TEMP IS NIL ]
        VERIFY X-TEMP:= NIL;
        EITHER ASCEND TO RN OR SA
        PASSING THROUGH VINGO OR TOVO OR TOVO-N OR PVO OR PVO-N
        OR DO $UP-TO-O.
   $UP-TO-O =
        ONE OF $ASCEND-TO-OBJECT, $ASCEND-TO-OBJBE, $BESHOW-VINGO.
   $ASCEND-TO-OBJECT =
        ASCEND TO OBJECT
        PASSING THROUGH VINGO OR VENO OR TOVO OR PVO OR TOBE OR VO OR
        ASOBJBE OR Q-CONJ.
   $ASCEND-TO-OBJBE =
        ASCEND TO OBJBE PASSING THROUGH VENO OR TOVO OR PVO OR TOBE.
   $BESHOW-VINGO =
        ASCEND TO VINGO WHERE IMMEDIATE-NODE IS BESHOW.
   $COEL-N =
        IF PRESENT-ELEMENT- IS RN
        @THEN HOST X2 EXISTS WHERE X-TEMP:= X2
        [* X-TEMP NON-NIL for HOST RN *]
        ELSE ONE OF $SUBJ-OF-OBJBE, $COEL-SUBJ, $NO-SUBJ-INFRAG.
   $SUBJ-OF-OBJBE =
        X1 IS SOBJBE OR BESHOW;
        CORE X2 OF BESUBJ EXISTS.
   $COEL-SUBJ =
        PRESENT-ELEMENT- HAS COELEMENT SUBJECT
        WHERE EXTENDED-CORE X2 EXISTS.
   $NO-SUBJ-INFRAG =
        EITHER IMMEDIATE-NODE IS VO X2
        WHERE IMMEDIATE-NODE IS IMPERATIVE
        OR IMMEDIATE-NODE IS TVO OR TOVO OR PVO OR VINGSTG X2
        WHERE IMMEDIATE-NODE IS FRAGMENT.
   $CHECK-NVN =
        [* Don't do SELECTION if HOST is NVN *]
        IF X-TEMP IS NOT NIL [* Selection is between HOST and RN *]
        THEN IF RIGHT-ADJUNCT OF X2 IS VINGO OR TOVO OR PVO OR TOVO-N
        OR PVO-N
        THEN X2 IS NOT NVN.
   $REG-SUBCLASS =
        DO $GET-SUBCLASS-LIST [TSEL-GLOBAL];
        X2-LIST:= XNN-LIST [SET IN $SUBCLASS-CHK].
   $WH-X2 =
        EITHER X2 IS 'WHO' OR 'WHOSE' OR 'QUI' OR 'DONT'
        WHERE X2-LIST:= LIST HUMAN-LIST
        OR EITHER X2 IS 'WHICH' OR 'WHAT' OR 'QUE'
        WHERE X2-LIST := LIST NONHUMAN-LIST
        OR $A-DIDOMIT-NULLWH.
   $A-DIDOMIT-NULLWH = [* recover NULLWH *]
        X2 IS NULLWH;
        IMMEDIATE-NODE- IS SUBJECT;
        IMMEDIATE-NODE- IS ASSERTION;
        IMMEDIATE-NODE- IS WHS-N;
        BOTH PRESENT-ELEMENT- HAS NODE ATTRIBUTE DIDOMIT
        WHERE PRESENT-ELEMENT- IS IDENTICAL TO X2
        AND HOST- X2 EXISTS;
        CORE-ATT X2-LIST EXISTS.
   $FRAG-NO-SUBJ =
        EITHER X2 IS VO OR [TVO OR] TOVO OR PVO OR VINGSTG
        WHERE X2-LIST:= NIL
        OR X2 IS TVO WHERE X2-LIST := LIST TVO-SUBJECT.
   $GET-VERB =
        EITHER X1-LIST IS NOT NIL [ALREADY ASSIGNED IF IN SOBJBE/SHOW]
        OR EXTENDED-CORE X1 EXISTS WHERE CORE-ATT X1-LIST EXISTS;
        DO $SET-SEL [GLOBAL; INITIALIZE X-SELS TO NIL].
   $SETUP-PR-REG =
        XW1:=X2; XW2:=X1;
        X-TYPE-LIST:= NIL;
        IF X3 EXISTS THEN XW3:=X3 [FOR SEL PRINTOUT].
   $SELECT-FOR-VERB =
        DO $INITIALIZE [* GLOBAL; initialize X-SEL-SAVE's *];
        X-COMPSW:= NIL;
        IF X1-LIST HAS MEMBER BEREP
        THEN ALL OF $SEL-V-S-O [* select for verb other than BEREP *],
   $SET-UP-BEREP-LIST [select for BEREP-similar to VBE],
   $TEST-FOR-EQUIV [* Equiv. test for SUBJ:N & OBJ:N *]
        ELSE IF EITHER X1 IS SOBJBE
        OR $X1-BESHOW
        THEN $SEL-BE [* Sets up X1-LIST; checks for equivalence, *]
        [* BE-S-O, SUBJECT-P-N, and V-S-O *]
        ELSE $SEL-BE-OR-V [* for all verbs *].
   $INITIALIZE =
        X1-SEL-SAVE := NIL;
        X2-SEL-SAVE := NIL;
        X3-SEL-SAVE := NIL.
   $SEL-V-S-O =
        ALL OF $SET-V-S-O-REG,
   $SET-SEL [GLOBAL; initializes X-SELs TO NIL],
   $TEST-SEL.
   $SET-V-S-O-REG =
        X-NAME-LIST := LIST NAME-V-S-O;
        X-CO-OCCUR-LIST:= LIST V-S-O .
   $TEST-SEL =
        IF $CO-OCCUR-CHK
        THEN $ADD-TO-LIST [* add X-SELs to X-SAVE-SELs *].
   $PRO-PTVERB-TEST =
        IF BOTH X1-LIST HAS MEMBER H-PTVERB
        AND BOTH X2 IS PRO:SINGULAR
        AND X2-LIST HAS MEMBER H-PT
        THEN BOTH BOTH X2-SEL := NIL
        AND BOTH X-PT := SYMBOL H-PT
        AND PREFIX X-PT TO X2-SEL
        AND DO $ADD-TO-LIST.
   $H-PTSPEC-TEST =
        IF BOTH X2-LIST HAS MEMBER H-PTSPEC
        AND EITHER X1-LIST HAS MEMBER H-SHOW OR VBE
        OR X1 IS BESHOW OR SOBJBE
        THEN BOTH X2-SEL:= LIST H-PTSPEC-LIST
        AND $ASSIGN-TESTYPE WHERE DO $ADD-TO-LIST.
   $ASSIGN-TESTYPE =
        X-COMP-ATT := LIST H-TXVAR-LIST;
        AT X2 ASSIGN NODE ATTRIBUTE COMPUTED-ATT WITH VALUE X-COMP-ATT.
   $SET-UP-BEREP-LIST =
        [* SET UP LIST SIMILAR TO BE-S-O, CONSISTING OF BEREP WITH ]
        [* SAME ATTRIBUTES AS ARE ON BE-S-O LIST, EXCEPT HEAD = VBE]
        IF EITHER X3 IS NULLOBJ
        OR X3 IS SOBJBE OR THATS OR ASSERTION
        THEN TRUE [* DO NOT TEST FOR EQUIVALENCE WITH NULLOBJ OR SENTOBJ]
        ELSE $SETUP-FOR-SEL-BE.
   $SETUP-FOR-SEL-BE =
        X1-LIST:= LIST BEREP-LIST;
        X-HEAD:= HEAD OF LIST BEREP-LIST;
        X-ATTRB:= ATTRIBUTE-LIST OF LIST BE-S-O;
        X-CO-OCCUR-LIST := NIL;
        X-NAME-LIST := LIST NAME-BE-S-O;
        PREFIX X-HEAD:X-ATTRB TO X-CO-OCCUR-LIST;
        [CREATE BEREP-S-O LIST FROM BE-S-O LIST]
        DO $SET-SEL [GLOBAL, INITIALIZES X-SELS TO NIL];
        DO $SEL-BE-BEREP.
   $SEL-BE-BEREP =
        [* WHEN OBJ = NULLC IN Q-ASSERT, LINKC POINTS TO AVAR NOT ASTG]
        [* DETERMINE WHAT KIND OF OBJECTBE THERE IS]
        AT X-OBJ EITHER $DESCEND-TO-BEREP OR TEST FOR AVAR;
        STORE IN X11;
        ONE OF $SEL-ADJ-IN-OBJBE [USE BE-S-O LIST],
   $SEL-NSTG, $SEL-FOR-PN, $SEL-FOR-DSTG.
   $DESCEND-TO-BEREP = DESCEND TO NSTG OR ASTG OR DSTG OR PN.
   $SEL-ADJ-IN-OBJBE =
        EITHER X11 IS ASTG OR AVAR
        OR X11 IS NSTG WHERE EITHER X3-LIST HAS MEMBER NUNIT
        OR X2-LIST HAS MEMBER NUNIT;
        DO $SET-SEL [* GLOBAL - INIT SEL *];
        EITHER $SEL-ADJ-CONN [* ADJ IS H-CONN *]
        OR $ADJ-SEL [* SEL WITH N-ADJ LIST *].
   $SEL-ADJ-CONN =
        CORE-SELATT OF X3 HAS MEMBER CONNECTIVE-LIST;
        DO $CONN-SEL.
   $CONN-SEL =
        RIGHT-ADJUNCT OF X3 IS PN X-PN;
        AT ELEMENT- P OF X-PN
        EITHER PRESENT-ELEMENT- HAS NODE ATTRIBUTE PVAL-ATT
        OR PRESENT-ELEMENT- IS 'OF' OR 'DE' OR 'D''';
        DO $SAVE-X3;
        DO $SAVE-X1;
        AT X-PN EXTENDED-CORE X3 OF NSTGO EXISTS;
        DO $SET-X3-LIST [TSEL-P-N];
        DO $SET-SEL [GLOBAL - INIT. XSELS TO NIL];
        DO $PRINT-RESTR-INFO [TSEL-GLOBAL];
        DO $DO-EQUIV-TST;
        X-N := X3;
        XN-SEL := X3-SEL [ASSIGN X3];
        DO $ASSIGN-COMP-AND-SEL [TSEL-GLOBAL-ASSIGN N IN PN];
        DO $RESTORE-X1;
        DO $RESTORE-X3.
   $SAVE-X3 =
        X3-TEMP:= X3;
        X3-TEMP-LIST:= X3-LIST;
        X3-TEMP-SAVE:= X3-SEL-SAVE.
   $SAVE-X1 =
        X1-TEMP-SEL:= X1-SEL-SAVE;
        X1-TEMP:= X1;
        X1-TEMP-LIST:= X1-LIST.
   $RESTORE-X1 =
        X1:= X1-TEMP;
        X1-SEL:= X1-TEMP-SEL;
        X1-LIST:= X1-TEMP-LIST.
   $RESTORE-X3 =
        X3:= X3-TEMP;
        X3-LIST:= X3-TEMP-LIST;
        X3-SEL-SAVE:= X3-TEMP-SAVE.
   $ADJ-SEL =
        [* Use LIST N-ADJ, X2>X1, X3>X2 for N-ADJ]
        DO $SAVE-X1;
        X1:= X2; X1-LIST:= X2-LIST; X1-SEL:= X2-SEL;
        X2:= X3; X2-LIST:= X3-LIST; X3-SEL:= X2-SEL;
        X-NAME-LIST:= LIST NAME-N-ADJ;
        X-CO-OCCUR-LIST:= LIST N-ADJ;
        EITHER $CO-OCCUR-CHK OR TRUE;
        X3:= X2; X3-LIST:= X2-LIST; X3-SEL:= X2-SEL;
        X2:= X1; X2-LIST:= X1-LIST; X2-SEL:= X1-SEL;
        DO $RESTORE-X1;
        DO $SEL-FOR-DSTG [SET X1-SEL TO VBE];
        DO $ADD-TO-LIST.
   $SEL-FOR-DSTG =
        X1-SEL := LIST VBE-LIST
        [DO NOT FAIL SELECT IF X11 IS DSTG].
   $SEL-NSTG =
        X11 IS NSTG;
        IF CORE-SELATT OF X2 HAS MEMBER CONNECTIVE-LIST
        [THE CAUSE OF X IS Y]
        THEN ALL OF $SWITCH-X3TOX2 [TO USE CONN-SEL],
   $CONN-SEL,
   $SWITCH-X3TOX2 [SWITCH BACK]
        ELSE IF CORE-SELATT OF X3 HAS MEMBER CONNECTIVE-LIST
        [Y IS THE CAUSE OF X]
        THEN $CONN-SEL
        ELSE BOTH $SHOW-IN-BESHOW
        AND $TEST-FOR-EQUIV.
   $SWITCH-X3TOX2 =
        X2-TEMP := X2;
        X2-TEMP-SEL := X2-SEL-SAVE;
        X2-TEMP-LIST:= X2-LIST;
        X2 := X3;
        X2-SEL-SAVE := X3-SEL-SAVE;
        X2-LIST:= X3-LIST;
        X3 := X2-TEMP;
        X3-LIST:= X2-TEMP-LIST;
        X3-SEL-SAVE := X2-TEMP-SEL.
   $SHOW-IN-BESHOW =
        [* NEED TO DO SELEC. USING LIST V-S-O FOR 'SHOW' READING OF BESHOW]
        IF X1 IS BESHOW THEN $SEL-V-S-O.
   $TEST-FOR-EQUIV =
        IF BOTH AT X-OBJ DESCEND TO NSTG OR NPN OR NN OR PNN OR PN
        NOT PASSING THROUGH ADJSET1
        WHERE DO $GET-OBJ-N [OBJECT OF VERB IS NSTG]
        AND AT X2 EITHER IMMEDIATE-NODE- IS NVAR [VERB SUBJ IS N]
        OR PRESENT-ELEMENT- [X2] IS VENPASS
        THEN BOTH X-COMPSW:= NIL [* 6/2/88 ADD *]
        AND $DO-EQUIV-TST.
   $GET-OBJ-N =
        IF PRESENT-ELEMENT- IS NPN OR NN OR PNN
        THEN $LAST-NSTGO [GET DIRECT OBJ N].
   $LAST-NSTGO =
        LAST-ELEMENT EXISTS;
        ITERATET GO LEFT
        UNTIL TEST FOR NSTGO SUCCEEDS;
        CORE X3 EXISTS;
        AT X3 DO $GET-SUBCLASS-LIST[TSEL-GLOBAL];
        X3-LIST:= XNN-LIST.
   $SEL-FOR-PN =
        X1-TEMP:= X1;
        IF X11 IS PN X-PN WHERE ELEMENT P X1 EXISTS
        THEN IF ALL OF $SUBJ-TO-X3 [SUBJECT IN X3],
   $SET-X2-LIST,
   $SET-SEL
        THEN BOTH $DO-P-SEL [GLOBAL IN TSEL-P-N]
        AND $VBE-FOR-X1
        ELSE TRUE
        ELSE $SEL-FOR-DSTG .
   $SUBJ-TO-X3 =
        X3:= X2;
        X3-LIST:= X2-LIST .
   $VBE-FOR-X1 =
        X1:= X1-TEMP;
        X1-SEL-SAVE:= LIST VBE-LIST;
        X2-SEL-SAVE := NIL;
        [X2 AND X3 SELECT-ATT ASSIGNED BY $DO-P-SEL ALREADY;ASSIGN X1 ONLY]
        X3-SEL-SAVE:= NIL.
   $X1-BESHOW =
        X1 IS BESHOW.
   $SEL-BE =
        X-CO-OCCUR-LIST:= LIST BE-S-O;
        DO $SEL-BE-BEREP.
   $SEL-BE-OR-V =
        IF X1-LIST HAS MEMBER VBE
        THEN $SEL-BE [* for VBE, BESHOW *]
        ELSE BOTH $SEL-V-S-O
        AND IF EITHER X1-LIST HAS MEMBER CONNECTIVE-LIST
        OR X1-LIST HAS MEMBER H-CHANGE OR H-CHANGE-MORE OR
        H-CHANGE-LESS OR H-CHANGE-SAME OR H-RESP
        THEN $TEST-FOR-EQUIV.
— TSEL-VEN-SUBJ
—       COMPUTES SELECTION BETWEEN PASSIVE VERB (X1), ITS SURFACE SUBJECT
—       (UNDERLYING OBJECT, X2) USING V-S-O LIST. SINCE THE SURFACE
—       SUBJECT IS NOT ALWAYS THE UNDERLYING DIRECT OBJECT, THE
—       RESTRICTION IS DONE IN TWO PARTS:
—       1. IN LVENR (TSEL-VEN-SUBJ) SELECTION IS DONE ONLY IF THE POBJLIS
—       CONTAINS ONLY NULLOBJ OR PN.
—       2. IN PASSOBJ (TSEL-PASSOBJ), SELECTION IS DONE IF PASSOBJ ITSELF
—       IS EITHER PN OR NULLOBJ.
—       ONCE X3 IS SET UP, $VERB-SUBJ-CHK [TSEL-VERB-SUBJ] CHECKS
—       SELECTION; SELECTIONAL ATTRIBUTES FOR X2 (UNDERLYING SUBJECT)
—       ARE ATTACHED AS SELECT-ATT NODE ON VENPASS, FOR USE IN LATER
—       TRANSFORMATIONS.

TSEL-VEN-SUBJ = IN LVENR:
        BOTH $WRITE-SEL-ID AND
        DO $SEL-VEN-SUBJ.
   $WRITE-SEL-ID =
        BOTH BOTH WRITE ON INFO '*** Starting TSEL-VEN-SUBJ:'
        AND WRITE ON INFO END OF LINE
        AND AT PRESENT-ELEMENT- WRITE ON INFO WORDS SUBSUMED;
        WRITE ON INFO END OF LINE.
   $SEL-VEN-SUBJ =
        PRESENT-ELEMENT- X-PRE EXISTS;
        IF IMMEDIATE-NODE IS VENPASS X2
        WHERE STORE IN X-VENPASS
        THEN IF ALL OF $GET-VERB,
   $SUBJ-OF-VENPASS [* 6/2/88 ADDITION *],
   $OBJ-OF-VENPASS,
   $SUBJ-TO-ANYTHING,
   $SETUP-PR-REG
        THEN EITHER $SEL-VEN-S-O
        OR $NEW-OBJ.
   $SEL-VEN-S-O =
        ALL OF $SWITCH-X3TOX2,
   $SELECT-FOR-VERB [TSEL-VERB-SUBJ],
   $SWITCH-X3TOX2,
   $SEL-SUCCEEDS,
   $ASSIGN-SEL [* Global TSEL-ADJINRN *].
   $SETUP-PR-REG = [* registers for SEL printout *]
        [XW1:=X2;] XW2:=X1;
        X-TYPE-LIST:= NIL;
        IF X3 EXISTS THEN BOTH XW1:=X2 AND XW3:=X3.
   $SEL-SUCCEEDS =
        X1-SEL-SAVE IS NOT NIL
        [X2-SEL-SAVE IS NOT NIL;]
        [X3-SEL-SAVE IS NOT NIL].
   $NEW-OBJ =
        IMMEDIATE-NODE OF X2 IS NVAR;
        X-START:= X-VENPASS;
        X-HOST:= X2;
        EITHER ITERATE DO NEW-HOST
        UNTIL $SELECT-FOR-NEW SUCCEEDS
        OR AT X-VENPASS ALL OF $ASSIGN-FAIL-SEL, $PRINT-NOCHNGE.
   $SELECT-FOR-NEW =
        IF AT X-HOST
        BOTH XW1:= X-HOST [FOR SEL PRINTOUT]
        AND PRESENT-ELEMENT- X2 EXISTS WHERE DO $SUBJ-TO-ANYTHING
        THEN BOTH $SEL-VEN-S-O
        AND $VENPASS-MOVE.
   $SWITCH-X3TOX2 =
        X2-TEMP := X2;
        IF X2-SEL-SAVE IS NOT NIL
        THEN X2-TEMP-SEL := X2-SEL-SAVE
        ELSE X2-TEMP-SEL := NIL;
        X2-TEMP-LIST:= X2-LIST;
        X2 := X3;
        IF X3-SEL-SAVE IS NOT NIL
        THEN X2-SEL-SAVE := X3-SEL-SAVE
        ELSE X2-SEL-SAVE := NIL;
        X3-SEL-SAVE := X2-TEMP-SEL;
        X2-LIST:= X3-LIST;
        X3 := X2-TEMP;
        X3-LIST:= X2-TEMP-LIST.
   $VENPASS-MOVE =
        BOTH IF X-NEWADJ [new position of X-START] IS NULL
        THEN REPLACE X-NEWADJ BY X-START, X-NEW
        ELSE AFTER X-NEWADJ INSERT X-START, X-NEW
        AND REPLACE X-START BY <NULL>.
   $GET-VERB =
        X-PN-NULLOBJ := LIST PN-NULLOBJ-LIST;
        BOTH CORE- X1 OF X-PRE HAS ATTRIBUTE POBJLIST
        WHERE ATTRIBUTE-LIST X-NEWLIST EXISTS
        AND AT X-PN-NULLOBJ
        BOTH INTERSECT X-SUBLIST EXISTS
        WHERE COMPLEMENT OF X-NEWLIST IS NIL
        [check if there is a subclass other than NULLOBJ]
        [or PN on the POBJLIST. If there is, do not do ]
        AND AT X1, EITHER CORE-ATT X1-LIST EXISTS
        OR EITHER X1 IS BEREP
        OR AT X1 DO $CONN-CHK
        [GLOBAL; checks for H-CONN, H-BECONN].
   $SUBJ-OF-VENPASS =
        IF BOTH EITHER LAST-ELEMENT- OF X2 IS SA X-OBJ
        WHERE ELEMENT- PN X-PN EXISTS
        OR LAST-ELEMENT- OF X-PRE IS RV X-OBJ
        WHERE ELEMENT- PN X-PN EXISTS
        AND P OF X-PN IS 'BY' OR 'WITH' OR 'PAR' OR 'AVEC'
        THEN CORE- X3 OF LNR OF NSTG OF NSTGO OF X-PN EXISTS. [GLOBAL]
   $OBJ-OF-VENPASS =
        AT X2 ITERATE $UP-TO-OBJ-OR-RN [TSEL-VERB-SUBJ]
        UNTIL EITHER $COEL-SUBJ
        OR $COEL-NVAR SUCCEEDS;
        AT X3 DO $GET-SUBCLASS-LIST [TSEL-GLOBAL];
        X3-LIST:= XNN-LIST [SET IN $GET-SUBCLASS-LIST]. (GLOBAL)
   $COEL-NVAR =
        PRESENT-ELEMENT- HAS COELEMENT- NVAR WHERE CORE- X2 EXISTS.
   $SUBJ-TO-ANYTHING =
        BOTH AT X2 DO $GET-SUBCLASS-LIST [TSEL-GLOBAL]
        AND X2-LIST := XNN-LIST.
— TSEL-OBJ-VS
—       CHECKS SELECTION BETWEEN VERB (X1), SUBJECT (X2) AND DIRECT
—       OBJECT (X3) USING V-S-O LIST AND $VERB-SUBJ-CHK IN TSEL-VERB-SUBJ
—       HOUSED IN RIGHT ADJUNCTS TO BE COMPATIBLE WITH CONJUNCTION
—       MECHANISM.

TSEL-OBJ-VS = IN OBJECT, OBJBE:
        BOTH $WRITE-SEL-ID AND
        IF PRESENT-ELEMENT- X-OBJ IS OBJECT
        THEN $SEL-OBJ-VS
        ELSE IF BOTH VALUE OF X-OBJ IS NOT PDATE
        AND AT X-OBJ IT IS NOT THE CASE
        THAT IMMEDIATE OBJECT EXISTS
        THEN $SEL-OBJ-VS.
   $WRITE-SEL-ID =
        BOTH BOTH WRITE ON INFO '*** Starting TSEL-OBJ-VS:'
        AND WRITE ON INFO END OF LINE
        AND AT PRESENT-ELEMENT- WRITE ON INFO WORDS SUBSUMED;
        WRITE ON INFO END OF LINE.
   $SEL-OBJ-VS =
        IF $GO-TO-VERB
        THEN IF BOTH $NOT-NULLC-WH
        AND NOT $TRANSP-OBJ
        THEN ONE OF $OBJ-N-SEL, $SENTOBJ-SEL, $NULLOBJ-SEL,
   $QUANT-SEL, $OTHER-SEL.
   $NOT-NULLC-WH = CORE X-CORE OF X-OBJ IS NOT NULLC OR NULLWH.
   $TRANSP-OBJ = [* already looked at *]
        X-CORE IS VINGO OR VENO OR TOVO OR PVO OR TOBE OR VO OR
        ASOBJBE OR Q-CONJ OR TOVO-N OR PVO-N.
   $QUANT-SEL =
        X-CORE IS QN OR QPERUNIT OR PQUANT [*GRI*].
   $GO-TO-VERB =
        X1-LIST:= NIL;
        AT X-OBJ PRESENT-ELEMENT- X-PRE EXISTS;
        EITHER $NO-VERB OR VERB-COELEMENT X-VERB EXISTS.
   $NO-VERB =
        X-OBJ IS OBJBE;
        VERIFY EITHER $VBE OR $BE-OR-SHOW.
   $VBE =
        IMMEDIATE-NODE- IS SOBJBE X1;
        X1-LIST:= LIST VBE-LIST .
   $BE-OR-SHOW =
        IMMEDIATE-NODE- IS BESHOW X1;
        X1-LIST:= LIST BE-OR-SHOW-LIST.
   $OBJ-N-SEL =
        AT X-CORE DO $OBJ-FOR-SEL [IN TSEL-NULLC-OBJ];
        DO $SET-UP-X3;
        EITHER X1 EXISTS OR X-VERB EXISTS;
        DO $VERB-SUBJ-CHK [IN TSEL-VERB-SUBJ].
   $SET-UP-X3 =
        X3:= X-CORE;
        AT X3 EITHER DO $GET-SUBCLASS-LIST WHERE X3-LIST:= XNN-LIST
        OR X3 IS QN OR NQ WHERE CORE-ATT X3-LIST OF ELEMENT- N
        EXISTS.
   $SENTOBJ-SEL =
        X-CORE IS THATS OR ASSERTION OR SOBJBE OR C1SHOULD;
        IF CORE-SELATT X1-SEL OF CORE X1 OF X-VERB IS NOT NIL
        THEN BOTH X-NEWLIST:= LIST VSENT-LIST
        AND $ASSIGN-X1-SEL [GLOBAL].
   $NULLOBJ-SEL =
        X-CORE IS NULLOBJ;
        X3-LIST:=LIST NULLOBJ-LIST;
        EITHER X1 EXISTS OR X-VERB EXISTS;
        DO $VERB-SUBJ-CHK [GLOBAL IN TSEL-VERB-SUBJ].
   $OTHER-SEL =
        EITHER X1 EXISTS OR X-VERB EXISTS;
        IF X3 EXISTS
        THEN IF X3-LIST IS NOT NIL
        THEN $VERB-SUBJ-CHK
        ELSE TRUE
        ELSE $VERB-SUBJ-CHK.
— TSEL-NULLOBJ-VS
—       CHECKS SELECTION BETWEEN VERB (X1), SUBJECT (X2), AND NULLOBJ,
—       USING LIST NULLOBJ-LIST (TO CREATE LIST = NULLOBJ FOR X3)
—       AND V-S-O LIST; CHECKING DONE BY $VERB-SUBJ-CHK [TSEL-VERB-SUBJ].

— TSEL-NULLC-OBJ
—       CHECKS SELECTION BETWEEN VERB (X1), SUBJECT (X2), AND NULLC
—       OBJECT, USING LINKC TO FIND ACTUAL OBJECT (X3). ALL CHANGES
—       TO OBJECT SELECTION LIST ARE MADE ON REAL (UNZEROED) OBJECT.
—       RESTRICTION USES LIST V-S-O AND $VERB-SUBJ-CHK (TSEL-VERB-SUBJ)

TSEL-NULLC-OBJ = IN OBJECT:
        BOTH $WRITE-SEL-ID AND
        IF VALUE IS NULLC
        THEN AT OBJECT X-OBJ1, IF ALL OF $OBJ-HAS-LINKC,
   $GET-VERB,
   $TEST-OBJ
        THEN AT X-VERB, DO $VERB-SUBJ-CHK
        [GLOBAL IN TSEL-VERB-SUBJ].
   $WRITE-SEL-ID =
        BOTH BOTH WRITE ON INFO '*** Starting TSEL-NULLC-OBJ:'
        AND WRITE ON INFO END OF LINE
        AND AT PRESENT-ELEMENT- WRITE ON INFO WORDS SUBSUMED;
        WRITE ON INFO END OF LINE.
   $OBJ-HAS-LINKC = VALUE HAS NODE ATTRIBUTE LINKC X-OBJ.
   $GET-VERB =
        EITHER VERB-COELEMENT X-VERB OF X-OBJ1 IS NOT EMPTY
        OR AT CORE OF X-VERB
        EITHER PRESENT-ELEMENT- HAS NODE ATTRIBUTE LINKC
        OR PRESENT-ELEMENT- HAS NODE ATTRIBUTE SELECT-ATT.
   $TEST-OBJ =
        CORE X-CORE OF X-OBJ EXISTS;
        DO $OBJ-FOR-SEL.
   $OBJ-FOR-SEL = ONE OF $N-ADJ-Q, $NPN-OR-PNN, $NN, $N-PLUS. (GLOBAL)
   $N-ADJ-Q =
        IMMEDIATE-NODE IS NVAR OR QVAR OR AVAR;
        DO $SET-UP-X3 [GLOBAL IN TSEL-OBJ-VS].
   $NPN-OR-PNN =
        [* MAKE SURE OBJECT IS DIRECT OBJECT]
        PRESENT-ELEMENT- IS NPN OR PNN WHERE CORE X3 OF NSTGO EXISTS;
        DO $SET-UP-X3 [GLOBAL IN TSEL-OBJ-VS].
   $NN =
        PRESENT-ELEMENT- IS NN WHERE AT VALUE DO R(NSTGO);
        CORE X3 EXISTS;
        DO $SET-UP-X3.
   $N-PLUS =
        PRESENT-ELEMENT- IS NTHATS OR NASOBJBE OR NPVINGO OR NPVINGSTG
        OR NPSVINGO OR NPSNWH OR NA OR ND;
        CORE X-CORE OF NSTGO EXISTS;
        DO $SET-UP-X3.
— TSEL-PASSOBJ
—       checks selection between verb (X1) and surface subject
—       [underlying object, X3], after PASSOBJ has been completed.
—       Surface subject is underlying direct object only if PASSOBJ
—       is either NULLOBJ or PN. Uses LIST V-S-O and $VERB-SUBJ-CHK
—       (GLOBAL in TSEL-VERB-SUBJ). Selection computed for underlying
—       Subject (X2) is attached as a SELECT-ATT to VENPASS, for use
—       in later transformations.
TSEL-PASSOBJ = IN PASSOBJ:
        BOTH $WRITE-SEL-ID AND
        DO $SEL-PASSOBJ.
   $WRITE-SEL-ID =
        BOTH BOTH WRITE ON INFO '*** Starting TSEL-PASSOBJ:'
        AND WRITE ON INFO END OF LINE
        AND AT PRESENT-ELEMENT- WRITE ON INFO WORDS SUBSUMED;
        WRITE ON INFO END OF LINE.
   $SEL-PASSOBJ =
        IF EITHER VALUE IS PN OR VALUE IS NULLOBJ
        THEN AT IMMEDIATE-NODE X2 [VENPASS] OF PRESENT-ELEMENT- X-PRE
        IF ALL OF $GET-VERB,
   $SUBJ-OF-VENPASS [TSEL-VEN-SUBJ],
   $OBJ-OF-VENPASS [TSEL-VEN-SUBJ],
   $SUBJ-TO-ANYTHING,
   $SETUP-PR-REG
        THEN BOTH $SELECT-FOR-VERB [TSEL-VERB-SUBJ]
        AND EITHER $ASSIGN-SEL [TSEL-VERB-SUBJ]
        OR AT X2 DO $ASSIGN-FAIL-SEL [* mark failure *].
   $SETUP-PR-REG = [* registers for SEL printout *]
        [XW1:=X2;] XW2:=X1;
        X-TYPE-LIST:= NIL;
        IF X3 EXISTS THEN BOTH XW1:=X2 AND XW3:=X3.
   $GET-VERB =
        AT X2, CORE X1 OF LVENR EXISTS
        WHERE EITHER CORE-ATT X1-LIST EXISTS
        OR EITHER X1 IS VBE OR BEREP
        OR AT X1 DO $CONN-CHK [GLOBAL; H-CONN/BECONN].
   $SUBJ-TO-ANYTHING = X2-LIST:= NIL.
— TSEL-NULLWH-NSTGO
—       CHECKS SELECTION BETWEEN VERB (X1), SUBJECT (X2) AND NULLWH
—       OBJECT USING EXTENDED-CORE (X3). ALL SELECTIONAL ATTRIBUTES
—       ARE TAKEN FROM EXTENDED-CORE, AND ADDED TO EXTENDED-CORE.
—       LIST V-S-O AND $VERB-SUBJ-CHK (TSEL-VERB-SUBJ) ARE USED TO
—       COMPUTE SELECTION.

TSEL-NULLWH-NSTGO = IN NSTGO:
        BOTH $WRITE-SEL-ID AND
        IF VALUE IS NULLWH THEN $SEL-NULLWH-NSTGO.
   $WRITE-SEL-ID =
        BOTH BOTH WRITE ON INFO '*** Starting TSEL-NULLWH-NSTGO:'
        AND WRITE ON INFO END OF LINE
        AND AT PRESENT-ELEMENT- WRITE ON INFO WORDS SUBSUMED;
        WRITE ON INFO END OF LINE.
   $SEL-NULLWH-NSTGO =
        PRESENT-ELEMENT- X-STG EXISTS;
        IF AT EXTENDED-CORE X3 DO $OBJ-FOR-SEL [TSEL-NULL]
        THEN BOTH EITHER $SET-UP-X3 [TSEL-OBJ-VS]
        OR $WH-X3
        AND BOTH $TO-VERB @AND $VERB-SUBJ-CHK.
   $WH-X3 =
        EITHER X3 IS 'WHO' OR 'WHOM' OR 'WHOSE'
        OR 'QUI' OR 'DONT'
        WHERE X3-LIST:= LIST HUMAN-LIST
        OR X3 IS 'WHICH' OR 'WHAT' OR 'QUE'
        WHERE X3-LIST := LIST NONHUMAN-LIST.
   $TO-VERB =
        AT ULTIMATE-OBJECT X-OBJ DO $GO-TO-VERB [TSEL-OBJ-VS].
— TSEL-WHENS
—       REQUIRES THAT THE HOST (X1) OF A 'WHERE' OR 'WHEN' CLAUSE BE ABLE
—       TO TAKE A TIME (WHEN) OR LOCATIVE (WHERE) MODIFIER. FOR EXAMPLE,
—       IT SHOULD RULE OUT 'SHE WAS ADMITTED TO THE ER WHEN SHE FELL'
—       WITH THE WHEN CLAUSE MODIFYING 'ER', BUT SHOULD ALLOW 'SHE WAS
—       ADMITTED TO THE ER WHERE SHE UNDERWENT TESTS'.
—       SELECTION FOR WHERE DETERMINED BY LIST WHERE-LIST;
—       SELECTION FOR TIME-ADVERBIAL DETERMINED BY LIST WHEN-LIST.

TSEL-WHENS = IN WHENS:
        BOTH $WRITE-SEL-ID AND
        DO $SEL-WHENS.
   $WRITE-SEL-ID =
        BOTH BOTH WRITE ON INFO '*** Starting TSEL-WHENS:'
        AND WRITE ON INFO END OF LINE
        AND AT PRESENT-ELEMENT- WRITE ON INFO WORDS SUBSUMED;
        WRITE ON INFO END OF LINE.
   $SEL-WHENS =
        PRESENT-ELEMENT- X-PRE EXISTS;
        IF VALUE X2 IS 'WHERE' OR 'OU2'
        THEN $WHERE-SEL
        ELSE IF X2 IS [ENGLISH] 'WHEN' OR 'BEFORE' OR 'AFTER'
        OR [FRENCH] 'QUAND' OR 'AVANT' OR 'APRE2S'
        THEN $WHEN-SEL.
   $WHERE-SEL =
        IF $GET-HOST
        THEN IF $LOC-SELECT
        THEN $ASSIGN-COMP-AND-SEL
        ELSE $NEW-HOST-LOC.
   $GET-HOST =
        HOST X1 EXISTS;
        BOTH X1 IS NOT OCCURRING IN VERBAL[DO NOT DO SELECT]
        AND CORE-ATT X1-LIST OF X1 EXISTS.
   $LOC-SELECT =
        ALL OF $LOC-SEL, $PRINT-SEL-MESSGE [IN TSEL-GLOBAL],
   $PRINT-RESULT [GLOBAL IN TSEL GLOBAL].
   $LOC-SEL =
        DO $SEL-REG;
        X-NAME-LIST:= LIST NAME-WHERE;
        X-NEWLIST:= X1-LIST;
        X-LOC:= LIST WHERE-LIST;
        INTERSECT X1-SEL OF X-LOC[WITH X1-LIST] EXISTS;
        X-N:= X1;
        IF X1-SEL IS NOT NIL THEN XN-SEL:= X1-SEL.
   $SEL-REG =
        X1-SEL:= NIL;
        X2-SEL:= NIL;
        XW1:=X1; XW2:=X2 [* Registers for SEL printout *];
        X2-LIST:= X2.
   $NEW-HOST-LOC =
        IF $GET-NEW-HOST
        THEN IF EITHER X1 IS OCCURRING IN VERBAL
        OR CORE-ATT X1-LIST OF X1 IS NIL
        THEN BOTH $PRINT-MESSGE AND $ASSIGN-NEW
        ELSE IF $LOC-SELECT
        THEN $ASSIGN-NEW
        ELSE $NEW-HOST-LOC.
   $GET-NEW-HOST =
        X-HOST:= X1;
        DO NEW-HOST [FIND NEW HOST];
        DO $PRINT-NEW-HOST [GLOBAL IN TSEL-GLOBAL];
        X1:= X-HOST.
   $WHEN-SEL =
        IF $GET-HOST
        THEN IF $TIME-SELECT
        THEN $ASSIGN-COMP-AND-SEL
        ELSE $NEW-HOST-TIME.
   $TIME-SELECT =
        ALL OF $TIME-SEL, $PRINT-SEL-MESSGE, $PRINT-RESULT.
   $TIME-SEL =
        DO $SEL-REG;
        X-NAME-LIST:= LIST NAME-TIME-ADVERBIAL;
        X-NEWLIST:=X1-LIST;
        X-TYPE-LIST:= LIST ADVERBIAL-TYPE-LIST;
        X-TYPE-LIST HAS MEMBER TIME-ADVERBIAL WHERE ATTRIBUTE-LIST
        X-TIME EXISTS;
        INTERSECT X1-SEL OF X-TIME EXISTS;
        X-N:= X1;
        IF X1-SEL IS NOT NIL THEN XN-SEL:= X1-SEL.
   $NEW-HOST-TIME =
        IF $GET-NEW-HOST
        THEN IF EITHER X1 IS OCCURRING IN VERBAL
        OR CORE-ATT X1-LIST OF X1 IS NIL
        THEN BOTH $PRINT-MESSGE[AUTOMATIC SUCCESS]
        AND $ASSIGN-NEW[GLOBAL IN ]
        ELSE IF $TIME-SELECT
        THEN $ASSIGN-NEW
        ELSE $NEW-HOST-TIME.
— TSEL-BESHOW-BE
—       WHEN BESHOW HAS ELEMENT VINGO OR VENPASS
—       IT SHOULD BE ASSIGNED SELECT-ATT WITH VALUE VBE.

TSEL-BESHOW-BE = IN BESHOW:
        BOTH $WRITE-SEL-ID AND
        IF PRESENT-ELEMENT- HAS ELEMENT- VINGO OR VENPASS
        THEN BOTH X1-SEL:= LIST VBE-LIST
        AND ASSIGN NODE ATTRIBUTE SELECT-ATT WITH VALUE X1-SEL.
   $WRITE-SEL-ID =
        BOTH BOTH WRITE ON INFO '*** Starting TSEL-BESHOW-BE:'
        AND WRITE ON INFO END OF LINE
        AND AT PRESENT-ELEMENT- WRITE ON INFO WORDS SUBSUMED;
        WRITE ON INFO END OF LINE.
— T-FIXUP-ATOMS
—       1. ASSIGNS NODE ATTRIBUTE SELECT-ATT FOR A GROUP OF WORD
—       NOT BELONGING TO ANY SUBLANGUAGE ATTRIBUTES (IN ADD-BACK-LIST)
—       BUT IMPORTANT FOR LATER FORMATTING.
—       2. A HOMOGRAPH IS A NODE WHICH HAS MORE THAN 1 SIGNIFICANT SUBLAN-
—       GUAGE ATTRIBUTES (HAVING MORE THAN 1 MEMBER OF LIST SIG-CLASS).
—       A NODE IS START-HGRAPH IF IT IS LEXICALLY A HOMOGRAPH. A NODE IS
—       STAY-HGRAPH IF IT IS STRUCTURALLY A HOMOGRAPH.
—       A. DETERMINE IF A NODE IS LEXICALLY A HOMOGRAPH:
—       ASSIGN START-HGRAPH TO ANY NODES WHICH HAS AN ATTRIBUTE LIST
—       INTERSECTABLE WITH SIG-CLASS (AND REMOVING H-PTAREA IF IT IS
—       ALREADY A H-PTPART) AND RESULTING IN A LIST OF MORE THAN ONE
—       ELEMENT.
—       B. DETERMINE IF A NODE IS STRUCTURALLY A HOMOGRAPH:
—       ASSIGN STAY-HGRAPH TO ANY NODE WHICH HAS AN ATTRIBUTE LIST
—       OF SUBLANGUAGE ATTRIBUTES, INTERSECTABLE WITH SIG-CLASS ETC.
—       AND RESULTING IN A LIST OF MORE THAN ONE ELEMENT.
—       C. IF A NODE HAS N.A. SELECT-ATT WHOSE ELEMENTS ARE NOT
—       SUBLANGUAGE ATTRIBUTES, THEN RENAME THE N.A. TO ASSIGN-ATT.
T-FIXUP-ATOMS = IN SENTENCE:
        ITERATE BOTH $PROCESS-NODE AND $GO-TO-NEXT-NODE.
   $PROCESS-NODE =
        IF ALL OF $TYPE-ATOM, $NOT-FAIL-SEL, $NOT-ADJUNCT-ATT,
   $NO-SELECT-ATT [* NTN 6/27/89 *]
        THEN ALL OF $ADD-BACK-CHK, $ISIT-HGRAPH.
   $TYPE-ATOM = PRESENT-ELEMENT- X-PRE IS OF TYPE ATOM.
   $NOT-FAIL-SEL = PRESENT-ELEMENT- DOES NOT HAVE NODE ATTRIBUTE FAIL-SEL.
   $NOT-ADJUNCT-ATT = NOT $ADJUNCT-ATT.
   $ADJUNCT-ATT =
        PRESENT-ELEMENT- HAS NODE ATTRIBUTE ADVERBIAL-TYPE
        WHERE PRESENT-ELEMENT- HAS MEMBER ADJUNCT-TYPE.
   $NO-SELECT-ATT =
        PRESENT-ELEMENT- DOES NOT HAVE NODE ATTRIBUTE SELECT-ATT.
   $ADD-BACK-CHK =
        IF ATTRIBUTE-LIST X-ATT OF X-PRE HAS MEMBER ADD-BACK-LIST
        THEN $ADD-BACK.
   $ADD-BACK = [* NTN 6/27/89 takes SELECT-ATT out of ADD-BACK *]
        [EITHER X-PRE HAS NODE ATTRIBUTE SELECT-ATT X1-ATT]
        [WHERE X-RE:= NIL] [ONLY REASSIGN IF X-DIDADD IS NOT NIL]
        [OR] EITHER CORE-SELATT X1-ATT OF X-PRE EXISTS
        WHERE X-RE:= X1-ATT [UNCONDITIONAL REASSIGN SIGNAL]
        OR X1-ATT := NIL WHERE X-RE:= X-PRE ;[UNCOND REASSIGN]
        X-NEWLIST:= LIST ADD-BACK-LIST;
        IF INTERSECT X-ADD OF X-ATT IS NOT NIL
        THEN $ADD-ON.
   $ADD-ON =
        X-DIDADD:= NIL;
        ITERATE $ADD-IT UNTIL SUCCESSORS X-ADD OF X-ADD IS NIL SUCCEEDS;
        IF EITHER X-DIDADD IS NOT NIL OR X-RE IS NOT NIL
        THEN AT X-PRE ASSIGN NODE ATTRIBUTE SELECT-ATT WITH VALUE X1-ATT.
   $ADD-IT =
        X-HEAD:= HEAD OF X-ADD;
        IF X1-ATT DOES NOT HAVE MEMBER X-HEAD
        THEN BOTH PREFIX X-HEAD TO X1-ATT
        AND X-DIDADD:= X1-ATT [SET TO NON NIL].
   $ISIT-HGRAPH =
        BOTH $START-H AND $ATT-CHK [DID IT STAY HOMOGRAPH].
   $START-H =
        IF ATTRIBUTE-LIST X-MED OF X-PRE EXISTS
        THEN IF $IS-HGRAPH
        THEN $ASSIGN-START-H.
   $ASSIGN-START-H =
        AT X-PRE ASSIGN NODE ATTRIBUTE START-HGRAPH.
   $IS-HGRAPH =
        X-NEWLIST:= LIST SIG-CLASS;
        BOTH INTERSECT X-MED OF X-MED IS NOT NIL
        AND $SUCCESSOR-CHK.
   $SUCCESSOR-CHK =
        SUCCESSORS OF X-MED IS NOT NIL;
        DO $BP-AREA-CHK.
   $BP-AREA-CHK =
        IF BOTH X-MED HAS MEMBER H-PTPART
        AND X-MED HAS MEMBER H-PTAREA
        THEN BOTH $REMOVE-AREA AND $SUCCESSOR-CHK.
   $REMOVE-AREA =
        X-SUBLIST:= LIST AREA-LIST;
        X-MED:= COMPLEMENT OF X-MED.
   $ATT-CHK =
        IF $IS-MEDATT THEN $HGRAPH-CHK
        ELSE $ASSIGN-ATT-CHK.
   $IS-MEDATT =
        [* INTERSECTION OF ATTRIBUTE-LIST WITH LIST OF MED SUBCLASSES *]
        CORE-SELATT X-MED IS NOT NIL.
   $HGRAPH-CHK =
        [* WORD HAVING MORE THAN 1 SIG. SUBCLASS IS ASSIGNED NODE ATTRIBUTE]
        [* STAY-HGRAPH - SIGNALING POTENTIAL PROBLEM TO LATER COMPONENT]
        IF SUCCESSORS OF X-MED IS NOT NIL
        THEN IF $IS-HGRAPH
        THEN $ASSIGN-HGRAPH.
   $ASSIGN-HGRAPH =
        AT X-PRE ASSIGN NODE ATTRIBUTE STAY-HGRAPH.
   $ASSIGN-ATT-CHK =
        [* WORD HAS NO MED SUBCLASSES - BUT HAS A SELECT-ATT: *]
        [* CHANGE IT TO AN ASSIGN-ATT WITH SAME VALUE. *]
        IF X-PRE HAS NODE ATTRIBUTE SELECT-ATT X-TEMP
        THEN AT X-PRE BOTH ASSIGN NODE ATTRIBUTE ASSIGN-ATT WITH VALUE X-TEMP
        AND ERASE NODE ATTRIBUTE SELECT-ATT.
   $GO-TO-NEXT-NODE =
        EITHER $GO-DOWN OR ITERATET GO UP UNTIL GO RIGHT SUCCEEDS.
   $GO-DOWN =
        PRESENT-ELEMENT- IS NOT EMPTY;
        BOTH $NOT-FAIL-SEL AND BOTH $NOT-ADJUNCT-ATT AND GO DOWN.
— END-SELECTIONS