Papers
Topics
Authors
Recent
Search
2000 character limit reached

Goal-Directed ASP System

Updated 14 January 2026
  • Goal-directed ASP systems are logic-based architectures that compute only the portions of stable models relevant to a query using top-down evaluation and constructive negation.
  • The architecture, exemplified by s(CASP), maintains ungrounded variables and constraints while employing tabling and dynamic consistency checks for efficient inference.
  • Applications span explainable AI, conversational agents, and safety assurance, providing rapid, interpretable responses in constraint-rich environments.

A goal-directed ASP (Answer Set Programming) system is a logic-based reasoning architecture that computes only those fragments of stable models that are directly relevant to a user’s query. This is in contrast to traditional ASP systems that fully ground the input program and enumerate all possible stable models in a bottom-up fashion. Goal-directed ASP systems such as s(CASP) advance this methodology by supporting variables, constraints, and a top-down, query-driven proof search intertwined with “constructive negation.” These systems have enabled applications in explainable AI, counterfactual reasoning, semantic assurance of safety cases, conversational agents, and deontic modal reasoning, by providing just-in-time partial models and human-readable justification trees.

1. Foundations: Stable Model Semantics and Goal-Directed Execution

Classical ASP is based on the stable-model (answer-set) semantics, where a program PP is represented as a collection of (possibly non-ground) rules: hb1,,bm,not bm+1,,not bnh \leftarrow b_1, \dots, b_m, \text{not } b_{m+1}, \dots, \text{not } b_n for atoms h,bih, b_i and negation-as-failure not\text{not}. The Gelfond–Lifschitz reduct reduces a candidate model MM by iteratively removing rules whose body is not satisfied under MM, yielding the operator LM(PM)\mathit{LM}(P^M), the least Herbrand model of the positive reduct (Murugesan et al., 2024, Dasgupta et al., 2024). SAT-based ASP solvers (e.g., Clingo) ground the program and enumerate all stable models, but this scales poorly for programs with variables, function symbols, or numeric constraints.

Goal-directed ASP, as realized in s(CASP) (Dasgupta et al., 2024, Dasgupta et al., 2024, Arias et al., 2020), implements a Prolog-style, top-down evaluation:

  • Variables and constraints remain ungrounded throughout execution.
  • Only those rules and atoms relevant to the user’s query are unfolded.
  • Constructive (dual) negation is implemented via automatically generated “dual rules,” ensuring that not p(X) can succeed with constraints describing the conditions under which p(X) cannot be proven.
  • Coinductive reasoning and loop checks enable handling of recursion and fixed points.

This paradigm produces “partial stable models” containing only the literals, variable bindings, and constraints utilized by the proof of the query (Li et al., 2021, Murugesan et al., 2024).

2. System Architecture: s(CASP) and Dynamic Execution

The s(CASP) system is architected as a meta-interpreter atop a Prolog engine, extended to support the following features:

  • Top-down search: On receiving a query, the system recursively applies SLD-style resolution, mixed with dual rules for negation.
  • Tabling (Memoization): Each unique subgoal is evaluated once per variant to ensure termination in the presence of recursion and cyclic dependencies (Dasgupta et al., 2024).
  • Constraint Accumulation: During derivation, constraints on variables (disequality, linear arithmetic, etc.) are accumulated in a global store, checked incrementally for satisfiability (Dasgupta et al., 2024, Hall et al., 2021).
  • Justification Trees: As proof search unfolds, a tree of rule applications is constructed, which can be output in human-readable form and directly maps to the proof steps for the query (Arias et al., 2020, Varanasi et al., 2022).
  • Dynamic Consistency Checking: Recent enhancements interleave constraint satisfaction checking early in search, pruning branches as soon as an integrity constraint (denial) would be violated—yielding exponential speedups for constraint-rich combinatorial problems (Arias et al., 2021).

