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

Abierto
#2,006 1 comentario 0 reacciones 0 asignados Ver en GitHub

Los mantenedores suelen responder en 1 día

Nadie ha tomado este issue todavía.

Evaluación

Dificultad
3/5
Tiempo estimado
1-2 días
Aptitud para principiantes
65/100
Tipo de issue
Error
Claridad
Bastante claro
Estado de actividad
Activo
Stack tecnológico
go
Área
backend

Línea de trabajo

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.

Escrito por el modelo de indexación a partir del texto del issue.

Descripción

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

Lenguaje dominante
Go
Estrellas
56
Forks
17
Merge medio
12 h 31 min
PR fusionados (30 d)
909

Preparar el entorno

Primeros pasos

  1. Lee el issue completo y luego la guía de contribución del proyecto.
  2. Comenta en el issue que vas a ocuparte — evita que dos personas hagan lo mismo.
  3. Haz un fork del repositorio y trabaja en una rama.
  4. Abre un pull request que haga referencia al número del issue.

Más de Open-MBEE/OpenSysML

Todos los issues de Open-MBEE/OpenSysML

Issues similares

Más issues de Go

Recibe los nuevos issues en tu correo

Un resumen breve de issues de GitHub para principiantes.