Affiliation:
1. Technical University of Madrid (UPM), Spain
2. Complutense University of Madrid (UCM), Spain
Abstract
In heap-based languages, knowing that a variable x points to an acyclic data structure is useful for analyzing termination. This information guarantees that the depth of the data structure to which x points is greater than the depth of the structure pointed to by x.
fld
, and allows bounding the number of iterations of a loop that traverses the data structure on
fld
.
In general, proving termination needs acyclicity, unless program-specific or nonautomated reasoning is performed. However, recent work could prove that certain loops terminate even without inferring acyclicity, because they traverse data structures “acyclically.” Consider a double-linked list: if it is possible to demonstrate that every cycle involves both the “next” and the “prev” field, then a traversal on “next” terminates since no cycle will be traversed completely.
This article develops a static analysis inferring field-sensitive reachability and cyclicity information, which is more general than existing approaches. Propositional formulæ are computed, which describe which fields may or may not be traversed by paths in the heap. Consider a tree with edges “left” and “right” to the left and right subtrees, and “parent” to the parent node: termination of a loop traversing leaf-up cannot be guaranteed by state-of-the-art analyses. Instead, propositional formulæ computed by this analysis indicate that cycles must traverse “parent” and at least one between “left” and “right”: termination is guaranteed, as no cycle is traversed completely.
This work defines the necessary abstract domains and builds an abstract semantics on them. A prototypical implementation provides the expected result on relevant examples.
Funder
Spanish projects TIN2008-05624 and TIN2012-38137
European research project FP7-ICT-610582 ENVISAGE: Engineering Virtualized Services (Web site: http://www.envisage-project.eu)
Publisher
Association for Computing Machinery (ACM)
Subject
Computational Mathematics,Logic,General Computer Science,Theoretical Computer Science
Cited by
2 articles.
订阅此论文施引文献
订阅此论文施引文献,注册后可以免费订阅5篇论文的施引文献,订阅后可以查看论文全部施引文献
1. Field-sensitive sharing;Journal of Logical and Algebraic Methods in Programming;2018-02
2. Unified Reasoning About Robustness Properties of Symbolic-Heap Separation Logic;Programming Languages and Systems;2017