Rethinking Answer Set Programming Templates
Mario Alviano, Giovambattista Ianni, Francesco Pacenza, Jessica, Zangari

TL;DR
This paper proposes a template system for Answer Set Programming inspired by Domain-Driven Design, enabling modular, invariant-enforcing, and shareable code that integrates with existing engines without conflicts.
Contribution
It introduces a novel template concept for ASP that enforces predicate locality and invariants using naming conventions and UUIDs, facilitating modularity and sharing.
Findings
Templates enforce predicate locality and invariants.
Templates are compatible with mainstream ASP engines.
Shared templates improve modularity and code reuse.
Abstract
In imperative programming, the Domain-Driven Design methodology helps in coping with the complexity of software development by materializing in code the invariants of a domain of interest. Code is cleaner and more secure because any implicit assumption is removed in favor of invariants, thus enabling a fail fast mindset and the immediate reporting of unexpected conditions. This article introduces a notion of template for Answer Set Programming that, in addition to the don't repeat yourself principle, enforces locality of some predicates by means of a simple naming convention. Local predicates are mapped to the usual global namespace adopted by mainstream engines, using universally unique identifiers to avoid name clashes. This way, local predicates can be used to enforce invariants on the expected outcome of a template in a possibly empty context of application, independently by other…
Peer Reviews
No public reviews on file for this paper yet. If you reviewed it on a platform where reviews are public (OpenReview, ICLR, NeurIPS, ICML), you can paste yours below so the community can read it here.
Videos
No videos yet. Explain this paper in a talk, walkthrough, or lecture? Add one.
Taxonomy
TopicsLogic, Reasoning, and Knowledge · Multi-Agent Systems and Negotiation · Logic, programming, and type systems
Methodsfail
