Papers
Topics
Authors
Recent
Search
2000 character limit reached

Clingcon 3: Hybrid CASP Solver

Updated 7 July 2026
  • Clingcon 3 is the third generation constraint answer set system that integrates ASP with finite-domain constraint propagation using lazy translation and dedicated propagators.
  • It employs advanced preprocessing and order encoding techniques, such as view elimination and domain splitting, to optimize performance on combinatorial problems.
  • Empirical evaluations show that clingcon 3 outperforms other CP and CASP systems, particularly in bounded-horizon tasks like traffic signal optimization.

Searching arXiv for the cited clingcon 3 papers to ground the article in current records. to=arxiv_search tool 天天中彩票不中返json {"query":"clingcon 3 arXiv (Banbara et al., 2017, Cabalar et al., 2021) traffic signal optimisation clingcon (Tarzariol et al., 25 Jul 2025)", "max_results": 10} I found the relevant arXiv entries and will use them as citations in the article. clingcon 3 is the third generation of the constraint answer set system clingcon, combining Answer Set Programming (ASP) with finite domain constraint processing (CP) (Banbara et al., 2017). It is built as an extension of clingo 5, itself consisting of the grounder Gringo and the solver clasp, and it uses Gringo’s generic theory handling capabilities to accommodate a hybrid modeling language without a dedicated parser or pre-processor (Banbara et al., 2017). In the literature represented here, clingcon 3 appears both as a general-purpose CASP system with lazy constraint propagation and as a practical engine for bounded-horizon optimization, including a CASP-based solution for traffic signal optimisation (Tarzariol et al., 25 Jul 2025).

1. System architecture and position within hybrid ASP

clingcon 3 is presented as an extension of clingo 5 in which parsing, grounding, and solving remain closely aligned with the ASP toolchain while finite-domain constraints are integrated through theory atoms and dedicated propagators (Banbara et al., 2017). The front end uses Gringo’s “theory language” interface to parse a small constraint grammar including dom, sum, distinct, show, and minimize, and grounding emits the usual aspif format augmented with theory atoms and dedicated order-atom placeholders such as (x ≤ d) (Banbara et al., 2017). The solver layer is clasp’s CDCL engine extended by partial translation of a subset of constraints into ordinary nogoods and by lazy CP-propagators that implement the remaining constraints and the order-encoding on demand (Banbara et al., 2017).

This design distinguishes clingcon 3 from earlier clingcon versions that relied on a black-box approach integrating the CP solver gecode (Banbara et al., 2017). The new system instead pursues a lazy approach using dedicated constraint propagators to extend propagation in the underlying ASP solver clasp, and the abstract emphasizes that no extension is needed for parsing and grounding because these are accommodated by Gringo’s generic theory handling capabilities (Banbara et al., 2017). The paper further states that all of clasp’s features, including multi-threading, multi-shot or incremental solving, unsat-core and multi-objective optimization, user-defined heuristics, and output-filtering, carry over to clingcon 3 almost unchanged (Banbara et al., 2017).

A plausible implication is that clingcon 3 should be understood less as an external solver coupled to ASP than as a tightly integrated ASP modulo finite-domain constraints environment. That interpretation is directly supported by the paper’s summary that, in practice, it amounts to “Clingo 5 + a first-class FD-propagator” (Banbara et al., 2017).

2. Constraint language, theory atoms, and lazy propagation

clingcon 3 employs theory atoms as first-class objects in the grounded program. In the traffic-signal encoding, two main kinds of theory atoms are highlighted: &dom{ℓ..u}=x, which enforces the integer domain xu\ell \le x \le u, and &sum{…}=s, which encodes linear equality constraints Σ coefficientsvariables=s\Sigma\ \text{coefficients}\cdot\text{variables} = s; optimization directives are expressed through &maximize{x} and &minimize{x} (Tarzariol et al., 25 Jul 2025). In the broader system description, theory atoms for linear constraints take forms such as

sum{k1x1;;knxn}k0\mathit{sum}\{k_1*x_1;\dots;k_n*x_n\}\prec k_0

