Abstract
We present a static analysis that infers both upper and lower bounds on the usage that a logic program makes of a set of user-definable resources. The inferred bounds will in general be functions of input data sizes. A resource in our approach is a quite general, user-defined notion which associates a basic cost function with elementary operations. The analysis then derives the related (upper- and lower-bound) resource usage functions for all predicates in the program. We also present an assertion language which is used to define both such resources and resource-related properties that the system can then check based on the results of the analysis. We have performed some preliminary experiments with some concrete resources such as execution steps, bytes sent or received by an application, number of files left open, number of accesses to a database, number of calls to a procedure, number of asserts/retracts, etc. Applications of our analysis include resource consumption verification and debugging (including for mobile code), resource control in parallel/distributed computing, and resource-oriented specialization.
Preview
Unable to display preview. Download preview PDF.
Similar content being viewed by others
References
Aspinall, D., Beringer, L., Hofmann, M., Loidl, H.-W., Momigliano, A.: A program logic for resource verification. In: Slind, K., Bunker, A., Gopalakrishnan, G.C. (eds.) TPHOLs 2004. LNCS, vol. 3223, pp. 34–49. Springer, Heidelberg (2004)
Bagnara, R., Pescetti, A., Zaccagnini, A., Zaffanella, E., Zolo, T.: Purrs: The Parma University’s Recurrence Relation Solver, http://www.cs.unipr.it/purrs/
Basin, D., Ganzinger, H.: Complexity Analysis based on Ordered Resolution. In: 11th. IEEE Symposium on Logic in Computer Science, IEEE Computer Society Press, Los Alamitos (1996)
Bate, I., Bernat, G., Puschner, P.: Java virtual-machine support for portable worst-case execution-time analysis. In: 5th IEEE Int’l. Symp. on Object-oriented Real-time Distributed Computing (April 2002)
Chander, A., Espinosa, D., Islam, N., Lee, P., Necula, G.C.: Enforcing resource bounds via static verification of dynamic checks. In: Sagiv, M. (ed.) ESOP 2005. LNCS, vol. 3444, pp. 311–325. Springer, Heidelberg (2005)
Craig, S.J., Leuschel, M.: Self-tuning resource aware specialisation for Prolog. In: Proc. of PPDP 2005, pp. 23–34. ACM Press, New York (2005)
Debray, S.K., Lin, N.W.: Cost analysis of logic programs. TOPLAS, 15(5) (1993)
Debray, S.K., Lin, N.-W., Hermenegildo, M.: Task Granularity Analysis in Logic Programs. In: Proc. PLDI 1990, pp. 174–188. ACM, New York (1990)
Debray, S.K., López-García, P., Hermenegildo, M., Lin, N.-W.: Lower Bound Cost Estimation for Logic Programs. In: Proc. ILPS 1997, MIT Press, Cambridge (1997)
Eisinger, J., Polian, I., Becker, B., Metzner, A., Thesing, S., Wilhelm, R.: Automatic identification of timing anomalies for cycle-accurate worst-case execution time analysis. In: Proc. of DDECS, IEEE Computer Society Press, Los Alamitos (2006)
Grobauer, B.: Cost recurrences for DML programs. In: Int’l. Conf. on Functional Programming, pp. 253–264 (2001)
Hermenegildo, M., Puebla, G., Bueno, F., López García., P.: Integrated Program Debugging, Verification, and Optimization Using Abstract Interpretation (and The Ciao System Preprocessor). Science of Computer Programming 58(1-2), 115–140 (2005)
Igarashi, A., Kobayashi, N.: Resource usage analysis. In: Symposium on Principles of Programming Languages, pp. 331–342 (2002)
López-García, P., Bueno, F., Hermenegildo, M.: Determinacy Analysis for Logic Programs Using Mode and Type Information. In: Bruynooghe, M. (ed.) Logic Based Program Synthesis and Transformation. LNCS, vol. 3018, pp. 19–35. Springer, Heidelberg (2004)
McAllester, D.A.: On the complexity analysis of static analyses. In: Static Analysis Symp., pp. 312–329 (1999)
Le Metayer, D.: ACE: An Automatic Complexity Evaluator. ACM Transactions on Programming Languages and Systems 10(2), 248–266 (1988)
Nielson, F., Nielson, H.R., Seidl, H.: Automatic complexity analysis. In: European Symposium on Programming, pp. 243–261 (2002)
Puebla, G., Ochoa, C.: Poly-Controlled Partial Evaluation. In: Proc. of PPDP 2006, pp. 261–271. ACM Press, New York (2006)
Rosendhal, M.: Automatic Complexity Analysis. In: Proc. FPCA, ACM, New York (1989)
Thiele, L., Wilhelm, R.: Design for time-predictability. In: Perspectives Workshop: Design of Systems with Predictable Behaviour
Vasconcelos, P., Hammond, K.: Inferring Cost Equations for Recursive, Polymorphic and Higher-Order Functional Programs. In: Trinder, P., Michaelson, G.J., Peña, R. (eds.) IFL 2003. LNCS, vol. 3145, Springer, Heidelberg (2004)
Author information
Authors and Affiliations
Editor information
Rights and permissions
Copyright information
© 2007 Springer-Verlag Berlin Heidelberg
About this paper
Cite this paper
Navas, J., Mera, E., López-García, P., Hermenegildo, M.V. (2007). User-Definable Resource Bounds Analysis for Logic Programs. In: Dahl, V., Niemelä, I. (eds) Logic Programming. ICLP 2007. Lecture Notes in Computer Science, vol 4670. Springer, Berlin, Heidelberg. https://doi.org/10.1007/978-3-540-74610-2_24
Download citation
DOI: https://doi.org/10.1007/978-3-540-74610-2_24
Publisher Name: Springer, Berlin, Heidelberg
Print ISBN: 978-3-540-74608-9
Online ISBN: 978-3-540-74610-2
eBook Packages: Computer ScienceComputer Science (R0)