Results 1 -
7 of
7
Multivariate Amortized Resource Analysis
, 2010
"... We study the problem of automatically analyzing the worst-case resource usage of procedures with several arguments. Existing automatic analyses based on amortization, or sized types bound the resource usage or result size of such a procedure by a sum of unary functions of the sizes of the arguments. ..."
Abstract
-
Cited by 47 (8 self)
- Add to MetaCart
(Show Context)
We study the problem of automatically analyzing the worst-case resource usage of procedures with several arguments. Existing automatic analyses based on amortization, or sized types bound the resource usage or result size of such a procedure by a sum of unary functions of the sizes of the arguments. In this paper we generalize this to arbitrary multivariate polynomial functions thus allowing bounds of the form mn which had to be grossly overestimated by m 2 + n 2 before. Our framework even encompasses bounds like ∑ i,j≤n mimj where the mi are the sizes of the entries of a list of length n. This allows us for the first time to derive useful resource bounds for operations on matrices that are represented as lists of lists and to considerably improve bounds on other super-linear operations on lists such as longest common subsequence and removal of duplicates from lists of lists. Furthermore, resource bounds are now closed under composition which improves accuracy of the analysis of composed programs when some or all of the components exhibit super-linear resource or size behavior. The analysis is based on a novel multivariate amortized resource analysis. We present it in form of a type system for a simple firstorder functional language with lists and trees, prove soundness, and describe automatic type inference based on linear programming. We have experimentally validated the automatic analysis on a wide range of examples from functional programming with lists and trees. The obtained bounds were compared with actual resource consumption. All bounds were asymptotically tight, and the constants were close or even identical to the optimal ones.
Resource Aware ML
"... Abstract. The automatic determination of the quantitative resource consumption of programs is a classic research topic which has many applications in software development. Recently, we developed a novel multivariate amortized resource analysis that automatically computes polynomial resource bounds f ..."
Abstract
-
Cited by 3 (3 self)
- Add to MetaCart
Abstract. The automatic determination of the quantitative resource consumption of programs is a classic research topic which has many applications in software development. Recently, we developed a novel multivariate amortized resource analysis that automatically computes polynomial resource bounds for first-order functional programs. In this tool paper, we describe Resource Aware ML (RAML), a functional programming language that implements our analysis. Other than in earlier articles, we focus on the practical aspects of the implementation. We describe the syntax of RAML, the code transformation prior to the analysis, the web interface, the output of the analysis, and the results of our experiments with the analysis of examples programs. This is the first presentation of the prototype implementation at a conference.
Type-Based Amortized Resource Analysis with Integers and Arrays
"... Abstract Proving bounds on the resource consumption of a program by statically analyzing its source code is an important and well-studied problem. Automatic approaches for numeric programs with side effects usually apply abstract interpretation-based invariant generation to derive bounds on loops a ..."
Abstract
-
Cited by 2 (2 self)
- Add to MetaCart
(Show Context)
Abstract Proving bounds on the resource consumption of a program by statically analyzing its source code is an important and well-studied problem. Automatic approaches for numeric programs with side effects usually apply abstract interpretation-based invariant generation to derive bounds on loops and recursion depths of function calls. This paper presents an alternative approach to resource-bound analysis for numeric and heapmanipulating programs that uses type-based amortized resource analysis. As a first step towards the analysis of imperative code, the technique is developed for a first-order ML-like language with unsigned integers and arrays. The analysis automatically derives bounds that are multivariate polynomials in the numbers and the lengths of the arrays in the input. Experiments with example programs demonstrate two main advantages of amortized analysis over current abstract interpretationbased techniques. For one thing, amortized analysis can handle programs with non-linear intermediate values like f ((n + m) 2 ). For another thing, amortized analysis is compositional and works naturally for compound programs like f (g(x)).
Amortised resource analysis and typed polynomial interpretations
- In Proc. RTA-TLCA ’14, LNCS 8560
, 2014
"... ar ..."
(Show Context)
Automatic Static Cost Analysis for Parallel Programs
"... Abstract Static analysis of the evaluation cost of programs is an extensively studied problem that has many important applications. However, most automatic methods for static cost analysis are limited to sequential evaluation while programs are increasingly evaluated on modern multicore and multipr ..."
Abstract
- Add to MetaCart
(Show Context)
Abstract Static analysis of the evaluation cost of programs is an extensively studied problem that has many important applications. However, most automatic methods for static cost analysis are limited to sequential evaluation while programs are increasingly evaluated on modern multicore and multiprocessor hardware. This article introduces the first automatic analysis for deriving bounds on the worst-case evaluation cost of parallel first-order functional programs. The analysis is performed by a novel type system for amortized resource analysis. The main innovation is a technique that separates the reasoning about sizes of data structures and evaluation cost within the same framework. The cost semantics of parallel programs is based on call-by-value evaluation and the standard cost measures work and depth. A soundness proof of the type system establishes the correctness of the derived cost bounds with respect to the cost semantics. The derived bounds are multivariate resource polynomials which depend on the sizes of the arguments of a function. Type inference can be reduced to linear programming and is fully automatic. A prototype implementation of the analysis system has been developed to experimentally evaluate the effectiveness of the approach. The experiments show that the analysis infers bounds for realistic example programs such as quick sort for lists of lists, matrix multiplication, and an implementation of sets with lists. The derived bounds are often asymptotically tight and the constant factors are close to the optimal ones.
Analyzing Sorting Algorithms in Resource Aware ML
"... Software development sometimes requires to statically predict the quantity of resources—such as memory and time—that is needed to execute a program. The difficulties of manual resource analysis led to extensive research on automatic methods for quantitative resource analysis. Recently we developed ..."
Abstract
- Add to MetaCart
Software development sometimes requires to statically predict the quantity of resources—such as memory and time—that is needed to execute a program. The difficulties of manual resource analysis led to extensive research on automatic methods for quantitative resource analysis. Recently we developed an automatic amortized analysis to compute polynomial resource bounds for first-order functional programs at compile time. Its basis is a type system that augments types with resource annotations. The analysis system is integrated in the programming language Resource Aware ML. Our experiments with a prototype implementation show that the analysis efficiently computes precise time and heap-space bounds for many example programs. In this paper I demonstrate how a user can employ Resource Aware ML to analyze the worst-case time behavior of the sorting algorithms quick sort, insertion sort and merge sort. To illustrate pros and cons, I compare our automatic analysis to a manual analysis of the algorithms in a standard textbook. The paper is divided into three sections. Section 1 motivates the research on static resource analysis. Section 2 briefly introduces Resource Aware ML. Finally, Section 3 contains the actual case study on sorting algorithms.
Novel Sorting Algorithm R.Srinivas
"... Abstract--- Sorting has become a stand in need of prosaic life activities. Sorting in computer science alluded to as ordering deals with arranging elements of a list or a set of records of a file in ascending or descending order. We have gone through a number of sorting algorithms like bubble sort, ..."
Abstract
- Add to MetaCart
Abstract--- Sorting has become a stand in need of prosaic life activities. Sorting in computer science alluded to as ordering deals with arranging elements of a list or a set of records of a file in ascending or descending order. We have gone through a number of sorting algorithms like bubble sort, selection sort, insertion sort, shell sort, merge sort and bucket etc. Each algorithm has intrinsic odds and restrictions. We cannot say that a particular algorithm is the best algorithm, because algorithm may be easy to implement but it may take maximum time to execute, where as the other algorithm may be hard to implement but it may save execution time. The time complexity of sorting algorithms is, maximum in the range O(n) to O(n 2). Most of the algorithms have O(n 2) as worst case time complexity and for few algorithms have O(n) as the best case time complexity. Some algorithms have O(nlogn) as the time complexity in best and or average and or worst cases. We are proposing novel sorting algorithm which has time complexity O(n) in the best case and O(n 2)in the worst case.