Abstract
Many complex analysis problems can be most clearly and easily specified as logic rules and queries, where rules specify how given facts can be combined to infer new facts, and queries select facts of interest to the analysis problem at hand. However, it has been extremely challenging to obtain efficient implementations from logic rules and to understand their time and space complexities, especially for on-demand analysis driven by queries.
This paper describes a powerful method for generating specialized rules and programs for demand-driven analysis from Datalog rules and queries, and further for providing time and space complexity guarantees. The method combines recursion conversion with specialization of rules and then uses a method for program generation and complexity calculation from rules. We compare carefully with the best prior methods by examining many variants of rules and queries for the same graph reachability problems, and show the application of our method in implementing graph query languages in general.
This work was supported in part by NSF under grants CCR-0306399 and CCF-0613913.
Preview
Unable to display preview. Download preview PDF.
Similar content being viewed by others
References
Afrati, F.N., Gergatsoulis, M., Toni, F.: Linearisability on datalog programs. Theoretical Computer Science 308(1-3), 199–226 (2003)
Bancilhon, F., Ramakrishnan, R.: An amateur’s introduction to recursive query processing strategies. In: Proc. of the 1986 ACM SIGMOD Intl. Conf. on Management of Data, pp. 16–52 (1986)
Barker, S., Leuschel, M., Varea, M.: Efficient and flexible access control via logic program specialisation. In: Proc. of the 2004 ACM SIGPLAN Workshop on Partial Evaluation and Semantics-based Program Manipulation, pp. 190–199 (2004)
Beeri, C., Ramakrishnan, R.: On the power of magic. J. Logic Programming 10(1/2/3&4), 255–299 (1991)
Brough, D.R., Hogger, C.J.: Grammar-related transformations of logic programs. New Generation Computing 9(2), 115–134 (1991)
Ceri, S., Gottlob, G., Tanca, L.: Logic Programming and Databases. Springer, Heidelberg (1990)
Chen, W., Warren, D.S.: Tabled evaluation with delaying for general logic programs. J. ACM 43(1), 20–74 (1996)
Consens, M.P., Mendelzon, A.O.: GraphLog: a visual formalism for real life recursion. In: Proc. of the 9th ACM SIGMOD-SIGACT-SIGART Symp. on Principles of Database Systems, pp. 404–416 (1990)
Gottlob, G., Koch, C.: Monadic datalog and the expressive power of languages for web information extraction. J. ACM 51(1), 74–113 (2004)
Greco, S., Saccà , D., Zaniolo, C.: Grammars and automata to optimize chain logic queries. Intl. J. Foundations of Computer Science 10(3), 349 (1999)
Hristova, K., Liu, Y.A.: Improved algorithm complexities for linear temporal logic model checking of pushdown systems. In: Proc. of 7th Intl. Conf. on Verification, Model Checking and Abstract Interpretation, pp. 190–206 (2006)
Hristova, K., Rothamel, T., Liu, Y.A., Stoller, S.D.: Efficient type inference for secure information flow. In: Technical Report DAR 07-35, Computer Science Department, SUNY Stony Brook (May 2007); A preliminary version of this work appeared in Proc. of the 2006 ACM SIGPLAN Workshop on Programming Languages and Analysis for Security
Hristova, K., Tekle, K.T., Liu, Y.A.: Efficient trust management policy analysis from rules. In: Proc. of the 9th ACM SIGPLAN Intl. Conf. on Principles and Practice of Declarative Programming (July 2007)
Kifer, M., Lozinskii, E.L.: A framework for an efficient implementation of deductive database systems. In: Proc. of the Advanced Database Symposium (1986)
Kifer, M., Lozinskii, E.L.: On compile-time query optimization in deductive databases by means of static filtering. ACM Trans. Database Systems 15(3), 385–426 (1990)
Lam, M.S., Whaley, J., Livshits, V.B., Martin, M.C., Avots, D., Carbin, M., Unkel, C.: Context-sensitive program analysis as database queries. In: Proc. of the 24th ACM SIGACT-SIGMOD-SIGART Symp. on Principles of Database Systems, pp. 1–12 (2005)
Leuschel, M.: Logic program specialisation. In: Hatcliff, J., Mogensen, T.Æ., Thiemann, P. (eds.) DIKU 1998. LNCS, vol. 1706, pp. 155–188. Springer, Heidelberg (1999)
Liu, Y.A., Rothamel, T., Yu, F., Stoller, S.D., Hu, N.: Parametric regular path queries. In: Proc. of the ACM SIGPLAN 2004 Conf. on Programming Language Design and Implementation, pp. 219–230 (2004)
Liu, Y.A., Stoller, S.D.: From datalog rules to efficient programs with time and space guarantees. In: Proc. of the 5th Intl. ACM SIGPLAN Conf. on Principles and Practice of Declarative Programming, pp. 172–183 (2003)
Liu, Y.A., Stoller, S.D.: Querying complex graphs. In: Proc. of the 7th Intl. Symp. on Practical Aspects of Declarative Languages, pp. 199–214 (2006)
Maier, D., Warren, D.S.: Computing with logic: logic programming with Prolog. Benjamin-Cummings Publishing Co. Inc., Redwood City (1988)
Melski, D., Reps, T.W.: Interconvertibility of a class of set constraints and context-free-language reachability. Theoretical Computer Science 248(1-2), 29–98 (2000)
Ramakrishnan, R., Sagiv, Y., Ullman, J.D., Vardi,: Proof-tree transformation theorems and their applications. In: Proc. of the 8th ACM SIGACT-SIGMOD-SIGART Symp. on Principles of Database Systems, pp. 172–181 (1989)
Sagonas, K.F., Swift, T., Warren, D.S.: XSB as a deductive database. In: Proc. of the 1994 ACM SIGMOD Intl. Conf. on Management of Data, p. 512 (1994)
Zhang, W., Yu, C.T., Troy, D.: Necessary and sufficient conditions to linearize double recursive programs in logic databases. ACM Trans. on Database Systems 15(3), 459–482 (1990)
Author information
Authors and Affiliations
Editor information
Rights and permissions
Copyright information
© 2008 Springer-Verlag Berlin Heidelberg
About this paper
Cite this paper
Tekle, K.T., Hristova, K., Liu, Y.A. (2008). Generating Specialized Rules and Programs for Demand-Driven Analysis. In: Meseguer, J., RoÅŸu, G. (eds) Algebraic Methodology and Software Technology. AMAST 2008. Lecture Notes in Computer Science, vol 5140. Springer, Berlin, Heidelberg. https://doi.org/10.1007/978-3-540-79980-1_26
Download citation
DOI: https://doi.org/10.1007/978-3-540-79980-1_26
Publisher Name: Springer, Berlin, Heidelberg
Print ISBN: 978-3-540-79979-5
Online ISBN: 978-3-540-79980-1
eBook Packages: Computer ScienceComputer Science (R0)