Skip to main content

Decidability of logic program semantics and applications to testing

  • Tools and Programming Environments
  • Conference paper
  • First Online:
Programming Languages: Implementations, Logics, and Programs (PLILP 1996)

Part of the book series: Lecture Notes in Computer Science ((LNCS,volume 1140))

Abstract

We consider the decidability problem of logic program semantics, focusing in particular on the least Herbrand model, the least term model and the S-semantics. A declarative characterization is given for a large class of programs whose semantics are decidable sets. In addition, we show how decidability is strongly related to (black box) testing. In our terminology, the testing problem consists of checking whether or not the formal semantics of a program includes a given finite set of atoms. We show that the testing problem for a program is decidable iff its formal semantics is a decidable set.

Interestingly, the decision procedure used to check whether an atom belongs to the S-semantics of a program has a natural implementation in the logic programming paradigm itself, in the form of a Prolog metaprogram. Consequently, this provides us with a basic tool for testing. Theory and tools are refined to consider the use of non-standard predicates, such as arithmetic built-in's and the meta-predicate demo.

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

Access this chapter

Institutional subscriptions

Preview

Unable to display preview. Download preview PDF.

Unable to display preview. Download preview PDF.

References

  1. K.R. Apt. Logic programming. In J. van Leeuwen, editor, Handbook of Theoretical Computer Science, volume B, pages 493–574. Elsevier, 1990.

    Google Scholar 

  2. K.R. Apt, M. Gabbrielli, and D. Pedreschi. A Closer Look at Declarative Interpretations. Technical Report CS-R9470, Centre for Mathematics and Computer Science, Amsterdam, 1994. To appear in Journal of Logic Programming.

    Google Scholar 

  3. K.R. Apt and E. Marchiori. Reasoning about Prolog programs: from modes through types to assertions. Formal Aspects of Computing, 6A:743–764, 1994.

    Google Scholar 

  4. K.R. Apt and D. Pedreschi. Studies in Pure Prolog: Termination. In J. W. Lloyd, editor, Symposium on Computational Logic. Springer-Verlag, Berlin, 1990.

    Google Scholar 

  5. A. Bossi, M. Gabbrielli, G. Levi, and M. Martelli. The S-semantics Approach: Theory and Applications. Journal of Logic Programming, 19, 20:149–197, 1994.

    Google Scholar 

  6. L. Bougè, N. Choquet, L. Fribourg, and M. Gaudel. Test sets generation from algebraic specifications using logic programming. Journal of System and Software, 6(4), 1986.

    Google Scholar 

  7. M. Bruynooghe. A Practical Framework for the Abstract Interpretation of Logic Programs. New Generation Computing, 10(2):91–124, 1991.

    Google Scholar 

  8. K.L. Clark. Predicate logic as a computational formalism. Technical Report DOC 79/59, Imperial College, Dept. of Computing, 1979.

    Google Scholar 

  9. M. Comini, G. Levi, and G. Vitiello. Efficient detection of incompleteness errors in the abstract debugging of logic programs. In AADEBUG'95, 1995.

    Google Scholar 

  10. M. Falaschi, G. Levi, M. Martelli, and C. Palamidessi. A Model-Theoretic Reconstruction of the Operational Semantics of Logic Programs. Information and Computation, 102(1):86–113, 1993.

    Google Scholar 

  11. M. Gorlick, C.F. Kesselman, D. Marotta, and D. Stott Parker. MOCKINGBIRD: A Logical Methodology for Testing. Journal of Logic Programming, 8(1,2), 1990.

    Google Scholar 

  12. G. Levi and D. Ramundo. A Formalization of Metaprogramming for Real. In D.S. Warren, editor, Proceedings Tenth International Conference on Logic Programming, pages 354–373. The MIT Press, 1993.

    Google Scholar 

  13. L. Naish. Declarative Diagnosis of Missing Answers. New Generation Computing, 10:255–285, 1991.

    Google Scholar 

  14. D. Pedreschi and S. Ruggieri. Termination is language-independent. In M. Alpuente et. al., editor, Proc. of the GULP-PRODE'94 Joint Conference on Declarative Programming. Univ. Politecnica de Valencia, 1994.

    Google Scholar 

  15. D. Pedreschi and S. Ruggieri. Verification of Metainterpreters. Technical Report TR-96-23, Dipartimento di Informatica, Università di Pisa, 1996. Accepted for publication in Journal of Logic and Computation.

    Google Scholar 

  16. J. Shoenfield. Mathematical logic. Addison Wesdley, Reading, 1967.

    Google Scholar 

  17. L. Sterling and E. Shapiro. The Art of Prolog. The MIT Press, 1986.

    Google Scholar 

  18. J.D. Ulmann and A. van Gelder. Efficient tests for top-down termination of logical rules. Journal of the ACM, 35(2):345–373, 1988.

    Google Scholar 

Download references

Author information

Authors and Affiliations

Authors

Editor information

Herbert Kuchen S. Doaitse Swierstra

Rights and permissions

Reprints and permissions

Copyright information

© 1996 Springer-Verlag Berlin Heidelberg

About this paper

Cite this paper

Ruggieri, S. (1996). Decidability of logic program semantics and applications to testing. In: Kuchen, H., Doaitse Swierstra, S. (eds) Programming Languages: Implementations, Logics, and Programs. PLILP 1996. Lecture Notes in Computer Science, vol 1140. Springer, Berlin, Heidelberg. https://doi.org/10.1007/3-540-61756-6_96

Download citation

  • DOI: https://doi.org/10.1007/3-540-61756-6_96

  • Published:

  • Publisher Name: Springer, Berlin, Heidelberg

  • Print ISBN: 978-3-540-61756-3

  • Online ISBN: 978-3-540-70654-0

  • eBook Packages: Springer Book Archive

Publish with us

Policies and ethics