Abstract
There have been many studies in termination analysis of logic programming but little has been done on analyzing non-termination of logic programs, which is even more important in our opinion. Non-termination analysis examines program execution history when non-termination is suspected and informs the programmer of non-termination causes and possible ways to fix them. In the first part of this thesis, we study the problem of non-termination in tabled logic engines with subgoal abstraction, such as XSB, and propose a suite of algorithms, called non-Termination analyzer, \(\texttt{Terminyzer}\), for automatic detection and explanation of non-termination.
The second part of this thesis focuses on cost-based query optimization. Database query optimizers rely on data statistics in selecting query execution plans and rule-based systems can greatly benefit from such optimizations as well. To this end, one first needs to collect data statistics for base and propagate them to derived predicates. However, there are two difficulties: dependencies among arguments and recursion. To address these problems, we implement a Cost-based query optimizer, \(\texttt{Costimizer}\), which consists of a cost estimator and an optimizing unit. The optimizing unit performs a greedy search optimization based on predicate statistics computed by the cost estimator. We validate the effectiveness of \(\texttt{Costimizer}\) on both size estimation and query optimization through experimental studies.
Access this chapter
Tax calculation will be finalised at checkout
Purchases are for personal use only
Preview
Unable to display preview. Download preview PDF.
References
Bruynooghe, M., Codish, M., Gallagher, J.P., Genaim, S., Vanhoof, W.: Ter- mination analysis of logic programs through combination of type-based norms. ACM Trans. Program. Lang. Syst. 29 (April 2007), http://doi.acm.org/10.1145/1216374.1216378
Chen, W., Kifer, M., Warren, D.S.: HiLog: A foundation for higher-order logic programming. J. Log. Program. 15(3), 187–230 (1993)
Christodoulakis, S.: Implications of certain assumptions in database performance evauation. ACM Trans. Database Syst. 9(2), 163–186 (1984)
DeHaan, D., Tompa, F.W.: Optimal top-down join enumeration. In: Proceedings of the 2007 ACM SIGMOD International Conference on Management of Data, SIGMOD 2007, pp. 785–796. ACM, New York (2007)
Ioannidis, Y.: The history of histograms (abridged). In: Proc. of VLDB Conference (2003)
Ioannidis, Y.E., Christodoulakis, S.: On the propagation of errors in the size of join results. SIGMOD Rec. 20(2), 268–277 (1991)
Ioannidis, Y.E., Poosala, V.: Balancing histogram optimality and practicality for query result size estimation. In: SIGMOD 1995: Proceedings of the 1995 ACM SIG- MOD International Conference on Management of Data, pp. 233–244. ACM, New York (1995)
Liang, S., Kifer, M.: Deriving predicate statistics in datalog. In: Kutsia, T., Schreiner, W., Fernández, M. (eds.) PPDP, pp. 45–56. ACM (2010)
Liang, S., Kifer, M.: Deriving Predicate Statistics for Logic Rules. In: Krötzsch, M., Staraccia, U. (eds.) RR 2012. LNCS, vol. 7497, pp. 139–155. Springer, Heidelberg (2012)
Lindenstrauss, N., Sagiv, Y., Serebrenik, A.: Proving termination for logic pro- grams by the query-mapping pairs approach. In: Program Developments in Computational Logic. LNCS, pp. 453–498. Springer (2004)
Moerkotte, G., Neumann, T.: Dynamic programming strikes back. In: SIGMOD 2008: Proceedings of the 2008 ACM SIGMOD International Conference on Management of Data, pp. 539–552. ACM, New York (2008)
Neumerkel, U., Mesnard, F.: Localizing and Explaining Reasons for Non-Terminating Logic Programs with Failure-Slices. In: Nadathur, G. (ed.) PPDP 1999. LNCS, vol. 1702, pp. 328–342. Springer, Heidelberg (1999), http://dl.acm.org/citation.cfm?id=645815.668882
Nguyen, M.T., De Schreye, D.: Polytool: Proving Termination Automatically Based on Polynomial Interpretations. In: Puebla, G. (ed.) LOPSTR 2006. LNCS, vol. 4407, pp. 210–218. Springer, Heidelberg (2007), http://dl.acm.org/citation.cfm?id=1759187.1759208
Nguyen, M.T., Giesl, J., Schneider-Kamp, P., De Schreye, D.: Termination Analysis of Logic Programs Based on Dependency Graphs. In: King, A. (ed.) LOPSTR 2007. LNCS, vol. 4915, pp. 8–22. Springer, Heidelberg (2008), http://dx.doi.org/10.1007/978-3-540-78769-3_2
Ono, K., Lohman, G.M.: Measuring the complexity of join enumeration in query optimization. In: Proceedings of the Sixteenth International Conference on Very Large Databases, pp. 314–325. Morgan Kaufmann Publishers Inc., San Francisco (1990), http://portal.acm.org/citation.cfm?id=94362.94436
Payet, E., Mesnard, F.: Nontermination inference of logic programs. ACM Trans. Program. Lang. Syst. 28, 256–289 (2006), http://doi.acm.org/10.1145/1119479.1119481
Riguzzi, F., Swift, T.: Well-definedness and efficient inference for probabilistic logic programming under the distribution semantics. In: TPLP (to appear, 2012)
Schneider-Kamp, P., Giesl, J., Ströder, T., Serebrenik, A., Thiemann, R.: Automated termination analysis for logic programs with cut*. Theory Pract. Log. Program. 10, 365–381, http://dx.doi.org/10.1017/S1471068410000165
Schreye, D.D., Decorte, S.: Termination of logic programs: The never-ending story. J. Log. Program. 19/20, 199–260 (1994)
Selinger, P.G., Astrahan, M.M., Chamberlin, D.D., Lorie, R.A., Price, T.G.: Access path selection in a relational database management system. In: SIGMOD 1979: Proceedings of the 1979 ACM SIGMOD International Conference on Management of Data, pp. 23–34. ACM, New York (1979)
Sipser, M.: Introduction to the Theory of Computation, 1st edn. International Thomson Publishing (1996)
Stillger, M., Lohman, G.M., Markl, V., Kandil, M.: Leo - db2’s learning optimizer. In: VLDB 2001: Proceedings of the 27th International Conference on Very Large Data Bases, pp. 19–28. Morgan Kaufmann Publishers Inc., San Francisco (2001)
Swift, T., Warren, D.S., Sagonas, K., Freire, J., Rao, P., Cui, B., Johnson, E., de Castro, L., Marques, R.F., Saha, D., Dawson, S., Kifer, M.: The XSB system, version 3.3.x., vol. 1. Programmer’s manual, http://xsb.sourceforge.net
Swift, T., Warren, D.S.: Xsb: Extending prolog with tabled logic programming. CoRR abs/1012.5123 (2010)
Vance, B., Maier, D.: Rapid bushy join-order optimization with cartesian products. In: Proceedings of the 1996 ACM SIGMOD International Conference on Management of Data, SIGMOD 1996, pp. 35–46. ACM, New York (1996)
Voets, D., De Schreye, D.: Non-termination Analysis of Logic Programs Using Types. In: Alpuente, M. (ed.) LOPSTR 2010. LNCS, vol. 6564, pp. 133–148. Springer, Heidelberg (2011), http://dl.acm.org/citation.cfm?id=2008282.2008291
Author information
Authors and Affiliations
Editor information
Editors and Affiliations
Rights and permissions
Copyright information
© 2012 Springer-Verlag Berlin Heidelberg
About this paper
Cite this paper
Liang, S. (2012). Non-termination Analysis and Cost-Based Query Optimization of Logic Programs. In: Krötzsch, M., Straccia, U. (eds) Web Reasoning and Rule Systems. RR 2012. Lecture Notes in Computer Science, vol 7497. Springer, Berlin, Heidelberg. https://doi.org/10.1007/978-3-642-33203-6_33
Download citation
DOI: https://doi.org/10.1007/978-3-642-33203-6_33
Publisher Name: Springer, Berlin, Heidelberg
Print ISBN: 978-3-642-33202-9
Online ISBN: 978-3-642-33203-6
eBook Packages: Computer ScienceComputer Science (R0)