Vispatch Tutorial (using Java 1.02) > TOC > The Vispatch Visual Language > Heads of Rules > Maximum Match

Maximum Match

When more than one rule matches, the one that has the most figures in its head is chosen. This explains why the rule with the red X (on this and the previous page) is only executed if no other rule matches, since the other rules involve more figures.

If two rules that have the same number of figures in their heads both match, one rule is arbitrarily chosen. Try performing mouse drags in the applet below and try to guess which which rule will execute. You can tell which rule executed by the text that it puts at the end of your mouse drag.

 
Notice that some corners of the star match 2 lines and some match 5 lines. This is a bug in Vispatch that will be fixed soon. Every corner of the star should match 5 lines.