Requirement evaluation ignores assume constraints (assumption false is reported as violated)
Maintainer thường phản hồi trong vòng 1 ngày
Một pull request liên quan đã được merge.
- #1791 của @devin-ai-integration — đã merge
Đá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
- 55/100
Hướng nghiên cứu
The bug is in the Go code that evaluates requirement checks; find the function implementing RequirementConstraintCheck or the satisfy command (likely in a requirements or evaluation package). Run sysml assume.sysml -satisfy to reproduce the wrong violations. Done when satisfy levelOk by off reports hold and by on reports fail.
Do mô hình lập chỉ mục viết ra từ nội dung của issue.
Mô tả
Summary
When a requirement has an assume constraint, OpenSysML evaluates only the required constraints and ignores the assumptions. A subject for which the assumption is false is reported as violating the requirement.
The standard library defines the result of a requirement check as (Requirements.sysml, RequirementConstraintCheck):
return result = allTrue(assumptions()) implies allTrue(constraints())
so when an assumption is false the requirement holds.
Reproduction
assume.sysml:
package Repro {
private import ScalarValues::*;
part def Thing { attribute enabled : Boolean; attribute level : Integer; }
requirement def LevelOk {
subject t : Thing;
assume constraint { t.enabled }
require constraint { t.level == 1 }
}
// assumption false -> by RequirementConstraintCheck::result, LevelOk should hold
part off : Thing { attribute :>> enabled = false; attribute :>> level = 5; }
// assumption true, required constraint false -> LevelOk should fail
part on : Thing { attribute :>> enabled = true; attribute :>> level = 5; }
requirement levelOk : LevelOk;
satisfy levelOk by off;
satisfy levelOk by on;
}
$ sysml assume.sysml -satisfy
✓ package Repro
✗ satisfy levelOk by off fails (on Repro::off ID: 1)
Required condition evaluated to false: t.level == 1
standing: violated (witnessed: 1 run under reverse)
✗ satisfy levelOk by on fails (on Repro::on ID: 2)
Required condition evaluated to false: t.level == 1
standing: violated (witnessed: 1 run under reverse)
The REPL gives the same result:
%instantiate Repro::off
%requirement Repro::LevelOk off
✗ Requirement Repro::LevelOk failed (on Repro::off ID: 1)
Required condition evaluated to false: t.level == 1
Expected
satisfy levelOk by offholds (assumptiont.enabledis false).satisfy levelOk by onfails (assumption true,t.level == 1false).
Version
Reproduced on linux-amd64 with:
sysml v0.11.0(commit ddf4df00037d6ddbfb1fa9d743a4389f75c9e2dc), the latest releasesysml v0.10.0(commit 08ef397841767b829e492bbecf6d723483b4421e)
- Ngôn ngữ chính
- Go
- Star
- 47
- Fork
- 13
- Merge trung bình
- 15 giờ 10 phút
- Pull request đã merge (30 ngày)
- 930
Chuẩn bị môi trường
- Có Dockerfile hoặc tệp Docker Compose
- Có mẫu pull request
- Đọc hướng dẫn đóng góp
Bắt đầu từ đâu
- Đọc hết issue, rồi đọc hướng dẫn đóng góp của dự án.
- 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.
- Fork repository và làm thay đổi trên một nhánh.
- Mở pull request có tham chiếu số hiệu của issue.
Issue khác của Open-MBEE/OpenSysML
-
Definition of requirementsĐang mởquestion
Độ khó 2/5 1-3 giờ Mức phù hợp với người mới 66/100
Open-MBEE/OpenSysML#1359 · 4 bình luận ·
Maintainer thường phản hồi trong vòng 1 ngày
-
enhancement
Độ khó 5/5 Hơn một tuần Mức phù hợp với người mới 25/100
Open-MBEE/OpenSysML#1628 · 3 bình luận ·
Maintainer thường phản hồi trong vòng 1 ngày
-
spec compliance
Độ khó 4/5 3-5 ngày Mức phù hợp với người mới 48/100
Open-MBEE/OpenSysML#1576 · 2 bình luận ·
Maintainer thường phản hồi trong vòng 1 ngày
-
question
Độ khó 4/5 1-2 ngày Mức phù hợp với người mới 48/100
Open-MBEE/OpenSysML#1575 · 2 bình luận ·
Maintainer thường phản hồi trong vòng 1 ngày
-
bug spec compliance
Độ khó 4/5 3-5 ngày Mức phù hợp với người mới 55/100
Open-MBEE/OpenSysML#1532 · 2 bình luận · 1 reaction ·
Maintainer thường phản hồi trong vòng 1 ngày
Tất cả issue của Open-MBEE/OpenSysML
Issue tương tự
-
Độ khó 2/5 1-3 giờ Mức phù hợp với người mới 62/100
Maintainer thường phản hồi trong vòng 2 ngày
-
needs-triage
Độ khó 2/5 1-3 giờ Mức phù hợp với người mới 62/100
Maintainer thường phản hồi trong vòng 1 ngày
-
Độ khó 2/5 1-3 giờ Mức phù hợp với người mới 85/100
kagent-dev/kagent#3462 ·
Maintainer thường phản hồi trong vòng 1 ngày
-
netrc credential source accepts a password with an embedded CR/LF that every other source rejectsĐang mởagent-butler-finding bug
Độ khó 2/5 1-3 giờ Mức phù hợp với người mới 76/100
jordansmall/spindrift#6268 ·
Maintainer thường phản hồi trong vòng 1 ngày
-
bug
Độ khó 2/5 1-3 giờ Mức phù hợp với người mới 62/100
Maintainer thường phản hồi trong vòng 7 ngày