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

オープン
#2,006 コメント 1 件 リアクション 0 件 担当者 0 名 GitHub で見る

メンテナーはふだん 1 日以内に返信

まだ誰も着手していません。

評価

難易度
3/5
見積もり時間
1〜2日
初心者へのやさしさ
65/100
issue の種類
バグ
明瞭さ
おおむね明確
活発さ
活発
技術スタック
go
領域
backend

調査の方向性

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.

索引モデルが issue の本文から書いたものです。

説明

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

主要言語
Go
スター
56
フォーク
17
平均マージ
12時間 31分
マージ済み PR(30日)
909

環境構築

はじめの一歩

  1. issue を最後まで読み、次にプロジェクトのコントリビューションガイドを読みます。
  2. 着手することを issue にコメントします — 二人が同じ作業をするのを防げます。
  3. リポジトリをフォークし、ブランチを切って変更します。
  4. issue 番号を参照したプルリクエストを送ります。

Open-MBEE/OpenSysML のほかの issue

Open-MBEE/OpenSysML の issue をすべて見る

似ている issue

Go の issue をもっと見る

新しい issue をメールで受け取る

初心者向けの GitHub issue を短くまとめたダイジェスト。