with {=,!=,,<,>,}\prec \in \{=, !=, \le, <, >, \ge\} and kiZk_i \in \mathbb{Z} (Cabalar et al., 2021).

The operational core is a lazy CDCL+CP loop. The system maintains three kinds of nogoods: ΔPC\Delta_P^{\mathcal C} for completion, ΛPC\Lambda_P^{\mathcal C} for loop or unfounded-set reasoning, and Ψ(C)\Psi(\mathcal C') for a fully translated subset of constraint nogoods together with order-nogoods for small constraints (Banbara et al., 2017). All other CSP constraints are handled by a propagator ΠCSP\Pi_{\text{CSP}} that watches the current partial assignment, generates new order-atoms, generates the corresponding nogoods only when needed, and reports conflicts and unit propagations back to clasp (Banbara et al., 2017). The propagation cycle interleaves UnitPropagation, UfsPropagation, and CspPropagation, and each time CspPropagation detects that a constraint would propagate or conflict, it introduces the needed order-atoms, adds the corresponding nogood, and returns control so clasp can resume unit propagation (Banbara et al., 2017).

For solving behavior in concrete optimization tasks, the traffic-signal study gives an explicit four-stage integration pattern: after grounding, each theory atom is passed to an embedded theory propagator; the propagator maintains domain intervals, watches sums, and communicates nogoods back to the ASP solver; Boolean decisions on ASP atoms trigger theory-level propagation such as domain prunings and bound checks; and branch-and-bound over &maximize or &minimize variables is orchestrated by clingo’s optimizing loop (Tarzariol et al., 25 Jul 2025). The same source notes that clingcon 3 can be configured, for example with crafty, to use clingo’s VSIDS-style heuristics for Boolean atoms and smallest-domain heuristics for constraint variables (Tarzariol et al., 25 Jul 2025).

3. Formal characterization and semantics

A semantics for clingcon 3 is developed within the framework of abstract and structured theories and related to the logic of Here-and-there with constraints (HTc) (Cabalar et al., 2021). In this account, an abstract theory is a triple $\langle \TS,\Sol,\compl\rangle$ consisting of a set of theory atoms, a set of satisfiable subsets, and a complement operator assigning to each atom its complement, with Σ coefficientsvariables=s\Sigma\ \text{coefficients}\cdot\text{variables} = s0 (Cabalar et al., 2021). A structured presentation then specifies variables, a domain, variable-occurrence information, valuations, and denotations for theory atoms, subject to monotonicity and variable-irrelevance conditions (Cabalar et al., 2021).

For clingcon 3 programs, the ground alphabet is partitioned into ordinary atoms and theory atoms, and theory atoms are further classified so that those in rule heads are founded while those in bodies are external (Cabalar et al., 2021). The semantic procedure first generates stable models of a transformed program

Σ coefficientsvariables=s\Sigma\ \text{coefficients}\cdot\text{variables} = s1

for some choice Σ coefficientsvariables=s\Sigma\ \text{coefficients}\cdot\text{variables} = s2, and then checks through the theory of linear constraints that Σ coefficientsvariables=s\Sigma\ \text{coefficients}\cdot\text{variables} = s3 is a solution (Cabalar et al., 2021). The direct HTc translation maps ordinary propositional atoms to equalities of the form Σ coefficientsvariables=s\Sigma\ \text{coefficients}\cdot\text{variables} = s4 and maps theory atoms to the corresponding linear constraints; every rule becomes an HTc implication, and each external theory atom receives a choice axiom of the form

Σ coefficientsvariables=s\Sigma\ \text{coefficients}\cdot\text{variables} = s5

The main theorem establishes a one-to-many correspondence between Σ coefficientsvariables=s\Sigma\ \text{coefficients}\cdot\text{variables} = s6-stable models of a clingcon 3 program and equilibrium models Σ coefficientsvariables=s\Sigma\ \text{coefficients}\cdot\text{variables} = s7 of the associated HTc theory, yielding soundness, completeness, and model correspondence (Cabalar et al., 2021).

The same semantic treatment records an important difference from clingcon 1 and 2. Earlier incarnations treated every theory atom as external, whereas clingcon 3 refines this by partitioning Σ coefficientsvariables=s\Sigma\ \text{coefficients}\cdot\text{variables} = s8 so that founded theory atoms must be derived via program rules while external theory atoms remain free in the choice phase (Cabalar et al., 2021). This is described as yielding a cleaner correspondence theorem and enabling further extensions within the same uniform HTc setting (Cabalar et al., 2021).

4. Preprocessing, order encoding, and performance-oriented techniques

A central component of clingcon 3 is its management of order encoding and selective unfolding. For each integer variable Σ coefficientsvariables=s\Sigma\ \text{coefficients}\cdot\text{variables} = s9 and each sum{k1x1;;knxn}k0\mathit{sum}\{k_1*x_1;\dots;k_n*x_n\}\prec k_00, the formalization introduces an order atom sum{k1x1;;knxn}k0\mathit{sum}\{k_1*x_1;\dots;k_n*x_n\}\prec k_01, and a pure CSP constraint such as sum{k1x1;;knxn}k0\mathit{sum}\{k_1*x_1;\dots;k_n*x_n\}\prec k_02 is captured by nogood sets sum{k1x1;;knxn}k0\mathit{sum}\{k_1*x_1;\dots;k_n*x_n\}\prec k_03 and sum{k1x1;;knxn}k0\mathit{sum}\{k_1*x_1;\dots;k_n*x_n\}\prec k_04 (Banbara et al., 2017). In actual solving, clingcon 3 fully generates only a subset sum{k1x1;;knxn}k0\mathit{sum}\{k_1*x_1;\dots;k_n*x_n\}\prec k_05 and a restricted order set, leaving the rest to the propagator, which unfolds a constraint only when needed (Banbara et al., 2017). The paper explicitly states that no CSP-related nogood appears unless it actually participates in propagation or conflict (Banbara et al., 2017).

The system implements a suite of CP preprocessing methods before search. View elimination avoids introducing a fresh variable for a one-variable linear expression such as sum{k1x1;;knxn}k0\mathit{sum}\{k_1*x_1;\dots;k_n*x_n\}\prec k_06 and instead reuses sum{k1x1;;knxn}k0\mathit{sum}\{k_1*x_1;\dots;k_n*x_n\}\prec k_07’s order-atoms, which the paper says cuts both variables and nogoods in half (Banbara et al., 2017). Equality processing substitutes variables throughout the remaining CSP when an equality such as sum{k1x1;;knxn}k0\mathit{sum}\{k_1*x_1;\dots;k_n*x_n\}\prec k_08 or its complement is fixed to true or false, thereby removing pairs of variables and splitting large-domain sums into smaller ones (Banbara et al., 2017). Domain splitting estimates the cost of translating a linear constraint by the size of the order-encoding and, if this exceeds a threshold sum{k1x1;;knxn}k0\mathit{sum}\{k_1*x_1;\dots;k_n*x_n\}\prec k_09, splits the linear constraint into smaller ones via fresh auxiliary variables (Banbara et al., 2017). Further techniques include entailment and bound-checking, distinct handling either through pairwise inequalities or a direct encoding plus a cardinality constraint per value, and don’t-care half-reification propagation for certain constraint-atoms that occur only in integrity constraints and always positively or negatively (Banbara et al., 2017).

The empirical feature study on 16 optimization problems from the MiniZinc 2015 competition reports that equality processing, don’t-care propagation, flattening objectives, strong bound propagation with prop-strength=4, and selective translation of “small” constraints up to 10,000 nogoods all significantly boost performance (Banbara et al., 2017). The same study reports that global distinct was best handled by the pairwise inequality encoding augmented with pigeon-hole constraints, while aggressive splitting of constraints or eager generation of all order-atoms hurt performance (Banbara et al., 2017). These findings situate clingcon 3’s performance not simply in its modeling language but in the interaction between lazy translation, preprocessing, and clasp’s conflict-driven search.

5. Empirical evaluation against CP and CASP systems

The 2017 evaluation is organized into three blocks: an internal feature study, a comparison to CP solvers, and a comparison to other CASP systems (Banbara et al., 2017). The internal study uses 16 optimization problems from the MiniZinc 2015 competition, including “costas,” “cvrp,” “freepizza,” “gfd-schedule,” “grid-colour,” “knapsack,” and “triangular,” with a Borda-count style score on solution quality plus runtime (Banbara et al., 2017). This study identifies the configuration choices summarized above as beneficial.

In the comparison to CP solvers, the best clingcon 3 configuration is evaluated against G12-FD, Gecode, MiniSATid, Chuffed, and PicatSAT on the same MiniZinc 2015 set (Banbara et al., 2017). The reported result is that clingcon 3 beats G12-FD, Gecode, MiniSATid, and PicatSAT, and is competitive with Chuffed; on many classes, including freepizza, grid-colour, knapsack, and spot5, it even outperformed Chuffed (Banbara et al., 2017).

The comparison to other CASP systems uses 2D strip-packing, incremental scheduling, weighted sequence, and reverse folding, and compares Clingo 5, Clingcon 2, Inca, Aspartame, EZCSP, EZSMT, and Clingcon 3 (Banbara et al., 2017). The reported outcome is that clingcon 3 vastly improves on Clingcon 2 and on Inca, Aspartame, and EZCSP, and even slightly beats EZSMT; in 2D packing, clingcon 3 won 28 out of 40 instances, and in several ASP-competition tracks it was either best or very close to best (Banbara et al., 2017). Within the limits of the benchmark suite, this suggests that the integrated CP-propagator approach pays off in real CASP applications.

6. Bounded-horizon traffic signal optimisation as a case study

A 2025 study applies clingcon 3 to traffic signal optimisation, defined there as determining the optimal green length for each signal in a set of traffic signals (Tarzariol et al., 25 Jul 2025). The work proposes a CASP encoding for the entire corridor at discrete seconds {=,!=,,<,>,}\prec \in \{=, !=, \le, <, >, \ge\}0, with decision variables selecting exactly one cycle-configuration for each junction and cycle step, precomputed stage and intergreen timing functions, and integer variables for link occupancies and cumulative arrivals (Tarzariol et al., 25 Jul 2025). For each link {=,!=,,<,>,}\prec \in \{=, !=, \le, <, >, \ge\}1 and timestep {=,!=,,<,>,}\prec \in \{=, !=, \le, <, >, \ge\}2, the encoding introduces

{=,!=,,<,>,}\prec \in \{=, !=, \le, <, >, \ge\}3

together with auxiliary flow deltas and update constraints encoded as &sum theory atoms (Tarzariol et al., 25 Jul 2025). The objective at horizon {=,!=,,<,>,}\prec \in \{=, !=, \le, <, >, \ge\}4 is to maximize {=,!=,,<,>,}\prec \in \{=, !=, \le, <, >, \ge\}5, encoded as &maximize{ cnt(H,ℓ) : goal(ℓ) } (Tarzariol et al., 25 Jul 2025).

The solving process is described in concrete stages. Grounding instantiates ASP rules and theory-atom templates up to {=,!=,,<,>,}\prec \in \{=, !=, \le, <, >, \ge\}6 over the corridor links; initialization registers domain constraints and linear equations; search selects Boolean literals such as conf(J,k,T,A) by a VSIDS-style heuristic, while the theory propagator checks feasibility and learns nogoods when &sum constraints become sufficiently decided; optimization extracts the current objective value from the &maximize directive and adds a bounding constraint to push for strictly larger sums; and termination occurs by time-out, memory limit, or proof of optimality under the given horizon (Tarzariol et al., 25 Jul 2025).

The benchmark uses the corridor of the Huddersfield ring-road to M62/M1, with 6 junctions and 34 links, seven traffic scenarios, two historical data sets, and five sub-instances {=,!=,,<,>,}\prec \in \{=, !=, \le, <, >, \ge\}7 per scenario, for a total of 70 instances (Tarzariol et al., 25 Jul 2025). On hardware specified as AMD EPYC 9354(4) @ 3.2 GHz with 32 GB RAM and Ubuntu 22.04, the experiments use clingcon 3.2.1 with libclingo 5.8.0, --config=crafty, and a timeout of 600 s; the PDDL+ baseline is the FiRe model via enhsp with Java OpenJDK 21 (Tarzariol et al., 25 Jul 2025).

Three tasks are reported. In a decision task with a lower bound derived from FiRe, clingcon matches or strictly improves 27–35 out of 70 instances under 600 s for horizons 600–840 s, and 27 out of 70 at 900 s, where 43 time out; typical improvements are 2–10% in total throughput (Tarzariol et al., 25 Jul 2025). In pure optimization at {=,!=,,<,>,}\prec \in \{=, !=, \le, <, >, \ge\}8 s with a 10 min timeout, clingcon improves average throughput in 60–70 out of 35 runs per time-slice, except for an anomalous dip around 720 s where FiRe sometimes flushes certain links very quickly; the best gains occur for instances with 3–5 goals, while instances with 1–2 goals occasionally degrade due to unforeseen local congestion (Tarzariol et al., 25 Jul 2025). In a hybrid pipeline, FiRe’s returned {=,!=,,<,>,}\prec \in \{=, !=, \le, <, >, \ge\}9 is encoded as facts pddl_solution(ℓ,b) and clingcon re-solves under the stricter constraint kiZk_i \in \mathbb{Z}0, yielding strictly improved quality on approximately 50% of PDDL+ solutions within the same time-outs (Tarzariol et al., 25 Jul 2025).

7. Limitations, extensions, and broader use

The traffic-signal study explicitly identifies several strengths of the clingcon 3-based approach: native support for arithmetic and optimization, a global objective function with true optimality guarantees within a bounded horizon, modularity with respect to alternative objectives, and easy integration with existing ASP encodings of domain logic (Tarzariol et al., 25 Jul 2025). These points align closely with the 2017 system paper’s characterization of clingcon 3 as a tight CDCL+CP integration that combines selective eager translation for small constraints, fully lazy propagation and variable generation for large domains, a host of CP preprocessing techniques, and access to clasp’s advanced solving modes (Banbara et al., 2017).

The same application study also states the principal limitations. Grounding blow-up occurs if the horizon grows beyond approximately 200 s or if many junctions or configurations are involved, leading to out-of-memory conditions or timeouts; one-shot solving struggles to reuse knowledge across similar horizons or instance variants; and standard clingo heuristics are oblivious to traffic-specific structure such as stage synchrony and green-wave patterns (Tarzariol et al., 25 Jul 2025). Potential improvements listed there are multi-shot CASP solving, domain-specific heuristics, symmetry breaking on cycles and stage indices, and hybrid combinatorial optimization in which PDDL+ or local search provides an initial plan that is then polished via clingcon branch-and-bound (Tarzariol et al., 25 Jul 2025).

The broader applications named in the same source extend beyond traffic control to other fixed-horizon scheduling and resource-allocation tasks with both logical and numeric constraints, including manufacturing line balancing, drone routing with fuel constraints, timetabling problems where periods and resource capacities must be jointly optimized, and energy management for scheduling charge or discharge cycles in smart-grid microcells with demand and capacity constraints (Tarzariol et al., 25 Jul 2025). This suggests that clingcon 3 is best viewed as a general CASP substrate for problems in which logical structure, integer domains, and optimization objectives must be handled within a single solving framework.

Definition Search Book Streamline Icon: https://streamlinehq.com
References (3)

Topic to Video (Beta)

No one has generated a video about this topic yet.

Whiteboard

No one has generated a whiteboard explanation for this topic yet.

Follow Topic

Get notified by email when new papers are published related to clingcon 3.