Rethinking Answer Set Programming Templates

07/12/2023
by   Mario Alviano, et al.
0

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 rules that can be added to such a context. Template applications transpiled this way can be processed by mainstream engines and safely shared with other knowledge designers, even when they have zero knowledge of templates.

READ FULL TEXT

page 1

page 2

page 3

page 4

research
03/26/2000

Differential Invariants under Gamma Correction

This paper presents invariants under gamma correction and similarity tra...
research
10/22/2021

Methodology for Assessing the State of the Practice for Domain X

To improve software development methods and tools for research software,...
research
03/30/2020

Templates and Recurrences: Better Together

This paper is the confluence of two streams of ideas in the literature o...
research
10/06/2015

Disjunctive Answer Set Solvers via Templates

Answer set programming is a declarative programming paradigm oriented to...
research
07/25/2018

A 36-Element Solution To Schneiders' Pyramid Hex-Meshing Problem And A Parity-Changing Template For Hex-Mesh Revision

In this paper, we present a solution that uses the least number of hexah...
research
02/07/2017

Extracting Lifted Mutual Exclusion Invariants from Temporal Planning Domains

We present a technique for automatically extracting mutual exclusion inv...

Please sign up or login with your details

Forgot password? Click here to reset