Hostname: page-component-77c89778f8-vsgnj Total loading time: 0 Render date: 2024-07-16T13:45:57.291Z 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: [email protected], [email protected], [email protected])
CARMINE DODARO
Affiliation:
Department of Mathematics and Computer Science, University of Calabria, Via P. Bucci, cubo 30B, 87036, Rende (CS), Italy (e-mails: [email protected], [email protected], [email protected])
ARNEL ZAMAYLA
Affiliation:
Department of Mathematics and Computer Science, University of Calabria, Via P. Bucci, cubo 30B, 87036, Rende (CS), Italy (e-mails: [email protected], [email protected], [email protected])

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.

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.)

Footnotes

*

This work was partially supported by projects PRIN “Declarative Reasoning over Streams” (CUP: H24I17000080001), PON-MISE MAP4ID “Multipurpose Analytics Platform 4 Industrial Data” (CUP: B21B19000650008), lab LAIA (part of SILA), and GNCS-INdAM.

References

Adrian, W. T., Alviano, M., Calimeri, F., Cuteri, B., Dodaro, C., Faber, W., Fuscà, D., Leone, N., Manna, M., Perri, S., Ricca, F., Veltri, P. and Zangari, J. 2018. The ASP system DLV: Advancements and applications. KI 32, 2-3, 177179.Google Scholar
Alviano, M. and Dodaro, C. 2020. Data validation for answer set programming (extended abstract). In Proceedings of ICLP (Technical Communications). Electronic Proceedings in Theoretical Computer Science, EPTCS, vol. 325. Open Publishing Association, 9395.Google Scholar
Alviano, M., Dodaro, C. and Zamayla, A. 2021. Data validation meets answer set programming. In Practical Aspects of Declarative Languages - 23rd International Symposium, PADL 2021, Copenhagen, Denmark, January 18–19, 2021, Proceedings, J. F. Morales and D. A. Orchard, Eds. Lecture Notes in Computer Science, vol. 12548. Springer, 90106.Google Scholar
Alviano, M., Faber, W. and Leone, N. 2010. Disjunctive ASP with functions: Decidable queries and effective computation. Theory and Practice of Logic Programming 10, 4-6, 497512.CrossRefGoogle Scholar
Amendola, G., Berei, T. and Ricca, F. 2021. Testing in ASP: Revisited language and programming environment. In JELIA. Lecture Notes in Computer Science, vol. 12678. Springer, 362376.Google Scholar
Balduccini, M. 2013. ASP with non-herbrand partial functions: A language and system for practical use. Theory and Practice of Logic Programming 13, 4-5, 547561.CrossRefGoogle Scholar
Baselice, S. and Bonatti, P. A. 2010. A decidable subclass of finitary programs. Theory and Practice of Logic Programming 10, 4-6, 481496.CrossRefGoogle Scholar
Calimeri, F., Cozza, S., Ianni, G. and Leone, N. 2011. Finitely recursive programs: Decidability and bottom-up computation. AI Communications 24, 4, 311334.CrossRefGoogle Scholar
Calimeri, F., Faber, W., Gebser, M., Ianni, G., Kaminski, R., Krennwallner, T., Leone, N., Maratea, M., Ricca, F. and Schaub, T. 2020. ASP-Core-2 input language format. Theory and Practice of Logic Programming 20, 2, 294309.CrossRefGoogle Scholar
Cat, B. D., Bogaerts, B., Bruynooghe, M., Janssens, G. and Denecker, M. 2018. Predicate logic as a modeling language: The IDP system. In Declarative Logic Programming: Theory, Systems, and Applications. ACM/Morgan & Claypool, 279323.Google Scholar
Dodaro, C., Alviano, M., Faber, W., Leone, N., Ricca, F. and Sirianni, M. 2011. The birth of a WASP: Preliminary report on a new ASP solver. In Proceedings of CILC. CEUR Workshop Proceedings, vol. 810. CEUR-WS.org, 99113.Google Scholar
Dodaro, C., Gasteiger, P., Reale, K., Ricca, F. and Schekotihin, K. 2019. Debugging non-ground ASP programs: Technique and graphical tools. Theory and Practice of Logic Programming 19, 2, 290316.CrossRefGoogle Scholar
Eiter, T., Germano, S., Ianni, G., Kaminski, T., Redl, C., Schüller, P. and Weinzierl, A. 2018. The DLVHEX system. KI 32, 2-3, 187189.Google Scholar
Eiter, T. and Simkus, M. 2009. Bidirectional answer set programs with function symbols. In Proceedings of IJCAI, 765771.Google Scholar
Fandinno, J. and Schulz, C. 2019. Answering the “why” in answer set programming - A survey of explanation approaches. Theory and Practice of Logic Programming 19, 2, 114203.CrossRefGoogle Scholar
Gebser, M., Kaminski, R., Kaufmann, B., Lühne, P., Obermeier, P., Ostrowski, M., Romero, J., Schaub, T., Schellhorn, S. and Wanko, P. 2018. The potsdam answer set solving collection 5.0. KI 32, 2-3, 181182.Google Scholar
Gebser, M., Maratea, M. and Ricca, F. 2020. The seventh answer set programming competition: Design and results. Theory and Practice of Logic Programming 20, 2, 176204.CrossRefGoogle Scholar
Gebser, M., Pührer, J., Schaub, T. and Tompits, H. 2008. A meta-programming technique for debugging answer-set programs. In Proceedings of AAAI. AAAI Press, 448453.Google Scholar
Gelfond, M. and Lifschitz, V. 1991. Classical negation in logic programs and disjunctive databases. New Generation Computing 9, 3/4, 365386.Google Scholar
Hermenegildo, M. V., Puebla, G., Bueno, F. and López-Garca, P. 2002. Program debugging and validation using semantic approximations and partial specifications. In Proceedings of ICALP. LNCS, vol. 2380. Springer, 6972.Google Scholar
Johnsson, D. B., Deogun, D. and Sawano, D. 2019. Secure by Design. Manning Publications.Google Scholar
Kaneiwa, K. 2004. Order-sorted logic programming with predicate hierarchy. Artificial Intelligence 158, 2, 155188.CrossRefGoogle Scholar
Kiel, R. and Schader, M. 1991. A tool for validating prolog programs. In Classification, Data Analysis, and Knowledge Organization. Springer, 183188.CrossRefGoogle Scholar
Ko, A. J. and Myers, B. A. 2003. Development and evaluation of a model of programming errors. In Proceedings of HCC. IEEE Computer Society, 714.Google Scholar
Ko, A. J. and Myers, B. A. 2005. A framework and methodology for studying the causes of software errors in programming systems. Journal of Visual Languages and Computing 16, 1-2, 4184.CrossRefGoogle Scholar
Leone, N., Allocca, C., Alviano, M., Calimeri, F., Civili, C., Costabile, R., Fiorentino, A., Fuscà, D., Germano, S., Laboccetta, G., Cuteri, B., Manna, M., Perri, S., Reale, K., Ricca, F., Veltri, P. and Zangari, J. 2019. Enhancing DLV for large-scale reasoning. In Proceedings of LPNMR. LNCS, vol. 11481. Springer, 312325.Google Scholar
Lierler, Y. and Lifschitz, V. 2009. One more decidable class of finitely ground programs. In Proceedings of ICLP. LNCS, vol. 5649. Springer, 489493.Google Scholar
Lifschitz, V. 2017. Achievements in answer set programming. Theory and Practice of Logic Programming 17, 5-6, 961973.CrossRefGoogle Scholar
Marcopoulos, E. and Zhang, Y. 2019. OnlineSPARC: A programming environment for answer set programming. Theory and Practice of Logic Programming 19, 2, 262289.CrossRefGoogle Scholar
Marek, V. W. and Truszczyński, M. 1999. Stable models and an alternative logic programming paradigm. In The Logic Programming Paradigm – A 25-Year Perspective. Springer Verlag, 375398.CrossRefGoogle Scholar
Natella, R., Winter, S., Cotroneo, D. and Suri, N. 2020. Analyzing the effects of bugs on software interfaces. IEEE Transactions on Software Engineering 46, 3, 280301.CrossRefGoogle Scholar
Niemelä, I. 1999. Logic programming with stable model semantics as constraint programming paradigm. Annals of Mathematics and Artificial Intelligence 25, 3–4, 241273.CrossRefGoogle Scholar
Oetsch, J., Pührer, J. and Tompits, H. 2010. Catching the ouroboros: On debugging non-ground answer-set programs. Theory and Practice of Logic Programming 10, 4-6, 513529.CrossRefGoogle Scholar
Padhye, R. and Sen, K. 2019. Efficient fail-fast dynamic subtype checking. In Proceedings of VMIL@SPLASH. ACM, 3237.Google Scholar
Pierce, B. C. 2002. Types and Programming Languages. MIT Press.Google Scholar
Prim, R. C. 1957. Shortest connection networks and some generalizations. The Bell System Technical Journal 36, 6, 13891401.CrossRefGoogle Scholar
Puebla, G., Bueno, F. and Hermenegildo, M. V. 2000. A generic processor for program validation and debugging. In Analysis and Visualization Tools for Constraint Programming, Constrain Debugging (DiSCiPl project). LNCS, vol. 1870. Springer, 63107.Google Scholar
Redl, C. 2017. Extending answer set programs with interpreted functions as first-class citizens. In Proceedings of PADL. LNCS, vol. 10137. Springer, 6885.Google Scholar
Vernon, V. 2016. Domain-Driven Design Distilled. Addison-Wesley.Google Scholar