Hacktoberfest 2026:维护者为十月标记出来的 issue,仍然开放、适合新手。 浏览 Hacktoberfest issue

verify() returns True for any two equations with no free symbols

未关闭
#87 1 条评论 0 个 reaction 已指派 0 人 在 GitHub 查看

@pfolex 已经在做这个了。

开始于 2026年10月24日。

  • #94 来自 @pfolex —— 未关闭

评估

难度
3/5
预计耗时
1-2 天
新手友好度
50/100
Issue 类型
缺陷
描述清晰度
描述清楚
活跃度
活跃
技术栈
python
领域
tooling

调研方向

Start by running the two reproduction snippets in the issue: verify(gold=parse("$3 = 4$"), target=parse("$1 = 2$")) should return False but currently returns True. The bug is in the equation fallback of verify, which solves each side over an empty symbol set and treats the resulting empty solution lists as a match. Done means symbol-free equations that are not identical no longer verify equal, and the existing tests still pass.

由索引模型根据 Issue 内容生成。

描述

verify reports two equations as equivalent whenever both parse to relations with no free symbols. The equation fallback solves each side over an empty symbol set, obtains two empty solution lists, and treats the empty pairwise comparison as a match, so any symbol-free pair compares equal, including outright false equations.

Reproduce (math-verify 0.9.0, current PyPI release, Python 3.12):

from math_verify import parse, verify

gold = parse("$I_{e}(0)=\\gamma I_{i}(0)$")
target = parse("$I_{i}(0) = I_{e}(0)$")
print(verify(gold=gold, target=target))  # True

print(verify(gold=parse("$3 = 4$"), target=parse("$1 = 2$")))  # True

Both parses are sympy Equality objects whose free_symbols set is empty: the terms are undefined-function applications such as I_i(0), which do not count as free symbols. verify returns True for both pairs.

Expected: an empty solution list should not satisfy the equation comparison; symbol-free relations that are not trivially identical should not verify equal.

Impact: this inflated benchmark scores in an LLM evaluation harness that grades extracted LaTeX answers through parse/verify — a candidate equation and a structurally different reference equation, both without free symbols, always received deterministic credit. Evidence and the downstream guard:

主要语言
Python
星标
1.2k
派生
67
PR 合并指标
30 天内没有已合并 PR

环境准备

这个项目没有提供开发容器、Dockerfile 或贡献指南,环境需要你自己搭建:先看它的 README,通用步骤见我们的新手贡献指南。

从这里开始

  1. 先读完整个 Issue,再读项目的贡献指南。
  2. 在 Issue 下留言说明你要接手 —— 这能避免两个人做同样的事。
  3. Fork 仓库,在一个分支上完成修改。
  4. 提交 Pull Request,并在描述里引用这个 Issue 编号。

huggingface/Math-Verify 的其他 Issue

查看 huggingface/Math-Verify 的全部 Issue

相似的 Issue

更多 Python Issue

把新 issue 发到你的邮箱

精选适合新手参与的 GitHub issue 摘要。