Skip to content

Incorrect inverse by EMV2 validator #1735

@joeseibel

Description

@joeseibel

When a propagation refers to a feature in a feature group type and the type has an inverse of statement, but the feature is not in the inverted feature group type, the EMV2 validator incorrectly inverts the feature.

The following model is valid, but an error is reported for the propagation fg1.out_port1. The propagation fg2.in_port2 is included as an example of the validator correctly inverting a feature. The difference is that in_port2 is in an inverted feature group type while out_port1 is in a feature group type that is not inverted, but is an inverse of another feature group type.

package inverse_bug
public
  feature group a
    features
      in_port1: in data port;
  end a;

  feature group b
    features
      out_port1: out data port;
    inverse of a
  end b;

  feature group c
    features
      in_port2: in data port;
  end c;

  feature group d
    inverse of c
  end d;

  system s
    features
      fg1: feature group b;
      fg2: feature group d;
    annex EMV2 {**
      error propagations
        -- Error message: Propagation 'fg1.out_port1' direction does not match feature direction.
        fg1.out_port1: out propagation {ErrorLibrary::AboveRange};
        fg2.in_port2: out propagation {ErrorLibrary::AboveRange};
      end propagations;
    **};
  end s;
end inverse_bug;

The problem is in EMV2Util.getErrorPropagationFeatureDirection(ErrorPropagation).

Metadata

Metadata

Assignees

Type

No type

Projects

No projects

Milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions