Can LLM Aid in Solving Constraints with Inductive Definitions?

This paper proposes a neuro-symbolic approach that synergistically integrates Large Language Models with constraint solvers to iteratively generate and verify auxiliary lemmas, thereby significantly improving the ability to solve constraints involving inductive definitions compared to state-of-the-art solvers.

Weizhi Feng, Shidong Shen, Jiaxiang Liu, Taolue Chen, Fu Song, Zhilin Wu

Published Mon, 09 Ma
📖 5 min read🧠 Deep dive

Imagine you are trying to solve a massive, complex logic puzzle. The rules of the puzzle are written in a very strict, mathematical language (like a computer's native tongue). You have a super-smart robot (a Constraint Solver) that is incredibly fast at checking if a specific move follows the rules. However, this robot has a blind spot: it struggles with puzzles that require "thinking ahead" or understanding patterns that repeat themselves (like counting up from zero, or building a list of items). This is called inductive reasoning.

Currently, if the robot gets stuck, it just gives up. It needs a human to whisper a hint: "Hey, try proving this smaller fact first!" But asking a human for help on thousands of puzzles is slow and expensive.

Enter the Large Language Model (LLM). Think of the LLM as a brilliant, creative, but slightly chaotic storyteller. It has read millions of books and code snippets. It can guess what the next step might be, but it sometimes makes things up (hallucinates) or suggests ideas that sound good but are actually wrong.

This paper introduces a new team-up: The Neuro-Symbolic Approach. It's like hiring a creative writer (the LLM) to work alongside a strict editor (the Solver) to solve these tough puzzles.

The Problem: The "Stuck" Robot

The authors found that the best existing robots (SMT solvers like cvc5) are great at checking facts but terrible at guessing the right hints.

  • The Challenge: To prove a big statement (e.g., "Multiplication is commutative"), the robot often needs to prove a smaller, hidden fact first (an "auxiliary lemma").
  • The Failure: Without that hidden fact, the robot spins its wheels and fails.

The Solution: A Three-Stage Workflow

The authors built a system called LLM4Ind that acts as a bridge between the creative writer and the strict editor. Here is how it works, using a simple analogy:

1. The Query Stage (The Brainstorming Session)

Instead of just asking the LLM, "Give me a hint," the system uses specialized prompts (like a detailed instruction manual for the writer).

  • Strategy 1 (Equational Reasoning): The system asks the LLM to "walk through the steps" like a human mathematician. "If I have a number, and I add one, what happens? Now, what if I do it again?" It forces the LLM to think step-by-step.
  • Strategy 2 (Generalization): If the first way fails, the system asks the LLM to "simplify the problem." "Can we replace this complicated part with a generic variable to see the pattern?"

The LLM spits out a list of conjectures (guesses/hints).

2. The Filter Stage (The Quick Check)

The LLM is creative, but it's also messy. It might suggest a hint that is:

  • Wrong: It contradicts the rules of the puzzle.
  • Useless: It's true, but it doesn't help solve the specific puzzle.
  • Too Hard: It's a hint that is just as hard to prove as the original puzzle.

The system runs these guesses through a "speed trap" (a fast, short timeout check). If a guess is obviously wrong or useless, it gets tossed out immediately. This saves time.

3. The Validate Stage (The Final Exam)

The remaining guesses are passed to the Strict Editor (the Solver).

  • The Solver checks: "Does this guess actually help prove the main goal?"
  • If yes, the Solver tries to prove the guess itself. If the guess is hard, the system recursively asks the LLM for more hints to prove that hint. It's like a ladder of hints, climbing up until the top is reached.

The Results: A Winning Team

The authors tested this on 706 different logic puzzles (ranging from simple math to complex data structures).

  • The Old Way: The best robots solved about 293 puzzles.
  • The New Way: The LLM + Robot team solved 525 puzzles.
  • The Gain: They solved about 25% more puzzles than the state-of-the-art robots could do alone.

Why This Matters

Think of it like a co-pilot system for software verification.

  • Before: You had to be a math genius to manually guide the computer through every tricky proof.
  • Now: The computer uses an AI to suggest the path, checks if the path is safe, and then drives itself to the finish line.

The paper proves that while AI can be hallucinatory and unpredictable, if you wrap it in a strict, logical framework (the "neuro-symbolic" approach), it becomes a powerful tool for solving problems that were previously impossible for computers to solve automatically.

In a Nutshell

The paper shows that by letting a creative AI suggest ideas and a logical robot verify them, we can solve complex mathematical proofs that were previously too hard for either of them to do alone. It's the best of both worlds: human-like intuition combined with machine-like precision.