The interface is flexible: users may embed s(CASP) as a SWI-Prolog REST service (Varanasi et al., 2022), invoke it at the CLI with constraints and abducibles, or integrate it with external ML systems as in the CoGS framework (Dasgupta et al., 2024, Dasgupta et al., 2024).

3. Partial Models, Constructive Negation, and Proof Tracing

A hallmark of goal-directed ASP is the construction of partial stable models tailored to the input query:

  • Partial Models: For query QQ, the system builds a model M+M^+ (proven atoms), MM^- (atoms for which not p succeeded), along with constraints C{\cal C} such that QM+Q \in M^+, and (M+,M,C)(M^+, M^-, {\cal C}) is extendible to a full stable model if needed (Dasgupta et al., 2024, Li et al., 2021).
  • Constructive Negation: Dual rules derived from Clark’s completion handle failure branches and constructive derivation of not p(X), representing exactly the conditions (in variable and constraint form) under which p(X) cannot succeed (Dasgupta et al., 2024, Arias et al., 2020).
  • Proof Trees: Each successful query yields a minimal, annotated proof tree depicting which rules, constraints, and assumable abducibles contributed to the result, supporting explainability and traceability (Varanasi et al., 2022, Murugesan et al., 2024, Arias et al., 2020).

This ability to isolate only query-relevant justification is in contrast to bottom-up ASP solvers, which can only justify an atom by showing its inclusion in a full model.

4. Algorithmic Details: Execution, Constraint Handling, and Loop Detection

Algorithmically, execution proceeds as follows (Dasgupta et al., 2024, Dasgupta et al., 2024, Arias et al., 2020):

  1. Goal Selection: The leftmost literal (positive or negative) in the query is selected.
  2. Positive Resolution: For p(t), find a matching rule p(s) :- Body, unify t and s, push Body onto the goal stack.
  3. Negation/Dual Rule: For not p(t), select a dual clause describing how p(t) would fail, accumulate any entailed constraints and move to subgoals.
  4. Constraint Application: When a constraint literal is encountered, it is checked for consistency with the global store.
  5. Coinduction and Loop Handling: If a goal is revisited with even nesting of default negation, the call is succeeded coinductively; with odd nesting, failure is enforced to prevent inconsistency.
  6. Dynamic Consistency Check (optional): Upon adding a new literal, check if any constraint (denial) is violated by the current model fragment; if so, prune and backtrack immediately (Arias et al., 2021).

At success, only the fragment of the program visited during proof is present in the resulting partial model and justification.

5. Applications: Explainability, Assurance, Counterfactuals

Goal-directed ASP systems are now key infrastructure in several domains:

  • Counterfactual Explanations for ML: CoGS and CFGs frameworks extract rule-based logic (using FOLD-SE) from statistical models, encode both decision and causal feature dependencies, and invoke s(CASP) to synthesize counterfactual paths—demonstrating actionable, causally plausible interventions needed to achieve a desired label. All steps obey the learned causal rules, and only causally consistent modifications are produced. The generated explanations are interpretable and traceable to the learned logic and user scenario (Dasgupta et al., 2024, Dasgupta et al., 2024, Dasgupta et al., 2024).
  • Semantics of Assurance Cases: In Assurance 2.0, s(CASP) encodes graph-structured arguments, evidence trees, and defeaters for safety- or security-critical claims. The proof engine checks for semantic coherence, adequacy, infeasibility, completeness, and theory-harmony, mapping back violations and successes to claims and evidence sources, supporting both defect detection and iterative authoring (Murugesan et al., 2024).
  • Conversational AI and Socialbots: s(CASP) powers systems that enforce coherence, logical consistency, and relevant topic progression in conversational agents, often in tandem with LLM-based natural language components. The goal-directed discipline prevents off-topic drift and enables tight merges of user intent, background knowledge, and causal constraints (Zeng et al., 2024, Li et al., 2021).
  • Deontic Modal Reasoning: The expressive power of the framework allows encoding of obligations, prohibitions, and permissions as integrity constraints and strong/default negation, with paradoxes resolved compositionally at the proof level (Gupta et al., 7 Jul 2025).
  • Regulatory Compliance: Automated checking and explanation of UAV flight readiness aligns with the same justification-driven protocol (Varanasi et al., 2022).

