Hostname: page-component-76fb5796d-r6qrq Total loading time: 0 Render date: 2024-04-25T07:56:08.571Z Has data issue: false hasContentIssue false

Explainable dynamic programming

Published online by Cambridge University Press:  18 May 2021

MARTIN ERWIG
Affiliation:
School of EECS, Kelley Engineering Center 3047, Oregon State University, Corvallis, Oregon, 97331, USA e-mails: erwig@oregonstate.edu, kumarpra@oregonstate.edu
PRASHANT KUMAR
Affiliation:
School of EECS, Kelley Engineering Center 3047, Oregon State University, Corvallis, Oregon, 97331, USA e-mails: erwig@oregonstate.edu, kumarpra@oregonstate.edu
Rights & Permissions [Opens in a new window]

Abstract

Core share and HTML view are not available for this content. However, as you have access to this content, a full PDF is available via the ‘Save PDF’ action button.

In this paper, we present a method for explaining the results produced by dynamic programming (DP) algorithms. Our approach is based on retaining a granular representation of values that are aggregated during program execution. The explanations that are created from the granular representations can answer questions of why one result was obtained instead of another and therefore can increase the confidence in the correctness of program results.

Our focus on dynamic programming is motivated by the fact that dynamic programming offers a systematic approach to implementing a large class of optimization algorithms which produce decisions based on aggregated value comparisons. It is those decisions that the granular representation can help explain. Moreover, the fact that dynamic programming can be formalized using semirings supports the creation of a Haskell library for dynamic programming that has two important features. First, it allows programmers to specify programs by recurrence relationships from which efficient implementations are derived automatically. Second, the dynamic programs can be formulated generically (as type classes), which supports the smooth transition from programs that only produce result to programs that can run with granular representation and also produce explanations. Finally, we also demonstrate how to anticipate user questions about program results and how to produce corresponding explanations automatically in advance.

Type
Research Article
Copyright
© The Author(s) 2021. Published by Cambridge University Press

References

