;;; Hey, emacs(1), this is -*- Mode: TDL; Package: LKB; -*- got it? ;; ;; ;;; first shot of minimal type hierarchy for transfer rules in LOGON; derived ;; from LinGO Grammar Matrix, but greatly stripped down. (7-oct-03; oe) ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; ; updates from oe's mrs.tdl. ; d.b. ; 29-jan-04 ; ; the SCRATCH attribute introduced 05-03 not put to use yet ; db ; as of 11-03 integrated /ntnu/noen/ and /uio/noen ; the version ; made avaible in the LOGONROOT ; db ; files are now cascaded, following the /ntnu/noen/script (11-03 db) ; ;;;;;;;;;;;;;;;;;;;, ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; mrs := top & [ LTOP h, INDEX u, RELS list, HCONS list ]. psoa := mrs & [ INDEX e ]. nom-obj := mrs & [ INDEX x ]. message := relation & [ MARG h, TPC i ]. qeq := top & [ HARG h, LARG h ]. ;;; ;;; minimal hierarchy of variable types, using the new (R)MRS naming scheme. ;;; ;;; taken from /uio/noen ;;; the effect of scratch - not clear, DITCH nice to have ;;; integrate in the new rule cycle for second phase -- (11-03) db ;;; ;;; introduce two transfer-only `scratch' slots in variables: one that will be ;;; purged after each successful rule application, one that will stick until we ;;; leave transfer. additionally, provide DITCH property to mark variables we ;;; want to loose in the final output (e.g. to ditch the ARG0 from conjunctions ;;; while the ERG uses C-ARG instead). ;;; u := top & [ SCRATCH scratch, MARK scratch, DITCH bool ]. h := u. a := u. i := u. e := i & [ TENSE tense, PERF luk, PROG luk, BOUNDED luk]. x := i & [ PERS person, NUM number, NATGEND gender ]. ;;; ;;; it is not clear if u has to be a, but ;;; to check for `arity' in MTRs, maybe we need an `anti-'variable type ;;; ;; sort types for index properties tense := top. past := tense. non-past := tense. pres := non-past. fut := non-past. untensed := tense. no_tense := tense. notense := tense. nontense := tense. luk := top. bool := luk. na := luk. + := bool. - := bool. person := top. 1 := person. 2 := person. 3 := person. number := top. sg := number. pl := number. gender := top. m := gender. f := gender. n := gender. ;;; ;;; the scratch slot in variables: used during transfer to control application ;;; of rules, e.g. the rules that introduce selected preposition EPs in the ERG ;;; accomodation phase which would otherwise be cyclic, i.e. the rule would ;;; fire on its own output (since it does not consume anything). ;;; scratch := top. test := scratch. complete := scratch. one := scratch. two := scratch. three := scratch. four := scratch. fixe := scratch. six := scratch. ;;; ;;; _fix_me_ ;;; in `abrams saw the chair in berlin', the ERG uses `untensed' the PP event ;;; when attaching inside of the NP, but `no_tense' when attaching to the VP. ;;; check with ERG documentation or dan to see whether this is intended. also, ;;; is there a hierarchical relation between the two? (28-jan-04; oe) ;;; e_untensed := e & [ TENSE untensed ]. e_no_tense := e & [ TENSE no_tense ]. e_nontense := e & [ TENSE nontense ]. ;;; ;;; relations are classified according to the types of arguments they take. ;;; all relations have a hande. In addition, quantifier relations have a ;;; bound variable and a restriction, nominal relations have an instance, and ;;; event relations have an event. furthermore, nominal relations and event ;;; relations can have additional roles, depending on their meaning. ;;; relation := top & [ LBL h, PRED top ]. cond-relation := relation & [ MAIN h, SUBORD h ]. arg0-relation := relation & [ ARG0 i ]. ;;; the hierarchy of basic-relational types is somewhat different ;;; from the one assumed in the /uio/noen basic-arg1-relation := relation & [ ARG1 u ]. basic-arg2-relation := relation & [ARG2 u ]. basic-arg3-relation := relation & [ARG3 u]. basic-arg4-relation := relation & [ARG4 u]. basic-arg12-relation := basic-arg1-relation & basic-arg2-relation. degree-arg0-relation := arg0-relation & [ DARG u ]. arg01-relation := arg0-relation & basic-arg1-relation. arg012-relation := arg01-relation & basic-arg2-relation. arg0123-relation := arg012-relation & basic-arg3-relation. argO1234-relation := arg0123-relation & basic-arg4-relation. event-relation := arg0-relation & [ ARG0 e ]. noun-relation := arg0-relation & [ ARG0 x ]. named-relation := noun-relation & [ CARG string ]. norgram-card_rel := named-relation & basic-arg1-relation. dofw-relation := named-relation & basic-arg1-relation. part-conjunction-relation := relation & [ L-INDEX i, R-INDEX i ]. basic-conjunction-relation := part-conjunction-relation & [ C-ARG i ]. and_c_relation := part-conjunction-relation & arg0-relation & [ L-HNDL u, R-HNDL u ]. norgram-and-relation := part-conjunction-relation & arg0-relation. 2te-norgram-and-relation := part-conjunction-relation & arg01-relation. and_relation := basic-conjunction-relation. unspec-compound-relation := arg012-relation & [ ARG0 e, ARG1 x, ARG2 x ]. quant-relation := arg0-relation & [ ARG0 x, RSTR h, BODY h ]. ;;; ;;; relation types specific to the ERG ;;; predsort := top. message_m_rel := predsort. imp_m_rel := message_m_rel. prop_ques_m_rel := message_m_rel. prpstn_or_like_m_rel := message_m_rel. propositional_m_rel := prop_ques_m_rel & prpstn_or_like_m_rel. prpstn_m_rel := propositional_m_rel. abstr_int_m_rel := prop_ques_m_rel. _time_n_rel := predsort. int_m_rel := abstr_int_m_rel. ne_m_rel := abstr_int_m_rel. appos_rel := predsort. which_q_rel := predsort. _towards_p_rel := predsort. compound_rel := predsort. _to_p_sel_rel := arg012-relation. part_of_rel := arg01-relation. proper_q_rel := quant-relation. thing_rel := predsort. _the_q_rel := predsort. _then_p_temp_rel := predsort. named_rel := predsort. neg_rel := predsort. yofc_rel := predsort. def_q_rel := predsort. gerund_rel := predsort. free_relative_ever_q_rel := predsort. unspec_loc_rel := predsort. _a_q_rel := predsort. _on_p_rel := quant-relation. _could_v_rel := predsort. _every_q_rel := predsort. pronoun_q_rel := predsort. poss_rel := predsort. _by_p_rel := predsort. _through_p_rel := predsort. udef_q_rel := quant-relation. _many_q_rel := quant-relation. pron_rel := arg0-relation. generic_nonpro_rel := arg0-relation. pro_poss_rel := arg012-relation. def_explicit_q_rel := predsort. _that_q_dem_rel := predsort. generic_nom_rel := arg0-relation. bare_div_q_rel := quant-relation. bare_rel := predsort. _morning_n_rel := arg0-relation. compound_name_rel := predsort. _some_q_rel := predsort. unspec_rel := predsort. _this_q_dem_rel := predsort. season_rel := predsort. _night_n_def_rel := predsort. dofw_rel := predsort. _may_v_rel := predsort. _place_n_rel := predsort. _on_p_temp_rel := predsort. conj_rel := basic-conjunction-relation. _and_c_rel := predsort. _or_c_rel := predsort. _about_p_sel_rel := predsort. _should_v_rel := predsort. _with_p_sel_rel := arg012-relation. _must_v_rel := predsort. _in_p_rel := predsort. _of_p_rel := predsort. _can_v_rel := predsort. _be_v_id_rel := predsort. _these_q_dem_rel := predsort. _with_p_rel := predsort. superl_rel := arg01-relation. _as_p_rel := predsort. _around_p_rel := predsort. _back_p_rel := predsort. _for_p_rel := predsort. _from_p_rel := predsort. _to_p_rel := predsort. _since_p_rel := predsort. _along_p_rel := arg012-relation. _of_p_sel_rel := arg012-relation. generic_nopro_rel := arg0-relation. _be_v_there_rel := arg01-relation. ;;; ;;; some basic types ;;; list := top. cons := list & [ FIRST top, REST list ]. null := list. string := top. flags := top & [OPTIONAL luk ]. ;;; basic transfer rules mrs_transfer_rule := top & [ FILTER mrs, CONTEXT mrs, INPUT mrs, OUTPUT mrs, FLAGS flags ]. monotonic_mtr := mrs_transfer_rule & [ CONTEXT.LTOP #h, INPUT.LTOP #h, OUTPUT.LTOP #h ]. monotonic_omtr := monotonic_mtr & optional_mtr. optional_mtr := mrs_transfer_rule & [ FLAGS.OPTIONAL + ]. quantifier_mtr := monotonic_mtr & [ INPUT.RELS < [ LBL #h1, ARG0 #x1, RSTR #h2, BODY #h3 ] >, OUTPUT.RELS < [ LBL #h1, ARG0 #x1, RSTR #h2, BODY #h3 ] > ]. quantifier_omtr := quantifier_mtr & optional_mtr. noun_mtr := monotonic_mtr & [ INPUT.RELS < [ LBL #h1, ARG0 #x1 ] >, OUTPUT.RELS < [ LBL #h1, ARG0 #x1 ] > ]. noun_omtr := noun_mtr & optional_mtr. noun-arg1_mtr := noun_mtr & [ INPUT.RELS < [ ARG1 #x1 ]>, OUTPUT.RELS < [ ARG1 #x1]> ]. noun-arg1_omtr := noun-arg1_mtr & optional_mtr. proper_noun_mtr := noun_mtr & [ INPUT.RELS < [ PRED "named_rel" ] >, OUTPUT.RELS < [ PRED named_rel] > ]. proper_np_mtr := monotonic_mtr & [ CONTEXT.HCONS < qeq & [ HARG #h4, LARG #h1 ] >, INPUT.RELS < [ PRED "named_rel", LBL #h1, ARG0 #x2 ], [ PRED "proper_q_rel", LBL #h3, ARG0 #x2, RSTR #h4, BODY #h5 ]>, OUTPUT.RELS < [ PRED named_rel, LBL #h1, ARG0 #x2 ], [ PRED proper_q_rel, LBL #h3, ARG0 #x2, RSTR #h4, BODY #h5 ] > ]. #| dofw_mtr := monotonic_mtr & [ CONTEXT.HCONS < qeq & [ HARG #h4, LARG #h1 ] >, INPUT.RELS < [ PRED "named_rel", LBL #h1, ARG0 #x2 ], [ PRED "proper_q_rel", LBL #h3, ARG0 #x2, RSTR #h4, BODY #h5 ]>, OUTPUT.RELS < [ PRED named_rel, LBL #h1, ARG0 #x2 ], [ PRED proper_q_rel, LBL #h3, ARG0 #x2, RSTR #h4, BODY #h5 ] > ]. |# ;;; message types ;;; predating expected changes from norgram prpstn_mtr := monotonic_mtr & [ INPUT.RELS < [ LBL #h1, MARG #h2, TPC #u1] >, OUTPUT.RELS < [ LBL #h1, MARG #h2, TPC #u1 ] > ]. event_mtr:= monotonic_mtr & [ INPUT.RELS < [ LBL #h1, ARG0 #e1 ] >, OUTPUT.RELS < [ LBL #h1, ARG0 #e1 ] > ]. 3_noun_compound_mtr := monotonic_mtr & [ INPUT.RELS < [ LBL #h1, ARG0 #x1, PRED "named_rel", CARG "Bergensområdet" ] >, OUTPUT.RELS < [ LBL #h1, ARG0 #x1, PRED "_area_n_rel"], arg0-relation & [ LBL #h1, PRED named_rel, ARG0 #x2, CARG "bergen"], proper_q_rel & [ARG0 #x2, RSTR #h2, PRED proper_q_rel], unspec-compound-relation & [ PRED unspec_rel, ARG1 #x1, ARG2 #x2]>, OUTPUT.HCONS < [ HARG #h2, LARG #h1] >]. 4_noun_compound_mtr := monotonic_mtr & [ INPUT.RELS < [ LBL #h1, ARG0 #x1, PRED "_tungmetall_n_rel" ] >, OUTPUT.RELS < [ LBL #h1, ARG0 #x1, PRED "_metal_n_rel"], arg01-relation & [ LBL #h1, PRED "_heavy_j_rel", ARG0 e, ARG1 #x1], udef_q_rel & [ PRED udef_q_rel, ARG0 #x1, RSTR #h2]>, OUTPUT.HCONS < [ HARG #h2, LARG #h1] >]. noun-add-arg_mtr := monotonic_mtr & [ INPUT.RELS < [ LBL #h1, ARG0 #1 ] >, OUTPUT.RELS < [ LBL #h1, ARG0 #1, ARG1 u ] > ]. conditional_mtr := monotonic_mtr & [ INPUT.RELS < [ LBL #h, MAIN #h1, SUBORD #h2 ] >, OUTPUT.RELS <[ LBL #h, MAIN #h1, SUBORD #h2 ] > ]. arg1_mtr := monotonic_mtr & [ INPUT.RELS < [ LBL #h1, ARG1 #h ] >, OUTPUT.RELS < [ LBL #h1, ARG1 #h ] > ]. expl_v_mtr := monotonic_mtr & [ INPUT.RELS < [ LBL #h1, ARG0 #e1 ] >, OUTPUT.RELS < [ LBL #h1, ARG0 #e1 ] > ]. arg0_mtr := monotonic_mtr & [ INPUT.RELS < [ LBL #h1, ARG0 #x1 ] >, OUTPUT.RELS < [ LBL #h1, ARG0 #x1 ] > ]. arg01_v_mtr := monotonic_mtr & [ INPUT.RELS < [ LBL #h1, ARG0 #e1, ARG1 #x1 ] >, OUTPUT.RELS < [ LBL #h1, ARG0 #e1, ARG1 #x1 ] > ]. ;;; this type might also soon be redundant --db arg012_refl_mtr := monotonic_mtr & [ INPUT.RELS < [LBL #h, ARG0 #e, ARG1 #1, ARG2 #1 ]>, OUTPUT.RELS < [ LBL #h, ARG0 #e, ARG1 #1, ARG2 #3 ], [PRED pronoun_q_rel, ARG0 #3,RSTR #2], [PRED pron_rel, ARG0 #3, LBL #4] >, OUTPUT.HCONS < [ HARG #2, LARG #4] >]. arg012_v_mtr := monotonic_mtr & [ INPUT.RELS < [ LBL #h1, ARG0 #e1, ARG1 #x1, ARG2 #x2 ] >, OUTPUT.RELS < [ LBL #h1, ARG0 #e1, ARG1 #x1, ARG2 #x2 ] > ]. arg012-add_v_mtr := monotonic_mtr & [ INPUT.RELS < [ LBL #h1, ARG0 #e1, ARG1 #x1, ARG2 #x2 ] >, OUTPUT.RELS < [ LBL #h1, ARG0 #e1, ARG1 #x1, ARG2 #x2, ARG3 u ] > ]. passive-arg012+quant_v_mtr := monotonic_mtr & [ INPUT.RELS < [ LBL #h1, ARG0 #e1, ARG1 u, ARG2 #x2 ] >, OUTPUT.RELS < [ LBL #h1, ARG0 #e1, ARG1 #x1 , ARG2 #x2 ], [PRED pronoun_q_rel, ARG0 #x1,RSTR #2], [PRED pron_rel, ARG0 #x1, LBL #4] >, OUTPUT.HCONS < [ HARG #2, LARG #4] > ]. passive-arg012_v_mtr := monotonic_mtr & [ INPUT.RELS < [ LBL #h1, ARG0 #e1, ARG1 # u, ARG2 #x2 ] >, OUTPUT.RELS < [ LBL #h1, ARG0 #e1, ARG1 #u , ARG2 #x2, ARG3 u ]> ]. arg0123_v_mtr := monotonic_mtr & [ INPUT.RELS < [ LBL #h1, ARG0 #e1, ARG1 #x1, ARG2 #x2, ARG3 #x3 ] >, OUTPUT.RELS < [ LBL #h1, ARG0 #e1, ARG1 #x1, ARG2 #x2, ARG3 #x3 ] > ]. mixed-up-passive-arg0123_v_mtr := monotonic_mtr & [ INPUT.RELS < [ LBL #h1, ARG0 #e1, ARG1 u & #u1, ARG2 #x2, ARG3 #x3 ] >, OUTPUT.RELS < [ LBL #h1, ARG0 #e1, ARG1 u & #u1, ARG2 #x3, ARG3 #x2 ] > ]. arg12_mtr := monotonic_mtr & [ INPUT.RELS < [ LBL #h1, ARG1 #x1, ARG2 #x2 ] >, OUTPUT.RELS < [ LBL #h1, ARG1 #x1, ARG2 #x2 ] > ]. arg01234_v_mtr := monotonic_mtr & [ INPUT.RELS < [ LBL #h1, ARG0 #e1, ARG1 #x1, ARG2 #x2, ARG3 #x3, ARG4 #x4 ] >, OUTPUT.RELS < [ LBL #h1, ARG0 #e1, ARG1 #x1, ARG2 #x2, ARG3 #x3, ARG4 #x4 ] > ]. arg01_v_omtr := arg01_v_mtr & optional_mtr. arg012_v_omtr := arg012_v_mtr & optional_mtr. arg0123_v_omtr := arg0123_v_mtr & optional_mtr. arg01234_v_omtr := arg01234_v_mtr & optional_mtr. ;;; adjectives adjective_mtr := monotonic_mtr & [ INPUT.RELS < [ LBL #h1, ARG0 #e2, ARG1 #u3 ] >, OUTPUT.RELS < [ LBL #h1, ARG0 #e2, ARG1 #u3 ] > ]. ;;; adverbs and prepositions adverb_mtr := monotonic_mtr & [ INPUT.RELS < [ LBL #h1, ARG1 #u2 ] >, OUTPUT.RELS < [ LBL #h1, ARG1 #u2 ] > ]. adverb_omtr := adverb_mtr & optional_mtr. ; PREPOSITION RELATIONS ;;; this reflects stages of preposition relations ;;; no further change at this point - consolidation necessary preposition_mtr := monotonic_mtr & [ INPUT.RELS < [ LBL #h1, ARG0 e & #e1, ARG1 #u2, ARG2 #u3 ] >, OUTPUT.RELS < [ LBL #h1, ARG0 #e1, ARG1 #u2, ARG2 #u3 ] > ]. ;;; _fix_me : this is not a possible way to reenter a prepositions ;;; ARG1 with the main index preposition-add-arg_mtr := monotonic_mtr & [ CONTEXT.INDEX #e2, INPUT.RELS < [ LBL #h1, ARG0 e & #e1, ARG2 #u3 ] >, OUTPUT.RELS < [ LBL #h1, ARG0 #e1, ARG1 e & #e2, ARG2 #u3 ] > ]. preposition_omtr := preposition_mtr & optional_mtr. ;;; for the old norgram set-up #| coordination_mtr := monotonic_mtr & [ INPUT.RELS < 2te-norgram-and-relation & [ LBL #h1,ARG0 #x3, ARG1 [ DITCH +], L-INDEX #x2, R-INDEX #x1 ] >, OUTPUT.RELS < and_c_relation & [ LBL #h1, C-ARG #x3, L-HNDL u, R-HNDL u, L-INDEX #x2, R-INDEX #x1 ] > ]. |# ;;; the ideal state conjunction_mtr := monotonic_mtr & [ INPUT.RELS , OUTPUT.RELS < and_c_relation & [ LBL #h1, ARG0 #x1, L-HNDL #h ,L-INDEX #i3, R-HNDL #h2 ,R-INDEX #i5 ] > ]. degree_mtr := monotonic_mtr & [INPUT.RELS < [ LBL #h1, ARG0 #e1, DARG #u1 ] >, OUTPUT.RELS < [ LBL #h1, ARG0 #e1, DARG #u1 ] > ]. ;;;munging ;;; _fix_me: a rule that munges an incoming relation ;;; without that we specify the OUTPUT.RELS diff-list ;;; as empty leads to WARNINGS under grammar reload--db elision_mtr := monotonic_mtr & [ INPUT.RELS < relation > ]. erase_mtr := monotonic_mtr & [ INPUT.RELS < [ PRED string ] >, OUTPUT.RELS < > ]. 2-erase_mtr := monotonic_mtr & [ INPUT.RELS < relation, relation >, OUTPUT.RELS < >]. compound-to-noun_mtr := monotonic_mtr & [ INPUT.RELS < [ LBL #lbl, ARG0 #x1 ], [ LBL #lbl3,ARG0 #x4 ] , [LBL #lbl3, ARG0 e, ARG1 #x4, ARG2 #x1], [ARG0 #x1, RSTR #h4] >, INPUT.HCONS < [ HARG #h4, LARG #lbl] >, OUTPUT.RELS < [ LBL #lbl3, ARG0 #x4 ] > ]. compound-to-of_mtr := monotonic_mtr & [ INPUT.RELS < arg0-relation &[ LBL #h0, ARG0 #x1], arg0-relation & [ LBL #h1, ARG0 #x2 ], arg012-relation & [ LBL #h0, ARG2 #x2, ARG1 #x1] >, OUTPUT.RELS < arg012-relation & [ARG2 #x1, LBL #h2], arg01-relation & [ LBL #h0,ARG0 #x1, ARG1 #x2, LBL #h2],[LBL #h1,ARG0 #x2 ] >]. adj-noun-compound-to-nom-phrase_mtr := monotonic_mtr & [ INPUT.RELS < [ LBL #h1, ARG0 #x1 ] >, OUTPUT.RELS < [ LBL #h1, ARG0 e, ARG1 #x1 ], [LBL #h1, ARG0 #x1] > ]. quantifier_adj_mtr := monotonic_mtr & [ CONTEXT.HCONS < qeq & [ HARG #h1, LARG #h2] >, INPUT.RELS < [ LBL #h3, ARG0 #x2, RSTR #h1, BODY #h4 ] >, OUTPUT.RELS < [ LBL #h3, ARG0 #x2, RSTR #h1, BODY #h4 ], [ LBL #h2, ARG0 e_no_tense, ARG1 #x2] > ]. erase_omtr := erase_mtr & optional_mtr. ;;; ;;; a few `special-purpose' types, transfer operators in a sense ;;; +upcase+ := string. +downcase+ := string. operator := top. +copy+ := operator. +equal+ := operator. +subsume+ := operator.