;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; ;;; ;;; SYNTACTIC THEORY by Sag and Wasow -- Textbook Grammar ;;; implementation by Chris Callison-Burch & Scott Guffey ;;; ;;; types.tdl ;;; ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; feat-struc :< *top*. synsem-struc := feat-struc & [ ORTH *diff-list*, SYN gram-cat, SEM sem-struc ]. agr-cat := feat-struc & [ PER per, NUM num, GEND gend ]. gram-cat := feat-struc & [ HEAD pos, SPR list-of-synsem-structs, COMPS list-of-synsem-structs, GAP *diff-list* & [ LIST list-of-synsem-structs ] ]. pos := feat-struc & [ FORM form-cat, PRED boolean, ANA boolean ]. sem-struc := feat-struc & [ MODE mode-cat, INDEX index, RESTR list-of-predications ]. predication := feat-struc & [ RELN reln, SIT sit-index ]. list-of-indexes :< *list*. index := feat-struc & [ INSTLOC string ]. real-index :< index. ref-index :< real-index. sit-index :< real-index. null-index :< index. ;;; <<<---- PARTS OF SPEECH ---->>> norv :< pos. ;; See Changes File #5 ;aux-value := feat-struc & ; [ AUX boolean ]. verb := norv & verbal-feat. ;; This intermediate type was added to allow the complimentizer ;; "to" contain the appropriate features for the ellipsis rule. verbal-feat := feat-struc & [ AUX boolean, INV boolean, NEG boolean ]. ;; Added "topic" to the heirarchy to restrict what can be topicalized ;; though the GAP and head-filler rules. CCB topic :< pos. nominal-cat := topic & [ AGR agr-cat ]. noun := nominal-cat & norv & [ CASE case-cat ]. det := nominal-cat & [ COUNT boolean ]. comp := pos & verbal-feat. conj := pos. mod-type := *value* & [ MOD list-of-synsem-structs ]. adv := topic & mod-type. adj := pos & mod-type. prep := mod-type & nominal-cat & [ P-OBJ list-of-synsem-structs ]. ;; CCB - Agreement is really only marked on Nouns and Dets. I added onto ;; preps because our current bining theory implementation relys on PPs ;; having AGR. ;;; <<<----- TYPES INHERITING FROM FORM-CAT ----->>> *value* :< *top*. form-cat :< *value*. ;Nouns normal :< form-cat. ;Verbs inf :< form-cat. fin :< form-cat. prp :< form-cat. psp :< form-cat. imp :< form-cat. pass :< form-cat. ;Prepositions f_to :< form-cat. f_about:< form-cat. f_around:< form-cat. f_on :< form-cat. f_in :< form-cat. f_with :< form-cat. f_of :< form-cat. f_for :< form-cat. f_by :< form-cat. ;Adverbs f_not :< form-cat. ;Conjuctions f_and :< form-cat. f_but :< form-cat. ;Idioms f_advantage :< form-cat. f_tabs :< form-cat. ;Dummies f_there :< form-cat. f_it :< form-cat. ;;; <<<----- STRUCTURE FOR AGR-CAT ----->>> 3sing := agr-cat & [ PER 3rd, NUM sing ]. non-3sing :< agr-cat. 2orplural := non-3sing. ;; See Changes File #6 1sing := non-3sing & [ PER 1st, NUM sing ]. per :< *value*. 1or3 :< per. 1st := 1or3. 3rd :< 1or3. 2nd :< per. num :< *value*. sing :< num. plur :< num. singandplur :< num. gend :< *value*. fem :< gend. masc :< gend. neut :< gend. case-cat :< *value*. nom :< case-cat. acc :< case-cat. ;;; <<>> ----- CONST-LXM DEFINITIONS ----- ;; Right now we have MOD implemented as a list to cover the case where ;; the thing that can be modified is "none", which we mark as the empty list. CCB ;; Should the semantics for the entries below be put in the semantics file? prep-lxm := const-lxm & [ SYN [ HEAD prep ] ]. ;; The nom/acc values on the ARG-ST were recently deleted. Better? ;; The semantics are left empty in the book, do we need any? pdp-lxm := prep-lxm & [ SYN [ HEAD [ MOD < [SYN [HEAD norv] ] >, ANA false ], SPR < [ ] > ], SEM [ RESTR ], ARG-ST < [ SYN NP ], [ SYN NP ] > ]. ;; If the ARG-ST isn't limited to things of type NP then that info ;; must be placed on the the ARG-ST of verbs using P-OBJ. ;; The semantics are left empty in the book, do we need any? #| mkp-lxm := prep-lxm & [ SYN [ HEAD [ MOD < >, P-OBJ < #1 > ], SPR < > ], SEM [ RESTR ], ARG-ST < #1 & [ SYN NP ] > ]. ; ARG-ST < #1 & [SEM [INDEX #2] ] > ]. ; SEM [ MODE ref, ; INDEX #2 & ref-index ] ]. |# mkp-lxm := prep-lxm & [ SYN [ HEAD [ MOD < >, P-OBJ < #1 > ], SPR < > ], SEM [ INDEX #2 & ref-index, RESTR ], ARG-ST < #1 & [ SYN NP, SEM [INDEX #2] ] > ]. adv-lxm := const-lxm & modifier-sem & [ SYN [ HEAD adv & [ FORM /l normal, MOD /l < [ SYN [ HEAD verb, COMPS < > ] ] > ] ], ARG-ST < > ]. ;; The NP in the ARG-ST was added to parse "I am happy" ;; It's really not clear what should be put on the ARG-ST. adj-lxm := const-lxm & modifier-sem & [ SYN [ HEAD adj & [ FORM normal, MOD /l < [ SYN [ HEAD noun, COMPS < > ] ] > ] ], ARG-ST /l < [ SYN NP, SEM [INDEX ref-index] ] > ]. ;; This entry has been left underspecified for index because the noun-coord. ;; requires a ref-index, but the verb-coord. requires a sit-index. conj-lxm := const-lxm & [ SYN [ HEAD conj ], SEM [ RESTR ], ARG-ST < > ]. det-lxm := const-lxm & [ SYN [ HEAD det ], SEM null-sem, ARG-ST /l < > ]. comp1-lxm := const-lxm & [ SYN [ HEAD comp & [ FORM #form, AUX true ], SPR < #spr > ], SEM [ MODE prop, INDEX sit-index & #1, RESTR ], ARG-ST < #spr , [ SYN [ HEAD verb & [ FORM #form ], COMPS < > ], SEM [ MODE prop, INDEX sit-index & #2 ] ] > ]. comp2-lxm := const-lxm & [ SYN [ HEAD comp & [ FORM #form ], SPR < > ], SEM [ MODE prop, INDEX sit-index & #1, RESTR ], ARG-ST < [ SYN [ HEAD verb & [ FORM #form ], COMPS < > ], SEM [ MODE prop, INDEX sit-index & #2 ] ] > ]. ;;; <<>> ----- NOUN-LXM DEFINITIONS ----- noun-lxm := infl-lxm & noun-sem & [ SYN [ HEAD noun & [FORM /l normal, AGR [ PER /l 3rd ], ANA /l false] ], ARG-ST /l < > ]. pron-lxm := const-lxm & noun-sem & [ SYN [ HEAD noun & [FORM /l normal, ANA /l false] ], ARG-ST < > ]. cn-lxm := noun-lxm & [ SYN [ HEAD [ AGR #agr & [ GEND /l neut ] ], SPR < [ ] > ], ARG-ST < [ SYN [ HEAD det & [AGR #agr, COUNT /l true] ] ] > ]. cn-pp-lxm := noun-lxm & [ SYN [ HEAD [ AGR #agr & [ GEND /l neut ] ], SPR < [ ] > ], ARG-ST < [ SYN [ HEAD det & [AGR #agr, COUNT /l true] ] ], [ SYN [ HEAD prep, COMPS < > ] ] > ]. pn-lxm := noun-lxm & pn-sem & [ SYN [ HEAD [ AGR 3sing ] ], ARG-ST < > ]. dummy-idiom-lxm := const-lxm & [ SYN [ HEAD noun & [ ANA false ] ], SEM null-sem, ARG-ST < > ]. ;;; <<>> ----- ABBREVIATED LEXEME TYPES ----- ;; Attempting to abrieviate the notation -- CCB ;; Should I abbreviate it more by making a type for SPR < >, COMPS < >? SMG NP := gram-cat & [ HEAD noun, SPR < >, COMPS < > ]. NP-acc := NP & [ HEAD noun & [CASE acc] ]. NP-nom := NP & [ HEAD [CASE nom] ]. N := gram-cat & [ HEAD noun, SPR < [ ] > ]. VP := gram-cat & [ HEAD verb, SPR < [ ] > ]. V := gram-cat & [ HEAD verb ]. S := gram-cat & [ HEAD verb, SPR < >, COMPS < > ]. PP := gram-cat & [ HEAD prep, SPR < >, COMPS < > ]. CP-fin := gram-cat & [ HEAD comp & [FORM fin], SPR < >, COMPS < > ]. CP-inf := gram-cat & [ HEAD comp & [FORM inf], COMPS < > ]. ;;; <<>> ----- VERB LEXEME TYPES ----- ;; There really shouldn't be an ANA value in verbs to begin with, this should ;; be corrected by either sticking it in the type hierarchy for np's/pp's only ;; or switching back to ANA/P-OBJ analysis. verb-lxm := infl-lxm & verb-sem & [ SYN [ HEAD verb & [ INV false, NEG false, AUX /l false, ANA false], SPR < [ ] > ], ARG-ST < [ SYN /l NP ], ... > ]. iv-lxm := verb-lxm & iv-sem & [ ARG-ST < [ ] > ]. piv-lxm := verb-lxm & piv-sem & [ ARG-ST < [ ], [ SYN PP ] > ]. fiv-lxm := verb-lxm & fiv-sem & [ ARG-ST < [ ], [ SYN [ HEAD [ FORM fin ], COMPS < > ] ] > ]. ;; See Changes File #7 ;; Tecnically, acc should be specified elsewhere. tv-lxm := verb-lxm & [ ARG-ST < [ ], [SYN /l NP-acc ], ... > ]. stv-lxm := tv-lxm & stv-sem & [ ARG-ST < [ ], [ ] > ]. ;; Tecnically, acc should be specified elsewhere. dtv-lxm := tv-lxm & dtv-sem & [ ARG-ST < [ ], [ ], [ SYN NP-acc ] > ]. ;; The P-OBJ must be used here to limit compliments to type NP, ;; at least unless this information is put directly on the mkp-lxm. ptv-lxm := tv-lxm & ptv-sem & [ ARG-ST < [ ], [ ], [ SYN PP & [HEAD [P-OBJ <[SYN NP]> ] ] ] > ]. ;; "continue" is an example... srv-lxm := verb-lxm & srv-sem & [ ARG-ST < #1 , [SYN [ SPR < #1 > ] ] > ]. auxv-lxm := srv-lxm & [ SYN [ HEAD verb & [ AUX true ] ] ]. ;; "appear" is an example... srv-to-lxm := verb-lxm & srv-to-sem & [ ARG-ST < #1 , [SYN [HEAD prep & [FORM f_to] ] ], [SYN [ SPR < #1 > ] ] > ]. ;; "try" is an example... scv-lxm := verb-lxm & scv-sem & [ ARG-ST < [ SEM [INDEX #1 ] ], [SYN [SPR < [SEM [INDEX #1 ] ] > ] ] > ]. ;; See Changes File #8 ;; "expect is an example... orv-lxm := tv-lxm & orv-sem & [ ARG-ST < [ ], #1, [SYN [ SPR < #1 > ] ] > ]. ;; "persuade" is an example... ocv-lxm := tv-lxm & ocv-sem & [ ARG-ST < [ ], [SEM [INDEX #1] ], [SYN CP-inf & [SPR < [SEM [INDEX #1] ] > ] ] > ]. modal-lxm := auxv-lxm & [ SYN [ HEAD verb & [ FORM fin] ], ARG-ST < [ ], [ SYN [ HEAD verb & [FORM inf] ] ] > ]. ;;; <<<---- TYPES INHERITING FROM SYNSEM-STRUC/LEXICAL RULE DEFINITIONS ---->>> args-type := *top* & [ ARGS *list* ]. phrase := synsem-struc & args-type. rule := synsem-struc & args-type & [ ARGS *list* ], status: root-node. ;; This is a slightly artificial type introduced for mechanical ;; purposes of preventing recursion in the mod_affix definition. argst-item := synsem-struc & args-type & [ ARG-ST *list* ]. lex-item := argst-item & [ AFFIX mod_affix ]. word :< lex-item. ;; SEM [ MODE /l null-mode ] Do we need to put this in? ;; When I do an error message says it gets ignored anyway. ;; Why does SYN appear in this entry? Should it? SMG lexeme := lex-item & [ ORTH #orth, SYN [ GAP ], ARGS < [ ORTH #orth ] > ]. infl-lxm := lexeme & [ SYN [HEAD #head ], ARG-ST #argst, ARGS < [ AFFIX affix & [ SYN [ HEAD #head], ARG-ST #argst ] ] > ]. const-lxm := lexeme & [ ARGS < [ AFFIX no-affix ] >]. ;; This was changed from gram-cat to arg-st item so as too allow affixes ;; to make reference to ARG-ST instead of SPR, just as in the book. SMG mod_affix := argst-item. affix := mod_affix. no-affix :< mod_affix. ;;; <<>> ----- MOST BASIC DEFINITIONS FOR TYPE HIERARCHY ----- boolean :< *value*. true :< boolean. false :< boolean. *list* :< *top*. ne-list := *cons* & [ FIRST *top*, REST *list* ]. list-of-synsem-structs :< *list*. *null* :< list-of-synsem-structs. ne-list-of-synsem-structs := list-of-synsem-structs & ne-list & [ FIRST synsem-struc, REST list-of-synsem-structs ]. label := synsem-struc & [ LABEL-NAME symbol ], status: label. phrase-label := label & phrase. word-label := label & word. meta := synsem-struc & [ META-PREFIX symbol, META-SUFFIX symbol ], status: meta.