[Victory] Rules (MaxCount 0) also have active apply match option
Ayurshi opened this issue · 7 comments
Rules which have been set to max count:0 also appear in Victory and have active “Apply Match” options which should not be the case.
Only the rules which have maxCount>0 should have active apply match option.
This bug can be noticed in the following scenario:
2 rules have max count=1
an axiom rule followed by 1 of the rules that can be applied next
Rule 1: Axiom rule has active apply match button
once the match is applied all rules(say 10 rules) following this rule appear in the left panel with active “Apply Match”
Expected behavior: after 1st axiom rule is applied only 1 rule (which is set to maxCount: 1 ) should appear next with active apply match.
If possible, it would be nice to somehow indicate in the UI that a rule is now blocked. This is a difference to there being no matches, and there being matches but the rule is blocked due to the StopCriterion.
putting this issue in a more generic manner the following behavior is seen: if MAXCount=x for a rule, the rule's (single _GEN) apply match can be actively applied x+1 times.
Except an exception when the axiom rule itself has MAXCount=0.
Also as @anthonyanjorin mentioned it would be nice if blocked matches by StopCriterion(are shown with "inactive apply match" probably differentiable by red colored _GEN) and active applicable matches(with active "apply match" green colored _GEN ) are used.
The original issue, displaying the match one time more than allowed in the UI is done now. Before, the stop criterion was only checked after choosing the match, so after choosing to apply the match it was discarded instead of applied. Now instead it is removed before asking to choose a match.
This is the branch where you will find the changes made. https://github.com/eMoflon/emoflon-ibex/tree/victory-monitor_issue_144 Please review this. And we are working on the matches that are blocked by the stop criterion should be displayed but the Apply Match button should be disabled.
As @anthonyanjorin mentioned to somehow indicate in the UI that a rule is now blocked and disabling the Apply Match button for the matches that are blocked by the stop criterion is also done. After the changes it looks like this and working properly.
The changes made to code are in these branches victory_ui_issue_144 and victory-monitor_issue_144 .
@LegionaryCohort and @Ayurshi Please test it and if everything is working as expected, @LegionaryCohort please merge it to the main branches.
Since you started working on this issue before the switch to the TreeViewer widget, the UI code will need to be adapted a little to work with the new widget.
Shouldn't be any problem though since the new structure is designed to accomodate these kinds of changes easily.
The changes made to handle this issue have now finally been adapted and merged into the stable branch.