The University of Arizona
banner image

  Lower Bound Cost Estimation for Logic Programs

Saumya Debray   Pedro López-García   Manuel Hermenegildo   Nai-Wei Lin
 

Abstract
It is generally recognized that information about the runtime cost of computations can be useful for a variety of applications, including program transformation, granularity control during parallel execution, and query optimization in deductive databases. Most of the work to date on compile-time cost estimation of logic programs has focused on the estimation of upper bounds on costs. However, in many applications, such as parallel implementations on distributed-memory machines, one would prefer to work with lower bounds instead. The problem with estimating lower bounds is that in general, it is necessary to account for the possibility of failure of head unification, leading to a trivial lower bound of 0. In this paper, we show how, given type and mode information about procedures in a logic program, it is possible to (semi-automatically) derive non-trivial lower bounds on their computational costs. We also discuss the cost analysis for the special and frequent case of divide-and-conquer programs and show how ---as a pragmatic short-term solution ---it may be possible to obtain useful results simply by identifying and treating divide-and-conquer programs specially. Finally, we present experimental results from a preliminary implementation of the proposed approach, applied to automatic parallel task size control.