English

MathDSL: A Domain-Specific Language for Concise Mathematical Solutions Via Program Synthesis

Machine Learning 2024-12-12 v3

Abstract

We present MathDSL, a Domain-Specific Language (DSL) for mathematical equation solving, which, when deployed in program synthesis models, outperforms state-of-the-art reinforcement-learning-based methods. We also introduce a quantitative metric for measuring the conciseness of a mathematical solution and demonstrate the improvement in the quality of generated solutions compared to other methods. Our system demonstrates that a program synthesis system (DreamCoder) using MathDSL can generate programs that solve linear equations with greater accuracy and conciseness than using reinforcement learning systems. Additionally, we demonstrate that if we use the action spaces of previous reinforcement learning systems as DSLs, MathDSL outperforms the action-space-DSLs. We use DreamCoder to store equation-solving strategies as learned abstractions in its program library and demonstrate that by using MathDSL, these can be converted into human-interpretable solution strategies that could have applications in mathematical education.

Cite

@article{arxiv.2409.17490,
  title  = {MathDSL: A Domain-Specific Language for Concise Mathematical Solutions Via Program Synthesis},
  author = {Sagnik Anupam and Maddy Bowers and Omar Costilla-Reyes and Armando Solar-Lezama},
  journal= {arXiv preprint arXiv:2409.17490},
  year   = {2024}
}

Comments

There was a typo in Figure 1 (a step in the Lemma solution was accidentally included twice). Additionally, our final experiment runs have MathDSL using one less step for this question, and ConPoLe using one more step to differentiate a division and a fraction in its final solution. Figure 1 has been updated to provide an exact copy of the experiment runs in the GitHub repository

R2 v1 2026-06-28T18:57:36.407Z