Papers
Topics
Authors
Recent
Search
2000 character limit reached

Quantified Answer Set Programming (QASP)

Updated 14 January 2026
  • QASP is an extension of Answer Set Programming that incorporates first-order quantification over stable models, allowing for natural and modular problem modeling.
  • It models high-complexity tasks across the full polynomial hierarchy by using alternating existential and universal quantifiers over ASP components.
  • QASP supports optimization via weak constraints and leverages QBF reductions for applications in planning, policy extraction, and adversarial reasoning.

Quantified Answer Set Programming (QASP) is an extension of Answer Set Programming (ASP) that introduces first-order quantification over solution spaces, enabling natural, modular modeling of problems throughout the full polynomial hierarchy (PH). Like Quantified Boolean Formulas (QBF), QASP provides alternating existential and universal quantifiers, but quantifies over stable models (answer sets) of logic programs rather than over Boolean assignments. This paradigm has direct implications for knowledge representation, planning under uncertainty, nonmonotonic reasoning, optimization, and AI, affording a clean declarative mechanism for compactly encoding high-complexity computational tasks (Amendola et al., 2019, Fandinno et al., 2021, Mazzotta et al., 2024).

1. Syntax and Semantics

A Quantified Answer Set Program—also known in the literature as an ASP(Q) program—has the general form

1P12P2nPn:C\Box_1 P_1\, \Box_2 P_2\, \dots\, \Box_n P_n : C

where each i{st,st}\Box_i \in \{\exists^{\mathsf{st}}, \forall^{\mathsf{st}}\} denotes existential or universal quantification over answer sets of component program PiP_i, and CC is a stratified program of constraints for final coherence checking (Amendola et al., 2019, Faber et al., 2023). In practical (propositional) QASP, a quantified logic program (QLP) is written as

Q0X0Q1X1QnXn:PQ_0 X_0\, Q_1 X_1\, \dots\, Q_n X_n : P

where Qi{,}Q_i \in \{\exists, \forall\}, XiAX_i \subseteq \mathcal{A} (the universe of ground atoms), pairwise disjoint, and PP is an ordinary (unquantified) ASP program (Fandinno et al., 2021).

The semantic interpretation is given in terms of stable models using an inductive “fixing” mechanism. For any PP, IBPI \subseteq B_P, define fixP(I)={a.:aI}{a.:aBPI}\mathit{fix}_P(I) = \{a. : a \in I\} \cup \{\leftarrow a. : a \in B_P\setminus I\}. Coherence and existence of quantified answer sets follow the quantifier prefix: existential quantification seeks some answer set in one block satisfying the next block, while universal quantification requires all answer sets in a block to satisfy the next (Amendola et al., 2019).

For example, stP:C\exists^{\mathsf{st}} P : C is coherent iff there exists MAS(P)M \in AS(P) such that CfixP(M)C \cup \mathit{fix}_P(M) is coherent; stP:C\forall^{\mathsf{st}} P : C is coherent iff for all MAS(P)M \in AS(P), CfixP(M)C \cup \mathit{fix}_P(M) is coherent. This inductive schema supports arbitrary alternations (Faber et al., 2023).

QASP also admits a higher-order semantic view: equilibrium logic and G\"odel’s G3G_3 three-valued logic are used for foundational characterizations, with equilibrium models coinciding with ASP answer sets (Diéguez et al., 7 Jan 2026).

2. Expressiveness and Complexity

QASP raises the expressive power of ASP to match the entire polynomial hierarchy. An ASP(Q) program with nn quantifier alternations models problems in ΣnP\Sigma_n^P (existential) or ΠnP\Pi_n^P (universal); the general decision (coherence) problem for QASP is PSPACE-complete (Amendola et al., 2019, Fandinno et al., 2021). More precisely:

Problem Class QASP Syntax Level Complexity
Existential QASP nn quantifiers \to ΣnP\Sigma_n^P ΣnP\Sigma_n^P-complete
Universal QASP nn quantifiers \to ΠnP\Pi_n^P ΠnP\Pi_n^P-complete
General (disjunctive) QASP Arbitrary alternations PSPACE-complete

These complexity results are mirrored in the translation-based solvers, as the QASP-to-QBF encoding preserves the alternation-depth and problem class (Faber et al., 2023). QASP thus enables uniform, modular encodings for a wide class of high-complexity problems, including those naturally inaccessible to conventional ASP.

3. QASP with Optimization: Weak Constraints

QASP can be extended to handle optimization problems by supporting weak constraints in the component programs and/or the coherence-checking suffix. In this optimized QASP (QASP+WC) form, each subprogram PiP_i may feature weak constraints (minimization criteria), and coherence is defined over the set of optimal answer sets OptAS(Pi)\text{OptAS}(P_i) at each quantifier level (Mazzotta et al., 2024).

Local weak constraints (in PiP_i) enable nested optimization; global weak constraints (in CwC^w) order the possible quantified answer sets lexicographically. The complexity of coherence checking for QASP+WC increases by one PH level compared to the quantifier count, i.e., for nn quantifiers

  • \exists-QASP+WC: Σn+1P\Sigma_{n+1}^P-complete,
  • \forall-QASP+WC: Πn+1P\Pi_{n+1}^P-complete.

