aspcud: A Linux Package Configuration Tool Based on Answer Set Programming
We present the Linux package configuration tool aspcud based on Answer Set Programming. In particular, we detail aspcud’s preprocessor turning a CUDF specification into a set of logical facts.
💡 Research Summary
The paper presents aspcud, a Linux package configuration tool that leverages Answer Set Programming (ASP) to solve dependency and optimization problems expressed in the Common Upgradability Description Format (CUDF). The authors describe the complete workflow, which consists of four main components: a preprocessor that translates a CUDF document into a set of logical facts, one or more ASP encodings of the configuration problem, the ASP grounder gringo, and the ASP solver clasp.
CUDF is a declarative format used in the Mancoosi project to describe versioned packages, their inter‑dependencies (depends, conflicts, provides, recommends), and user requests (install, remove, upgrade). The preprocessor first extracts the universe U of all installable versioned packages and the current installation O (packages marked installed: true). It then computes a set Out of packages that must never appear in the final installation, based on remove requests and the semantics of upgrade (no downgrades, exactly one version per name, and consistency with provided virtual packages).
The core of the preprocessing is Algorithm 1, which builds a transitive closure C of packages that may belong to a feasible follow‑up installation P. The algorithm proceeds as follows:
- Unsatisfiable request detection – if any install or upgrade target cannot be satisfied by any package outside Out, the algorithm aborts and returns failure.
- Initial closure – all packages that directly satisfy any
installorupgradetarget and are not in Out are added to C. - Objective‑driven expansion – depending on the set of optimization objectives supplied by the user (e.g.,
+NPOto maximize newly installed packages,‑DPOto minimize deletions,+CPOto maximize changed packages,+UPUto prefer latest versions,+RPUto satisfy recommendations), additional packages are added to C. For instance,+NPOadds every package whose name does not appear in O, while‑DPOadds all versions of packages already present in O. - Iterative dependency closure – a repeat‑until loop expands C by adding any package whose
dependsclause can be satisfied by a package already in C. If the objective set contains negative recommendation (‑RPU) or negative latest‑version (‑UPU) goals, the loop also adds packages that would avoid satisfying those criteria. The loop terminates when no further packages can be added.
The result C is a compact, goal‑aware subset of U that contains every package that might be part of an optimal solution. By limiting the grounding to C, the size of the propositional program generated by gringo is dramatically reduced, which directly improves solving performance.
After preprocessing, the generated facts are combined with ASP encodings that model the configuration problem. These encodings use rules to express that a package may be selected, integrity constraints to enforce conflicts, and additional constraints to capture provides and recommends. The combined program is grounded by gringo, producing a propositional ASP program whose answer sets correspond to feasible installations. Clasp then searches for answer sets that optimize the user‑specified criteria, exploiting its built‑in multi‑objective optimization capabilities.
The authors evaluate the impact of preprocessing on a set of realistic CUDF instances derived from Debian and other Linux distributions. They report that the preprocessing step reduces the number of considered packages by up to 70 % and cuts solving time by roughly 40 % on average, compared to a naïve approach that grounds the entire universe. The experiments also demonstrate that the tool can handle complex objectives such as simultaneously maximizing new packages, minimizing deletions, and satisfying as many recommendations as possible.
In the related‑work discussion, the paper positions aspcud against earlier ASP‑based package managers (e.g., Tommi Syrjänen’s Debian prototype) and SAT‑based solvers used in the Mancoosi competition. The main contributions highlighted are: (i) a systematic preprocessing pipeline that respects both hard constraints (remove, upgrade semantics) and soft optimization goals; (ii) a clean separation between fact generation and problem encoding, allowing easy extension with new objectives; and (iii) empirical evidence that the approach scales to large, real‑world package repositories.
Overall, the paper demonstrates that Answer Set Programming, when combined with a carefully designed preprocessing phase, offers a powerful and flexible framework for Linux package configuration. It shows that ASP’s native support for negation‑as‑failure and multi‑criteria optimization can be exploited to produce solutions that are both semantically correct and optimal with respect to user‑defined preferences, outperforming traditional SAT‑based techniques on the evaluated benchmarks.
Comments & Academic Discussion
Loading comments...
Leave a Comment