verify() rejects equivalent chained relations written in a different order
Evaluación
- Dificultad
- 3/5
- Tiempo estimado
- 1-2 días
- Aptitud para principiantes
- 35/100
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
- Lee el issue completo y luego la guía de contribución del proyecto.
- Comenta en el issue que vas a ocuparte — evita que dos personas hagan lo mismo.
- Haz un fork del repositorio y trabaja en una rama.
- Abre un pull request que haga referencia al número del issue.
Más de huggingface/Math-Verify
-
verify() raises ValueError comparing chained relations of different lengthPosiblemente ocupada @chetana1410 la tomó hace 4 días. Abierto
Dificultad 2/5 1-3 horas Aptitud para principiantes 84/100
huggingface/Math-Verify#93 ·
-
A period inside the math delimiters (`$\frac{1}{3}.$`) makes correct answers fail and can make wrong ones passPosiblemente ocupada @MohammadHijjawi97 la tomó hace 27 días. Abierto
Dificultad 2/5 1-3 horas Aptitud para principiantes 90/100
huggingface/Math-Verify#85 ·
-
evaluate_model_outputs.py: rows whose gold cannot be extracted are dropped from the accuracy denominator, so the printed accuracy disagrees with the is_correct column the script writesPosiblemente ocupada @shaurya416 la tomó hace 33 días. Abierto
Dificultad 2/5 1-3 horas Aptitud para principiantes 84/100
huggingface/Math-Verify#83 ·
-
verify() rejects a not-equal written in the other orderPosiblemente ocupada @chetana1410 la tomó hace 4 días. Abierto
Dificultad 2/5 1-3 horas Aptitud para principiantes 35/100
huggingface/Math-Verify#100 ·
-
verify() rejects an absolute-value inequality that is the same intervalPosiblemente ocupada @chetana1410 la tomó hace 4 días. Abierto
Dificultad 4/5 3-5 días Aptitud para principiantes 35/100
huggingface/Math-Verify#98 ·
Todos los issues de huggingface/Math-Verify
Issues similares
-
Dificultad 1/5 Menos de una hora Aptitud para principiantes 72/100
MIT-LCP/wfdb-python#590 ·
Los mantenedores suelen responder en 1 día
-
Dificultad 2/5 1-3 horas Aptitud para principiantes 77/100
pollen-robotics/reachy_mini#1517 ·
Los mantenedores suelen responder en 1 día
-
Dificultad 2/5 1-3 horas Aptitud para principiantes 69/100
NRLMMD-GEOIPS/pluginify#41 ·
-
Dificultad 2/5 1-3 horas Aptitud para principiantes 67/100
scverse/spatialdata#1293 · 1 comentario ·
Los mantenedores suelen responder en 1 día
-
Dificultad 2/5 1-3 horas Aptitud para principiantes 78/100
UKGovernmentBEIS/inspect_evals#2788 ·
Los mantenedores suelen responder en 1 día