Parametric Modular Answer Set Programs Made Declarative

JORGE FANDINNO, YULIYA LIERLER, TORSTEN SCHAUB · 2026

Read Parametric Modular Answer Set Programs Made Declarative by JORGE FANDINNO, YULIYA LIERLER, TORSTEN SCHAUB (2026) in the Tower of Babel, a free online library of public-domain works preserved in clean, searchable text. No sign-up. The full text is served as a plain-text file at a predictable URL, where text is present: https://antarctic-labs.com/tower-of-babel/arxiv-2605-22716.txt.

Introduction

Fandinno, Lierler and Schaub develop modularity for first order answer set programming through parametric modular logic programs. Subprograms gain parameters and intensionality statements, capturing the meaning of clingo programs under collective control, a feature for structuring and instantiating them. The paper supplies theory for modular ASP, shows its value, and connects the new formalism to older non modular ASP. The result gives logic coders a declarative route to reusable program modules.

Catalog record

CREATORJORGE FANDINNO, YULIYA LIERLER, TORSTEN SCHAUB
YEAR2026
COLLECTIONPAPERS
FORMATTXT
FILE SIZE54920
LICENSEhttp://creativecommons.org/licenses/by/4.0/
RIGHTSCC BY
SOURCEarXiv

Source: https://arxiv.org/abs/2605.22716

Browse the full library · About the Tower of Babel

Full text

The opening of the work, from the library's hosted text:

