Rewriting Techniques for Analysing Termination and Complexity Bounds of �Afe Programs�

Total Page:16

File Type:pdf, Size:1020Kb

Rewriting Techniques for Analysing Termination and Complexity Bounds of �Afe Programs� Rewriting Techniques for Analysing Termination and Complexity Bounds of �afe Programs� Salvador Lucas Ricardo Pe˜na Sistemas Inform´aticos y Computaci´on Sistemas Inform´aticos y Computaci´on Universidad Polit´ecnica de Valencia Universidad Complutense de Madrid Camino de Vera s/n, 46022 Prof. ! "arc´ıaSantesmases s/n, 2$040 [email protected] ricardo%sip.ucm.es Abstract. �afe is a &rst-order ea(er functional lan(ua(e )it* facilities for pro(rammer-controlled destruction and copyin( of data structures and is intended for compile-time analysis of memory consumption In �afe, *eap and stac+ memory consumption depends on t*e len(t* of recursive calls c*ains ,nsurin( termination of �afe pro(rams -or of par- ticular function calls) is t*erefore essential to implement t*ese features. /urt*ermore, 0ein( a0le to (ive 0ounds to the c*ain len(t* required 0y suc* terminatin( calls 0ecomes essential in computin( space 0ounds In t*is paper, )e investi(ate *o) to analyze termination of �afe pro' (rams 0y usin( standard term rewritin( tec*niques, i.e., 0y transform- in( �afe pro(rams into term rewritin( systems )*ose termination can 0e automatically analysed 0y means of existin( tools /urt*ermore, )e investi(ate *o) to use proofs of termination )*ic* com0ine the depen' dency pairs approac* )ith polynomial interpretations to o0tain suita0le 0ounds to t*e len(t* of c*ains of recursive calls in �afe pro(rams Keywords: 4ermination, 4erm 5ewritin( Systems, Space complexity 1 Introduction �afe [21, 18] is a first-order eager functional language with facilities for program- mer controlled destruction and cop!ing of data structures, intended for compile time anal!sis of emor! consumption. In �afe, the allocation and deallocation of compiler-defined memor! regions for data structures are associated with func- tion application. So, heap me or! consumption depends $oth on the num$er of recursive calls and on the length of calls chains" In order to compute space $ounds for the heap it is essential to compute $ounds to these figures and, in turn, to previousl! ensure termination of such functions. In this paper we investigate how to use rewriting techniques for proving ter- mination of �afe programs and, at the same time, giving appropriate $ounds to the num$er of recursive calls as a first step to compute space $ounds. In par- ticular, we introduce a transformation for proving termination of �afe programs $! translating the into &erm Rewriting Systems 'TRS(" � Salvador Lucas )as partially supported 0y the ,U -/,7,5. and t*e Spanish M,C (rant TI8 2009-6$0:;'C02'02 5icardo Pe<na )as partially supported 0y t*e Madrid 5egion Government under (rant S'050=/4IC/0409 (P5>M,S?S. )* Both termination and complexit! $ounds of programs have $een investigated in the abstract framewor- of &er Rewriting S!stems [3, 20]" / suitable wa! to prove termination of programs written in declarative programming languages li-e Has-ell or 1aude is translating them into 'variants of( ter rewriting systems and then using techniques and tools for proving termination of rewriting. See [9, 10] for recent proposals of concrete procedures and tools which appl! to the aforementioned programming languages" Polynomial interpretations have $een extensivel! investigated as suitable tools to address different issues in ter rewriting [3]" 4or instance, the limits of polynomial interpretations regarding their abilit! to prove termination of rewrite systems were first investigated in [12] $! considering the derivational complexity of pol!nomiall! terminating &RSs, i.e", the upper $ound of the lengths of arbi- trary '$ut finite( derivations issued from a given ter 'of sizen( in a terminating TRS" Hofbauer has shown that the derivational complexit! of a terminating &RS can $e $etter appro,i ated if pol!nomial interpretations over the reals 'instead of the more traditional polynomial interpretations over the naturals) are used to prove termination of the &RS [11]" Complexit! analysis of first order functional programs 'or TRSs( has also $een successfull! addressed $! using polynomial interpretations [4–6]" The ai of these papers is to classif! TRSs in different 'time or space( complexit! classes according to the 'least( -ind of pol!nomial interpretation which is 'wea-l!( com- patible with the TRS" Recent approaches [5] com$ine the use of path orderings [8] to ensure $oth termination together with suitable pol!nomial interpreta- tions for giving $ounds to the length of the rewrite se%uences 'which are -nown finite due to the ter ination proof(" Polynomials which are used in this set- ting are weakly monotone, i.e", ifx≥y thenP'. , x, . .(≥P'...,y,...(" This is in contrast with the use of pol!nomials in proofs of polynomial ter- mination [15], where monotony is re%uired 'i.e., wheneverx>y, we have P'...,x,...(>P'...,y,...((" However, when usin g polynomials in proofs of termination using the dependenc! pair approach [1], monoton! is not longer necessar! and we can use weakl! monotone pol!nomials again [7, 17]" The real advantage is that, we can now avoid the use of path orderings to ensure termi- nation; with the same pol!nomial interpretation we can $oth prove termination and, as we show in this paper, obtain suitable complexit! $ounds" 4urthermore, since the limits of using path orderings to prove termination of rewrite s!stems are well-known, and they obviously restrict the variet! of programs they can deal with, we are able to improve on the current techni%ues. 2 Preliminaries / $inar! relationR on a setA is terminating 'or well-founded( if th ere is no infinite se%uencea 1 R a2 R a3 ···" Throughout the paper,X denotes a count- able set of variables andF denotes a signature, i. e., a set of function s! $ols {f, g, . .}, each having a fixed arit! given $! a mapping ar;F→N" The set of terms built fromF andX isT'F,X (" Positions p, q, . are represented $! chains of positive natural nu $ers used to address su$terms oft" Positions are ordered $! the standard prefi, ordering≤" The set of positions o f a ter t is )) Pos't(" The subter at posi tionp oft is denoted ast| p andt[s] p is the term t with the subterm at positionp replaced $!s" / context is a termC[ ] with a <hole= 'formall!, a fresh constant s! $ol(" / rewrite rule is an ordered pair 'l,r(, writtenl→r, with l,r∈T'F,X(,l �∈ X and Var'r(⊆ Var'l(" / TRS is a pairR>'F,R( whereR is a set of rewrite rule s" ?iven a TRSR, a ter t∈T'F,X ( rewrites tos 'at positionp∈Pos't((, writtent→ R s, if there is a positionp∈Pos't(, a su$stitutionσ, and a rulel→r inR such thatt| p >σ'l( ands>t[σ'r)] p" The ter t| p is called a redex oft" / ter t∈T'F,X( inner- i most rewrites tos, writtent →R s ift→ R s at positionp andt| p contains no i redex" / TRSR is 'innermost( termina ting if→ R 'resp. →R( is terminating. / conditional, oriented TRS '6TRS(, has rules of the for l→r⇐C, whereC>s 1 →t 1, . , sk →t k is called an oriented condition" ?iven a CTRS R, we letR u $e the set of rulesR u >{l→r|l→r⇐C ∈R}" / CTRS which satisfies Var'r(⊆ Var'l(∪ Var'C( for every conditional rule is called a 3-CTRS" #t is deterministic if the variables of the right-hand sidet i of ever! conditions i →t i ofC are introduced $efore they are used in the left-hand side sj of a subsequent conditions j →t j" / deterministic 3-CTRSR is s!ntactically deter inistic if, for ever! rulel→r⇐s 1 →t 1, . , sk →t k inR every termt i is a constructor term or a ground normal form with respect toR u" 3 The �afe language �afe was introduced as a research platfor to investigate analyses related to sharing of data structures and to memor! consumption. Currently it is equipped with a type syste guaranteeing that, in spite of the emor! destruction facili- ties of the language, all well-typed programs will $e free of dangling pointers at runtime" 1ore information can $e found at [21, 18] and [19]" There are two versions of �afe; full-Safe, in which programmers are supposed to write their programs, and Core-Safe 'the compiler transformed version of full-Safe(, in which all program analyses are defined. 4ull-�afe syntax is close to Has-ell=s. The ain differences are that �afe is eager and first-order. �afe admits two basic t!pes 'booleans and integers(, alge- $raic datat!pes (introduced $! the usual data declarations(, and the function definitions $! eans of conditional equations with the usual facilitites for pat- tern matching, use of let and case expressions, and where clauses" No recursion is possible inside let e,pressions and where clauses and no local function def- inition can $e given" /dditionall!, the progra er can specify a destructive pattern atching operation $! using s! $ol A after the pattern" The intended meaning is the destruction of the cell associated with the constructor sy $ol, thus allowing its reuse later" / �afe program consists of a sequence of 'possibl! recursive) function definitions together with a main expression. The erge-sort program of 4igure 1 uses a constant heap space to implement the sorting of the list" This is a consequence of the destructive constant-space versions splitD and mergeD of the funtions which respectivel! split a list into two pieces and erge two sorted lists. The t!pes shown in the program are inferred $! the compiler" / sy $ol A in a t!pe signature indicates that the corresponding )9 splitD@@∀a, ρ.Int→AaBC%ρ→ρ→-AaB%ρ,AaB%ρ.%ρ splitD0 xsC D-AB,xsC.
Recommended publications
  • Formal Verification of Termination Criteria for First-Order Recursive Functions
    Formal Verification of Termination Criteria for First-Order Recursive Functions Cesar A. Muñoz £ Mauricio Ayala-Rincón £ NASA Langley Research Center, Hampton, VA, Departments of Computer Science and Mathem- USA atics, Universidade de Brasília, Brazil Mariano M. Moscato £ Aaron M. Dutle £ National Institute of Aerospace, Hampton, VA, NASA Langley Research Center, Hampton, VA, USA USA Anthony J. Narkawicz Ariane Alves Almeida £ USA Department of Computer Science, Universidade de Brasília, Brazil Andréia B. Avelar da Silva Thiago M. Ferreira Ramos £ Faculdade de Planaltina, Universidade de Brasília, Department of Computer Science, Universidade Brazil de Brasília, Brazil Abstract This paper presents a formalization of several termination criteria for first-order recursive functions. The formalization, which is developed in the Prototype Verification System (PVS), includes the specification and proof of equivalence of semantic termination, Turing termination, sizechange principle, calling context graphs, and matrix-weighted graphs. These termination criteria are defined on a computational model that consists of a basic functional language called PVS0, which is an embedding of recursive first-order functions. Through this embedding, the native mechanism for checking termination of recursive functions in PVS could be soundly extended with semi-automatic termination criteria such as calling contexts graphs. 2012 ACM Subject Classification Theory of computation → Models of computation; Software and its engineering → Software verification; Computing methodologies → Theorem proving algorithms Keywords and phrases Formal Verification, Termination, Calling Context Graph, PVS Digital Object Identifier 10.4230/LIPIcs.ITP.2021.26 Supplementary Material Other (NASA PVS Library): https://github.com/nasa/pvslib Funding Mariano M. Moscato: corresponding author; research supported by the National Aeronaut- ics and Space Administration under NASA/NIA Cooperative Agreement NNL09AA00A.
    [Show full text]
  • Synthesising Interprocedural Bit-Precise Termination Proofs
    Synthesising Interprocedural Bit-Precise Termination Proofs Hong-Yi Chen, Cristina David, Daniel Kroening, Peter Schrammel and Bjorn¨ Wachter Department of Computer Science, University of Oxford, fi[email protected] Abstract—Proving program termination is key to guaranteeing does terminate with mathematical integers, but does not ter- absence of undesirable behaviour, such as hanging programs and minate with machine integers if n equals the largest unsigned even security vulnerabilities such as denial-of-service attacks. To integer. On the other hand, the following code: make termination checks scale to large systems, interprocedural termination analysis seems essential, which is a largely unex- void foo2 ( unsigned x ) f while ( x>=10) x ++; g plored area of research in termination analysis, where most effort has focussed on difficult single-procedure problems. We present does not terminate with mathematical integers, but terminates a modular termination analysis for C programs using template- with machine integers because unsigned machine integers based interprocedural summarisation. Our analysis combines a wrap around. context-sensitive, over-approximating forward analysis with the A second challenge is to make termination analysis scale to inference of under-approximating preconditions for termination. Bit-precise termination arguments are synthesised over lexico- larger programs. The yearly Software Verification Competition graphic linear ranking function templates. Our experimental (SV-COMP) [6] includes a division in termination analysis, results show that our tool 2LS outperforms state-of-the-art alter- which reflects a representative picture of the state-of-the-art. natives, and demonstrate the clear advantage of interprocedural The SV-COMP’15 termination benchmarks contain challeng- reasoning over monolithic analysis in terms of efficiency, while ing termination problems on smaller programs with at most retaining comparable precision.
    [Show full text]
  • Practical Reflection and Metaprogramming for Dependent
    Practical Reflection and Metaprogramming for Dependent Types David Raymond Christiansen Advisor: Peter Sestoft Submitted: November 2, 2015 i Abstract Embedded domain-specific languages are special-purpose pro- gramming languages that are implemented within existing general- purpose programming languages. Dependent type systems allow strong invariants to be encoded in representations of domain-specific languages, but it can also make it difficult to program in these em- bedded languages. Interpreters and compilers must always take these invariants into account at each stage, and authors of embedded languages must work hard to relieve users of the burden of proving these properties. Idris is a dependently typed functional programming language whose semantics are given by elaboration to a core dependent type theory through a tactic language. This dissertation introduces elabo- rator reflection, in which the core operators of the elaborator are real- ized as a type of computations that are executed during the elab- oration process of Idris itself, along with a rich API for reflection. Elaborator reflection allows domain-specific languages to be imple- mented using the same elaboration technology as Idris itself, and it gives them additional means of interacting with native Idris code. It also allows Idris to be used as its own metalanguage, making it into a programmable programming language and allowing code re-use across all three stages: elaboration, type checking, and execution. Beyond elaborator reflection, other forms of compile-time reflec- tion have proven useful for embedded languages. This dissertation also describes error reflection, in which Idris code can rewrite DSL er- ror messages before presenting domain-specific messages to users, as well as a means for integrating quasiquotation into a tactic-based elaborator so that high-level syntax can be used for low-level reflected terms.
    [Show full text]
  • Unfailing Haskell
    The University of York Department of Computer Science Programming Languages and Systems Group Unfailing Haskell Qualifying Dissertation 30th June 2005 Neil Mitchell 2 Abstract Programs written in Haskell may fail at runtime with either a pattern match error, or with non-termination. Both of these can be thought of as giving the value ⊥ as a result. Other forms of failure, for example heap exhaustion, are not considered. The first section of this document reviews previous work, including total functional programming and sized types. Attention is paid to termination checkers for both Prolog and various functional languages. The main result from work so far is a static checker for pattern match errors that allows non-exhaustive patterns to exist, yet ensures that a pattern match error does not occur. It includes a constraint language that can be used to reason about pattern matches, along with mechanisms to propagate these constraints between program components. The proposal deals with future work to be done. It gives an approximate timetable for the design and implementation of a static checker for termination and pattern match errors. 1 Contents 1 Introduction 4 1.1 Total Programming . 4 1.2 Benefits of Totality . 4 1.3 Drawbacks of Totality . 5 1.4 A Totality Checker . 5 2 Field Survey and Review 6 2.1 Background . 6 2.1.1 Bottom ⊥ ........................................... 6 2.1.2 Normal Form . 7 2.1.3 Laziness . 7 2.1.4 Higher Order . 8 2.1.5 Peano Numbers . 8 2.2 Static Analysis . 8 2.2.1 Data Flow Analysis . 9 2.2.2 Constraint Based Analysis .
    [Show full text]
  • Termination Analysis with Compositional Transition Invariants*
    Termination Analysis with Compositional Transition Invariants? Daniel Kroening1, Natasha Sharygina2;4, Aliaksei Tsitovich2, and Christoph M. Wintersteiger3 1 Oxford University, Computing Laboratory, UK 2 Formal Verification and Security Group, University of Lugano, Switzerland 3 Computer Systems Institute, ETH Zurich, Switzerland 4 School of Computer Science, Carnegie Mellon University, USA Abstract. Modern termination provers rely on a safety checker to con- struct disjunctively well-founded transition invariants. This safety check is known to be the bottleneck of the procedure. We present an alter- native algorithm that uses a light-weight check based on transitivity of ranking relations to prove program termination. We provide an exper- imental evaluation over a set of 87 Windows drivers, and demonstrate that our algorithm is often able to conclude termination by examining only a small fraction of the program. As a consequence, our algorithm is able to outperform known approaches by multiple orders of magnitude. 1 Introduction Automated termination analysis of systems code has advanced to a level that permits industrial application of termination provers. One possible way to obtain a formal argument for termination of a program is to rank all states of the pro- gram with natural numbers such that for any pair of consecutive states si; si+1 the rank is decreasing, i.e., rank(si+1) < rank(si). In other words, a program is terminating if there exists a ranking function for every program execution. Substantial progress towards the applicability of procedures that compute ranking arguments to industrial code was achieved by an algorithm called Binary Reachability Analysis (BRA), proposed by Cook, Podelski, and Rybalchenko [1].
    [Show full text]
  • A Flexible Approach to Termination with General Recursion
    Termination Casts: A Flexible Approach to Termination with General Recursion Aaron Stump Vilhelm Sj¨oberg Stephanie Weirich Computer Science Computer and Information Science Computer and Information Science The University of Iowa University of Pennsylvania University of Pennsylvania [email protected] [email protected] [email protected] This paper proposes a type-and-effect system called Teq↓, which distinguishes terminating terms and total functions from possibly diverging terms and partial functions, for a lambda calculus with general recursion and equality types. The central idea is to include a primitive type-form “Terminates t”, expressing that term t is terminating; and then allow terms t to be coerced from possibly diverging to total, using a proof of Terminates t. We call such coercions termination casts, and show how to implement terminating recursion using them. For the meta-theory of the system, we describe a translation from Teq↓ to a logical theory of termination for general recursive, simply typed functions. Every typing judgment of Teq↓ is translated to a theorem expressing the appropriate termination property of the computational part of the Teq↓ term. 1 Introduction Soundly combining general recursion and dependent types is a significant current challenge in the design of dependently typed programming languages. The two main difficulties raised by this combination are (1) type-equivalence checking with dependent types usually depends on term reduction, which may fail to terminate in the presence of general recursion; and (2) under the Curry-Howard isomorphism, non- terminating recursions are interpreted as unsound inductive proofs, and hence we lose soundness of the type system as a logic.
    [Show full text]
  • Proving Conditional Termination
    Proving Conditional Termination Byron Cook1, Sumit Gulwani1, Tal Lev-Ami2,?, Andrey Rybalchenko3,??, and Mooly Sagiv2 1 Microsoft Research 2 Tel Aviv University 3 MPI-SWS Abstract. We describe a method for synthesizing reasonable underap- proximations to weakest preconditions for termination—a long-standing open problem. The paper provides experimental evidence to demonstrate the usefulness of the new procedure. 1 Introduction Termination analysis is critical to the process of ensuring the stability and us- ability of software systems, as liveness properties such “Will Decode() always return back to its call sites?” or “Is every call to Acquire() eventually followed by a call to Release()?” can be reduced to a question of program termina- tion [8,22]. Automatic methods for proving such properties are now well studied in the literature, e.g. [1,4,6,9,16]. But what about the cases in which code only terminates for some inputs? What are the preconditions under which the code is still safe to call, and how can we automatically synthesize these conditions? We refer to these questions as the conditional termination problem. This paper describes a method for proving conditional termination. Our method is based on the discovery of potential ranking functions—functions over program states that are bounded but not necessarily decreasing—and then finding preconditions that promote the potential ranking functions into valid ranking functions. We describe two procedures based on this idea: PreSynth, which finds preconditions to termination, and PreSynthPhase, which extends PreSynth with the ability to identify the phases necessary to prove the termi- nation of phase-transition programs [3].
    [Show full text]
  • Automated Termination Proofs for Haskell by Term Rewriting
    Automated Termination Proofs for Haskell by Term Rewriting J¨urgen Giesl, RWTH Aachen University, Germany Matthias Raffelsieper, TU Eindhoven, The Netherlands Peter Schneider-Kamp, University of Southern Denmark, Odense, Denmark Stephan Swiderski, RWTH Aachen University, Germany Ren´eThiemann, University of Innsbruck, Austria There are many powerful techniques for automated termination analysis of term rewriting. How- ever, up to now they have hardly been used for real programming languages. We present a new approach which permits the application of existing techniques from term rewriting to prove ter- mination of most functions defined in Haskell programs. In particular, we show how termination techniques for ordinary rewriting can be used to handle those features of Haskell which are miss- ing in term rewriting (e.g., lazy evaluation, polymorphic types, and higher-order functions). We implemented our results in the termination prover AProVE and successfully evaluated them on existing Haskell-libraries. Categories and Subject Descriptors: F.3.1 [Logic and Meanings of Programs]: Specifying and Verifying and Reasoning about Programs—Mechanical verification; D.1.1 [Programming Techniques]: Applicative (Functional) Programming; I.2.2 [Artificial Intelligence]: Automatic Programming—Automatic analysis of algorithms; I.2.3 [Artificial Intelligence]: Deduction and Theorem Proving General Terms: Languages, Theory, Verification Additional Key Words and Phrases: functional programming, Haskell, termination analysis, term rewriting, dependency pairs Supported by the Deutsche Forschungsgsmeinschaft DFG under grant GI 274/5-2 and the DFG Research Training Group 1298 (AlgoSyn). Authors’ addresses: J¨urgen Giesl, Stephan Swiderski, LuFG Informatik 2, RWTH Aachen University, Ahornstr. 55, 52074 Aachen, Germany, {giesl,swiderski}@informatik.rwth-aachen.de Matthias Raffelsieper, Dept.
    [Show full text]
  • A Predicative Analysis of Structural Recursion
    Under consideration for publication in J. Functional Programming 1 A Predicative Analysis of Structural Recursion ANDREAS ABEL ∗ Department of Computer Science, University of Munich, 80538 Munich, Germany (e-mail: [email protected]) THORSTEN ALTENKIRCH School of Computer Science & Information Technology, University of Nottingham, Nottingham, NG8 1BB, UK (e-mail: [email protected]) Abstract We introduce a language based upon lambda calculus with products, coproducts and strictly positive inductive types that allows the definition of recursive terms. We present the implementation (foetus) of a syntactical check that ensures that all such terms are structurally recursive, i.e., recursive calls appear only with arguments structurally smaller than the input parameters of terms considered. To ensure the correctness of the termina- tion checker, we show that all structurally recursive terms are normalizing with respect to a given operational semantics. To this end, we define a semantics on all types and a structural ordering on the values in this semantics and prove that all values are accessible with regard to this ordering. Finally, we point out how to do this proof predicatively using set based operators. 1 Introduction In lambda calculi with inductive types the standard means to construct a function over an inductive type is the recursor, which corresponds to induction. This method, however, has several drawbacks, as discussed in (Coquand, 1992). One of them is that programs are hard to understand intuitively. E.g., the \division by 2"-function may be coded with recursors over natural numbers RN and booleans RB as follows: RN : σ (N σ σ) N σ ! ! ! ! ! RB : σ σ B σ !N !N !B N B N B half = λn :R (λx : 0) (λx λf ! :R (f true) (1 + (f false))) n false Alternatively, in the presence of products, it can be implemented involving an aux- iliary function returning a pair.
    [Show full text]
  • Distilling Programs to Prove Termination
    Distilling Programs to Prove Termination G.W. Hamilton School of Computing Dublin City University Ireland [email protected] The problem of determining whether or not any program terminates was shown to be undecidable by Turing, but recent advances in the area have allowed this information to be determined for a large class of programs. The classic method for deciding whether a program terminates dates back to Turing himself and involves finding a ranking function that maps a program state to a well-order, and then proving that the result of this function decreases for every possible program transition. More recent approaches to proving termination have involved moving away from the search for a single ranking function and toward a search for a set of ranking functions; this set is a choice of ranking functions and a disjunctive termination argument is used. In this paper, we describe a new technique for determining whether programs terminate. Our technique is applied to the output of the distillation program transformation that converts programs into a simplified form called distilled form. Programs in distilled form are converted into a corresponding labelled transition system and termination can be demonstrated by showing that all possible infinite traces through this labelled transition system would result in an infinite descent of well-founded data values. We demonstrate our technique on a number of examples, and compare it to previous work. 1 Introduction The program termination problem, or halting problem, can be defined as follows: using only a finite amount of time, determine whether a given program will always finish running or could execute for- ever.
    [Show full text]
  • Termination Analysis with Recursive Calling Graphs
    Journal of Network and Computer Applications 59 (2016) 109–116 Contents lists available at ScienceDirect Journal of Network and Computer Applications journal homepage: www.elsevier.com/locate/jnca Termination analysis with recursive calling graphs Teng Long a,b,n, Wenhui Zhang b a School of Information Engineering, China University of Geosciences (Beijing), 29#, Xueyuan Road, Haidian District, Beijing, PR China b State Key Laboratory of Computer Science, Institute of Software, Chinese Academy of Sciences, 4#, South Fourth Street of Zhongguancun, Haidian District, Beijing, PR China article info abstract Available online 16 July 2015 As one of the significant aspects for green software systems, termination analysis is related to the fi Keywords: optimization of the resource utilization. The approach for size-change termination principle was rst Termination analysis proposed by Lee, Jones and Ben-Amram in 2001, which is an effective method for automatic termination Green software programs analysis. According to its abstracted constructs (size-change graphs), the principle ignores the condition and Size-change termination principle return values for function call. In this paper, we devise a new construct including the ignoring features to extend the set of programs that are size-change terminating in real life. The main contribution of our paper is twofold: firstly, it supports the analysis of functions in which the returned values are relevant to termination. Secondly, it gains more accuracy for oscillating value change in termination analysis. & 2015 Elsevier Ltd. All rights reserved. 1. Introduction analysis is unrelated to the order of the variables which is decided in SCT. Therefore, it is one of the approaches which are success- With the development of information and communication fully applied in a large class of programs for termination analysis.
    [Show full text]
  • Program Termination and Worst Time Complexity with Multi-Dimensional Affine Ranking Functions
    Program Termination and Worst Time Complexity with Multi-Dimensional Affine Ranking Functions Christophe Alias, Alain Darte, Paul Feautrier, Laure Gonnord, Cl´ement Quinson To cite this version: Christophe Alias, Alain Darte, Paul Feautrier, Laure Gonnord, Cl´ement Quinson. Program Termination and Worst Time Complexity with Multi-Dimensional Affine Ranking Functions. [Research Report] 2009, pp.31. <inria-00434037> HAL Id: inria-00434037 https://hal.inria.fr/inria-00434037 Submitted on 20 Nov 2009 HAL is a multi-disciplinary open access L'archive ouverte pluridisciplinaire HAL, est archive for the deposit and dissemination of sci- destin´eeau d´ep^otet `ala diffusion de documents entific research documents, whether they are pub- scientifiques de niveau recherche, publi´esou non, lished or not. The documents may come from ´emanant des ´etablissements d'enseignement et de teaching and research institutions in France or recherche fran¸caisou ´etrangers,des laboratoires abroad, or from public or private research centers. publics ou priv´es. INSTITUT NATIONAL DE RECHERCHE EN INFORMATIQUE ET EN AUTOMATIQUE Program Termination and Worst Time Complexity with Multi-Dimensional Affine Ranking Functions Christophe Alias — Alain Darte — Paul Feautrier — Laure Gonnord — Clément Quinson N° 7037 Novembre 2009 apport de recherche ISSN 0249-6399 ISRN INRIA/RR--7037--FR+ENG Program Termination and Worst Time Complexity with Multi-Dimensional Affine Ranking Functions Christophe Alias∗, Alain Darte †, Paul Feautrier ‡, Laure Gonnord §, Clément Quinson ¶ Thème : Architecture et compilation Équipe-Projet Compsys Rapport de recherche n° 7037 — Novembre 2009 — 31 pages Abstract: A standard method for proving the termination of a flowchart program is to exhibit a ranking function, i.e., a function from the program states to a well-founded set, which strictly decreases at each program step.
    [Show full text]