Source-linked AI summary
Clingo = ASP + Control: Preliminary Report
Martin Gebser, Roland Kaminski, Benjamin Kaufmann, Torsten Schaub
TL;DR
Clingo 4 addresses the rigidity of one-shot ASP systems for reasoning processes in which programs evolve through changing data or constraints. It combines modular subprograms with embedded scripting to control integrated grounding and solving, enabling incremental, reactive, optimization, and theory-solving workflows while reducing redundant relaunches. Its semantics nevertheless assume compositional modules, and the paper identifies future work on operationalizing updating and forgetting.
Problem
Standard ASP and earlier clingo systems use a rigid one-shot grounding-and-solving process, limiting reasoning processes whose programs evolve during computation.
Method
Clingo 4 combines named parameterizable subprograms, embedded Lua or Python control, and directives such as #external within one integrated grounding-and-solving process.
Results
Clingo 4 supports evolving programs, incremental optimization, sequential model-based solving, and reactive control without repeatedly relaunching grounder and solver programs.
Takeaways & Limitations
The framework supersedes dedicated incremental and reactive predecessors by providing modular, controllable ASP reasoning across planning, interaction, theory solving, and advanced search.
Takeaways & Limitations
Clingo 4 assumes compositional modules, requiring definitions and mutual positive dependencies to remain local to evolving ground programs.
Abstract
from arXiv · showhide
We present the new ASP system clingo 4. Unlike its predecessors, being mere monolithic combinations of the grounder gringo with the solver clasp, the new clingo 4 series offers high-level constructs for realizing complex reasoning processes. Among others, such processes feature advanced forms of search, as in optimization or theory solving, or even interact with an environment, as in robotics or query-answering. Common to them is that the problem specification evolves during the reasoning process, either because data or constraints are added, deleted, or replaced. In fact, clingo 4 carries out such complex reasoning within a single integrated ASP grounding and solving process. This avoids redundancies in relaunching grounder and solver programs and benefits from the solver's learning capacities. clingo 4 accomplishes this by complementing ASP's declarative input language by control capacities expressed via the embedded scripting languages lua and python. On the declarative side, clingo 4 offers a new directive that allows for structuring logic programs into named and parameterizable subprograms. The grounding and integration of these subprograms into the solving process is completely modular and fully controllable from the procedural side, viz. the scripting languages. By strictly separating logic and control programs, clingo 4 also abolishes the need for dedicated systems for incremental and reactive reasoning, like iclingo and oclingo, respectively, and its flexibility goes well beyond the advanced yet still rigid solving processes of the latter.
1 Introduction
Standard ASP uses a rigid one-shot grounding-and-solving process, and earlier clingo versions were monolithic combinations of gringo and clasp. Clingo 4 introduces high-level control for more complex, evolving reasoning processes.
- 1 Introduction: Standard ASP computes stable models through a one-shot process with separate grounding and solving stages.The grounder first generates a finite propositional representation, after which the solver computes stable models.
- 1 Introduction: Earlier clingo versions combined the gringo grounder and clasp solver without integrated high-level control.The passage characterizes prior clingo as a mere combination of these components.
- 1 Introduction: Clingo 4 provides high-level constructs for complex reasoning processes whose problem specifications evolve during reasoning.Such evolution can involve adding, deleting, or replacing data or constraints.
- 1 Introduction: Clingo 4 integrates grounding and solving in one process while separating declarative logic from procedural control.Control is expressed through embedded Lua and Python scripting, while logic is organized through named, parameterizable subprograms.
2 Controlling grounding and solving in clingo 4
Clingo 4 structures logic programs into parameterized subprograms and exposes procedural control over grounding, solving, evolving inputs, and solver interaction. This supports modular reasoning while retaining a compositionality assumption for well-defined semantics.
- Subprograms: The #program directive groups nonground rules into named subprograms with optional parameters.Rules remain in the subprogram scope until the next directive or end of file.
- Subprograms: The parameterless base subprogram collects ordinary rules by default, while other subprograms require scripting control.Without further instructions, clingo 4 grounds and solves only base.
- Procedural control: Lua and Python main routines control which subprograms are grounded and when solving occurs.Ground instructions instantiate selected subprograms, whereas solve reasons over accumulated ground rules.
- Evolving programs: The #external directive declares atoms that can be defined by rules added later, allowing evolving ground programs to activate or deactivate inputs.These atoms are treated as module inputs and are not simplified to false.
- Evolving programs: Schematic externals are embedded in grounding and identify input atoms for subprogram instances without contributing ground rules.Their grounding behavior relies on virtual rules and parameter replacement for subprogram instances.
- Semantics: Clingo 4 assumes that modules induced by instantiated subprograms are compositional, requiring local definitions and positive dependencies.This assumption provides the basis for well-defined semantics when programs evolve.
3 Using clingo 4 in practice
Clingo 4 applies its control framework to incremental reasoning, planning, optimization, and reactive solving. Programs and objectives can evolve across solver invocations while reusing accumulated grounding and solver state.
- Incremental reasoning: Clingo 4 reproduces iclingo-style incremental reasoning by partitioning programs into base, cumulative, and volatile parts.This processes extensions gradually rather than repeatedly re-processing the entire problem.
- Incremental reasoning: The Towers of Hanoi example separates static instance knowledge, cumulative transitions, and a volatile query controlled by an external atom.A Python script grounds the base once and iterates over subsequent steps.
- Incremental optimization: Incremental optimization extends objective functions with new terms as successive subprogram instances are grounded and solved.Previous objective atoms are retained when cumulativeObjective(t) is processed for later t values.
- Incremental optimization: External atoms can remove corresponding literals from evolving objective functions when their activation is disabled.For volatileObjective(t), setting activateObjective(t) false dismisses the associated move/5 atoms from objectives.
- Reactive solving: Model callbacks support adding constraints based on prior stable models, including theory consistency checks and externally evaluated objectives.Asynchronous solving additionally allows reactive interruption when new external information arrives.
- Solver configuration: Solver configuration can change between steps, including search parameters, reasoning modes, and thread counts.This is useful for computational tasks that generate several models, such as optimal planning.
4 Related work
Related systems provide overlapping forms of procedural attachment, incremental solving, or external computation, but differ in integration level and scope. Clingo 4 emphasizes fine-grained control over grounding and solving within an ASP system.
- Related systems: Dlvhex integrates external computation through higher-order external atoms while using gringo and clasp as back-ends.Its external atoms are procedurally evaluated and should not be confused with clingo’s #external directive.
- Related systems: Unlike tightly integrated theory solvers such as clingcon, clingo 4’s lightweight theory-solving approach accesses only total stable assignments.The related approach gives theory solvers access to partial assignments during solving.
- Related systems: The idp system also supports repeated grounding and solving, solution inspection, and reactions to external input through C++ and Lua interfaces.Clingo 4 instead offers more fine-grained control over the grounding and solving process.
- Related systems: SAT incremental APIs support solving under assumptions but do not provide modeling languages or grounding because SAT handles propositional formulas only.Clingo 4 combines incremental solver capabilities with ASP modeling and grounding.
5 Discussion
clingo 4 provides a generic framework for dynamically combining logic programs through embedded control and module-theoretic foundations. Its scope includes extended ASP capabilities, while practical support for dedicated change operations remains future work.
- Dynamic control: Embedded scripting and a dedicated library let clingo 4 add, delete, replace, and instantiate subprograms between solver invocations.This supports planning, robotics, stream reasoning, theory solving, and other evolving reasoning processes within one integrated grounding-and-solving process.
- Semantic foundations: Module theory provides the semantic foundations for dynamically combining logic programs in a generic way.
- Open directions: Updating and forgetting are identified as dedicated change operations whose practical integration remains future work.
- System scope: clingo 4 extends ASP-Core-2, accepts extended disjunctive programs, and includes multithreaded solving, domain-specific heuristics, and unsatisfiable-core optimization.These capabilities are described across clingo 4 and version 4.3.