Skip to main content

Data Validation Meets Answer Set Programming

  • Conference paper
  • First Online:

Part of the book series: Lecture Notes in Computer Science ((LNPSE,volume 12548))

Abstract

Data validation may save the day of computer programmers, whatever programming language they use. 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 is not an exception, but the quest for better and better performance resulted in systems that essentially do not validate data in any way. Even under the simplistic assumption that input and 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 declarative language to specify data validation, and presents 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. Additionally, the proposed approach opens the possibility to take advantage of ASP declarativity for validating complex data of imperative programming languages.

This is a preview of subscription content, log in via an institution.

Buying options

Chapter
USD   29.95
Price excludes VAT (USA)
  • Available as PDF
  • Read on any device
  • Instant download
  • Own it forever
eBook
USD   39.99
Price excludes VAT (USA)
  • Available as EPUB and PDF
  • Read on any device
  • Instant download
  • Own it forever
Softcover Book
USD   54.99
Price excludes VAT (USA)
  • Compact, lightweight edition
  • Dispatched in 3 to 5 business days
  • Free shipping worldwide - see info

Tax calculation will be finalised at checkout

Purchases are for personal use only

Learn about institutional subscriptions

Notes

  1. 1.

    An extended abstract of this work was presented at the International Conference on Logic Programming (ICLP) 2020 [2].

