For RR purposes I'll only need to add constraints of the type "=" or "=c" However, the TrRule needs to be able to read in the rule constraints as they are in the original grammar (==, = *NOT*, = *OR*, etc.), so having a well structured and organized Constraint class would probably be very useful, even though it might be an overkill... think about this carefully... and email Erik with the specs for a constraint class to make sure I didn't forget anything! Things I will want to do with constraints (a small subset of possible constraint manipulations): [!!!look at all the documentation to make sure] - Add a value constraint for a specific index on the Y-side - Add an agreement constraint for two specific indices on the Y-side - Modify indices of all the constraints affecting one index on the Y-side (for example if a constituent is added or deleted, or moved to a different position, change original index Yi into final index Yj) In theory, also (not sure I'll get to that in practice): - Delete a value constraint for a specific Y index - Delete an agreement constraint for two specific Y indices think about the advantage of treating constraints to delete as strings vs highly structured objects... I don't think I'll need to do anything with XY constraints, except for changing the Y-side index. General Constraint class: 3 categories: 1 = parsing (X-side) 3 = transfer (XY constraints) 4 = generation (Yx-side) Have them all indexed by X-side index and Y-side index, if an agreement constraint. allow different equal operations: =, =c, == FeatureName (might be empty (what K calls "all") when just unifying whole constituents) ValName (might be empty for an agreement constraint) But maybe I could do with a more specific Constraint class: - only index constraints by Y-side index, which is the only thing that might change and that I will need to extract - will need to add a method to access all the constraints between any two indices: // vector<&Constraint*> GetConstraintSet(int Ypos1, int Ypos2); // implement a method that given two indexes, it checks all // the constraints between them, so that if I want to add a cosntraint // between y1 and y2, say, first I make sure such constraint does not exist // for that it would probably be useful to have a matrix // vector>> // pos1 pos2 set of constraints - look at how Constraint is implemented so that I can see if it also forsees =c and NOT, OR constraints Here is the Constraint class data members I think I'll need: int ConstraintType; int EquationType; int FeatureType; ValueTupe Value; int Pos1; // redundant since I want to store them according to the 2 indices int Pos2; where ConstraintType = {agr, value} FeatureType = {tense, ender, feat_1, feat_2...} // problem: this is an infinite list... // these depend on the Featuretype ValueType = {sg, pl, masc, fem, past, +, -...} // but also *NOT* and *OR*, not sure how to encode that... EquationType = { =, =c, ...?}