;;; -*- Mode: tdl; Coding: utf-8; -*- ;; DPF 2013-10-28 ;; Rules for inflating minimal MRSs into full MRSs for input to generator. ;; Initially developed to generate from FOL expressions, which are converted ;; to MRS format via Aaron Kalb's script in erg/openproof/scripts. ;; Aaron's script, for example, converts "smaller(b,a)" to the following ;; [ LTOP: h1 ;; INDEX: e3 ;; RELS: < [ named_rel LBL: h8 ARG0: x6 CARG: "B" ] ;; [ named_rel LBL: h9 ARG0: x7 CARG: "A" ] ;; [ "smaller" LBL: h2 ARG0: e3 ARG1: x6 ARG2: x7 ] > ] ;; Then these rules apply to produce a full MRS acceptable to the generator. ;; Conjunctions ;; Embedding conj_rel embedded_and_and_left_op_mtr := embedded_conj_left_op_mtr & [ CONTEXT.RELS ]. embedded_and_or_left_op_mtr := embedded_conj_left_op_mtr & [ CONTEXT.RELS ]. embedded_or_and_left_op_mtr := embedded_conj_left_op_mtr & [ CONTEXT.RELS ]. embedded_or_or_left_op_mtr := embedded_conj_left_op_mtr & [ CONTEXT.RELS ]. embedded_and_and_right_op_mtr := embedded_conj_right_op_mtr & [ CONTEXT.RELS ]. embedded_and_or_right_op_mtr := embedded_conj_right_op_mtr & [ CONTEXT.RELS ]. embedded_or_and_right_op_mtr := embedded_conj_right_op_mtr & [ CONTEXT.RELS ]. embedded_or_or_right_op_mtr := embedded_conj_right_op_mtr & [ CONTEXT.RELS ]. embed_negconj_left_op_mtr := embedded_negconj_left_op_mtr. embed_negconj_right_op_mtr := embedded_negconj_right_op_mtr. #| 19-06-15 - Removed event constraints on embedded_mark ARG0s: redundant and_conj_both_op_mtr := conj_op_mtr & [ INPUT.RELS , OUTPUT.RELS ]. and_conj_right_op_mtr := conj_op_mtr & [ INPUT.RELS , OUTPUT.RELS ]. and_conj_left_op_mtr := conj_op_mtr & [ INPUT.RELS , OUTPUT.RELS ]. or_conj_both_op_mtr := conj_op_mtr & [ INPUT.RELS , OUTPUT.RELS ]. or_conj_right_op_mtr := conj_op_mtr & [ INPUT.RELS , OUTPUT.RELS ]. or_conj_left_op_mtr := conj_op_mtr & [ INPUT.RELS , OUTPUT.RELS ]. |# and_conj_both_op_mtr := conj_op_mtr & [ INPUT.RELS , OUTPUT.RELS ]. and_conj_right_op_mtr := conj_op_mtr & [ INPUT.RELS , OUTPUT.RELS ]. and_conj_left_op_mtr := conj_op_mtr & [ INPUT.RELS , OUTPUT.RELS ]. or_conj_both_op_mtr := conj_op_mtr & [ INPUT.RELS , OUTPUT.RELS ]. or_conj_right_op_mtr := conj_op_mtr & [ INPUT.RELS , OUTPUT.RELS ]. or_conj_left_op_mtr := conj_op_mtr & [ INPUT.RELS , OUTPUT.RELS ]. and_op_mtr := conj_op_mtr & [ INPUT.RELS , OUTPUT.RELS ]. or_op_mtr := conj_op_mtr & [ INPUT.RELS , OUTPUT.RELS ]. neg_in_and_left_op_mtr := neg_in_conj_left_op_mtr & [ INPUT.RELS ]. neg_in_and_right_op_mtr := neg_in_conj_right_op_mtr & [ INPUT.RELS ]. drop_negrev_op_mtr := remove_negrev_op_mtr. ;; Convert name preds ;; name_op_mtr := named_op_mtr. ;; Add quantifier for each proper name. ;; add_properq_mtr := add_quant_mtr & [ CONTEXT.RELS , OUTPUT.RELS ]. ;; Predicate nouns ;; cube_op_gpr := pred_noun_gpr & [ INPUT.RELS , OUTPUT.RELS ]. tetrahedron_op_gpr := pred_noun_gpr & [ INPUT.RELS , OUTPUT.RELS ]. dodecahedron_op_gpr := pred_noun_gpr & [ INPUT.RELS , OUTPUT.RELS ]. ;; Comparative adjectives ;; smaller_op_gpr := compar_adj_op_gpr & [ INPUT.RELS , OUTPUT.RELS ]. larger_op_gpr := compar_adj_op_gpr & [ INPUT.RELS , OUTPUT.RELS ]. ;; Three-arg prepositions ;; between_op_gpr := prep_threearg_op_gpr & [ INPUT.RELS , OUTPUT.RELS ]. ;; Prepositions ;; backof_op_gpr := prep_op_gpr & [ INPUT.RELS , OUTPUT.RELS ]. frontof_op_gpr := prep_op_gpr & [ INPUT.RELS , OUTPUT.RELS ]. ;; Two-place Verbs ;; adjoin_op_gpr := verb_op_gpr & [ INPUT.RELS , OUTPUT.RELS ]. like_op_gpr := verb_op_gpr & [ INPUT.RELS , OUTPUT.RELS ]. ;; Adjectives ;; large_op_gpr := adj_op_gpr & [ INPUT.RELS , OUTPUT.RELS ]. small_op_gpr := adj_op_gpr & [ INPUT.RELS , OUTPUT.RELS ]. medium_op_gpr := adj_op_gpr & [ INPUT.RELS , OUTPUT.RELS ]. happy_op_gpr := adj_op_gpr & [ INPUT.RELS , OUTPUT.RELS ]. ;; Noun+of ;; rightof_op_gpr := loc_of_op_gpr & [ INPUT.RELS , OUTPUT.RELS ]. leftof_op_gpr := loc_of_op_gpr & [ INPUT.RELS , OUTPUT.RELS ]. ;; loc + same + Noun ;; samerow_op_gpr := same_loc_op_gpr & [ INPUT.RELS , OUTPUT.RELS ]. samecol_op_gpr := same_loc_op_gpr & [ INPUT.RELS , OUTPUT.RELS ]. ;; same + Noun ;; samesize_op_gpr := same_noun_op_gpr & [ INPUT.RELS , OUTPUT.RELS ]. sameshape_op_gpr := same_noun_op_gpr & [ INPUT.RELS , OUTPUT.RELS ]. ;; Add the indefinite quantifier for predicative nouns ;; add_indefq_cube_mtr := add_quant_mtr & [ CONTEXT.RELS , OUTPUT.RELS ]. add_indefq_tet_mtr := add_quant_mtr & [ CONTEXT.RELS , OUTPUT.RELS ]. add_indefq_dodec_mtr := add_quant_mtr & [ CONTEXT.RELS , OUTPUT.RELS ]. ;; Add the udef quantifier for coordinated NPs ;; add_udefq_mtr := add_quant_mtr & [ CONTEXT.RELS , OUTPUT.RELS ]. ;; Add the definite quantifier for "right", "left" ;; add_defq_mtr := add_quant_mtr & [ CONTEXT.RELS , OUTPUT.RELS ]. ;; Change neg from taking event argument to handle argument, and undo the ;; reversal hack of preconj_neg_mtr. ;; neg_op_mtr := negation_op_mtr. #| ;; Replace "not" with "not the case that" for conjoined-S negation neg_clause_op_mtr := negated_clause_op_mtr. |# ;; Replace and+not with but ;; and_not_to_but_op_mtr := and_neg_to_but_op_mtr & [ OUTPUT.RELS.LIST.FIRST [ CARG "and-neg-but-op-gpr", ARG0.PORD pr023 ] ]. ;; if-then ;; if_then_mtr := if_then_cond_mtr. ;; if-and-only-if ;; iff_mtr := if_and_only_if_mtr. ;; Restrict to paired conjunction with conditionals (disambig): ;; |If P then either Q or R.| ;; paired_or_cond := paired_conj_ifthen_gpr. ;; Restrict to the+case plus paired conjunction with conditionals (disambig): ;; |If P then it is the case both that Q and that R.| ;; paired_and_cond := cond_and_thecase_gpr. paired_and_bicond := bicond_and_thecase_gpr. paired_or_bicond := bicond_or_thecase_gpr.