Getting a rule to inherit from correct types in

I’m working on adding the outlines of my lexical rules in, and so far, I’ve pretty closely shadowing what the evidential and valence change libraries did. They each have write_x_behavior() functions defined at the end of, which write several rules which interact with what already outputs.

So to take the evidential iibrary as an example, the write_evidential_behavior() function adds this type automatically any time an evidential strategy is defined:

evidential-lex-rule := cont-change-only-lex-rule & same-spr-lex-rule & same-spec-lex-rule &
[ C-CONT [ RELS <! event-relation &
[ LBL #ltop,
ARG0 event,
ARG1 #harg ] !>,
HCONS <! qeq &
[ HARG #harg,
LARG #larg ] !>,
HOOK [ LTOP #ltop,
INDEX #mainev,
XARG #mainagent ] ],
XARG #mainagent,
INDEX #mainev ] ].

Then, given choices file that defines a lexical rule that carries the firsthand feature, it outputs this rule:

firsthand-evidential-lex-rule := evidential-lex-rule &
[ C-CONT.RELS <! [ PRED "ev_firsthand_rel" ] !> ].

These then have to interact with the rules already being output by So, given a position class called ‘evid,’ outputs a supertype that keeps track of INFLECTED values:

evid-lex-rule-super := cont-change-only-lex-rule &
[ INFLECTED #infl,
DTR evid-rule-dtr &
[ INFLECTED #infl ] ].

And then here’s where they link up: given a lexical rule type called “1st-hand” that carries the above mentioned feature firsthand, the following type is output:

1st-hand-lex-rule := evid-lex-rule-super & firsthand-evidential-lex-rule & infl-lex-rule.

So, since this rule inherits from both evid-lex-rule-super – the rule that deals with the FLAG behavior necessary to make position classes work – and the type 'firsthand-evidential-lex-rule` – which has the necessary semantics – this rule has both the correct semantics and the correct morphotactics.

The part I can’t figure out is how Mike got this last rule to inherit from the firsthand-evidential-lex-rule that he defined in write_evidential_behavior(). This is hopefully a very simple question to those of you who understand the guts of thoroughly – I’m still vague on a lot of the specifics which is making this really confusing :slight_smile:

Without stepping through the code with the debugger, it is hard to say, but I would guess that this line is responsible:

if lrt.evidential:
    lrt.supertypes.add(lrt.evidential + '-evidential-lex-rule')

I would assume that in some cases, the value of lrt.evidential can be “firsthand”.

That was it! Thanks, Olga!