References

  1. Adrian, W.T., et al.: The ASP system DLV: advancements and applications. KI 32(2–3), 177–179 (2018). https://doi.org/10.1007/s13218-018-0533-0

  2. Alviano, M., Dodaro, C.: Data validation for answer set programming (extended abstract). In: Ricca, F., et al. (eds.) Proceedings 36th International Conference on Logic Programming (Technical Communications), Rende (CS), Italy, 18–24th September 2020. Electronic Proceedings in Theoretical Computer Science, EPTCS, vol. 325, pp. 93–95. Open Publishing Association (2020)

    Google Scholar 

  3. Alviano, M., Faber, W., Leone, N.: Disjunctive ASP with functions: decidable queries and effective computation. Theory Pract. Log. Program. 10(4–6), 497–512 (2010). https://doi.org/10.1017/S1471068410000244

  4. Balduccini, M.: ASP with non-Herbrand partial functions: a language and system for practical use. Theory Pract. Log. Program. 13(4–5), 547–561 (2013). https://doi.org/10.1017/S1471068413000343

  5. Baselice, S., Bonatti, P.A.: A decidable subclass of finitary programs. Theory Pract. Log. Program. 10(4–6), 481–496 (2010). https://doi.org/10.1017/S1471068410000232

  6. Calimeri, F., Cozza, S., Ianni, G., Leone, N.: Finitely recursive programs: decidability and bottom-up computation. AI Commun. 24(4), 311–334 (2011). https://doi.org/10.3233/AIC-2011-0509

  7. Calimeri, F., et al.: ASP-Core-2 input language format. Theory Pract. Log. Program. 20(2), 294–309 (2020). https://doi.org/10.1017/S1471068419000450

  8. Cat, B.D., Bogaerts, B., Bruynooghe, M., Janssens, G., Denecker, M.: Predicate logic as a modeling language: the IDP system. In: Kifer, M., Liu, Y.A. (eds.) Declarative Logic Programming: Theory, Systems, and Applications, pp. 279–323. ACM/Morgan & Claypool (2018). https://doi.org/10.1145/3191315.3191321

  9. Dodaro, C., Alviano, M., Faber, W., Leone, N., Ricca, F., Sirianni, M.: The birth of a WASP: preliminary report on a new ASP solver. In: Fioravanti, F. (ed.) Proceedings of the 26th Italian Conference on Computational Logic, Pescara, Italy, 31 August–2 September 2011. CEUR Workshop Proceedings, vol. 810, pp. 99–113. CEUR-WS.org (2011). http://ceur-ws.org/Vol-810/paper-l06.pdf

  10. Dodaro, C., Gasteiger, P., Reale, K., Ricca, F., Schekotihin, K.: Debugging non-ground ASP programs: technique and graphical tools. Theory Pract. Log. Program. 19(2), 290–316 (2019). https://doi.org/10.1017/S1471068418000492

  11. Eiter, T., et al.: The DLVHEX system. KI 32(2–3), 187–189 (2018). https://doi.org/10.1007/s13218-018-0535-y

  12. Eiter, T., Simkus, M.: Bidirectional answer set programs with function symbols. In: Boutilier, C. (ed.) Proceedings of IJCAI, pp. 765–771 (2009). http://ijcai.org/Proceedings/09/Papers/132.pdf

  13. Fandinno, J., Schulz, C.: Answering the “why” in answer set programming - a survey of explanation approaches. Theory Pract. Log. Program. 19(2), 114–203 (2019). https://doi.org/10.1017/S1471068418000534

  14. Gebser, M., et al.: The Potsdam answer set solving collection 5.0. KI 32(2–3), 181–182 (2018). https://doi.org/10.1007/s13218-018-0528-x

  15. Gebser, M., Maratea, M., Ricca, F.: The seventh answer set programming competition: design and results. Theory Pract. Log. Program. 20(2), 176–204 (2020)

    Article  MathSciNet  Google Scholar 

  16. Gebser, M., Pührer, J., Schaub, T., Tompits, H.: A meta-programming technique for debugging answer-set programs. In: Fox, D., Gomes, C.P. (eds.) Proceedings of AAAI, pp. 448–453. AAAI Press (2008). http://www.aaai.org/Library/AAAI/2008/aaai08-071.php

  17. Gelfond, M., Lifschitz, V.: Classical negation in logic programs and disjunctive databases. New Gener. Comput. 9(3/4), 365–386 (1991). https://doi.org/10.1007/BF03037169

  18. Hermenegildo, M., Puebla, G., Bueno, F., López-García, P.: Program debugging and validation using semantic approximations and partial specifications. In: Widmayer, P., Eidenbenz, S., Triguero, F., Morales, R., Conejo, R., Hennessy, M. (eds.) ICALP 2002. LNCS, vol. 2380, pp. 69–72. Springer, Heidelberg (2002). https://doi.org/10.1007/3-540-45465-9_7

    Chapter  MATH  Google Scholar 

  19. Johnsson, D.B., Deogun, D., Sawano, D.: Secure by Design. Manning Publications, Shelter Island (2019)

    Google Scholar 

  20. Kaneiwa, K.: Order-sorted logic programming with predicate hierarchy. Artif. Intell. 158(2), 155–188 (2004). https://doi.org/10.1016/j.artint.2004.05.001

  21. Kiel, R., Schader, M.: A tool for validating PROLOG programs. In: Bock, H.H., Ihm, P. (eds) Classification, Data Analysis, and Knowledge Organization. STUDIES CLASS. Springer, Heidelberg (1991). https://doi.org/10.1007/978-3-642-76307-6_24

  22. Ko, A.J., Myers, B.A.: Development and evaluation of a model of programming errors. In: Proceedings of HCC, pp. 7–14. IEEE Computer Society (2003). https://doi.org/10.1109/HCC.2003.1260196

  23. Ko, A.J., Myers, B.A.: A framework and methodology for studying the causes of software errors in programming systems. J. Vis. Lang. Comput. 16(1–2), 41–84 (2005). https://doi.org/10.1016/j.jvlc.2004.08.003

  24. Leone, N., et al.: Enhancing DLV for large-scale reasoning. In: Balduccini, M., Lierler, Y., Woltran, S. (eds.) LPNMR 2019. LNCS, vol. 11481, pp. 312–325. Springer, Cham (2019). https://doi.org/10.1007/978-3-030-20528-7_23

  25. Lierler, Y., Lifschitz, V.: One more decidable class of finitely ground programs. In: Hill, P.M., Warren, D.S. (eds.) ICLP 2009. LNCS, vol. 5649, pp. 489–493. Springer, Heidelberg (2009). https://doi.org/10.1007/978-3-642-02846-5_40

    Chapter  Google Scholar 

  26. Marcopoulos, E., Zhang, Y.: OnlineSPARC: a programming environment for answer set programming. Theory Pract. Log. Program. 19(2), 262–289 (2019). https://doi.org/10.1017/S1471068418000509

  27. Marek, V.W., Truszczyński, M.: Stable models and an alternative logic programming paradigm. In: Apt, K.R., Marek, V.W., Truszczynski, M., Warren, D.S. (eds.) The Logic Programming Paradigm. AI, pp. 375–398. Springer, Heidelberg (1999). https://doi.org/10.1007/978-3-642-60085-2_17

  28. Natella, R., Winter, S., Cotroneo, D., Suri, N.: Analyzing the effects of bugs on software interfaces. IEEE Trans. Softw. Eng. 46(3), 280–301 (2020). https://doi.org/10.1109/TSE.2018.2850755

  29. Niemelä, I.: Logic programming with stable model semantics as constraint programming paradigm. Ann. Math. Artif. Intell. 25(3–4), 241–273 (1999). https://doi.org/10.1023/A:1018930122475

    Article  MATH  Google Scholar 

  30. Oetsch, J., Pührer, J., Tompits, H.: Catching the ouroboros: on debugging non-ground answer-set programs. Theory Pract. Log. Program. 10(4–6), 513–529 (2010). https://doi.org/10.1017/S1471068410000256

    Article  MathSciNet  MATH  Google Scholar 

  31. Padhye, R., Sen, K.: Efficient fail-fast dynamic subtype checking. In: Bonetta, D., Liu, Y.D. (eds.) Proceedings of VMIL@SPLASH, pp. 32–37. ACM (2019). https://doi.org/10.1145/3358504.3361229

  32. Pierce, B.C.: Types and Programming Languages. MIT Press, Cambridge (2002)

    MATH  Google Scholar 

  33. Puebla, G., Bueno, F., Hermenegildo, M.: A generic preprocessor for program validation and debugging. In: Deransart, P., Hermenegildo, M.V., Małuszynski, J. (eds.) Analysis and Visualization Tools for Constraint Programming. LNCS, vol. 1870, pp. 63–107. Springer, Heidelberg (2000). https://doi.org/10.1007/10722311_3

    Chapter  Google Scholar 

  34. Redl, C.: Extending answer set programs with interpreted functions as first-class citizens. In: Lierler, Y., Taha, W. (eds.) PADL 2017. LNCS, vol. 10137, pp. 68–85. Springer, Cham (2017). https://doi.org/10.1007/978-3-319-51676-9_5

    Chapter  Google Scholar 

  35. Vernon, V.: Domain-Driven Design Distilled. Addison-Wesley, Boston (2016)

    Google Scholar 

Download references

Author information

Authors and Affiliations

Authors

Corresponding author

Correspondence to Mario Alviano .

Editor information

Editors and Affiliations

Rights and permissions

Reprints and permissions

Copyright information

© 2021 Springer Nature Switzerland AG

About this paper

Check for updates. Verify currency and authenticity via CrossMark

Cite this paper

Alviano, M., Dodaro, C., Zamayla, A. (2021). Data Validation Meets Answer Set Programming. In: Morales, J.F., Orchard, D. (eds) Practical Aspects of Declarative Languages. PADL 2021. Lecture Notes in Computer Science(), vol 12548. Springer, Cham. https://doi.org/10.1007/978-3-030-67438-0_6

Download citation

  • DOI: https://doi.org/10.1007/978-3-030-67438-0_6

  • Published:

  • Publisher Name: Springer, Cham

  • Print ISBN: 978-3-030-67437-3

  • Online ISBN: 978-3-030-67438-0

  • eBook Packages: Computer ScienceComputer Science (R0)

Publish with us

Policies and ethics