ILP System for ASP Heuristics
- Inductive Logic Programming for ASP is a framework that learns rules under stable model semantics using structured examples and mode bias to define the hypothesis space.
- The system employs the FastLAS engine and conflict-driven ILP techniques to generate, score, and integrate candidate rules as domain-specific heuristics in ASP solvers.
- Empirical evaluations on the House Reconfiguration Problem show that learned soft heuristics can enhance solver performance, although human-crafted heuristics may sometimes perform better.
An Inductive Logic Programming (@@@@6@@@@) System for Answer Set Programming (ASP) is a computational framework that automates the induction of ASP rules or constraints from structured examples and background knowledge. ASP is a declarative logic programming paradigm based on stable model semantics, and ILP systems for ASP extend classical ILP by supporting nonmonotonic reasoning, context-dependent examples, and learning in the presence of complex ASP constructs, including choice rules, constraints, and weak constraints. This article surveys state-of-the-art ILP systems for ASP, focusing on their formal foundations, hypothesis languages, algorithmics (including conflict-driven learning and heuristic induction), practical applications (notably in domain-specific heuristic learning), and empirical results, with a primary technical case study from the automatic derivation of clingo heuristics via FastLAS (Comploi-Taupe, 2023).
1. Formal Learning Framework in ILP for ASP
Inductive logic programming for ASP is typically posed as a search for a hypothesis (a set of ASP rules) that, together with background knowledge , explains a set of context-dependent examples under the stable model semantics. Each example consists of sets of included () and excluded () atoms, and a context program (instantiating the facts of a problem instance). The core coverage criterion is:
- is covered by if there exists an answer set of with and .
- For negative examples, the requirement is that no answer set of satisfies the inclusion/exclusion conditions.
Learning is formulated as searching for , where is the hypothesis language specified by the mode bias (sets of syntactic templates indicating which predicates and argument types/ranges may be used in rule heads and bodies). The objective in noise-free settings is to minimize hypothesis size , while in noisy or penalized settings the objective is
where is the penalty (e.g., for uncovered or miscovered examples) (Comploi-Taupe, 2023, Law et al., 2020).
2. Hypothesis Language, Mode Bias, and ASP Mapping
The hypothesis space in ILP for ASP is rigorously controlled by mode declarations, which restrict the allowable shape of learned rules:
- For each admissible head predicate , declare
#modeh a(var(arg_1), ..., var(arg_k)). - For each body predicate , declare
#modeb b(var(arg_1), ..., var(arg_m)).
Variables are explicitly typed using strict-type predicates generated in , ensuring safety and correct grounding. The space includes all rules with syntactic forms admitting modeh and modeb predicates, subject to safety and domain constraints (Comploi-Taupe, 2023). The learned hypothesis comprises definite rules of the form:
To integrate learned rules as domain-specific heuristics in clingo, each -rule is mapped to a #heuristic directive:
$\texttt{#heuristic ~a~ :~ b_1,...,b_r.~[w, m]}$
where and encode the weight and mode of the heuristic (e.g., hard assignment or “soft” scoring ) (Comploi-Taupe, 2023).
3. Inductive Algorithmics: FastLAS and Conflict-Driven ILP
The system outlined in (Comploi-Taupe, 2023) leverages the FastLAS engine, which innovatively implements ILP for ASP by encoding the learning task as a sequence of meta-ASP problems:
- Initialization: Begin with .
- Iteration: Check which examples remain uncovered (positive: not explained; negative: erroneously explained) by .
- Candidate Generation: From the current mode bias, generate candidate rules that cover at least one uncovered positive without violating negatives; use refinement operators that iteratively specialize rule bodies by adding literals.
- Scoring: Rank each candidate rule by net gain (number of positives newly covered minus negatives violated, or net penalty reduction).
- Update: Add the best candidate to ; repeat until all examples are covered or a termination criterion is met.
This algorithm is implemented entirely as an ASP meta-program using weak constraints to encode the optimization objectives and coverage penalties. No external search is needed aside from enumeration and constraint solving by the ASP solver itself.
The CDILP (Conflict-Driven ILP) paradigm relates closely, as seen in the lineage of ILASP systems. In these, coverage constraints derived from failed examples are used to prune entire classes of hypotheses. This enables efficiency and scalability to problems with large rule and example spaces, and supports noise robustness (Law, 2020, Law et al., 2020).
4. Feature Representation and Example Extraction
In the experimental instantiation for the House Reconfiguration Problem (HRP), positive examples are obtained by running ASP solving (clingo) with built-in or human-crafted heuristics on small representative instances. For each (near-)optimal answer set , only those atoms with predicates matching modeh declarations are retained as inclusions for one positive example; excluded atoms may be empty if no explicit negatives are available.
Background knowledge is reduced to strict-type declarations, and context-specific facts are embedded in each example's . By confining training to small but representative instances (e.g., four for HRP), the system leverages ASP's expressiveness while avoiding the combinatorial blowup associated with learning over large, complex programs (Comploi-Taupe, 2023).
5. Empirical Evaluation: Domain-Specific Heuristic Induction
The system was evaluated on 94 HRP test instances (up to 800 objects), with four learning scenarios:
- Plain encoding: No domain heuristics.
- Learned (hard): Heuristics — atom forced to true.
- Learned (soft): Heuristics — doubles VSIDS score.
- Built-in optimization heuristics.
- Human-made heuristics (baseline).
Key findings [Table 1, (Comploi-Taupe, 2023)]:
- Among 30 “solved” instances, the learned (soft) heuristics improved solution quality in 20 cases (up to +40%) and deteriorated in 6 (vs. base). Learned (hard) heuristics helped in only 3 cases.
- Human-made heuristics still outperformed learned ones on 23/30 solved cases, but learned heuristics showed statistically significant improvements over the plain solver, especially for medium instances.
- “Soft” steering (factor) is more robust than “hard” settings; learning from near-optimal solutions is sufficient; even minimal training data suffices for meaningful enhancement.
- Richer mode biases and larger/more diverse training sets may further improve efficacy.
6. Observed Limitations and Research Directions
While the outlined approach demonstrates that data-efficient ILP can induce meaningful heuristics for large-scale ASP problem solving, several limitations and future avenues are noted:
- The expressiveness of learned heuristics is fundamentally tied to the allowed mode bias. Incorporating aggregates or optimization/sum predicates in modeb could increase learning power.
- Only head predicates of choice rules are currently targeted for heuristic induction. Extending coverage to body and constraint-level heuristics may yield further solver improvements.
- The system assumes noiseless or low-noise examples; integrating robust loss functions or more advanced penalization for noisy input would generalize applicability.
- The approach is domain-agnostic but tested solely on a combinatorial optimization task in HRP. Application to other domains (planning, diagnosis, scheduling) and integration with more sophisticated learning paradigms remain open directions (Comploi-Taupe, 2023).
7. Context within the ILP-for-ASP Ecosystem
The FastLAS approach for learning clingo heuristics is one in a family of ILP-for-ASP systems characterized by declarative meta-encoding, scalability via conflict-driven reduction, and strong reliance on mode-bias-controlled search spaces. In the broader ILP field, it contrasts with both earlier exhaustive meta-level encodings (e.g., ASPAL (Cropper et al., 2020)) and recent highly scalable, constraint-driven learning frameworks (ILASP3/4 (Law et al., 2020, Law, 2020)). The central insight is that the logical transparency of induced rules permits direct translation to ASP native heuristic specifications, offering both interpretability and practical acceleration in hard combinatorial domains. This convergence of logic-based learning and ASP-grounded solving marks a significant advancement in the automation of solver configuration and domain-specific program synthesis.