Using Matching in Algebraic Equation Solving

Alan Borning, Alan Bundy

Introduction

In symbolic mathematics, the transition from simple algebraic manipulation to the systematic discovery of complex formulas often appears as "magic" in traditional pedagogy. This paper, originating from the University of Edinburgh in 1981, describes the evolution of the PRelog Equation Solving System (PRESS). The authors introduce a sophisticated algebraic matcher capable of understanding fundamental properties like commutativity and associativity. By treating algebraic matching as a search problem guided by meta-level heuristics, the system can derive complex solutions—such as the quadratic formula—from first principles.

The Challenge of Symbolic Search Control

Early symbolic algebra systems frequently encountered "search control" issues. When provided with a library of algebraic identities, these systems could easily enter infinite loops of unproductive transformations. Furthermore, standard pattern matching was often too rigid; for instance, a basic matcher might fail to recognize that the pattern $u + v$ should match the expression $x + y + z$ without explicit instructions on handling additional terms. The goal of PRESS was to bridge the gap between rigid pattern matching and the strategic "magic" steps, such as completing the square, required to isolate unknown variables in messy equations.

Methodology: The Advanced Matcher

The core of the PRESS system is a matcher written in PROLOG that employs several key techniques to navigate the algebraic search space:

  • Commutative/Associative Matching: The matcher treats sums and products as "unordered bags" of terms rather than rigid trees, allowing it to match $ax + b$ against $b + xa$ seamlessly.
  • Algebraic Matching: If a direct match fails, the matcher can recursively invoke the equation solver to find values for pattern variables that would satisfy the match.
  • Meta-level Rewrite Rules: Rules are categorized into three functional sets to guide the search:
  • Isolation: Stripping functions to isolate the unknown (e.g., $\arcsin(x) = b \rightarrow x = \sin(b)$).
  • Collection: Reducing multiple occurrences of an unknown (e.g., $uw + vw \rightarrow (u+v)w$).
  • Attraction: Moving occurrences of the unknown closer together in the expression tree.
  • Fuzzy Matching: To optimize performance, a "fuzzy" pre-check extracts a "features term" (stripping coefficients and constants) to determine if a rule is worth attempting. For example, $ax^2 + bx$ is simplified to $x^2 + x$ for initial structural matching.

Key Results and Derivations

The system was evaluated on its ability to solve general quadratic, cubic, and trigonometric equations. A significant achievement was the derivation of the general quadratic formula for $ax^2 + bx + c = 0$. PRESS identified the need to "collect" the two occurrences of $x$, automatically determining the necessary algebraic steps—including multiplying by $a$ and adjusting terms—to fit the "Collection" rule.

The positive root of the general quadratic equation as derived by PRESS.

Beyond quadratics, the system demonstrated mastery over trigonometric equations, such as $a \sin x + b \cos x = c$, by matching them against identities like $\sin(u+v)$ and solving for phase shifts and amplitudes. The use of PROLOG, combined with a custom "memo" procedure to cache match results, ensured reasonable performance despite the complexity of the search space.

Discussion and Limitations

The research demonstrates that "completing the square" is not a unique trick but a logical outcome of applying "Collection" rules. By using meta-level reasoning to decide how to solve before executing the math, PRESS avoids the combinatorial explosion typical of symbolic logic.

However, the system faced limitations with higher-order equations. While it made progress on the general cubic equation, it still required human-provided "magic substitutions" to proceed past certain points. Additionally, as a heuristic-based system, it lacks a completeness proof; there is no guarantee it will find a match even if one exists. Future work aimed to solve cubic and quartic equations from first principles without human intervention.

Summary updated

BibTeX
@inproceedings{borning1981using,
  author = {Alan Borning and Alan Bundy},
  title = {{Using Matching in Algebraic Equation Solving}},
  booktitle = {International Joint Conference on Artificial Intelligence},
  year = {1981},
}
Figure