Membership queries (“Does atom aa appear in any optimal quantified answer set?”) are Δn+1P\Delta_{n+1}^P-complete in the general case, and Θn+1P\Theta_{n+1}^P-complete under unit weights and priorities (Mazzotta et al., 2024).

4. QASP-to-QBF Compilation and System Architecture

A standard approach to QASP solving is reduction to QBF, exploiting mature QBF solver technology (Fandinno et al., 2021, Faber et al., 2023). The translation process follows these steps:

  1. Ground and simplify the ASP components to obtain propositional programs;
  2. Compile each to CNF (using e.g., loop formulas or Clark’s completion);
  3. Construct the quantifier prefix following the QASP block structure;
  4. Assemble the QBF in prenex CNF form, mapping QASP quantifiers to QBF quantifiers over appropriate variable sets;
  5. Optionally preprocess with tools like blocked-clause elimination or QRAT;
  6. Solve using a QBF solver (e.g., DepQBF, Quabs, RareQS);
  7. For existentially quantified QASP, extract witness assignments to interpret as plans or solutions (Fandinno et al., 2021, Faber et al., 2023).

Architecturally, QASP solvers (such as QASP2QBF and pyqasp) employ:

  • Grounders (e.g., lp2normal)
  • Quantifier extractors (parsing annotations in the QASP input)
  • ASP-to-CNF translators
  • Multi-engine QBF solver selection (using ML-based strategies, e.g., a Random Forest classifier on instance features)
  • Extractors for witnesses/strategies as needed (Faber et al., 2023).

Key optimization steps, including well-founded simplification, trivial subprogram elimination, and Guess–Check rewriting, reduce QBF formula size and improve performance (Faber et al., 2023).

5. Policy Extraction and Strategic Interpretation

QASP naturally encodes policy synthesis tasks: quantified programs formalize decision-making strategies for existential choices (actions) contingent on universally quantified conditions (nature or adversarial uncertainty). The semantics of QASP, especially under Equilibrium Logic and the G3G_3 characterization, allow for the explicit extraction of policies represented as decision trees over quantifier blocks (Diéguez et al., 7 Jan 2026).

For a prefix Q1x1QnxnQ_1 x_1 \ldots Q_n x_n and a QASP matrix, a policy is defined as a tree:

  • Nodes at existential blocks correspond to choices of variable values.
  • Nodes at universal blocks branch on both possible values.

Algorithms such as QEM (Quantifier Elimination for Models) compute all equilibrium policies by systematic quantifier elimination and model tracking via Θ\Theta-pairs (solution sets and hard countermodels), enforcing stability and minimality (Diéguez et al., 7 Jan 2026). The approach is correct for equilibrium-model semantics and is exponential in quantifier alternations, reflecting the inherent PH-complexity.

6. Applications and Benchmark Performance

QASP encodes problems such as conformant/conditional planning, minmax optimization, logic-based abduction, resource allocation under uncertainty, and multi-level reasoning (e.g., games and adversarial planning) (Fandinno et al., 2021, Amendola et al., 2019, Mazzotta et al., 2024).

Canonical example: in conformant planning, an existential block guesses a sequence of actions, a universal block ranges over initial-state uncertainty, and the plan is valid iff the goal is met in all completions. Conditional planning introduces alternations based on sensing action outcomes, all representable in the QASP prefix.

Experimental evaluations across benchmarks (Bomb-in-the-Toilet, Domino, Ring, Minmax Clique, Argumentation Coherence, Paracoherent ASP, etc.) demonstrate that QASP solvers:

  • Solve all classical and conformant instances where incomplete-state ASP fails,
  • Achieve >90%>90\% instance completion on conditional tasks at competitive runtimes,
  • Outperform legacy ASP-based planners and stable-unstable combinatorial encodings in both total instances solved and memory usage (Fandinno et al., 2021, Faber et al., 2023).

QASP generalizes both ASP and QBF. Compared to QBF, QASP quantifies over stable models, supporting inductive definitions, aggregates, and variable-rich domains, typically yielding more compact encodings for AI problems (Amendola et al., 2019). Compared with saturation/meta-programming as well as stable-unstable combined programs, QASP enables natural encodings throughout the PH without cumbersome encodings or loss of modularity.

Limitations: while QASP is conceptually uniform, general-purpose solvers are still research-stage; scalability can degrade due to the grounding bottleneck and the size of resulting QBFs. Ongoing work includes more compact QBF encodings (e.g., circuit-based sharing), extended Guess–Check analyses, improved machine-learning–driven solver selection, support for inclusion-minimality, and deployment of complexity-aware QASP engines (Faber et al., 2023, Mazzotta et al., 2024). Empirical validation is being extended to more complex benchmarks in multi-agent planning, abduction, and nonmonotonic reasoning.

Topic to Video (Beta)

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 Quantified Answer Set Programming (QASP).