saeaadl / emv2

AADL Error Model V2 annex language
0 stars 0 forks source link

Mode mappings without types, but with a typed state #87

Open joeseibel opened 2 years ago

joeseibel commented 2 years ago

If an error state to mode mapping refers to a typed state, but does not specify a type, should that be legal? Consider the following example:

package StandardIssue
public
  system s
    modes
      m1: initial mode;
      m2: mode;
    annex EMV2 {**
      use behavior StandardIssue::machine1;

      component error behavior
        mode mappings
          state2 in modes (m1, m2);
      end component;
    **};
  end s;

  annex EMV2 {**
    error behavior machine1
      use types ErrorLibrary;
        states
          state1: initial state;
          state2: state {CommonErrors};
    end behavior;
  **};
end StandardIssue;

The grammar rule error_state_to_mode_mapping specifies that a mode mapping may refer to a single type, but not a type set. Therefore, it would make sense to me to add a legality rule stating that if a mode mapping refers to a typed state, then a type token must be specified.

joeseibel commented 2 years ago

@lwrage suggests that a type set should be allowed in the syntax rule error_state_to_mode_mapping.

brlarson commented 1 year ago

Consider removing error_to_state_mode_mapping as unnecessarily over-specific.