Introduction
Learning a single axis-aligned hypercube is a foundational problem in computational learning theory. However, learning a union of such shapes, particularly when they overlap, presents significant challenges. Without constraints on dimensionality ($d$), the problem is as hard as learning DNF (Disjunctive Normal Form) boolean formulas. This paper introduces the first polynomial-time algorithm for a fixed dimension $d$ to exactly learn a finite union of integer hypercubes over the $d$-dimensional integer lattice ($\mathbb{Z}^d$) using membership and equivalence queries.
This work is motivated by monadic decomposition, a technique in formal verification used to simplify complex logical formulas. By breaking down multi-variable formulas into combinations of single-variable formulas, researchers can significantly improve the efficiency of SMT solvers in proving program correctness.
The Overshooting Algorithm
The proposed approach operates within Angluin’s Minimally Adequate Teacher (MAT) framework. The learner interacts with a teacher (e.g., an SMT solver) through:
- Membership Queries ($\Phi_X$): Determining if a point $v$ is in the target set $X$.
- Equivalence Queries ($\Psi_X$): Checking if the current hypothesis $H$ matches $X$, returning a counterexample $v$ if they differ.
The core of the approach is the Overshooting Algorithm. Unlike standard algorithms that might add points individually, this algorithm uses a Corner Oracle (implemented via binary search) to identify the boundaries of a hypercube containing the counterexample.
As shown in Figure 1, the process involves:
- Step 1 (Add): Finding a maximal hypercube containing the counterexample that is mostly within the target set.
- Steps 2 & 3 (Remove): Refining the hypothesis by removing "overshot" regions that the membership oracle identifies as outside the target set.
The formal structure of these routines is detailed in the pseudocode below.
Key Variants
- RefineAddRemove: This variant alternates between adding overshot cubes and removing sub-cubes.
- RefineSym: Uses symmetric difference to update the hypothesis.
- Repetition-free Optimization: By tracking visited corners, the algorithm ensures polynomial termination for any fixed dimension, preventing infinite loops of additions and removals.
Extensions and Insights
The authors extended the algorithm to handle infinite hypercubes (e.g., $x \ge 7$) and introduced Subset Queries. Subset queries ask if an entire hypercube is contained within the target. In the context of SMT solvers, these queries are often as computationally inexpensive as membership queries but provide significantly more information, leading to substantial performance gains.
A critical insight is that any union of hypercubes is defined by its "maximal" and "minimal" corners. By utilizing binary search to locate these lattice points, the algorithm avoids the need for exhaustive enumeration, making the problem tractable for fixed dimensions.
Experimental Evaluation
The algorithm was tested against a custom micro-benchmark suite designed to challenge geometric learning, including diagonal overlaps, large overlapping cubes, and unbounded regions. In head-to-head comparisons with mondec1, a state-of-the-art generic monadic decomposition tool, the "maxcube optimized" version of the overshooting algorithm demonstrated superior performance and stability. While generic procedures struggled with large-scale overlapping objects, this approach remained robust.
Conclusion and Future Work
While the algorithm is polynomial in the number of cubes $n$ for a fixed dimension $d$, it remains exponential in $d$. This "curse of dimensionality" is expected given the relationship to DNF learning. Future research directions include handling periodic constraints (e.g., "$x$ is even") by encoding them into additional coordinates and exploring outputs in "If-Then-Else" structures to produce more compact representations for solvers.
Summary updated