;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; ;; OpenProof MRS-inflating and paraphrase rules ;;;; MRS `inflation' rules openproof_mtr := monotonic_mtr & [ INPUT.HOOK.INDEX #index, OUTPUT [ HOOK.INDEX #index & [ E [ TENSE present, ASPECT.PRF - ] ], ICONS ] ]. ;; "name" ;; named_op_mtr := openproof_mtr & [ INPUT [ RELS , HCONS ], OUTPUT [ RELS , HCONS ], FLAGS.EQUAL < #x2 > ]. ;; "cube" ;; pred_noun_gpr := openproof_mtr & [ INPUT.RELS , OUTPUT.RELS ]. ;; "large" ;; adj_op_gpr := openproof_mtr & [ INPUT.RELS , OUTPUT.RELS , FLAGS.EQUAL < #x4 > ]. ;; "samesize" ;; same_noun_op_gpr := openproof_mtr & [ INPUT.RELS , OUTPUT.RELS ]. ;; "samecol", "samerow" ;; same_loc_op_gpr := openproof_mtr & [ INPUT.RELS , OUTPUT.RELS ]. openproof_addquant_mtr := openproof_mtr & [ OUTPUT [ RELS.LIST < [ LBL #h1 ], [ RSTR #h2 ], ... >, HCONS ] ]. ;; "rightof" ;; loc_of_op_gpr := openproof_addquant_mtr & [ INPUT.RELS , OUTPUT.RELS , FLAGS.EQUAL < #x4, #x5 > ]. ;; "backof" ;; prep_op_gpr := openproof_mtr & [ INPUT.RELS , OUTPUT.RELS , FLAGS.EQUAL < #x4, #x5 > ]. ;; "between" ;; prep_threearg_op_gpr := openproof_mtr & [ INPUT.RELS , OUTPUT.RELS ]. ;; "adjoins" ;; verb_op_gpr := openproof_mtr & [ INPUT.RELS , OUTPUT.RELS , FLAGS.EQUAL < #x4, #x5 > ]. ;; "larger" ;; compar_adj_op_gpr := openproof_mtr & [ INPUT.RELS , OUTPUT.RELS , FLAGS.EQUAL < #h1 > ]. ;; Add quantifiers ;; add_quant_mtr := openproof_mtr & [ CONTEXT.RELS , FILTER.HCONS , OUTPUT [ RELS , HCONS ], FLAGS.SUBSUME < #x2 > ]. ;; Conjunctions ;; conj_op_mtr := openproof_mtr & [ FILTER.RELS , INPUT.RELS.LIST < [ LBL #h1 & handle, ARG0 #i2 & conj-ind, ARG1 #u3, ARG2 #u4 ], [ LBL handle, PRED #pred1, ARG0 #u3 & individual, ARG1 #u13, ARG2 #u14, ARG3 #u15 ], [ LBL handle, PRED #pred2, ARG0 #u4 & individual, ARG1 #u23, ARG2 #u24, ARG3 #u25 ], ... >, OUTPUT.RELS , FLAGS.SUBSUME < #u3, #u4 > ]. embedded_conj_op_mtr := openproof_mtr & [ FILTER.RELS , CONTEXT.RELS , INPUT.RELS , OUTPUT.RELS , FLAGS.EQUAL < #e1 > ]. embedded_conj_left_op_mtr := embedded_conj_op_mtr & [ CONTEXT.RELS ]. embedded_conj_right_op_mtr := embedded_conj_op_mtr & [ CONTEXT.RELS ]. ;; 2019-06-11 - For -(large(e)&large(b))&-(large(c)&large(a)) ;; the arg of conj starts out as the ARG0 of neg, and this doesn't get switched ;; until after the embedded_mark is removed, so make the mark record ARG0. ;; embedded_negconj_op_mtr := openproof_mtr & [ FILTER.RELS , CONTEXT.RELS , INPUT.RELS , OUTPUT.RELS , FLAGS.SUBSUME < #e1, #e2 > ]. embedded_negconj_left_op_mtr := embedded_negconj_op_mtr & [ CONTEXT.RELS ]. embedded_negconj_right_op_mtr := embedded_negconj_op_mtr & [ CONTEXT.RELS ]. ;; When neg is an arg of conj, adjust the conj's ARG to be the ARG1 of "not" ;; rather than its "ARG0" neg_in_conj_op_mtr := openproof_mtr & [ FILTER.RELS , CONTEXT.RELS , INPUT.RELS , OUTPUT.RELS , FLAGS.SUBSUME < #e0, #e1, #e2, #e10, #e11 > ]. neg_in_conj_left_op_mtr := neg_in_conj_op_mtr & [ CONTEXT.RELS , INPUT.RELS , OUTPUT.RELS ]. neg_in_conj_right_op_mtr := neg_in_conj_op_mtr & [ CONTEXT.RELS , INPUT.RELS , OUTPUT.RELS ]. remove_negrev_op_mtr := openproof_mtr & [ INPUT.RELS , OUTPUT.RELS ]. negation_op_mtr := openproof_mtr & [ CONTEXT.RELS , INPUT.RELS , OUTPUT [ RELS , HCONS ], FLAGS.SUBSUME < #e1, #e2 > ]. ;; if-then ;; if_then_cond_mtr := openproof_mtr & [ CONTEXT.RELS , INPUT.RELS , OUTPUT [ RELS , HCONS ] ]. ;; Accommodate variant input with ARG1, ARG2 ;; if_and_only_if_mtr := openproof_mtr & [ CONTEXT.RELS , INPUT [ RELS ], OUTPUT [ RELS , HCONS ] ]. ;; Copied from types-op.tdl ;; conj_paired_rel := conj_rel. conj_nopair_rel := conj_rel. _and_c_pr_rel := _and_c_rel & conj_paired_rel. _and_c_nopr_rel := _and_c_rel & conj_nopair_rel. _or_c_pr_rel := _or_c_rel & conj_paired_rel. _or_c_nopr_rel := _or_c_rel & conj_nopair_rel. _and_c_nrev_rel := _and_c_rel & conj_nonrev_rel. _and_c_rev_rel := _and_c_rel & conj_reversed_rel. _or_c_nrev_rel := _or_c_rel & conj_nonrev_rel. _or_c_rev_rel := _or_c_rel & conj_reversed_rel. _but_c_nrev_rel := _but_c_rel & conj_nonrev_rel. _but_c_rev_rel := _but_c_rel & conj_reversed_rel. _and_c_pr_nrev_rel := _and_c_pr_rel & _and_c_nrev_rel. _and_c_nopr_nrev_rel := _and_c_nopr_rel & _and_c_nrev_rel. _and_c_pr_rev_rel := _and_c_pr_rel & _and_c_rev_rel. _and_c_nopr_rev_rel := _and_c_nopr_rel & _and_c_rev_rel. _or_c_pr_nrev_rel := _or_c_pr_rel & _or_c_nrev_rel. _or_c_nopr_nrev_rel := _or_c_nopr_rel & _or_c_nrev_rel. _or_c_pr_rev_rel := _or_c_pr_rel & _or_c_rev_rel. _or_c_nopr_rev_rel := _or_c_nopr_rel & _or_c_rev_rel. ;; Restrict to paired conjunction when the consequent of conditional (disambig) ;; as in |If P then either Q or R| ;; This type is similar to the optional paired_conj_gpr below, but is obligatory ;; and does not introduce a rulename predication ;; paired_conj_ifthen_gpr := monotonic_mtr & [ CONTEXT [ RELS , HCONS ], INPUT [ HOOK.INDEX #index, RELS , HCONS ], OUTPUT [ HOOK.INDEX #index, RELS , HCONS ] ]. ;; Wrap "it is the case that" around conj-and S in consequent of conditional ;; for disambig: ;; |If P then it is the case both that Q and that R| ;; This is similar to the optional basic_conj_s_thecase_gpr type below, but ;; is obligatory and does not introduce a rulename predication, but also ;; changes the ARG0 of the conj_rel, necessary when it is the outermost pred. ;; #| cond_and_thecase_gpr := monotonic_mtr & [ CONTEXT [ RELS , HCONS ], INPUT [ HOOK.INDEX #e2, RELS , HCONS ], OUTPUT [ HOOK.INDEX #e2, RELS , HCONS ], FLAGS.SUBSUME < #e4, #le, #re > ]. |# subord_conj_thecase_gpr := monotonic_mtr & [ INPUT [ HOOK.INDEX #index, RELS , HCONS ], OUTPUT [ HOOK.INDEX #index, RELS , HCONS ], FLAGS.SUBSUME < #e4, #le, #re > ]. cond_and_thecase_gpr := subord_conj_thecase_gpr & [ CONTEXT [ RELS , HCONS ], INPUT [ RELS , HCONS ], OUTPUT.RELS ]. bicond_and_thecase_gpr := subord_conj_thecase_gpr & [ CONTEXT.RELS , INPUT [ RELS , HCONS ], OUTPUT.RELS ]. bicond_or_thecase_gpr := subord_conj_thecase_gpr & [ CONTEXT.RELS , INPUT [ RELS , HCONS ], OUTPUT.RELS ]. ;;;; OpenProof paraphrase rule types ;; To enable blocking of rules that add a modifier such as "also", we add ;; a MARKS attribute on individuals, to be used internally in the paraphraser individual :+ [ MARKS marks ]. marks := *avm* & [ ALSO-MARK bool, BOTH-MARK bool, EITHER-MARK bool ]. #| openproof_omtr := monotonic_mtr & optional_mtr & [ OUTPUT [ HOOK.INDEX #index, RELS.LIST.FIRST [ PRED "prule_rel", ARG1 #index ] ] ]. |# openproof_omtr := monotonic_mtr & optional_mtr & [ OUTPUT [ RELS.LIST.FIRST [ PRED "prule_rel" ] ] ]. ;; Coord subj: When given two clauses where the subjects differ but the ;; VPs are identical, discard the second identical verbal conjunct and create a ;; conjoined subject NP whose conj's PRED is the same as the sentence conj PRED. ;; ;; A and B are large ;; #| basic_coord_subj_onearg_op_gpr := openproof_omtr & [ CONTEXT.RELS.LIST < [ PRED named_rel, ARG0 ref-ind & #x3 ], [ ARG0 ref-ind & #x6 ], [ PRED quant_rel, ARG0 #x6 ], ... >, INPUT [ HOOK.INDEX #index, RELS.LIST < [ LBL handle, ARG0 event & [ E.TENSE present ], ARG1 #x3, PRED #pred ], [ LBL handle, ARG0 event & [ E.TENSE present ], ARG1 #x6, PRED #pred ], [ PRED conj_rel, LBL handle, ARG0 #e10 & event, ARG1 event & #e1, ARG2 event & #e2 ], ... > ], OUTPUT [ HOOK.INDEX #index, RELS.LIST < [ ], [ LBL handle, ARG0 #e10 & event & [ E [ ASPECT.PRF -, TENSE present ], SF prop ], ARG1 #x10, PRED #pred ], [ PRED udef_q_rel, LBL handle, ARG0 #x10 & conj_ref-ind, RSTR handle & #h11, BODY handle ], [ PRED conj_rel, LBL handle & #h12, ARG0 #x10 & [ PNG.PN 3 ], ARG1 #x3 & ref-ind & [ PNG [ PN 3s ] ], ARG2 #x6 & ref-ind ], ... >, HCONS ], FLAGS.SUBSUME < #x3, #x6, #e1, #e2, ... > ]. |# basic_coord_subj_onearg_op_gpr := openproof_omtr & [ CONTEXT.RELS.LIST < [ PRED named_rel, ARG0 ref-ind & #x3 ], [ ARG0 ref-ind & #x6 ], [ PRED quant_rel, ARG0 #x6 ], ... >, INPUT [ HOOK.INDEX #index, RELS.LIST < [ LBL handle, ARG0 event & #e1 & [ E.TENSE present ], ARG1 #x3, PRED #pred ], [ LBL handle, ARG0 event & #e2 & [ E.TENSE present ], ARG1 #x6, PRED #pred ], [ PRED conj_rel, LBL handle, ARG0 #e10 & event, ARG1 event & #e1, ARG2 event & #e2 ], ... > ], OUTPUT [ HOOK.INDEX #index, RELS.LIST < [ ], [ LBL handle, ARG0 #e10 & event & [ E [ ASPECT.PRF -, TENSE present ], SF prop ], ARG1 #x10, PRED #pred ], [ PRED udef_q_rel, LBL handle, ARG0 #x10 & conj_ref-ind, RSTR handle & #h11, BODY handle ], [ PRED conj_rel, LBL handle & #h12, ARG0 #x10 & [ PNG.PN 3 ], ARG1 #x3 & ref-ind & [ PNG [ PN 3s ] ], ARG2 #x6 & ref-ind ], ... >, HCONS ], FLAGS.SUBSUME < #x3, #x6, #e1, #e2, ... > ]. ;; The INPUT..[ARG2 handle] is a hack to prevent this rule from applying to ;; two-arg predications. ;; basic_coord_subj_onearg_pos_op_gpr := basic_coord_subj_onearg_op_gpr & [ CONTEXT.RELS , FILTER.RELS , INPUT [ RELS ], OUTPUT.RELS , FLAGS.SUBSUME < semarg, semarg, semarg, semarg > ]. coord_subj_onearg_pos_op_gpr := basic_coord_subj_onearg_pos_op_gpr & [ CONTEXT.RELS , INPUT.RELS , OUTPUT.RELS ]. coord_subj_onearg_pos_nary_op_gpr := basic_coord_subj_onearg_pos_op_gpr & [ CONTEXT.RELS , INPUT.RELS , OUTPUT.RELS ]. ;; "A and B are not large" ;; basic_coord_subj_onearg_neg_op_gpr := basic_coord_subj_onearg_op_gpr & [ CONTEXT.HCONS , FILTER.RELS , INPUT [ RELS , HCONS ], OUTPUT.RELS , FLAGS.SUBSUME < semarg, semarg, semarg, semarg, #e1 > ]. coord_subj_onearg_neg_op_gpr := basic_coord_subj_onearg_neg_op_gpr & [ CONTEXT.RELS , INPUT.RELS , OUTPUT.RELS ]. coord_subj_onearg_neg_nary_op_gpr := basic_coord_subj_onearg_neg_op_gpr & [ CONTEXT.RELS , INPUT.RELS , OUTPUT.RELS ]. ;; Two-argument common predicates with coord subj ;; B and D are smaller than C. ;; See subj_twoarg_noprop below for |B and D are cubes| ;; basic_coord_subj_twoarg_op_gpr := basic_coord_subj_onearg_op_gpr & [ CONTEXT.RELS.LIST < [ ], [ ], [ ], [ PRED named_rel, ARG0 #x7, CARG #carg ], ... >, ; FILTER [ RELS , ; HCONS ], INPUT [ RELS.LIST < [ ], [ ], [ ], [ PRED named_rel, ARG0 ref-ind & #x8, CARG #carg ], [ PRED proper_q_rel, LBL handle, ARG0 #x8, RSTR handle & #h20, BODY handle ], ... >, HCONS.LIST < qeq & [ HARG #h20 ], ... > ], FLAGS.SUBSUME < semarg, semarg, semarg, semarg, #x7, #x8, ... > ]. ;; B and D are in back of C. ;; coord_subj_twoarg_op_gpr := basic_coord_subj_twoarg_op_gpr & [ INPUT.HCONS ]. basic_coord_subj_twoarg_pos_op_gpr := coord_subj_twoarg_op_gpr & [ CONTEXT.RELS , INPUT.RELS , OUTPUT.RELS , FLAGS.SUBSUME < semarg, semarg, semarg, semarg, semarg, semarg > ]. coord_subj_twoarg_pos_op_gpr := basic_coord_subj_twoarg_pos_op_gpr & [ CONTEXT.RELS , INPUT.RELS , OUTPUT.RELS ]. coord_subj_twoarg_pos_nary_op_gpr := basic_coord_subj_twoarg_pos_op_gpr & [ CONTEXT.RELS , INPUT.RELS , OUTPUT.RELS ]. basic_coord_subj_compar_op_gpr := coord_subj_twoarg_op_gpr & [ CONTEXT.RELS , INPUT.RELS , OUTPUT.RELS , FLAGS.SUBSUME < semarg, semarg, semarg, semarg, semarg, semarg, #e1 > ]. coord_subj_compar_op_gpr := basic_coord_subj_compar_op_gpr & [ CONTEXT.RELS , INPUT.RELS , OUTPUT.RELS ]. coord_subj_compar_nary_op_gpr := basic_coord_subj_compar_op_gpr & [ CONTEXT.RELS , INPUT.RELS , OUTPUT.RELS ]. basic_coord_subj_twoarg_neg_op_gpr := basic_coord_subj_twoarg_op_gpr & [ CONTEXT [ RELS , HCONS ], ; FILTER.HCONS , INPUT [ RELS , HCONS ], OUTPUT.RELS , FLAGS.SUBSUME < semarg, semarg, semarg, semarg, semarg, semarg, #e1 > ]. coord_subj_twoarg_neg_op_gpr := basic_coord_subj_twoarg_neg_op_gpr & [ CONTEXT.RELS , INPUT.RELS , OUTPUT.RELS ]. coord_subj_twoarg_neg_nary_op_gpr := basic_coord_subj_twoarg_neg_op_gpr & [ CONTEXT.RELS , INPUT.RELS , OUTPUT.RELS ]. ;; B and D are cubes ;; B and D are not cubes ;; coord_subj_twoarg_noprop_op_gpr := basic_coord_subj_onearg_op_gpr & [ CONTEXT.RELS.LIST < [ ], [ ], [ ], [ PRED #pred, ARG0 ref-ind & #x7 ], [ PRED udef_a_q_rel, ARG0 #x7 ], ... >, INPUT [ RELS.LIST < [ ARG2 #x7 ], [ ARG2 #x8 ], [ ], [ PRED #pred, ARG0 ref-ind & #x8 ], [ PRED udef_a_q_rel, LBL handle, ARG0 #x8, RSTR handle & #h20, BODY handle ], ... >, HCONS.LIST < qeq & [ HARG #h20 ], ... > ], OUTPUT.RELS.LIST < [ ], [ LBL handle, ARG1.PNG.PN #pn, ARG2 #x7 & [ PNG.PN #pn ] ], [ ], [ ], ... >, FLAGS.SUBSUME < semarg, semarg, semarg, semarg, #x7, #x8 > ]. ;; B and D are cubes ;; bsc_crd_subj_twoarg_noprop_pos_op_gpr := coord_subj_twoarg_noprop_op_gpr & [ FILTER [ RELS , HCONS ], INPUT [ RELS , HCONS ], OUTPUT.RELS ]. coord_subj_twoarg_noprop_pos_op_gpr := bsc_crd_subj_twoarg_noprop_pos_op_gpr & [ CONTEXT.RELS , INPUT.RELS , OUTPUT.RELS ]. coord_subj_twoarg_noprop_nary_op_gpr := bsc_crd_subj_twoarg_noprop_pos_op_gpr & [ CONTEXT.RELS , INPUT.RELS , OUTPUT.RELS ]. ;; B and D are not cubes ;; bsc_coord_subj_twoarg_noprop_neg_gpr := coord_subj_twoarg_noprop_op_gpr & [ CONTEXT [ RELS , HCONS ], FILTER [ RELS , HCONS ], INPUT [ RELS , HCONS ], OUTPUT.RELS ]. coord_subj_twoarg_noprop_neg_gpr := bsc_coord_subj_twoarg_noprop_neg_gpr & [ CONTEXT.RELS , INPUT.RELS , OUTPUT.RELS ]. coord_subj_twoarg_noprop_neg_nary_gpr := bsc_coord_subj_twoarg_noprop_neg_gpr & [ CONTEXT.RELS , INPUT.RELS , OUTPUT.RELS ]. ;; A and B are between C and D ;; basic_coord_subj_threearg_op_gpr := basic_coord_subj_twoarg_op_gpr & [ CONTEXT.RELS , ; FILTER.HCONS , INPUT [ RELS , HCONS ], OUTPUT.RELS ]. coord_subj_threearg_op_gpr := basic_coord_subj_threearg_op_gpr & [ CONTEXT.RELS , INPUT.RELS , OUTPUT.RELS ]. coord_subj_threearg_nary_op_gpr := basic_coord_subj_threearg_op_gpr & [ CONTEXT.RELS , INPUT.RELS , OUTPUT.RELS ]. ;; Common subj in coord Ss: note that need to drop the qeqs for ARG1, ARG2 ;; when doing VP coord. REVIEW. ;; B is smaller than C and (is) larger than D. ;; basic_coord_vp_op_gpr := openproof_omtr & [ CONTEXT.RELS , INPUT [ HOOK.INDEX #index, RELS , HCONS ], OUTPUT [ HOOK.INDEX #index, RELS , HCONS ], FLAGS.SUBSUME < #e2, #x1, #x2, ... > ]. ;; 2019-06-29 - Removed ARG2 handle from CONTEXT rel (the second conjunct) ;; so we can use this for |B is a cube and B is large| ;; coord_vp_onearg_op_gpr := basic_coord_vp_op_gpr & [ CONTEXT.RELS , INPUT.RELS , FLAGS.SUBSUME < semarg, semarg, semarg > ]. ;; 2019-06-29 - Removed #x4 from FLAGS.SUBSUME, so we can use this rule for ;; |B is large and B is a cube| ;; Check for over-use ;; coord_vp_twoarg_op_gpr := basic_coord_vp_op_gpr & [ CONTEXT.RELS , INPUT.RELS , OUTPUT.RELS , FLAGS.SUBSUME < semarg, semarg, semarg, #x3 > ]. ;; B and C are large and (they) are not small. ;; coord_vp_prosubj_onearg_op_gpr := basic_coord_vp_op_gpr & [ CONTEXT.RELS , FILTER.RELS , INPUT.RELS , FLAGS.SUBSUME < semarg, semarg, semarg > ]. coord_vp_prosubj_twoarg_op_gpr := basic_coord_vp_op_gpr & [ CONTEXT.RELS , FILTER.RELS , INPUT.RELS , OUTPUT.RELS , FLAGS.SUBSUME < semarg, semarg, semarg, #x3, #x4 > ]. ;; Pronominal subjects ;; basic_pro_subj_gpr := openproof_omtr & [ CONTEXT.RELS.LIST < [ ARG0 event & [ E.TENSE present ], ARG1 #x1 ], [ ARG0 event & [ E.TENSE present ], ARG1 #x2 ], [ ARG0 #x1 & ref-ind ], [ PRED quant_rel & #qpred, ARG0 #x1 ], ... >, INPUT [ HOOK.INDEX #index, RELS.LIST < [ LBL #h10, ARG0 #x2 & ref-ind ], [ PRED #qpred, ARG0 #x2, RSTR #h20 ], ... > ], OUTPUT [ HOOK.INDEX #index, RELS.LIST < [ ], [ LBL #h10, ARG0 #x2 ], [ LBL handle, ARG0 #x2, RSTR #h20 ], ... > ], FLAGS.SUBSUME < #x2, ... > ]. ;; B is a cube, and it is large ;; pro_subj_gpr := basic_pro_subj_gpr & [ CONTEXT.RELS.LIST < [ ], [ ], [ PRED named_rel, CARG #carg ], ... >, INPUT.RELS , OUTPUT.RELS.LIST < [ ], [ PRED pron_rel ], [ PRED pronoun_q_rel ], ... >, FLAGS.SUBSUME < semarg > ]. ;; B is larger than C, and it is a cube. ;; coord_s_pro_subj_unambig_gpr := pro_subj_gpr & [ OUTPUT [ RELS , HCONS ] ]. ;; B is larger than C, and it (i.e., B) is a cube. ;; coord_s_pro_subj_ambig_gpr := pro_subj_gpr & [ CONTEXT.RELS , INPUT.RELS , OUTPUT [ RELS , HCONS ] ]. subord_s_pro_subj_gpr := pro_subj_gpr & [ CONTEXT [ RELS.LIST < [ ], [ ], [ ], [ ], [ ARG2 #h3 ], ... >, HCONS.LIST < qeq & [ ], qeq & [ HARG #h3 ], ... > ] ]. ;; If B is a cube then it is large ;; basic_cond_s_pro_subj_gpr := subord_s_pro_subj_gpr & [ CONTEXT [ RELS.LIST < [ LBL handle ], [ LBL handle ], [ ], [ ], [ PRED "_if_x_then_rel", ARG1 #h3 ], [ LBL #h1, ARG1 #h5 ], ... >, HCONS.LIST < qeq & [ HARG #h5 ], qeq, qeq & [ HARG #h3, LARG #h1 ], ... > ], OUTPUT.RELS.LIST < [ ], [ ], [ ], ... > ]. cond_s_pro_subj_gpr := basic_cond_s_pro_subj_gpr & [ CONTEXT [ RELS , HCONS ], OUTPUT [ RELS , HCONS ] ]. cond_s_pro_subj_ambig_gpr := basic_cond_s_pro_subj_gpr & [ CONTEXT [ RELS , HCONS ], INPUT.RELS , OUTPUT [ RELS , HCONS ] ]. ;; "B is large if it is a cube" or "... provided that it ..." ;; Assume this is ordered after "then"-deletion, so we don't produce output ;; that would have to be generated as "*then B is large if it is a cube". ;; basic_cond_s_pro_subj_rev_gpr := subord_s_pro_subj_gpr & [ CONTEXT [ RELS.LIST < [ LBL #h2 ], [ LBL #h4 ], [ ], [ ], [ ARG1 #h3, ARG2 #h5 ], ... >, HCONS ] ]. cond_s_pro_subj_rev_gpr := basic_cond_s_pro_subj_rev_gpr & [ CONTEXT.RELS , OUTPUT [ RELS , HCONS ] ]. cond_s_pro_subj_ambig_rev_gpr := basic_cond_s_pro_subj_rev_gpr & [ CONTEXT.RELS , INPUT.RELS , OUTPUT [ RELS , HCONS ] ]. ;; Embedded consequent ;; "If B is large, then it is a cube iff C is large" ;; cond_s_pro_subj_embed_cons_gpr := basic_cond_s_pro_subj_gpr & [ CONTEXT [ RELS , HCONS ], OUTPUT [ RELS , HCONS ] ]. ;; Embedded negated consequent ;; cond_s_pro_subj_embed_cons_neg_gpr := basic_cond_s_pro_subj_gpr & [ CONTEXT [ RELS , HCONS ], OUTPUT [ RELS , HCONS ] ]. ;; Embedded antecedent ;; "If B is large, then if it is a cube then C is large" ;; cond_s_pro_subj_embed_ant_gpr := basic_cond_s_pro_subj_gpr & [ CONTEXT [ RELS , HCONS ], OUTPUT [ RELS , HCONS ] ]. ;; "If B is large, then if it isn't a cube then C is large" ;; cond_s_pro_subj_embed_ant_neg_gpr := basic_cond_s_pro_subj_gpr & [ CONTEXT [ RELS , HCONS ], OUTPUT [ RELS , HCONS ] ]. basic_unless_s_pro_subj_gpr := subord_s_pro_subj_gpr & [ CONTEXT [ RELS.LIST < [ LBL handle ], [ LBL handle ], [ ], [ ], [ PRED "_unless_x_rel" ], ... >, HCONS ], OUTPUT.RELS.LIST < [ ], [ ], [ ], ... > ]. unless_s_pro_subj_gpr := basic_unless_s_pro_subj_gpr & [ CONTEXT [ RELS , HCONS ], OUTPUT [ RELS , HCONS ] ]. unless_s_pro_subj_ambig_gpr := basic_unless_s_pro_subj_gpr & [ CONTEXT [ RELS , HCONS ], INPUT.RELS , OUTPUT [ RELS , HCONS ] ]. ;; B is a cube only if it is large ;; onlyif_s_pro_subj_gpr := subord_s_pro_subj_gpr & [ CONTEXT [ RELS , HCONS ], OUTPUT [ RELS , HCONS ] ]. ;; B is a cube if and only if it is large ;; bicond_s_pro_subj_gpr := subord_s_pro_subj_gpr & [ CONTEXT [ RELS , HCONS ], OUTPUT [ RELS , HCONS ] ]. bicond_s_pro_subj_coordvp_gpr := subord_s_pro_subj_gpr & [ CONTEXT [ RELS , HCONS ], OUTPUT [ RELS , HCONS ] ]. ;; Coord subj with pronoun ;; ;; We specialize the SORT of pronouns to let us keep track of the conjoined ;; antecedent of a plural pronoun being either distributive or collective, ;; so we know whether we can replace `they' with `one of them' or `all of them'. ;; Note that we also then need multiple lexical entries for `they' and `them', ;; each with a specific value for SORT, since the generator needs to have the ;; output MRS subsume the input. ;; distrib_collect := basic-entity-or-event. distributive := distrib_collect. collective := distrib_collect. distrib-entity := entity & distributive. collect-entity := entity & collective. ;; We also want to distinguish the cardinality of plurals as exactly 2 or ;; more than 2, for "both of ..." vs. "all of ..." and for "neither of ..." ;; vs. "none of ..." ;; ;ref-ind :+ ; [ CARD string ]. pro_coord_subj_gpr := basic_pro_subj_gpr & [ CONTEXT.RELS.LIST < [ ], [ ], [ PRED _and_c_rel, ARG1 #x1, ARG2 #x2 ], [ ], [ PRED named_rel, ARG0 #x1, CARG #carg1 ], [ PRED named_rel, ARG0 #x2, CARG #carg2 ], ... >, INPUT [ RELS , HCONS ], OUTPUT [ RELS.LIST < [ ], [ ARG0.SORT #sort ], [ ], ... > ] ]. pro_coord_subj_disj_gpr := basic_pro_subj_gpr & [ INPUT.RELS.LIST < [ PRED _or_c_rel ], ... >, OUTPUT [ RELS , HCONS ] ]. conjnct_pro_coord_subj_gpr := pro_coord_subj_gpr & [ CONTEXT.RELS , OUTPUT.RELS.LIST < [ ], [ ARG0 #x3 & [ PNG.PN 3p, SORT #sort ] ], ... > ]. conjnct_pro_coord_subj_and_gpr := conjnct_pro_coord_subj_gpr & [ INPUT.RELS.LIST < [ PRED _and_c_rel ], ... >, OUTPUT [ RELS , HCONS ] ]. conjnct_pro_coord_subj_or_gpr := conjnct_pro_coord_subj_gpr & pro_coord_subj_disj_gpr. subord_s_pro_coord_subj_gpr := pro_coord_subj_gpr & [ CONTEXT [ RELS.LIST < [ ], [ ], [ ], [ ], [ ], [ ], [ ARG2 #h3 ], ... >, HCONS.LIST < qeq & [ ], qeq & [ HARG #h3 ], ... > ] ]. ;; If B and C are cubes then they are large ; cond_s_pro_coord_subj_gpr := subord_s_pro_coord_subj_gpr & [ CONTEXT [ RELS , HCONS ] ]. cond_s_pro_coord_subj_and_gpr := cond_s_pro_coord_subj_gpr & [ INPUT.RELS.LIST < [ PRED _and_c_rel ], ... >, OUTPUT [ RELS , HCONS ] ]. cond_s_pro_coord_subj_or_gpr := cond_s_pro_coord_subj_gpr & pro_coord_subj_disj_gpr. ;; IF B and C are cubes then they are large or small cond_s_pro_coord_subj_coord_conseq_gpr := subord_s_pro_coord_subj_gpr & [ CONTEXT [ RELS , HCONS ] ]. cond_s_pro_coord_subj_crd_cq_and_gpr := cond_s_pro_coord_subj_coord_conseq_gpr & [ INPUT.RELS.LIST < [ PRED _and_c_rel ], ... >, OUTPUT [ RELS , HCONS ] ]. cond_s_pro_coord_subj_crd_cq_or_gpr := cond_s_pro_coord_subj_coord_conseq_gpr & pro_coord_subj_disj_gpr. ;; B and C are cubes only if they are large ;; onlyif_s_pro_coord_subj_gpr := subord_s_pro_coord_subj_gpr & [ CONTEXT [ RELS , HCONS ] ]. onlyif_s_pro_coord_subj_and_gpr := onlyif_s_pro_coord_subj_gpr & [ INPUT.RELS.LIST < [ PRED _and_c_rel ], ... >, OUTPUT [ RELS , HCONS ] ]. onlyif_s_pro_coord_subj_or_gpr := onlyif_s_pro_coord_subj_gpr & pro_coord_subj_disj_gpr. ;; B and C are cubes if and only if they are large ;; bicond_s_pro_coord_subj_gpr := subord_s_pro_coord_subj_gpr & [ CONTEXT [ RELS , HCONS ] ]. bicond_s_pro_coord_subj_and_gpr := bicond_s_pro_coord_subj_gpr & [ INPUT.RELS.LIST < [ PRED _and_c_rel ], ... >, OUTPUT [ RELS , HCONS ] ]. bicond_s_pro_coord_subj_or_gpr := bicond_s_pro_coord_subj_gpr & pro_coord_subj_disj_gpr. ;; B is in front of or smaller than C ;; basic_shared_dobj_op_gpr := openproof_omtr & [ CONTEXT.RELS.LIST < [ ARG2 #x1 ], [ PRED named_rel, ARG0 #x1 & ref-ind, CARG #carg ], [ PRED pos_conj_rel, ARG1 non_conj_event & #e1 & [ E.TENSE present ], ARG2 non_conj_event & #e2 & [ E.TENSE present ] ], ... >, INPUT [ HOOK.INDEX #index, RELS , HCONS ], OUTPUT [ HOOK.INDEX #index, RELS , HCONS ], FLAGS.SUBSUME < #e1, #e2, #x1, #x2 > ]. ;; "B is in front of or in back of C" ;; shared_dobj_onepred_op_gpr := basic_shared_dobj_op_gpr & [ CONTEXT.RELS , INPUT.RELS , OUTPUT.RELS ]. ;; "B is larger than or smaller than C" ;; shared_dobj_twopred_op_gpr := basic_shared_dobj_op_gpr & [ CONTEXT.RELS , INPUT.RELS , OUTPUT.RELS ]. ;; "B is in front of or smaller than C" ;; shared_dobj_onetwopred_op_gpr := basic_shared_dobj_op_gpr & [ CONTEXT.RELS , INPUT.RELS , OUTPUT.RELS ]. ;; "B is smaller than or in front of C" ;; shared_dobj_twoonepred_op_gpr := basic_shared_dobj_op_gpr & [ CONTEXT.RELS , INPUT.RELS , OUTPUT.RELS ]. ;; "B is to the left of or right of C" shared_noun_obj_op_gpr := openproof_omtr & [ CONTEXT.RELS , INPUT [ HOOK.INDEX #index, RELS , HCONS ], OUTPUT [ HOOK.INDEX #index, RELS , HCONS ], FLAGS.SUBSUME < #x1, #x2 > ]. ;; B is smaller than D or C ;; shared_vp_comp_op_gpr := openproof_omtr & [ CONTEXT.RELS , INPUT [ HOOK.INDEX #index, RELS , HCONS ], OUTPUT [ HOOK.INDEX #index, RELS , HCONS ] ]. ;; "B is in the same column as D or C" ;; shared_vp_same_n_op_gpr := openproof_omtr & [ CONTEXT.RELS , INPUT [ HOOK.INDEX #index, RELS , HCONS ], OUTPUT [ HOOK.INDEX #index, RELS , HCONS ] ]. ;; "B is to the right of C and D" ;; shared_vp_dir_op_gpr := openproof_omtr & [ CONTEXT.RELS , INPUT [ HOOK.INDEX #index, RELS , HCONS ], OUTPUT [ HOOK.INDEX #index, RELS , HCONS ] ]. ;; B is in front of C or D ;; shared_vp_loc_op_gpr := openproof_omtr & [ CONTEXT.RELS , INPUT [ HOOK.INDEX #index, RELS , HCONS ], OUTPUT [ HOOK.INDEX #index, RELS , HCONS ] ]. ;; B is not in front of C or D ;; FIX: need to do this neg variant for the other pred types too ;; shared_vp_loc_neg_op_gpr := openproof_omtr & [ CONTEXT [ RELS , HCONS ], INPUT [ HOOK.INDEX #index, RELS , HCONS ], OUTPUT [ HOOK.INDEX #index, RELS , HCONS ] ]. ;; A is between B and C or D and F ;; shared_vp_threearg_op_gpr := openproof_omtr & [ CONTEXT.RELS , INPUT [ HOOK.INDEX #index, RELS , HCONS ], OUTPUT [ HOOK.INDEX #index, RELS , HCONS ] ]. ;; B is a cube or a tetrahedron ;; B is to the right or the left of D ;; shared_pred_op_gpr := openproof_omtr & [ CONTEXT.RELS , INPUT [ HOOK.INDEX #index, RELS , HCONS ], OUTPUT [ HOOK.INDEX #index, RELS , HCONS ] ]. ;; "B and C are in the same row" ;; and_same_op_mtr := openproof_omtr & [ CONTEXT.RELS , FILTER.RELS , INPUT [ HOOK.INDEX #index, RELS.LIST < [ PRED "~._n_" & #pred, LBL #h30, ARG0 #x3 & ref-ind ], [ PRED quant_rel & #qpred, LBL #h32, ARG0 #x3, RSTR #h33, BODY #h34 ], [ PRED "_same_a_as_rel", LBL #h31, ARG0 #e4, ARG1 #x3 ], [ PRED comp_equal_rel, LBL #h6, ARG0 #e7, ARG1 #e4, ARG2 #x2 ], ... > ], OUTPUT [ HOOK.INDEX #index, RELS , HCONS ], FLAGS.SUBSUME < #x1, #x2, #x3, #e4 > ]. ; FLAGS.SUBSUME < #x1, #x2, #x3, #x8, #e4 > ]. and_same_loc_op_mtr := and_same_op_mtr & [ CONTEXT.RELS , INPUT.RELS , OUTPUT.RELS ]. and_same_size_op_mtr := and_same_op_mtr & [ CONTEXT.RELS , INPUT.RELS , OUTPUT.RELS ]. ;; "and" => "but" ;; and_but_op_mtr := monotonic_mtr & [ INPUT [ HOOK.INDEX #index, RELS ], OUTPUT [ HOOK.INDEX #index, RELS ] ]. and_neg_to_but_op_mtr := and_but_op_mtr & [ CONTEXT [ RELS , HCONS ], FILTER [ RELS , HCONS ], INPUT [ RELS , HCONS ], OUTPUT.HCONS , FLAGS.OPTIONAL - ]. ;; A is larger than B but smaller than C. ;; and_but_size_op_mtr := and_but_op_mtr & [ CONTEXT.RELS , FILTER [ RELS , HCONS ], INPUT.RELS , FLAGS.OPTIONAL - ]. ;; B is in the same row as C but in the same column as D ;; 2019-06-29 - Removed OPT - so we can also get ;; |B is larger than A and is larger than C| ;; and_but_location_op_mtr := and_but_op_mtr & [ CONTEXT.RELS , FILTER [ RELS , HCONS ], INPUT.RELS , FLAGS.OPTIONAL + ]. and_but_front_back_op_mtr := and_but_op_mtr & [ CONTEXT.RELS , FILTER [ RELS , HCONS ], INPUT.RELS , FLAGS.OPTIONAL - ]. ;; "not" + "or" => "nor" ;; neg_or_to_nor_op_mtr := openproof_omtr & [ INPUT [ HOOK.INDEX #index, RELS , HCONS ], OUTPUT [ HOOK.INDEX #index, RELS , HCONS ] ]. ;; "not"-NPs + "or" => "nor" ;; "It's not the case that B or C are cubes" => "Neither B nor C are cubes" ;; neg_nom_or_to_nor_op_mtr := openproof_omtr & [ INPUT [ HOOK.INDEX #index, RELS.LIST < [ PRED neg_rel, LBL #h1, ARG1 #h2 ], [ PRED _or_c_rel, LBL #h7, ARG0 #x8 & ref-ind, ARG1 #x9 & ref-ind, ARG2 #x10 & ref-ind ], [ PRED #pred, LBL #h11, ARG0 #e20 & event & [ E.TENSE present], ARG1 #x8 ], ... >, HCONS ], OUTPUT [ HOOK.INDEX #index, RELS.LIST < [ ], [ PRED #pred, LBL #h1, ARG0 #e20, ARG1 #x8 ], [ PRED _nor_c_rel, LBL #h7, ARG0 #x8, ARG1 #x9, ARG2 #x10 ], ... >, HCONS ] ]. ;; Make [ARG2 handle] as the usual hack to exclude two-argument predicates ;; neg_nom_or_to_nor_onearg_op_mtr := neg_nom_or_to_nor_op_mtr & [ INPUT.RELS , OUTPUT.RELS ]. neg_nom_or_to_nor_comp_op_mtr := neg_nom_or_to_nor_op_mtr & [ INPUT.RELS , OUTPUT.RELS , FLAGS.SUBSUME < #x4 > ]. neg_nom_or_to_nor_twoarg_op_mtr := neg_nom_or_to_nor_op_mtr & [ INPUT.RELS , OUTPUT.RELS , FLAGS.SUBSUME < #i2 > ]. ;; "to the right or to the left of" ;; shared_ppof_op_gpr := openproof_omtr & [ CONTEXT.RELS , INPUT [ HOOK.INDEX #index, RELS , HCONS ], OUTPUT [ HOOK.INDEX #index, RELS , HCONS ], FLAGS.SUBSUME < #x3, #x7 > ]. shared_ppof_left_op_gpr := shared_ppof_op_gpr & [ CONTEXT.RELS ]. shared_ppof_right_op_gpr := shared_ppof_op_gpr & [ CONTEXT.RELS ]. ;; "to the right or left of" ;; shared_to_the_op_gpr := openproof_omtr & [ CONTEXT.RELS , INPUT [ HOOK.INDEX #index, RELS , HCONS ], OUTPUT [ HOOK.INDEX #index, RELS , HCONS ] ]. ;; Coord and-S with semicolon + moreover ;; 2019-07-01 - Exclude coord for left conjunct, to avoid ;; |A is large, B is large; moreover C is large|. Would be better to block ;; just implicit conj, but would have to split this rule into nonconj and ;; pos_conj_rel variants. FIX later? ;; Only allow when conj is main clause. ;; #| coord_sent_semi_op_gpr := openproof_omtr & [ FILTER [ HCONS ], INPUT [ HOOK.INDEX #index, RELS ], OUTPUT [ HOOK.INDEX #index, RELS , HCONS ], FLAGS.SUBSUME < #e10 > ]. |# coord_sent_semi_op_gpr := openproof_omtr & [ FILTER [ HCONS ], INPUT [ HOOK.INDEX #e10, RELS ], OUTPUT [ HOOK.INDEX #e10, RELS , HCONS ], FLAGS.SUBSUME < #e10 > ]. ;; "if-then" to "only if" ;; if_then_to_only_if_gpr := openproof_omtr & [ FILTER.RELS , CONTEXT [ RELS , HCONS ], INPUT [ RELS , HCONS ], OUTPUT [ HOOK.INDEX #e9, RELS , HCONS ], FLAGS.EQUAL < #h7, #h8, #h9 > ]. if_not_to_unless_gpr := openproof_omtr & [ INPUT [ HOOK.INDEX #index, RELS , HCONS ], OUTPUT [ HOOK.INDEX #index, RELS , HCONS ], FLAGS.EQUAL < #h7, #h8 > ]. ;; "iff" to "just in case" ;; iff_to_just_in_case_gpr := openproof_omtr & [ INPUT [ HOOK.INDEX #index, RELS ], OUTPUT [ HOOK.INDEX #index, RELS ], FLAGS.EQUAL < > ]. iff_to_just_in_case_fact_gpr := openproof_omtr & [ INPUT [ HOOK.INDEX #index, RELS ], OUTPUT [ HOOK.INDEX #index, RELS , HCONS ], FLAGS.EQUAL < > ]. ;; "B is a large cube" ;; basic_adj_and_predn_gpr := openproof_omtr & [ CONTEXT.RELS , INPUT [ HOOK.INDEX #index, RELS , HCONS ], OUTPUT [ HOOK.INDEX #index, RELS , HCONS ], FLAGS.EQUAL < #x1 > ]. adj_and_predn_gpr := basic_adj_and_predn_gpr & [ INPUT.RELS ]. predn_and_adj_gpr := basic_adj_and_predn_gpr & [ INPUT.RELS ]. ;; For conjoined clausal negation ;; unless_the_case_to_unless_gpr := openproof_omtr & [ CONTEXT.RELS , INPUT [ HOOK.INDEX #index, RELS , HCONS ], OUTPUT [ HOOK.INDEX #index, RELS , HCONS ] ]. ;; VP ellipsis ;; basic_vp_ellipsis_gpr := openproof_omtr & [ CONTEXT.RELS.LIST < [ PRED #pred, ARG0 event & #e1 ], ...>, FILTER.RELS , INPUT [ HOOK.INDEX #index, RELS.LIST < [ PRED #pred, LBL #h1 & handle, ARG0 #e2 & event, ARG1 #x3 & ref-ind ], ... > ], OUTPUT [ HOOK.INDEX #index, RELS ], FLAGS.SUBSUME < #e1, #e2, ... > ]. ;; If B is a cube, C is ;; vp_ellipsis_if_pos_gpr := basic_vp_ellipsis_gpr & [ CONTEXT [ RELS.LIST < [ LBL #h1 ], [ PRED "_if_x_then_rel", ARG1 #h2, ARG2 #h3 ], [ PRED "_then_a_1_rel", LBL #h5, ARG1 #h6 ], ... >, HCONS ], INPUT.RELS.LIST < [ LBL #h4 ], ... > ]. vp_ellipsis_if_pos_onearg_gpr := vp_ellipsis_if_pos_gpr & [ CONTEXT.RELS , INPUT [ RELS , HCONS ], FLAGS.SUBSUME < semarg, semarg > ]. vp_ellipsis_if_neg_gpr := basic_vp_ellipsis_gpr & [ CONTEXT [ RELS.LIST < [ LBL #h1 ], [ PRED "_if_x_then_rel", ARG1 #h2, ARG2 #h3 ], [ PRED "_then_a_1_rel", LBL #h5, ARG1 #h6 ], [ PRED neg_rel, LBL #h7, ARG1 #h8 ], ... >, HCONS ], INPUT.RELS.LIST < [ LBL #h4 ], ... > ]. vp_ellipsis_if_neg_onearg_gpr := vp_ellipsis_if_neg_gpr & [ CONTEXT.RELS , INPUT [ RELS , HCONS ], FLAGS.SUBSUME < semarg, semarg > ]. vp_ellipsis_twoarg_gpr := basic_vp_ellipsis_gpr & [ INPUT [ RELS.LIST < [ ARG2 #x10 & ref-ind ], [ LBL #h9 & handle, ARG0 #x10 ], [ PRED quant_rel, ARG0 #x10, RSTR #h11 & handle ], ... >, HCONS.LIST < qeq & [ HARG #h11, LARG #h9 ], ... > ], FLAGS.SUBSUME < semarg, semarg, #x10 > ]. vp_ellipsis_if_pos_twoarg_comp_gpr := vp_ellipsis_if_pos_gpr & vp_ellipsis_twoarg_gpr & [ CONTEXT.RELS , INPUT [ RELS , HCONS ] ]. vp_ellipsis_if_pos_twoarg_gpr := vp_ellipsis_if_pos_gpr & vp_ellipsis_twoarg_gpr & [ CONTEXT.RELS , INPUT [ RELS.LIST < [ ], [ PRED "_." & #pred ], ... >, HCONS ] ]. vp_ellipsis_if_neg_twoarg_gpr := vp_ellipsis_if_neg_gpr & vp_ellipsis_twoarg_gpr & [ CONTEXT.RELS , INPUT [ RELS.LIST < [ ], [ PRED #pred ], ... >, HCONS ] ]. ;; Ellipsis in the antecedent which follows the consequent ;; "C is a cube, if B is" ;; vp_ellipsis_if_pos_ante_gpr := basic_vp_ellipsis_gpr & [ CONTEXT [ RELS.LIST < [ LBL #h1 ], [ PRED "_if_x_then_rel", ARG1 #h2, ARG2 #h3 ], ... >, HCONS ], INPUT.RELS.LIST < [ LBL #h4 ], ... > ]. ;; C is large if B is ;; vp_ellipsis_if_pos_ante_onearg_gpr := vp_ellipsis_if_pos_ante_gpr & [ CONTEXT.RELS , INPUT [ RELS , HCONS ], FLAGS.SUBSUME < semarg, semarg > ]. vp_ellipsis_if_pos_ante_twoarg_comp_gpr := vp_ellipsis_if_pos_ante_gpr & vp_ellipsis_twoarg_gpr & [ CONTEXT.RELS , INPUT [ RELS , HCONS ] ]. vp_ellipsis_if_pos_ante_twoarg_gpr := vp_ellipsis_if_pos_ante_gpr & vp_ellipsis_twoarg_gpr & [ CONTEXT.RELS , INPUT [ RELS.LIST < [ ], [ PRED #pred ], ... >, HCONS ] ]. ;; VP ellipsis with iff ;; vp_ellipsis_iff_pos_gpr := basic_vp_ellipsis_gpr & [ CONTEXT [ RELS.LIST < [ LBL #h1 ], [ PRED "_if+and+only+if_x_1_rel", ARG1 #h2, ARG2 #h3 ], ... >, HCONS ], INPUT.RELS.LIST < [ LBL #h4 ], ... > ]. vp_ellipsis_iff_pos_onearg_gpr := vp_ellipsis_iff_pos_gpr & [ CONTEXT.RELS , INPUT [ RELS , HCONS ], FLAGS.SUBSUME < semarg, semarg > ]. vp_ellipsis_iff_neg_gpr := basic_vp_ellipsis_gpr & [ CONTEXT [ RELS.LIST < [ LBL #h1 ], [ PRED "_if+and+only+if_x_1_rel", ARG1 #h2, ARG2 #h3 ], [ PRED neg_rel, LBL #h7, ARG1 #h8 ], ... >, HCONS ], INPUT.RELS.LIST < [ LBL #h4 ], ... > ]. vp_ellipsis_iff_neg_onearg_gpr := vp_ellipsis_iff_neg_gpr & [ CONTEXT.RELS , INPUT [ RELS , HCONS ], FLAGS.SUBSUME < semarg, semarg > ]. vp_ellipsis_iff_pos_twoarg_comp_gpr := vp_ellipsis_iff_pos_gpr & vp_ellipsis_twoarg_gpr & [ CONTEXT.RELS , INPUT [ RELS , HCONS ] ]. vp_ellipsis_iff_pos_twoarg_gpr := vp_ellipsis_iff_pos_gpr & vp_ellipsis_twoarg_gpr & [ CONTEXT.RELS , INPUT [ RELS , HCONS ], FLAGS.EQUAL < #x1 > ]. vp_ellipsis_iff_neg_twoarg_gpr := vp_ellipsis_iff_neg_gpr & vp_ellipsis_twoarg_gpr & [ CONTEXT.RELS , INPUT [ RELS , HCONS ] ]. vp_ellipsis_coord_pos_gpr := basic_vp_ellipsis_gpr & [ CONTEXT.RELS.LIST < [ LBL handle, ARG0 #e2 ], [ PRED conj_rel, LBL handle, ARG1 #e2 & event, ARG2 #e3 & event ], ... >, INPUT.RELS.LIST < [ ARG0 #e3 ], ... > ]. ;; The [ ARG2 handle ] is a hack to prevent this rule from applying to two-args. ;; vp_ellipsis_coord_pos_onearg_gpr := vp_ellipsis_coord_pos_gpr & [ CONTEXT.RELS , INPUT [ RELS , HCONS ], FLAGS.SUBSUME < semarg, semarg > ]. basic_vp_ellipsis_coord_pos_twoarg_gpr := vp_ellipsis_coord_pos_gpr & vp_ellipsis_twoarg_gpr & [ CONTEXT [ RELS.LIST < [ ARG0.E.TENSE present, ARG1 ref-ind, ARG2 #x1 & ref-ind ], [ ], [ PRED #pred, LBL #h5, ARG0 #x1 & ref-ind ], [ PRED quant_rel, ARG0 #x1, RSTR #h4 ], ... >, HCONS ], INPUT.RELS.LIST < [ ARG0.E.TENSE present ], [ PRED #pred ], ... >, OUTPUT.HCONS ]. ;; "B is a cube, and C is" ;; 2019-06-29 - Alas, cannot exclude named_rel in the second INPUT relation ;; via reg-ex, because supertypes already need to make that value reentrant, ;; and currently we can't have both. So define specific rules for each of ;; the three predicate nouns we use. FIX someday? #| vp_ellipsis_coord_pos_twoarg_gpr := basic_vp_ellipsis_coord_pos_twoarg_gpr & [ CONTEXT.RELS , INPUT [ RELS , HCONS ] ]. |# vp_ellipsis_coord_pos_twoarg_gpr := basic_vp_ellipsis_coord_pos_twoarg_gpr & [ CONTEXT.RELS , INPUT [ RELS , HCONS ] ]. ;; "B is between C and D, and F is" vp_ellipsis_coord_pos_twoconj_gpr := basic_vp_ellipsis_coord_pos_twoarg_gpr & [ CONTEXT.RELS , INPUT [ RELS , HCONS ] ]. ;; Convert [A and [B and C]] to [[A and B] and C] rebracket_coord_gpr := monotonic_omtr & [ CONTEXT [ RELS ], INPUT [ HOOK.INDEX #index, RELS ], OUTPUT [ HOOK.INDEX #index, RELS ], FLAGS.EQUAL < #e10 > ]. ;; Drop `then' for non-coord consequent drop_cond_then_mtr := monotonic_mtr & [ CONTEXT.RELS , INPUT [ HOOK.INDEX #index, RELS , HCONS ], OUTPUT [ HOOK.INDEX #index, RELS , HCONS ], FLAGS.SUBSUME < #x6 > ]. cond_to_provided_mtr := drop_cond_then_mtr & optional_mtr & [ CONTEXT.RELS , FILTER.RELS , OUTPUT.RELS ]. ;; "(at least) one of A, B, and C" for "A or B or C" ;; one_of_set_mtr := openproof_omtr & [ CONTEXT.RELS , FILTER.RELS , INPUT [ HOOK.INDEX #index, RELS ], OUTPUT [ HOOK.INDEX #index, RELS , HCONS ] ]. one_of_set_twoarg_mtr := one_of_set_mtr & [ INPUT.RELS , OUTPUT.RELS.LIST < [ ], [ ARG2 #x1 ], ... >, FLAGS.SUBSUME < #x1 > ]. one_of_set_onearg_mtr := one_of_set_mtr & [ INPUT.RELS , FLAGS.SUBSUME < > ]. ;; "either B or C isn't" => "neither is" basic_either_neither_mtr := openproof_omtr & [ CONTEXT.RELS , INPUT [ HOOK.INDEX #index, RELS.LIST < [ PRED conj_rel, ARG0 #x2, ARG1 #x3, ARG2 #x4 ], [ PRED udef_q_rel, ARG0 #x2, RSTR #h13 ], [ PRED named_rel, ARG0 #x3, CARG #carg1 ], [ PRED quant_rel, ARG0 #x3, RSTR #h5 ], [ PRED named_rel, ARG0 #x4, CARG #carg2 ], [ PRED quant_rel, ARG0 #x4, RSTR #h6 ], [ PRED neg_rel, LBL #h10, ARG1 #h11 ], ... >, HCONS.LIST < qeq & [ HARG #h5 ], qeq & [ HARG #h6 ], qeq & [ HARG #h13 ], qeq & [ HARG #h20, LARG #h10 ], qeq & [ HARG #h11 ], ... > ], OUTPUT [ HOOK.INDEX #index, RELS , HCONS ] ]. either_neither_mtr := basic_either_neither_mtr & [ CONTEXT.RELS , INPUT [ RELS , HCONS ], OUTPUT.HCONS ]. either_neither_the_case_mtr := basic_either_neither_mtr & [ CONTEXT.RELS , INPUT [ RELS , HCONS ], OUTPUT.HCONS ]. ;; "neither of them" neither_part_of_op_mtr := openproof_omtr & [ CONTEXT.RELS , INPUT [ HOOK.INDEX #index, RELS ], OUTPUT [ HOOK.INDEX #index, RELS , HCONS ] ]. ;; "none of X" none_part_of_op_mtr := openproof_omtr & [ CONTEXT [ RELS , HCONS ], INPUT [ HOOK.INDEX #index, RELS , HCONS ], OUTPUT [ HOOK.INDEX #index, RELS , HCONS ] ]. ;; Add "both" adverb: "B and C are both cubes" ;; Note: used to block "*B and C aren't both cubes" for -(cube(a)&cube(b)) ;; both_adverb_op_mtr := openproof_omtr & [ CONTEXT.RELS , INPUT [ HOOK.INDEX #index, RELS ], OUTPUT [ HOOK.INDEX #index, RELS ], FLAGS.SUBSUME < #x1, #e3 > ]. ;; "B is a cube iff it is also large ;; Note that we need to avoid "also" with disjunctive S-coord: ;; "*B is a cube or it's also large" ;; also_adverb_op_mtr := openproof_omtr & [ CONTEXT [ RELS , HCONS ], INPUT [ HOOK.INDEX #index, RELS ], OUTPUT [ HOOK.INDEX #index, RELS ], FLAGS.SUBSUME < #x1 > ]. ;; "if P neg, then Q neg either" ;; either_adverb_op_mtr := openproof_omtr & [ CONTEXT [ RELS , HCONS ], INPUT [ HOOK.INDEX #index, RELS ], OUTPUT [ HOOK.INDEX #index, RELS ], FLAGS.SUBSUME < #e10 > ]. ;; "they" => "one of them", "both of them" ;; partitive_pron_op_mtr := monotonic_mtr & [ CONTEXT.RELS , INPUT [ HOOK.INDEX #index, RELS , HCONS ], OUTPUT [ HOOK.INDEX #index, RELS.LIST < [ PRED "prule_rel", ARG1 #index ], [ PRED part_of_rel, LBL #h5, ARG0 #x2, ARG1 #x4 ], [ PRED quant_rel, LBL handle, ARG0 #x2, RSTR #h6, BODY handle ], [ PRED pron_rel, LBL #h8, ARG0 #x4 & ref-ind & [ PNG.PN 3p ] ], [ PRED pronoun_q_rel, LBL handle, ARG0 #x4, RSTR #h7, BODY handle ], ... >, HCONS ] ]. ;; one of them ;; Make this one obligatory, to avoid paraphrasing ;; "A and B are cubes, and either A or B is large." ;; as "A and B are cubes, and they are large." ;; partitive_pron_one_op_mtr := partitive_pron_op_mtr & [ INPUT.RELS , OUTPUT.RELS , FLAGS.OPTIONAL - ]. ;; both of them ;; partitive_pron_both_op_mtr := partitive_pron_op_mtr & optional_mtr & [ CONTEXT.RELS , INPUT.RELS , OUTPUT.RELS ]. at_least_one_of_mtr := openproof_omtr & [ CONTEXT.RELS , FILTER.RELS , INPUT [ HOOK.INDEX #index, RELS , HCONS ], OUTPUT [ HOOK.INDEX #index, RELS , HCONS ] ]. ;; Add "also" with matching predicates ;; (similar in approach to VP ellipsis tests) ;; If B is a cube, C is also a cube. ;; 2019-06-30 - Removed event constraint on ARG0 of also_rel, since grammar ;; assumes it is only an "i". ;; also_adverb_common_pred_gpr := openproof_omtr & [ CONTEXT.RELS.LIST < [ PRED #pred, ARG0 event ], [ PRED #pred, LBL #h1 & handle, ARG0 #e2 & event & [ MARKS.ALSO-MARK - ], ARG1 ref-ind ], ...>, INPUT [ HOOK.INDEX #index, RELS , HCONS ], OUTPUT [ HOOK.INDEX #index, RELS ] ]. ;; If B is large, then C is also large ;; also_adverb_cond_gpr := also_adverb_common_pred_gpr & [ CONTEXT [ RELS.LIST < [ LBL #h1 ], [ LBL #h4 ], [ PRED "_if_x_then_rel", ARG1 #h2, ARG2 #h3 ], [ PRED "_then_a_1_rel", LBL #h5, ARG1 #h6 ], ... >, HCONS ] ]. also_adverb_cond_onearg_gpr := also_adverb_cond_gpr & [ FILTER.RELS , CONTEXT.RELS ]. also_adverb_twoarg_gpr := also_adverb_common_pred_gpr & [ CONTEXT.RELS.LIST < [ ], [ ], [ ], [ ], [ ARG0 #x10 & ref-ind ], [ PRED quant_rel, ARG0 #x10 ], ... >, FLAGS.SUBSUME < #x10, ... > ]. ;; If B is larger than C, then D is also larger than C" ;; also_adverb_cond_twoarg_comp_gpr := also_adverb_cond_gpr & also_adverb_twoarg_gpr & [ CONTEXT.RELS , FLAGS.SUBSUME < semarg, #x3 > ]. ;; If B is a cube, then C is also a cube ;; also_adverb_cond_twoarg_gpr := also_adverb_cond_gpr & also_adverb_twoarg_gpr & [ CONTEXT.RELS , FLAGS.SUBSUME < semarg, #x2 > ]. ;; Redefine from fundamentals.tdl ;;pos_conj_rel := conj_nopair_rel. paired_conj_gpr := openproof_omtr & [ INPUT [ HOOK.INDEX #index, RELS , HCONS ], OUTPUT [ HOOK.INDEX #index, RELS , HCONS ] ]. paired_conj_event_gpr := paired_conj_gpr & [ INPUT.RELS ]. ;; Was avoiding both S and S, which will fail to generate, but need ;; this for |both that S and that S| ;; 2019-07-02 - Let's try requiring embedding ;; #| paired_conj_event_both_gpr := paired_conj_event_gpr & [ CONTEXT.RELS , OUTPUT.RELS , FLAGS.SUBSUME < #e3, #e4 > ]. |# paired_conj_event_both_gpr := paired_conj_event_gpr & [ CONTEXT [ RELS , HCONS ], OUTPUT.RELS , FLAGS.SUBSUME < #e3, #e4 > ]. paired_conj_refind_gpr := paired_conj_gpr & [ INPUT.RELS , CONTEXT.RELS.LIST < [ PRED explicit_or_proper_q_rel, ARG0 #x2 ], ... > ]. paired_conj_refind_or_gpr := paired_conj_refind_gpr & [ INPUT.RELS , CONTEXT.RELS , OUTPUT.RELS ]. ;; Avoid applying in two cases, for efficiency: ;; (1) if the and-coord phrase is the subject of a verb modified by "both" ;; (2) if the and-coord phrase is the object of "between" ;; This is awkward since we have to enumerate the roles that the coord phrase ;; can occupy: ARG1, ARG2, ARG1, ARG2 ;; Puzzle - For some reason, cannot have the following constraint: ;; INPUT.RELS , ;; FLAGS.SUBSUME < #x1, ... > ;; even though it would help avoid wrong application of the ...refind_arg2 ;; variant to |cube(b)&cube(d)| ;; When imposed, it blocks application of the ...refind_arg2 rule to ;; |rightof(b,c)&rightof(b,d)| ;; to give |...to the right of both B and D| ;; paired_conj_refind_and_gpr := paired_conj_refind_gpr & [ INPUT.RELS , CONTEXT.RELS , OUTPUT.RELS , FLAGS.SUBSUME < #e3 > ]. paired_conj_finsbj_gpr := paired_conj_refind_and_gpr & [ INPUT.RELS , FILTER.RELS , CONTEXT.RELS , FLAGS.EQUAL < #h4 > ]. paired_conj_nonfin_arg1_gpr := paired_conj_refind_and_gpr & [ INPUT.RELS , CONTEXT.RELS ]. paired_conj_refind_arg2_gpr := paired_conj_refind_and_gpr & [ INPUT.RELS , FILTER.RELS , CONTEXT.RELS ]. ;; These two may not be needed: for |either both A and B or both C and D| ;; paired_conj_refind_lind_gpr := paired_conj_refind_and_gpr & [ INPUT.RELS , CONTEXT.RELS ]. paired_conj_refind_rind_gpr := paired_conj_refind_and_gpr & [ INPUT.RELS , CONTEXT.RELS ]. #| ;; Wrap "it is the case that" around conjoined Ss, to enable reduction in ;; ambiguity ;; basic_conj_s_thecase_gpr := openproof_mtr & [ INPUT.RELS , OUTPUT [ HOOK.INDEX #index, RELS.LIST < [ PRED "prule_rel", ARG1 #index ], [ PRED "_thecasethat_v_rel", ARG0 non_conj_event & #e5 & [ E [ ASPECT.PRF -, TENSE present ], SF prop ], ARG1 #arg ], ... >, HCONS.LIST < qeq & [ HARG #arg, LARG #clbl ], ... > ], FLAGS.SUBSUME < #e1, #e5 > ]. ;; The conj-S is outermost, so change INDEX on output: the point of introducing ;; this new predication is to replace a conj_event index with a non_conj one, ;; so we can generate from [[B and C] or [D and E]] while blocking overt ;; conjunction in left member of [S conj S]. ;; Block if conj-S is argument of neg_rel, since dealt with separately via ;; "it is not the case that ..." ;; conj_s_thecase_top_gpr := basic_conj_s_thecase_gpr & [ FILTER [ RELS , HCONS ], CONTEXT.RELS , INPUT [ HOOK.INDEX #e1, RELS , HCONS ], OUTPUT [ HOOK.INDEX #e2 & [ E [ ASPECT [ PRF - ], TENSE present ], SF prop ], RELS , HCONS ] ]. ;; The conj-S is not outermost, and so must (in our simple universe) be an ;; argument of a conjunction, left or right, since we already forced this ;; conversion during inflation if the conjunction is the consequent of a ;; conditional or the argument of a bi-conditional. ;; DPF 2015-07-25 - Restrict input to conj_paired_rel, since thecase_v requires ;; paired complement. Also make obligatory, since we now require is+the+case ;; wrapper for conjoined Ss. ;; conj_s_thecase_nontop_conjarg_gpr := basic_conj_s_thecase_gpr & [ INPUT [ HOOK.INDEX #e2, RELS , HCONS ], OUTPUT [ HOOK.INDEX #e2, RELS , HCONS ] ]. ;; Also reverse the order of the top-level conjuncts, to avoid remaining ambig ;; in |iitc that B and C or D| conj_s_thecase_nontop_cleft_gpr := conj_s_thecase_nontop_conjarg_gpr & [ INPUT.RELS , OUTPUT.RELS ]. conj_s_thecase_nontop_cright_gpr := conj_s_thecase_nontop_conjarg_gpr & [ INPUT.RELS , OUTPUT.RELS ]. |# conj_s_thecase_nontop_cleft_gpr := openproof_mtr & [ INPUT [ HOOK.INDEX #index, RELS , HCONS ], OUTPUT [ HOOK.INDEX #index, RELS , HCONS ], FLAGS.SUBSUME < #e1, #e5 > ]. ;; Reverse the order of two nonconjoined clauses: |P and Q| => |Q and P| ;; basic_conj_s_reverse_gpr := monotonic_mtr & [ CONTEXT.HCONS , INPUT [ HOOK.INDEX #index, RELS ], OUTPUT [ HOOK.INDEX #index, RELS ] ]. ;; Make this reversal optional as long as the left conjunct is not negated, ;; to avoid ambiguity for |not P and Q| conj_s_reverse_gpr := basic_conj_s_reverse_gpr & openproof_omtr & [ FILTER.RELS , CONTEXT.HCONS ]. ;; Make the reversal obligatory if the left conjunct is negated, ;; so that we change |not P and Q| to |Q and not P| ;; The reversal is only necessary if the negation is expressed as ;; |it is not the case that P and Q|, but currently we give this phrasal ;; negation the same semantics as "not". Consider FIX with a separate ;; paraphrase rule for "it is not the case that", and then only trigger ;; this obligatory reversal for the phrasal neg. ;; conj_s_reverse_neg_gpr := basic_conj_s_reverse_gpr & [ FILTER.RELS , CONTEXT [ RELS , HCONS ], OUTPUT [ HOOK.INDEX #index, RELS.LIST.FIRST [ PRED "prule_rel", ARG1 #index ] ], FLAGS [ EQUAL < #h1 >, OPTIONAL - ] ].