6. Empirical Performance and Complexity

Empirical and theoretical evaluation demonstrates that goal-directed ASP, and in particular s(CASP), achieves substantial gains in scalability and explainability:

  • Avoidance of Grounding Blow-up: By operating on non-ground representations, only the symbolic fragment needed by the proof is explored—opening inference over infinite or real-valued domains (Hall et al., 2021, Dasgupta et al., 2024).
  • Just-in-Time Constraint Pruning: DCC provides up to 90-fold speedups for combinatorial problems with many global denials by pruning dead-end branches early (Arias et al., 2021).
  • Benchmarked Use Cases: In counterfactual generation for standard ML datasets (German Credit, Adult Income), single-path explanations were found within 1.1–3.2 seconds. Semantic assurance case analysis on cases of ~150 nodes completed in under 2 seconds (Murugesan et al., 2024, Dasgupta et al., 2024).
  • Explainability: Proof trees are concise, readable, and map directly to the logical structure of the problem and the user’s query, with user- or context-specific translation available (Arias et al., 2020, Varanasi et al., 2022).

From a complexity perspective, individual query processing is polynomial in rule size but may be exponential in the number of features or branching decisions. The inherent worst-case is Σ2P\Sigma_2^P-complete, but in practice, domain-specific constraints and early pruning almost always restrict the effective search space (Dasgupta et al., 2024).

Goal-directed ASP generalizes and, in many cases, dominates tabled SLD or SAT-based approaches when queries and constraints control search locality. Other systems such as DiscASP (Li et al., 2021) and igASP (Li, 2021) use similar graph-based or top-down constructions, focusing on query-relevant partial models and causal justification granularity.

Key features distinguishing goal-directed ASP systems:

  • No full propositional grounding is required.
  • Constraints and variables persist symbolically throughout execution.
  • Query responsiveness and explanation generation are natural byproducts of the proof protocol.
  • Applications span transparent ML, real-time compliance assessment, normative reasoning, and more.

Goal-directed ASP, as typified by s(CASP), has thus established itself as a foundational paradigm for symbolic, explainable, and interactive AI reasoning across a spectrum of knowledge-intensive and constraint-rich domains.


References

  • (Dasgupta et al., 2024) CoGS: Causality Constrained Counterfactual Explanations using goal-directed ASP
  • (Dasgupta et al., 2024) CFGs: Causality Constrained Counterfactual Explanations using goal-directed ASP
  • (Dasgupta et al., 2024) CoGS: Model Agnostic Causality Constrained Counterfactual Explanations using goal-directed ASP
  • (Murugesan et al., 2024) Automating Semantic Analysis of System Assurance Cases using Goal-directed ASP
  • (Zeng et al., 2024) A Reliable Common-Sense Reasoning Socialbot Built Using LLMs and Goal-Directed ASP
  • (Varanasi et al., 2022) Automating UAV Flight Readiness Approval using Goal-Directed Answer Set Programming
  • (Li, 2021) Graph Based Answer Set Programming Solver Systems
  • (Li et al., 2021) DiscASP: A Graph-based ASP System for Finding Relevant Consistent Concepts with Applications to Conversational Socialbots
  • (Hall et al., 2021) Knowledge-Assisted Reasoning of Model-Augmented System Requirements with Event Calculus and Goal-Directed Answer Set Programming
  • (Arias et al., 2021) Towards Dynamic Consistency Checking in Goal-directed Predicate Answer Set Programming
  • (Gupta et al., 7 Jul 2025) Modeling (Deontic) Modal Operators With the s(CASP) Goal-directed Predicate Answer Set Programming System
  • (Arias et al., 2020) Justifications for Goal-Directed Constraint Answer Set Programming

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 Goal-directed ASP System.