Hacktoberfest 2026: los issues que los mantenedores marcaron para octubre, abiertos y aptos para principiantes. Explorar issues de Hacktoberfest

verify() rejects equivalent chained relations written in a different order

Abierto
#96 0 comentarios 0 reacciones 0 asignados Ver en GitHub

@chetana1410 ya está trabajando en esto.

Desde el 24/10/2026.

  • #97 de @chetana1410 — abierto

Evaluación

Dificultad
3/5
Tiempo estimado
1-2 días
Aptitud para principiantes
35/100
Tipo de issue
Error
Claridad
Bien especificado
Estado de actividad
Estancado
Stack tecnológico
python
Área
backend

Línea de trabajo

Start by reading sympy_compare_relational, where the issue says chained relations are compared with zip, and run the provided reproduction with timeout_seconds=None. Check equivalent chains in reversed order while preserving false results for different conditions and different term counts; done when the reproduction matches those expectations. Pull request #97 is already open for this issue.

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

Descripción

verify returns false for chained relations that describe the same condition when the terms are written in the other direction. A single inequality does flip: x<1 matches 1>x. The chain comparison zips the two sides in parser order, so the same relations in reverse order are treated as a mismatch.

Reproduction
from math_verify import parse, verify

print(verify(parse(r"$1<x<3$"), parse(r"$3>x>1$")))          # False, expected True
print(verify(parse(r"$1\leq x\leq 3$"), parse(r"$3\geq x\geq 1$")))  # False, expected True
print(verify(parse(r"$x<y<z$"), parse(r"$z>y>x$")))          # False, expected True
print(verify(parse(r"$x=y=1$"), parse(r"$y=x=1$")))          # False, expected True

print(verify(parse(r"$1<x<3$"), parse(r"$3<x<1$")))          # False, and should stay False

timeout_seconds can be None for the repro. I ran this on current main.

What the parser produces
$1<x<3$  -> And [1 < x, x < 3]
$3>x>1$  -> And [3 > x, x > 1]
$x=y=1$  -> And [Eq(x, y), Eq(y, 1)]
$y=x=1$  -> And [Eq(y, x), Eq(x, 1)]

sympy_compare_relational then compares those lists with zip, so 1<x is compared with 3>x and x<3 with x>1. Each of those pairs fails, even though 1<x is the same condition as x>1 and x<3 is the same condition as 3>x.

The equality chain has the same ordered comparison. x=y and y=1 are not the same pair of atoms as y=x and x=1, but both chains mean x=y=1.

Expected

Equivalent chains match. A chain that is not the same condition, such as 1<x<3 against 3<x<1, stays false. Chains with different numbers of terms stay false.

Lenguaje dominante
Python
Estrellas
1.2k
Forks
67
Métricas de merge de PR
Sin PR fusionados en 30 d

Preparar el entorno

Este proyecto no incluye contenedor de desarrollo, Dockerfile ni guía de contribución, así que la configuración corre por tu cuenta: empieza por su README y consulta nuestra guía para la primera contribución para los pasos generales.

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 huggingface/Math-Verify

Todos los issues de huggingface/Math-Verify

Issues similares

Más issues de Python

Recibe los nuevos issues en tu correo

Un resumen breve de issues de GitHub para principiantes.