Hacktoberfest 2026: những issue maintainer đã đánh dấu cho tháng Mười, đang mở và phù hợp người mới. Xem issue Hacktoberfest

Subsetting type conformance is not checked, although redefinition type conformance is

Đã đóng
#95 1 bình luận 0 reaction 0 người được giao Xem trên GitHub

Maintainer thường phản hồi trong vòng 1 ngày

Chưa có ai nhận issue này.

Đánh giá

Độ khó
3/5
Thời gian dự kiến
1-2 ngày
Mức phù hợp với người mới
65/100
Loại issue
Lỗi
Độ rõ ràng
Khá rõ ràng
Mức độ hoạt động
Sôi nổi
Công nghệ
go
Lĩnh vực
compilers

Hướng nghiên cứu

Bắt đầu với các entry point ParseFile và Resolve, đồng thời theo dõi cách các quan hệ subsetting và redefinition được xác thực cũng như cách các chẩn đoán được thu thập. Tái hiện ví dụ subsetting không phù hợp thông qua dịch vụ gRPC, sau đó thêm một hồi quy bao phủ ví dụ này cùng với trường hợp đối chứng phù hợp và trường hợp redefinition. Hoàn tất có nghĩa là mô hình subsetting không hợp lệ báo cáo một chẩn đoán về tính phù hợp kiểu, trong khi mô hình hợp lệ vẫn không có chẩn đoán.

Do mô hình lập chỉ mục viết ra từ nội dung của issue.

Mô tả

Subsetting type conformance is not checked, although redefinition type conformance is

Version: v0.3.0, sysml-grpc-linux-amd64, SHA-256 b39b720e020c325020af95c33640ad3583c938d74c40d29a0741fab6c03412de
Path: ParseFile + Resolve over gRPC, one inline document

Summary

The service validates that a redefining feature's type conforms to what it redefines, and it validates the multiplicity bound for subsetting and redefinition alike — but it does not validate that a subsetting feature's type conforms to what it subsets. That case produces no error, no warning, and no diagnostic of any kind.

The asymmetry looks unintentional rather than deliberate: the multiplicity rule is already applied to both relations (its message says so — "Subsetting/redefining feature should not have larger multiplicity upper bound"), and the redefinition type check already computes and formats exactly the diagnostic the subsetting case needs.

Reproduction

Each block is one document through ParseFile, then Resolve. Diagnostics are the union of both, de-duplicated.

1. Subsetting with a non-conforming type — expected a diagnostic, got none

package P {
	class A;
	class B;
	feature g : A;
	feature f : B subsets g;
}

→ (no diagnostics at all)

f subsets g asserts that f's values are among g's. g holds As and f is a B, which is unrelated to A, so no value of f can be a value of g.

2. Control — subsetting with a conforming type

package P {
	class A;
	class B specializes A;
	feature g : A;
	feature f : B subsets g;
}

→ (no diagnostics at all)

Correct, and together with (1) it shows the check is absent rather than merely lenient: the well-formed and the ill-formed model are indistinguishable in the output.

3. The same violation through redefinition — reported

package P {
	class A;
	class B;
	class C { feature g : A; }
	class D specializes C { feature g : B redefines C::g; }
}

→ [error] g (typed by B) redefines g (typed by A): types do not conform

4. The multiplicity half of subsetting — reported

package P {
	class A;
	feature g : A [0..5];
	feature f : A subsets g [0..10];
}

→ [warning] Subsetting/redefining feature should not have larger multiplicity upper bound

5. Control — the resolver is working

package P {
	class A;
	feature g : Nonexistent;
}

→ [error] unresolved reference: Nonexistent

Also reproduces in SysML usage syntax

Same silence with part def / part in a .sysml document, so it is not specific to the KerML surface:

package P {
	part def A;
	part def B;
	part g : A;
	part f : B subsets g;
}

→ (no diagnostics at all), and likewise with part def B :> A for the conforming control.

Expected

Case (1) reports a diagnostic in the shape case (3) already produces — e.g. f (typed by B) subsets g (typed by A): types do not conform.

Why it matters to a downstream consumer

Silence is indistinguishable from a clean bill of health. A tool that asks the service to validate a model gets an empty diagnostic list and has no way to learn that half of the subsetting check did not run — so it reports the model as sound. For consumers that build a specialization/subsetting graph out of the parsed model (we translate one to OWL), an unchecked subsetting edge propagates into everything derived from it.

Environment

Reproduced on Linux x86-64 against the published v0.3.0 release asset, checksum as above, over the gRPC API only. Happy to supply the exact request payloads if useful.

Ngôn ngữ chính
Go
Star
24
Fork
5
Merge trung bình
10 giờ 12 phút
Pull request đã merge (30 ngày)
598

Chuẩn bị môi trường

Bắt đầu từ đâu

  1. Đọc hết issue, rồi đọc hướng dẫn đóng góp của dự án.
  2. Bình luận trên issue rằng bạn sẽ nhận — tránh hai người làm cùng một việc.
  3. Fork repository và làm thay đổi trên một nhánh.
  4. Mở pull request có tham chiếu số hiệu của issue.

Issue khác của Open-MBEE/OpenSysML

Tất cả issue của Open-MBEE/OpenSysML

Issue tương tự

Thêm issue về Go

Nhận issue mới trong hộp thư của bạn

Bản tóm tắt ngắn những issue GitHub phù hợp với người mới.