Printed conditions drop parentheses: a and (b or c) is shown as a and b or c

Đang mở
#2,006 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
backend

Hướng nghiên cứu

Start by locating the code that formats or prints constraint conditions in the Go implementation, then trace how the reproduced a and (b or c) expression is rendered in a verdict line. The issue provides a concrete reproduction and expected behavior: preserve parentheses when removing them changes the reading, or keep them as written. Done when the output no longer reads as a and b or c for this condition.

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

Mô tả

bug
What happened, and what you expected instead

Verdict lines print the condition without the parentheses it was written with. a and (b or c) is printed as a and b or c, which reads as (a and b) or c.

The verdict itself is correct, so the expression is parsed and evaluated as written. With a = true and b = c = false, the written condition is false, but the printed one would be true. Anyone reading the output, or any tool that consumes it, sees a different condition from the one that was checked.

Expected: parentheses kept wherever omitting them changes the reading, or always kept as written.

Reproduction
# sysml-mcp v0.12.1, MCP tool "validate_instance" (the documented equivalent of %validate) {#sysml-mcp-v0121-mcp-tool-validate\_instance-the-documented-equivalent-of-validate  data-source-line="347"}

%validate Parens::q
constraint assert constraint d: violated (a and b or c) [run, witnessed]
summary: object Parens::q: violated [run, witnessed]

parens.sysml:
package Parens {
    private import ScalarValues::*;
    part q {
        attribute a : Boolean = true;
        attribute b : Boolean = false;
        attribute c : Boolean = false;
        assert constraint d { a and (b or c) }
    }
}
Version

sysml-mcp v0.12.1 (commit b2f0e9b802a334369da94312c35cefbd8726d3bf), npm @openmbee/sysml-mcp-linux-x64

Surface

Other / not sure

Platform

Linux x86_64

Ngôn ngữ chính
Go
Star
56
Fork
17
Merge trung bình
12 giờ 31 phút
Pull request đã merge (30 ngày)
909

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.