Lab 9 Write-up
Sanae Sato and Adam Ledyard
Miyako

1. Grammar clean up:

	Noun coordination
	
	Noun coordination was not working before so we needed to add some 
	rules to incorporate the =tu clitic:
	
		maju=tu in=tu kuruma=u tsikiir
		maju=tu in=tu kuruma=u tsikii-r
		cat=ASC dog=ASC car=ACC chase-NPST
		Cats and dogs chase cars.
		
	Each noun is marked with a coordinating clitic.  The first one
	carries the "_and_rel" and the second is semantically empty.
	The current matrix coordination rules produce a HEAD noun but all
	our verbs look for HEAD adp agruments so a unary rule needed to be
	created.  The boolean feature HEAD.ASC was added that signified that
	the constiuent was a coordinated noun.  The unary rule looked for a 
	COORD -, ASC + constiuent and produced a ASC -, HEAD adp constiuent:
	
		unary-coord-phrase := same-ynq-unary-phrase & non-converb-phrase &
		  [ SYNSEM.LOCAL [ COORD -,
				   CAT [ VAL [ SPR < >,
						   COMPS < >,
						   SUBJ < >],
					 HEAD adp &
						 [ CASE case,
						   ASC -,
						   MOD < >]]],
			ARGS < [ SYNSEM.LOCAL [ COORD -,
						CAT.HEAD.ASC +,
						CONT.HOOK #hook ] ] >,
			C-CONT [ HOOK #hook,
				 RELS <! !>,
				 HCONS <! !>,
				 ICONS <! !> ]].
				 
	The ASC value prevents this rule from spinning and the empty
	VAL and MOD lists also helped with the spinning. We left the phrase
	unspecified for case since it could be NOM or ACC depending on the 
	setence.
	
	Adjective MRS
		
		The adjective MRSs were incomplete and didn't have enough ARG
		values to match up with the rephrasing from English so the ARG1
		was introduced and attached to the XARG in the adj-lex:
		
		adjective-lex := basic-adjective-lex & basic-one-arg & norm-ltop-lex-item & no-hcons-lex-item & 
		   [ SYNSEM.LOCAL [ CAT [ HEAD.MOD < >,
								VAL [ SPR < >,
									  SUBJ < >,
									  COMPS < >,
									  SPEC < > ]],
					CONT [ HOOK.XARG #arg1,
					   RELS.LIST.FIRST.ARG1 #arg1 ] ] ].
			
	Adverbs
	
		The adverbs were not attaching to regular verbs so a new rule
		had to be created.  The matrix provided head-adj-int rule was
		not firing and this was due to the fact that the clitic '=du'
		attaches to the adverb first before attaching to the verb:
		
		head-final-adj-phrase := basic-head-mod-phrase-simple & head-final & phrasal &
		  [ SYNSEM [ LOCAL.CAT.POSTHEAD +,
				 MODIFIED rmod ],
			NON-HEAD-DTR.SYNSEM [ LOCAL.CAT [ POSTHEAD +,
							  HEAD adv ],
					  NON-LOCAL.QUE 0-dlist ] ].

		It's the same but instead of inheriting from head-initial,
		it inherits from head-final so sentences like below could
		be parsed:
		
				in=nu pjaaf=du faa0
				in=nu pjaaf=du fa-r 	
				dog=NOM quickly=FOC eat-NPST
				Dogs eat quickly.
				
				
	Locative copula
	
	We have created separate copula verb lex rule in order to dintinguis dative case marker in machine translation scenario. So we added following codes:

	lexicon.tdl
	---
	jar_3 := dat-copula-verb-lex &
	  [ STEM < "jar" >,
	    SYNSEM.LKEYS.KEYREL.PRED "_loc_v_rel" ].
	---

	miyako.tdl
	---	
	dat-transitive-copula-verb-lex := main-verb-lex & transitive-lex-item &
	  [ SYNSEM.LOCAL.CAT.VAL.COMPS < #comps >,
	    ARG-ST < [ LOCAL.CAT.HEAD adp ],
	             #comps &
	             [ LOCAL.CAT [ VAL [ SPR < >,
	                                 COMPS < > ],
	                           HEAD +njrp ] ] > ].
            :
            :

	dat-trans-copula-verb-lex := dat-transitive-copula-verb-lex & PRE-or-converb-rule-dtr & MOOD-rule-dtr & TENSE-rule-dtr & negation-rule-dtr &
	  [ INFLECTED.TENSE-FLAG -,	
	SYNSEM.LOCAL.CAT.VAL.COMPS.FIRST.OPT-CS type-id ].

            :
            :

	dat-copula-verb-lex := dat-trans-copula-verb-lex &
	  [ SYNSEM.LOCAL.CAT.HEAD.VCLASS - ].

	---	



	Case restrictions
	
	The copula was overgenerating in that the case value of it's arguments
	was underspecified so the case restriction was added to predicate
	rules:
	
		np-bar-predicate-rule := same-ynq-unary-phrase & non-converb-phrase &
		 [ SYNSEM.LOCAL.CAT [ HEAD verb & [ MOD < >],
					  VAL [ SPR < >,
							SPEC < >,
						COMPS < >,
						SUBJ < [ LOCAL [ CONT.HOOK.INDEX #arg1,
								 CAT [ HEAD adp &
									[ CASE nom ],
									   VAL.SPR < > ] ] ] > ] ],
	
		...
		
	
Transfer Rules Written:

	In order to incorporate with _in_p_rel into _loc_v_rel, we added following transfer rule in acm.tdl in English grammar. However, the rule was not working well with unspecified PRED value (such as ~_n_), we needs to work on this a little more to generalize the rule. The following rule does generate translated output, however, it is hard-coded for dog_n_rel and park_n_rel:

	---
	; Transfer  _in_p_rel  to _loc_v_rel
	
	prop2loc-mtr := monotonic_omtr &
	 [ INPUT [ RELS <![ PRED "exist_q_rel",;exit-dog
			   ARG0  #x4,
			   RSTR #harg5 ],
	                  [ PRED "_dog_n_rel",;#pred1 & "~_n_",; dog
			   LBL #h7,
	                   ARG0 #x4 ],
	                  [ PRED "_in_p_rel",
			     ARG0 e & #e,
			     ARG1  #x4,
			     ARG2  #x9 ],
			 [ PRED "exist_q_rel",;exit-park
			   ARG0 #x9,
			   RSTR #harg2 ],
	                  [ PRED "_park_n_rel",;#pred2 & "~_n_",; park
			   LBL #h13,
	                   ARG0 #x9 ] !>,
		   HCONS <! qeq & [LARG #h7,; _dog_n_rel's LBL
				   HARG #harg5 ],
			    qeq & [LARG #h13,  ; _park_n_rel's LBL
				    HARG #harg2 ] !> ],
	  OUTPUT	 [ RELS <! [ PRED "_dog_n_rel",;#pred1,;dog
			   LBL #h7,
	                   ARG0 #x4 ], 
			 [ PRED "exist_q_rel",
			   ARG0 #x4,
			   RSTR #harg5 ],
			  [ PRED "_park_n_rel",;#pred2,
			   LBL #h13,
	                   ARG0 #x9 ], 
	                 [ PRED "exist_q_rel",
			    ARG0 #x9,
			    RSTR #harg2 ],
	                 [ PRED "_loc_v_rel",
			    ARG0 #e,
			    ARG1 #x4,
			    ARG2 #x9 ]!>,    
		   HCONS <! qeq & [ LARG #h7,; _dog_n_rel's LBL
				    HARG #harg5 ],
			    qeq & [ LARG #h13,  ; _park_n_rel's LBL
				    HARG #harg2 ] !> ]].
	---

	
Transfer Rules still needed:

	One rule that we ran out of time that needed to be written was
	the transfer of the _hurt_v_rel to Miyako's _hurt_a_rel since 
	it is an adverb:
	
		#Example 87
		Source: author
		Vetted: f
		Judgment: g
		Phenomena: neg
		ba=ga agaf=du njaan0
		ba=ga agaf=du njaan-r
		1SG=TOP hurt.ADV=FOC  NEG-NPST
		I am not (in a) hurt (state). 
		

Tranlations from English to Miyako:

	If it was able to rephrase, we got single generation which is great
	except for the adverbial sentence:
	
		#Example 102
		Source: author
		Vetted: f
		Judgment: g
		Phenomena: wo
		in=nu pjaaf=du faa0
		in=nu pjaaf=du fa-r 	
		dog=NOM quickly=FOC eat-NPST
		Dogs eat quickly.
		
	THe adverb was getting generated in every position so something is
	not getting constrained properly. THe 'du' clitic is completely 
	missing as well.  This means the other sentence that required the 
	'du' clitic are not tranlating as well:
	
		#Example 103
		Source: author
		Vetted: f
		Judgment: g
		Phenomena: wo
		in=nu jaasimunuf=du jar0
		in=nu jaasimunuf=du jar-r
		dog=NOM hungry=FOC COP-NPST
		The dogs are hungry.
		
	We got a total of 12 sentences tranlated from English not including
	the messed up adverbial one.
	
	English parses:
	
	Dogs sleep.								yes
	Dogs chase cars.						yes
	I chase you.							yes
	These dogs sleep.						yes
	Dogs eat.								yes
	I can eat glass.						yes
	It doesnt hurt me.						no		-> 	adverbials are not transfering
	The dogs chase cars.					yes
	I think that you know that dogs chase cars.	no 	-> multiple embedded clause are not generating
	I ask whether you know that dogs chase cars.no 	-> 	"		"		"		"	"		"
	Cats and dogs chase cars.				yes
	Dogs chase cars and cats chase dogs.	no		-> Sentential coordination is not working	
	Cats chase dogs and sleep.				no		-> 	  "			"			"	"	"
	Do cats chase dogs?						yes
	Hungry dogs eat.						yes
	Dogs eat quickly.						no		->	adverbials are not transfering well
	The dogs are hungry.					no		-> 		"		"	"		"		"
	The dogs are in the park.				yes
	The dogs are the cats.					yes
	
	Italian parses:
	
	Cani dorm-ono										yes
	Cani insegu-ono macchine							yes
	Ti-insegu-o											no
	Questi cani dorm-ono								yes
	Cani mangi-ano										yes
	Posso mangi-are il vetro							no
	Non mi-f-a male										no
	I cani insegu-ono macchine							yes
	Pens-o che sai che cani insegu-ono macchine			no
	Domand-o se sai che cani insegu-ono macchine		no
	Cani e gatti insegu-ono macchine					yes
	Cani insegu-ono macchine e gatti insegu-ono cani 	no
	Gatti insegu-ono cani e dorm-ono					no
	Gatti insegu-ono cani								yes
	Cani affamat-i mangi-ano							yes
	Cani mangi-ano velocemente							no


Overall Coverage:
	Comparing with previous grammar (Lab8 grammar as gold standard), we got +14.0% increase in coverage and +0.12% in overgeneration out of 102 sentences. Although it is not the best figure/coverage throughout this quarter, we are satisfied with the final overage and overgeneration. :

			Coverage 	Overgeneration
	Lab8 Grammar :  60.6		1.13
	Lab9 Grammar :  74.6   		1.25


