Hostname: page-component-89b8bd64d-mmrw7 Total loading time: 0 Render date: 2026-05-07T11:43:32.675Z Has data issue: false hasContentIssue false

ValAsp: A Tool for Data Validation in Answer Set Programming

Published online by Cambridge University Press:  14 March 2022

MARIO ALVIANO
Affiliation:
Department of Mathematics and Computer Science, University of Calabria, Via P. Bucci, cubo 30B, 87036, Rende (CS), Italy (e-mails: alviano@mat.unical.it, dodaro@mat.unical.it, zamayla@mat.unical.it)
CARMINE DODARO
Affiliation:
Department of Mathematics and Computer Science, University of Calabria, Via P. Bucci, cubo 30B, 87036, Rende (CS), Italy (e-mails: alviano@mat.unical.it, dodaro@mat.unical.it, zamayla@mat.unical.it)
ARNEL ZAMAYLA
Affiliation:
Department of Mathematics and Computer Science, University of Calabria, Via P. Bucci, cubo 30B, 87036, Rende (CS), Italy (e-mails: alviano@mat.unical.it, dodaro@mat.unical.it, zamayla@mat.unical.it)

Abstract

The development of complex software requires tools promoting fail-fast approaches, so that bugs and unexpected behavior can be quickly identified and fixed. Tools for data validation may save the day of computer programmers. In fact, processing invalid data is a waste of resources at best, and a drama at worst if the problem remains unnoticed and wrong results are used for business. Answer Set Programming (ASP) is not an exception, but the quest for better and better performance resulted in systems that essentially do not validate data. Even under the simplistic assumption that input/output data are eventually validated by external tools, invalid data may appear in other portions of the program, and go undetected until some other module of the designed software suddenly breaks. This paper formalizes the problem of data validation for ASP programs, introduces a language to specify data validation, and presents valasp, a tool to inject data validation in ordinary programs. The proposed approach promotes fail-fast techniques at coding time without imposing any lag on the deployed system if data are pretended to be valid. Validation can be specified in terms of statements using YAML, ASP and Python. Additionally, the proposed approach opens the possibility to use ASP for validating data of imperative programming languages.

Information

Type
Rapid Communication
Copyright
© The Author(s), 2022. Published by Cambridge University Press

Access options

Get access to the full version of this content by using one of the access options below. (Log in options will check for institutional or personal access. Content may require purchase if you do not have access.)

Article purchase

Temporarily unavailable