verivital / hyst

HyST: A Source Transformation and Translation Tool for Hybrid Automaton Models
http://verivital.com/hyst/
Other
15 stars 18 forks source link

long names in flattened model #28

Open stanleybak opened 8 years ago

stanleybak commented 8 years ago

When flattening and merging with a single-mode automaton, it shouldn't be necessary to add its name to the resultant mode. This will result in shorter names:

The general logic for chosing a name (in mergeLocations() of FlattenAutomatonPass.java) should be:

if (right.modes.size() == 1)
    combinedName = locI.name;
else if (left.modes.size() == 1)
    combinedName = locJ.name;
else
    combinedName = locI.name + SEPARATOR + locJ.name;

The transitions and initial / forbidden states should also be adjusted, and likely unit tests will need to be updated to expect this.