Skip to content

Commit

Permalink
Update test data to aas-core-meta bd56058
Browse files Browse the repository at this point in the history
We update the development requirements to and re-record the test data
for [aas-core-meta bd56058].

Notably, we propagate the fix for AASd-109 in V3.0 where we change
the invariant such that it checks for consistency among properties even
when a ``value`` property is missing. This affects only the re-recording
of the test data corresponding to V3.0 meta-model.

[aas-core-meta bd56058]: aas-core-works/aas-core-meta@bd56058
  • Loading branch information
mristin committed Aug 29, 2024
1 parent e22ccae commit d5ccdb3
Show file tree
Hide file tree
Showing 9 changed files with 91 additions and 47 deletions.
2 changes: 1 addition & 1 deletion setup.py
Original file line number Diff line number Diff line change
Expand Up @@ -52,7 +52,7 @@
"twine",
"jsonschema==3.2.0",
"xmlschema==3.3.1",
"aas-core-meta@git+https://github.com/aas-core-works/aas-core-meta@31d6afd#egg=aas-core-meta",
"aas-core-meta@git+https://github.com/aas-core-works/aas-core-meta@bd56058#egg=aas-core-meta",
"ssort==0.12.3",
]
},
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -11551,7 +11551,7 @@ void OfSubmodelElementList::Execute() {
case 15: {
if (
!((
(instance_->value().has_value())
(instance_->type_value_list_element().has_value())
&& (
(
instance_->type_value_list_element() == types::AasSubmodelElements::kProperty
Expand All @@ -11561,9 +11561,14 @@ void OfSubmodelElementList::Execute() {
))
|| ((
(instance_->value_type_list_element().has_value())
&& PropertiesOrRangesHaveValueType(
(*(instance_->value())),
(*(instance_->value_type_list_element()))
&& (
(
(!(instance_->value().has_value()))
|| PropertiesOrRangesHaveValueType(
instance_->value(),
(*(instance_->value_type_list_element()))
)
)
)
))
) {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -4286,15 +4286,18 @@ Aas.ISubmodelElementList that

if (!(
!(
(that.Value != null)
(that.TypeValueListElement != null)
&& (
that.TypeValueListElement == AasSubmodelElements.Property
|| that.TypeValueListElement == AasSubmodelElements.Range
)
)
|| (
(that.ValueTypeListElement != null)
&& Verification.PropertiesOrRangesHaveValueType(that.Value, that.ValueTypeListElement)
&& (
(that.Value == null)
|| Verification.PropertiesOrRangesHaveValueType(that.Value, that.ValueTypeListElement)
)
)))
{
yield return new Reporting.Error(
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -5250,14 +5250,15 @@ func VerifySubmodelElementList(
}

if !(
!((that.Value() != nil) &&
!((that.TypeValueListElement() != nil) &&
(that.TypeValueListElement() == aastypes.AASSubmodelElementsProperty ||
that.TypeValueListElement() == aastypes.AASSubmodelElementsRange)) ||
((that.ValueTypeListElement() != nil) &&
((that.Value() == nil) ||
PropertiesOrRangesHaveValueType(
that.Value(),
*that.ValueTypeListElement(),
))) {
)))) {
abort = onError(
newVerificationError(
"Constraint AASd-109: If type value list element is equal to " +
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -9841,7 +9841,7 @@ SymbolTable(
instance=Name(
identifier='self',
original_node=...),
name='value',
name='type_value_list_element',
original_node=...),
original_node=...),
Or(
Expand Down Expand Up @@ -9888,20 +9888,31 @@ SymbolTable(
name='value_type_list_element',
original_node=...),
original_node=...),
FunctionCall(
name='properties_or_ranges_have_value_type',
args=[
Member(
instance=Name(
identifier='self',
Or(
values=[
IsNone(
value=Member(
instance=Name(
identifier='self',
original_node=...),
name='value',
original_node=...),
name='value',
original_node=...),
Member(
instance=Name(
identifier='self',
original_node=...),
name='value_type_list_element',
FunctionCall(
name='properties_or_ranges_have_value_type',
args=[
Member(
instance=Name(
identifier='self',
original_node=...),
name='value',
original_node=...),
Member(
instance=Name(
identifier='self',
original_node=...),
name='value_type_list_element',
original_node=...)],
original_node=...)],
original_node=...)],
original_node=...),
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -3795,17 +3795,20 @@ public Stream<Reporting.Error> transformSubmodelElementList(

if (!(
!(
(that.getValue().isPresent())
(that.getTypeValueListElement() != null)
&& (
that.getTypeValueListElement() == AasSubmodelElements.PROPERTY
|| that.getTypeValueListElement() == AasSubmodelElements.RANGE
)
)
|| (
(that.getValueTypeListElement().isPresent())
&& propertiesOrRangesHaveValueType(
that.getValue().orElse(null),
that.getValueTypeListElement().orElse(null))
&& (
(!that.getValue().isPresent())
|| propertiesOrRangesHaveValueType(
that.getValue().orElse(null),
that.getValueTypeListElement().orElse(null))
)
))) {
errorStream = Stream.<Reporting.Error>concat(errorStream,
Stream.of(new Reporting.Error(
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -4470,7 +4470,7 @@ UnverifiedSymbolTable(
instance=Name(
identifier='self',
original_node=...),
name='value',
name='type_value_list_element',
original_node=...),
original_node=...),
Or(
Expand Down Expand Up @@ -4517,20 +4517,31 @@ UnverifiedSymbolTable(
name='value_type_list_element',
original_node=...),
original_node=...),
FunctionCall(
name='properties_or_ranges_have_value_type',
args=[
Member(
instance=Name(
identifier='self',
Or(
values=[
IsNone(
value=Member(
instance=Name(
identifier='self',
original_node=...),
name='value',
original_node=...),
name='value',
original_node=...),
Member(
instance=Name(
identifier='self',
original_node=...),
name='value_type_list_element',
FunctionCall(
name='properties_or_ranges_have_value_type',
args=[
Member(
instance=Name(
identifier='self',
original_node=...),
name='value',
original_node=...),
Member(
instance=Name(
identifier='self',
original_node=...),
name='value_type_list_element',
original_node=...)],
original_node=...)],
original_node=...)],
original_node=...),
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -3426,7 +3426,7 @@ def transform_submodel_element_list(
if not (
not (
(
(that.value is not None)
(that.type_value_list_element is not None)
and (
(
that.type_value_list_element == aas_types.AASSubmodelElements.PROPERTY
Expand All @@ -3438,9 +3438,14 @@ def transform_submodel_element_list(
or (
(
(that.value_type_list_element is not None)
and properties_or_ranges_have_value_type(
that.value,
that.value_type_list_element
and (
(
(that.value is None)
or properties_or_ranges_have_value_type(
that.value,
that.value_type_list_element
)
)
)
)
)
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -3988,7 +3988,7 @@ class Verifier
if (!(
!(
(
(that.value !== null)
(that.typeValueListElement !== null)
&& (
(
that.typeValueListElement == AasTypes.AasSubmodelElements.Property
Expand All @@ -4000,9 +4000,14 @@ class Verifier
|| (
(
(that.valueTypeListElement !== null)
&& propertiesOrRangesHaveValueType(
that.value,
that.valueTypeListElement
&& (
(
(that.value === null)
|| propertiesOrRangesHaveValueType(
that.value,
that.valueTypeListElement
)
)
)
)
)
Expand Down

0 comments on commit d5ccdb3

Please sign in to comment.