Skip to main content

Explanations as Programs in Probabilistic Logic Programming

  • Conference paper
  • First Online:
Functional and Logic Programming (FLOPS 2022)

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

Included in the following conference series:

Abstract

The generation of comprehensible explanations is an essential feature of modern artificial intelligence systems. In this work, we consider probabilistic logic programming, an extension of logic programming which can be useful to model domains with relational structure and uncertainty. Essentially, a program specifies a probability distribution over possible worlds (i.e., sets of facts). The notion of explanation is typically associated with that of a world, so that one often looks for the most probable world as well as for the worlds where the query is true. Unfortunately, such explanations exhibit no causal structure. In particular, the chain of inferences required for a specific prediction (represented by a query) is not shown. In this paper, we propose a novel approach where explanations are represented as programs that are generated from a given query by a number of unfolding-like transformations. Here, the chain of inferences that proves a given query is made explicit. Furthermore, the generated explanations are minimal (i.e., contain no irrelevant information) and can be parameterized w.r.t. a specification of visible predicates, so that the user may hide uninteresting details from explanations.

This work has been partially supported by the EU (FEDER) and the Spanish MCI under grant PID2019-104735RB-C41/ AEI/10.13039/501100011033 (SAFER), by the Generalitat Valenciana under grant Prometeo/2019/098 (DeepTrust), and by TAILOR, a project funded by EU Horizon 2020 research and innovation programme under GA No. 952215.

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

Access this chapter

Chapter
USD 29.95
Price excludes VAT (USA)
  • Available as PDF
  • Read on any device
  • Instant download
  • Own it forever
eBook
USD 54.99
Price excludes VAT (USA)
  • Available as EPUB and PDF
  • Read on any device
  • Instant download
  • Own it forever
Softcover Book
USD 69.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

Institutional subscriptions

Notes

  1. 1.

    Publicly available from https://github.com/mistupv/xgen.

  2. 2.

    We do not consider function symbols in this work.

  3. 3.

    We follow Prolog’s notation in examples: variables start with an uppercase letter and the implication “\(\leftarrow \)” is denoted by “:-”.

  4. 4.

    See Sato’s seminal paper [29] for the distribution semantics in the infinite case.

  5. 5.

    Equivalently, has a successful SLD derivation; see Sect. 3.1 for a precise definition of SLD (Selective Linear Definite clause) resolution.

  6. 6.

    Observe that each fact should only be considered once. E.g., given a successful SLD derivation that uses the ground probabilistic fact \(\mathtt{0.4::person(ann)}\) twice, the associated probability is \(\mathtt{0.4}\) rather than \(\mathtt{0.4\cdot 0.4 = 0.16}\).

  7. 7.

    The interested reader can try the online ProbLog interpreter at https://dtai.cs.kuleuven.be/problog/editor.html.

  8. 8.

    We only show the relevant bindings of the computed \(\mathsf {mgu}\)’s in the examples.

  9. 9.

    The use of rule-based models to explain the predictions of AI systems is not new in the field of XAI (see, e.g., [3]).

  10. 10.

    Nevertheless, our tool \(\mathsf {xgen}\) considers more general programs by requiring the specification of those predicates that may violate the above condition (see Sect. 4).

  11. 11.

    Proofs of technical results can be found in [35].

  12. 12.

    Let \(B_1,a,B_2 \leadsto _\theta (B_1,B,B_2)\theta \) an SLD resolution step using clause \(h\leftarrow B\) and \(\mathsf {mgu}(a,h)=\theta \). Then, a is the direct ancestor of the atoms in B. The notion of ancestor is the transitive closure of this relation.

  13. 13.

    Considering negated ground probabilistic facts is straightforward, but dealing with negated derived atoms is much more challenging.

