Implemented g-rule and g-combine.