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

Aperta
#2,006 1 commento 0 reazioni 0 assegnatari Vedi su GitHub

I maintainer di solito rispondono entro 1 giorno

Nessuno ha ancora preso questa issue.

Valutazione

Difficoltà
3/5
Tempo stimato
1-2 giorni
Idoneità per principianti
65/100
Tipo di issue
Bug
Chiarezza
Abbastanza chiara
Stato di attività
Attiva
Stack tecnologico
go
Ambito
backend

Direzione di ricerca

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.

Scritto dal modello di indicizzazione a partire dal testo della issue.

Descrizione

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

Lingua principale
Go
Stelle
56
Fork
17
Merge medio
12h 31m
PR unite (30g)
909

Preparare l'ambiente

Come iniziare

  1. Leggi tutta la issue e poi la guida ai contributi del progetto.
  2. Commenta sulla issue per dire che te ne occupi tu — evita che due persone facciano lo stesso lavoro.
  3. Fai un fork del repository e lavora su un branch.
  4. Apri una pull request che faccia riferimento al numero della issue.

Altre issue di Open-MBEE/OpenSysML

Tutte le issue di Open-MBEE/OpenSysML

Issue simili

Altre issue su Go

Ricevi le nuove issue nella tua casella

Un breve riepilogo di issue GitHub adatte ai principianti.