References

  1. Apt, K.R.: From Logic Programming to Prolog. Prentice Hall, Hoboken (1997)

    Google Scholar 

  2. Arias, J., Carro, M., Chen, Z., Gupta, G.: Justifications for goal-directed constraint answer set programming. In: Ricca, F., et al. (eds.) Proceedings of the 36th International Conference on Logic Programming (ICLP Technical Communications 2020). EPTCS, vol. 325, pp. 59–72 (2020). https://doi.org/10.4204/EPTCS.325.12

  3. Arrieta, A.B., et al.: Explainable artificial intelligence (XAI): concepts, taxonomies, opportunities and challenges toward responsible AI. Inf. Fusion 58, 82–115 (2020). https://doi.org/10.1016/j.inffus.2019.12.012

    Article  Google Scholar 

  4. Azzolini, D., Riguzzi, F.: Syntactic requirements for well-defined hybrid probabilistic logic programs. In: Formisano, A., et al. (eds.) Proceedings of the 37th International Conference on Logic Programming (Technical Communications) (ICLP Technical Communications 2021). EPTCS, vol. 345, pp. 14–26 (2021). https://doi.org/10.4204/EPTCS.345.12

  5. Bol, R.N.: Loop checking in partial deduction. J. Log. Program. 16(1), 25–46 (1993). https://doi.org/10.1016/0743-1066(93)90022-9

    Article  MathSciNet  MATH  Google Scholar 

  6. Bol, R.N., Apt, K.R., Klop, J.W.: An analysis of loop checking mechanisms for logic programs. Theor. Comput. Sci. 86(1), 35–79 (1991)

    Article  Google Scholar 

  7. Brewka, G., Eiter, T., Truszczynski, M.: Answer set programming at a glance. Commun. ACM 54(12), 92–103 (2011). https://doi.org/10.1145/2043174.2043195

    Article  Google Scholar 

  8. Cabalar, P., Fandinno, J., Muñiz, B.: A system for explainable answer set programming. In: Ricca, F., et al. (eds.) Proceedings of the 36th International Conference on Logic Programming (ICLP Technical Communications 2020). EPTCS, vol. 325, pp. 124–136 (2020). https://doi.org/10.4204/EPTCS.325.19

  9. Choudhury, A., Gupta, D.: A survey on medical diagnosis of diabetes using machine learning techniques. In: Kalita, J., Balas, V.E., Borah, S., Pradhan, R. (eds.) Recent Developments in Machine Learning and Data Analytics. AISC, vol. 740, pp. 67–78. Springer, Singapore (2019). https://doi.org/10.1007/978-981-13-1280-9_6

    Chapter  Google Scholar 

  10. EU, EEA: Regulation (EU) 2016/679 on the protection of natural persons with regard to the processing of personal data and on the free movement of such data. https://eur-lex.europa.eu/eli/reg/2016/679/oj

  11. Fierens, D., et al.: Inference and learning in probabilistic logic programs using weighted boolean formulas. Theory Pract. Log. Program. 15(3), 358–401 (2015). https://doi.org/10.1017/S1471068414000076

    Article  MathSciNet  MATH  Google Scholar 

  12. Hruza, J., Stepánek, P.: Speedup of logic programs by binarization and partial deduction. Theory Pract. Log. Program. 4(3), 355–380 (2004). https://doi.org/10.1017/S147106840300190X

    Article  MathSciNet  MATH  Google Scholar 

  13. Kersting, K., Raedt, L.D.: Bayesian logic programs. CoRR cs.AI/0111058 (2001). https://arxiv.org/abs/cs/0111058

  14. Kimmig, A., Demoen, B., Raedt, L.D., Costa, V.S., Rocha, R.: On the implementation of the probabilistic logic programming language ProbLog. Theory Pract. Log. Program. 11(2–3), 235–262 (2011). https://doi.org/10.1017/S1471068410000566

    Article  MathSciNet  MATH  Google Scholar 

  15. Lloyd, J.W.: Foundations of Logic Programming, 2nd edn. Springer, Heidelberg (1987). https://doi.org/10.1007/978-3-642-83189-8

    Book  MATH  Google Scholar 

  16. Lloyd, J.W., Shepherdson, J.C.: Partial evaluation in logic programming. J. Log. Program. 11(3&4), 217–242 (1991). https://doi.org/10.1016/0743-1066(91)90027-M

    Article  MathSciNet  MATH  Google Scholar 

  17. Mantadelis, T., Rocha, R.: Using iterative deepening for probabilistic logic inference. In: Lierler, Y., Taha, W. (eds.) PADL 2017. LNCS, vol. 10137, pp. 198–213. Springer, Cham (2017). https://doi.org/10.1007/978-3-319-51676-9_14

    Chapter  Google Scholar 

  18. Molnar, C., Casalicchio, G., Bischl, B.: Interpretable machine learning – a brief history, state-of-the-art and challenges. In: Koprinska, I., et al. (eds.) ECML PKDD 2020. CCIS, vol. 1323, pp. 417–431. Springer, Cham (2020). https://doi.org/10.1007/978-3-030-65965-3_28

    Chapter  Google Scholar 

  19. Muggleton, S.: Stochastic logic programs. In: de Raedt, L. (ed.) Advances in Inductive Logic Programming, pp. 254–264. IOS Press (1996)

    Google Scholar 

  20. Muggleton, S.: Semantics and derivation for stochastic logic programs. In: Proceedings of the UAI-2000 Workshop on Fusion of Domain Knowledge with Data for Decision Support (2000)

    Google Scholar 

  21. Pettorossi, A., Proietti, M.: Transformation of logic programs: foundations and techniques. J. Log. Program. 19(20), 261–320 (1994). https://doi.org/10.1016/0743-1066(94)90028-0

    Article  MathSciNet  MATH  Google Scholar 

  22. Poole, D.: Probabilistic horn abduction and Bayesian networks. Artif. Intell. 64(1), 81–129 (1993). https://doi.org/10.1016/0004-3702(93)90061-F

    Article  MATH  Google Scholar 

  23. Poole, D.: The independent choice logic for modelling multiple agents under uncertainty. Artif. Intell. 94(1–2), 7–56 (1997). https://doi.org/10.1016/S0004-3702(97)00027-1

    Article  MathSciNet  MATH  Google Scholar 

  24. De Raedt, L., Kimmig, A.: Probabilistic (logic) programming concepts. Mach. Learn. 100(1), 5–47 (2015). https://doi.org/10.1007/s10994-015-5494-z

    Article  MathSciNet  MATH  Google Scholar 

  25. Raedt, L.D., Kimmig, A., Toivonen, H.: ProbLog: a probabilistic Prolog and its application in link discovery. In: Veloso, M.M. (ed.) Proceedings of the 20th International Joint Conference on Artificial Intelligence (IJCAI 2007), pp. 2462–2467 (2007). http://ijcai.org/Proceedings/07/Papers/396.pdf

  26. Ricci, F., Rokach, L., Shapira, B. (eds.): Recommender Systems Handbook. Springer, Boston (2015). https://doi.org/10.1007/978-1-4899-7637-6

    Book  MATH  Google Scholar 

  27. Riguzzi, F.: Foundations of Probabilistic Logic Programming: Languages, Semantics, Inference and Learning. River Publishers (2018)

    Google Scholar 

  28. Riguzzi, F., Swift, T.: Well-definedness and efficient inference for probabilistic logic programming under the distribution semantics. Theory Pract. Log. Program. 13(2), 279–302 (2013)

    Article  MathSciNet  Google Scholar 

  29. Sato, T.: A statistical learning method for logic programs with distribution semantics. In: Sterling, L. (ed.) Logic Programming, Proceedings of the Twelfth International Conference on Logic Programming, Tokyo, Japan, 13–16 June 1995, pp. 715–729. MIT Press (1995)

    Google Scholar 

  30. Sato, T., Kameya, Y.: PRISM: a language for symbolic-statistical modeling. In: Proceedings of the Fifteenth International Joint Conference on Artificial Intelligence, IJCAI 1997, Nagoya, Japan, 23–29 August 1997, vol. 2, pp. 1330–1339. Morgan Kaufmann (1997). http://ijcai.org/Proceedings/97-2/Papers/078.pdf

  31. Shterionov, D., Renkens, J., Vlasselaer, J., Kimmig, A., Meert, W., Janssens, G.: The most probable explanation for probabilistic logic programs with annotated disjunctions. In: Davis, J., Ramon, J. (eds.) ILP 2014. LNCS (LNAI), vol. 9046, pp. 139–153. Springer, Cham (2015). https://doi.org/10.1007/978-3-319-23708-4_10

    Chapter  Google Scholar 

  32. Vennekens, J., Verbaeten, S., Bruynooghe, M.: Logic programs with annotated disjunctions. In: Demoen, B., Lifschitz, V. (eds.) ICLP 2004. LNCS, vol. 3132, pp. 431–445. Springer, Heidelberg (2004). https://doi.org/10.1007/978-3-540-27775-0_30

    Chapter  MATH  Google Scholar 

  33. Veres, M., Moussa, M.: Deep learning for intelligent transportation systems: a survey of emerging trends. IEEE Trans. Intell. Transp. Syst. 21(8), 3152–3168 (2020). https://doi.org/10.1109/TITS.2019.2929020

    Article  Google Scholar 

  34. Vidal, G.: A hybrid approach to conjunctive partial evaluation of logic programs. In: Alpuente, M. (ed.) LOPSTR 2010. LNCS, vol. 6564, pp. 200–214. Springer, Heidelberg (2011). https://doi.org/10.1007/978-3-642-20551-4_13

    Chapter  Google Scholar 

  35. Vidal, G.: Explanations as programs in probabilistic logic programming (2022). http://personales.upv.es/gvidal/german/flops22/tr.pdf

Download references

Acknowledgements

I would like to thank the anonymous reviewers for their suggestions to improve this paper.

Author information

Authors and Affiliations

Authors

Corresponding author

Correspondence to Germán Vidal .

Editor information

Editors and Affiliations

Rights and permissions

Reprints and permissions

Copyright information

© 2022 Springer Nature Switzerland AG

About this paper

Check for updates. Verify currency and authenticity via CrossMark

Cite this paper

Vidal, G. (2022). Explanations as Programs in Probabilistic Logic Programming. In: Hanus, M., Igarashi, A. (eds) Functional and Logic Programming. FLOPS 2022. Lecture Notes in Computer Science, vol 13215. Springer, Cham. https://doi.org/10.1007/978-3-030-99461-7_12

Download citation

  • DOI: https://doi.org/10.1007/978-3-030-99461-7_12

  • Published:

  • Publisher Name: Springer, Cham

  • Print ISBN: 978-3-030-99460-0

  • Online ISBN: 978-3-030-99461-7

  • eBook Packages: Computer ScienceComputer Science (R0)

Publish with us

Policies and ethics