Abraham, R. & Erwig, M. (2005) Goal-directed debugging of spreadsheets. In IEEE International Symposium on Visual Languages and Human-Centric Computing, pp. 3744.CrossRefGoogle Scholar
Abraham, R. & Erwig, M. (2007) GoalDebug: A spreadsheet debugger for end users. In 29th IEEE International Conference on Software Engineering, pp. 251260.CrossRefGoogle Scholar
Ackley, D. H. (2013) Beyond efficiency. Commun. ACM 56(10), 3840.CrossRefGoogle Scholar
Bartholdi, J. J. (2008) The Knapsack Problem. Boston, MA: Springer US, pp. 1931.Google Scholar
Bauer, T., Erwig, M., Fern, A. & Pinto, J. (2011) Adaptation-based programming in Haskell. In IFIP Working Conference on Domain-Specific Languages, pp. 123.CrossRefGoogle Scholar
Bellman, R. (1957a) A Markovian decision process. J. Math. Mech. 6(5), 679684.Google Scholar
Bellman, R. (1958) On a routing problem. Q. Appl. Math. 16(1), 8790.CrossRefGoogle Scholar
Bellman, R. (1957b) Dynamic Programming, 1st edn. Princeton, NJ, USA: Princeton University Press.Google ScholarPubMed
Biswas, S. K. (1997) Dynamic Slicing in Higher-Order Programming Languages. Ph.D. thesis.Google Scholar
Cheney, J., Chiticariu, L. & Tan, W. (2009) Provenance in databases: Why, how, and where. Found. Trends Databases 1(4), 379474.CrossRefGoogle Scholar
Dantzig, G. (1957) Discrete-variable extremum problems. Oper. Res. 5, 266288.CrossRefGoogle Scholar
Erwig, M., Fern, A., Murali, M. & Koul, A. (2018). Explaining deep adaptive programs via reward decomposition. In IJCAI/ECAI Workshop on Explainable Artificial Intelligence, pp. 4044.Google Scholar
Ford, L. R. & Fulkerson, D. R. (1956) Maximal flow through a network. Canad. J. Math., 8, 399404.CrossRefGoogle Scholar
Garfinkel, P. (1981) Forms of Explanation. New Haven, CT, USA: Yale University Press.Google Scholar
Gill, A. (2001) Debugging Haskell by observing intermediate data structures. Electron. Notes Theoretical Comput. Sci. 41(1), 1.Google Scholar
Golan, J. S. (1999) Semirings and Their Applications. Dordrecht, Netherlands: Springer.CrossRefGoogle Scholar
Goodman, J. (1999) Semiring parsing. Comput. Linguist. 25(4), 573605.Google Scholar
Green, T., Karvounarakis, G. & Tannen, V. (2007, June). Provenance semirings.CrossRefGoogle Scholar
Juozapaitis, Z., Fern, A., Koul, A., Erwig, M. & Doshi-Velez, F. (2019). Explainable reinforcement learning via reward decomposition. In IJCAI/ECAI Workshop on Explainable Artificial Intelligence, pp. 4753.Google Scholar
Khan, O. Z., Poupart, P. & Black, J. P. (2009) Minimal sufficient explanations for factored Markov decision processes. In 19th International Conference on Automated Planning and Scheduling, pp. 194200.Google Scholar
Khoo, Y. P., Foster, J. S. & Hicks, M. (2013) Expositor: Scriptable time-travel debugging with first-class traces. In ACM/IEEE International Conference on Software Engineering, pp. 352361.Google Scholar
Ko, A. J. & Myers, B. A. (2004) Designing the Whyline: A debugging interface for asking questions about program behavior. In SIGCHI Conference on Human Factors in Computing Systems, pp. 151158.CrossRefGoogle Scholar
Ko, A. J. & Myers, B. A. (2009) Finding causes of program output with the Java Whyline. In SIGCHI Conference on Human Factors in Computing Systems, pp. 15691578.CrossRefGoogle Scholar
Lipton, P. (1990) Contrastive explanation. Royal Inst. Phil. Suppl. 27, 247266.CrossRefGoogle Scholar
Lipton, P. (2004) Inference to the Best Explanation. New York, NY, USA: Routledge.Google Scholar
Marceau, G., Cooper, G. H., Spiro, J. P., Krishnamurthi, S. & Reiss, S. P. (2007). The design and implementation of a dataflow language for scriptable debugging. Autom. Softw. Eng. 14(1), 5986.CrossRefGoogle Scholar
Michie, D. (1968) “Memo” functions and machine learning. Nature 218, 1922.CrossRefGoogle Scholar
Mohri, M. (2002) Semiring frameworks and algorithms for shortest-distance problems. J. Autom. Lang. Comb. 7(3), 321350.Google Scholar
Murphy, G. C., Kersten, M. & Findlater, L. (2006) How are Java software developers using the eclipse IDE? IEEE Softw. 23(4), 7683.CrossRefGoogle Scholar
Nilsson, H. & Fritzson, P. (1994) Algorithmic debugging for lazy functional languages. J. Funct. Program. 4(3), 337369.CrossRefGoogle Scholar
Nilsson, H. & Sparud, J. (1997) The evaluation dependence tree as a basis for lazy functional debugging. Autom. Softw. Eng. 4(2), 121150.CrossRefGoogle Scholar
Ochoa, C., Silva, J. & Vidal, G. (2004) Dynamic slicing based on redex trails. In ACM SIGPLAN Symposium on Partial Evaluation and Semantics-Based Program Manipulation, pp. 123134.CrossRefGoogle Scholar
Parnin, C. & Orso, A. (2011) Are automated debugging techniques actually helping programmers? International Symposium on Software Testing and Analysis, pp. 199209.Google Scholar
Perera, R., Acar, U. A., Cheney, J. & Levy, P. B. (2012) Functional programs that explain their work. In 17th ACM SIGPLAN International Confernce on Functional Programming, pp. 365376.CrossRefGoogle Scholar
Pope, B. (2005) Declarative debugging with Buddha. In 5th International Conference on Advanced Functional Programming, pp. 273308.CrossRefGoogle Scholar
Ricciotti, W., Stolarek, J., Perera, R., & Cheney, J. (2017) Imperative functional programs that explain their work. Proc. ACM Program. Lang. 1, 14:114:28.CrossRefGoogle Scholar
Roehm, T., Tiarks, R., Koschke, R. & Maalej, W. (2012) How do professional developers comprehend software? In 34th International Conference on Software Engineering, pp. 255265.Google Scholar
Vardi, M. Y. (2020) Efficiency vs. resilience: What covid-19 teaches computing. Commun. ACM 63(5), 9.CrossRefGoogle Scholar
Vessey, I. (1986) Expertise in debugging computer programs: An analysis of the content of verbal protocols. IEEE Trans. Syst. Man Cybernet. 16(5), 621637.CrossRefGoogle Scholar
Zeller, A. (2002) Isolating cause-effect chains from computer programs. In 10th ACM SIGSOFT Symposium on Foundations of Software Engineering, pp. 110.CrossRefGoogle Scholar
Submit a response

Discussions

No Discussions have been published for this article.