Parametric Modular Answer Set Programs Made Declarative JORGE FANDINNO, YULIYA LIERLER, TORSTEN SCHAUB Abstract In this paper, we explore the concept of modularity in first-order answer set programming (ASP). We introduce a new formalism called parametric modular logic programs, which allows defining subprograms with parameters and intensionality statements. We demonstrate how this formalism can capture the semantics of clingo-programs with collective control , a feature that enables structuring and instantiating subprograms. We provide theoretical foundations for modular ASP, illustrate its usefulness, and connect to traditional non-modular ASP. keywords Answer Set Programming, Modularity, Formal Methods 1 Introduction Answer set programming (ASP) is a well-established declarative logic programming paradigm under the answer set/stable models semantics ( Gelfond and Lifschitz 1988 ) . The ASP methodology relies on devising a logic program so that its answer sets are in one-to-one correspondence to the solutions of the target problem. This approach is fully declarative, since the logic program only describes a problem and conditions on its solutions, not the way to obtain them. The latter is delegated to systems called answer set solvers. A software engineer is then tasked with translating problem’s specifications into the formal language of logic programs rather than devising algorithms for obtaining solutions to a problem. Under these circumstances both the art of programming and the construction of an argument for code’s correctness become more direct ( Cabalar et al. 2020 ; Fandinno et al. 2020 ; Hansen and Lierler 2025 ; Fandinno et al. 2025 ) . This is essential in building trustworthy software solutions, making ASP a viable role player in the current programming landscape. Yet, to realize the full potential of ASP more attention to its theoretical and practical aspects have to be paid. Here, we target advancing theoretical foundations of the “modularity” frontiers of this programming paradigm. Modularity is one of the key techniques in principled software development, and it is essential for modeling large-scale practical applications. It provides a solid abstraction to study distinct approaches to solving a problem by identifying modules/parts of code that are responsible for different aspects and helps in constructing arguments of correctness by decomposing the argument about the whole program into arguments about its components ( Cabalar et al. 2020 ) . In general, traditional ASP programs lack modularity because subsections of the code cannot be evaluated in isolation. Most well known variants of ASP systems — lparse-smodels pair, earlier versions of clingo , dlv — expect a program at its full length bypassing any support for modularity. Yet, researchers realized early the importance of this aspect. Theoretical and practical advances exist. For instance, Oikarinen and Janhunen 2006 ; Oikarinen and Janhunen 2008 and Janhunen et al. 2007 devise a propositional modular framework for answer set programming and introduce concepts of equivalence for such programs; Harrison and Lierler 2016 introduce first-order modular logic programs. Lifschitz and Turner 1994 proposed splitting as a tool to “modularize” otherwise monolithic logic programs. Mentioned works were at the origin of more theoretical advances refining their proposals. On the practical side, Gebser et al. 2014 describe the {\mathit{ASP}\!+\!\mathit{control}} framework that, for example, allows encodings which include time horizons and assume repetitive code for each time step mimicking settings of planning domains. This framework was implemented within clingo 4. A PDDL planner plasp backed up by ASP technology utilizes this feature ( Dimopoulos et al. 2017 ) . Multi-shot solving ( Gebser et al. 2019 ) became one of the staples of clingo 5. It prominently positions an interactive mode of programming with ASP making control over ASP “modules” simple. Yet, control equates with a procedure that encroaches on the declarativness of ASP. In this paper, we study how “first-order modules” and “control” can be given a declarative meaning, by tackling on particular kind of control that we call collective . This work is a foundational step towards making the concepts pertaining (i) ASP modules as they are used in practice and (ii) control precise, well understood and declarative . This allow us to construct arguments of correctness for logic programs with collective control. This paper is organized as follows. We start by introducing a motivating example. We then introduce theoretical preliminaries. Modular programs are introduced as the basis for what we call parametrized modular logic programs. We conclude by illustrating how parametrized modular programs capture the semantics of programs such as the one discussed as a motivating example. We use this example to showcase possible formal claims that can be seen as arguments of correctness for modular ASP programs. 2 Motivating Examples We start by introducing a simple example that illustrates the key concepts of parametric modular logic programs and collective control. Listing 1: The property parametric-program ⬇ 1 # program base . 2 q (0,0). 3 # program property ( k ). 4 q ( N , k +1) :- q ( N -1, k ). Listing 1 contains two subprograms base and property(k) . Keyword base marks a dedicated subprogram (with an empty parameter list). The base subprogram in Listing 1 includes the single fact q(0,0) . Without further control instructions, clingo grounds and solves the base subprogram only. This yields the standard behavior of answer set systems. In order to process the other subprograms such as property(k) , control instructions have to be explicitly stated. For instance, assume the property parametric-program in the context of the following control : given a positive integer n , compute the answer sets of a program constructed from the property program by appending the content of its base program fact q(0,0) to n copies of the rules in property(k) where parameter k ranges from 0 to n-1 . (A) The python routine presented in Listing 2 below implements control ( A ). Listing 2: The implementation of control ( A ) ⬇ 5 #script(python) 6 from clingo . symbol import Number 7 def main ( prg ): 8 n = prg . get_const ( "n" ). number 9 subs = [( "base" ,[])] 10 for k in range (0, n ): 11 subs . append (( "property" ,[ Number ( k )])) 12 prg . ground ( subs ) 13 prg . solve () 14 #end. If the contents of Listings 1 and 2 are stored in a file named property.lp then the command line clingo property.lp -c n=100 (the presented code is compatible with clingo version 5.6) returns the unique answer set \{q(0,0)\;\;\ q(1,1)\;\;\ q(2,2)\;\;\ \dots\;\;\ q(100,100)\} . Directive -c n=100 provides a specific value 100 to be utilized in place of n by clingo . The while -loop of the routine in Listing 2 appends to the base program n pairs of the subprogram named property where the placeholder k is replaced by numbers 0 through n-1 . In line 12, the instruction is given to ground all rules in base together with all rules in the property subprograms with their parameters k substituted by the corresponding integers. In line 13, the resulting ground program is solved. Thus, the property parametric-program together with the specified control is understood as the following “typical” logic program: \displaystyle q(0,0).\qquad \displaystyle q(N,0+1)\texttt{ :- }q(N-1,0).\qquad \displaystyle q(N,1+1)\texttt{ :- }q(N-1,1). (1) \displaystyle\cdots \displaystyle q(N,99+1)\texttt{ :- }q(N-1,99). Though extremely simple, the

Read the complete text