Annotated Stack Trees
نویسندگان
چکیده
Annotated pushdown automata provide an automaton model of higher-order recursion schemes, which may in turn be used to model higher-order programs for the purposes of verification. We study Ground Annotated Stack Tree Rewrite Systems – a tree rewrite system where each node is labelled by the configuration of an annotated pushdown automaton. This allows the modelling of fork and join constructs in higher-order programs and is a generalisation of higher-order stack trees recently introduced by Penelle. We show that, given a regular set of annotated stack trees, the set of trees that can reach this set is also regular, and constructible in n-EXPTIME for an order-n system, which is optimal. We also show that our construction can be extended to allow a global state through which unrelated nodes of the tree may communicate, provided the number of communications is subject to a fixed bound. Modern day programming increasingly embraces higher-order programming, both via the inclusion of higher-order constructs in languages such as C++, JavaScript and Python, but also via the importance of callbacks in highly popular technologies such as jQuery and Node.js. For example, to read a file in Node.js, one would write fs.readFile('f.txt', function (err, data) { ..use data.. }); In this code, the call to readFile spawns a new thread that asynchronously reads f.txt and sends the data to the function argument. This function will have access to, and frequently use, the closure information of the scope in which it appears. The rest of the program runs in parallel with this call. This style of programming is fundamental to both jQuery and Node.js programming, as well as being a popular for programs handling input events or slow IO operations such as fetching remote data or querying databases (e.g. HTML5’s indexedDB). Analysing such programs is a challenge for verification tools which usually do not model higher-order recursion, or closures, accurately. However, several higher-order model-checking tools have been recently developed. This trend was pioneered by Kobayashi et al. [14] who developed an intersection type technique for analysing higher-order recursion schemes – a model of higher-order computation. This was implemented in the TRecS tool [13] which demonstrated the feasibility of higher-order model-checking in practice, despite the high theoretical complexities ((n − 1)-EXPTIME for an order-n recursion scheme). This success has led to the development of several new tools for analysing recursion schemes: GTRecS [15, 17], TravMC [21], C-SHORe [5], HorSat [6], and Preface [25]. In particular, the C-SHORe tool is based on an automata model of recursion schemes called annotated (or collapsible) pushdown systems [11]. This is a generalisation of pushdown systems – which accurately model first-order recursion – to the higher-order case. C-SHORe implements a saturation algorithm to perform a backwards reachability analysis, which first appeared in ICALP 2012 [4]. Saturation was popularised by Bouajjani et al. [1] for the analysis of pushdown systems, which was implemented in the successful Moped tool [28, 30]. ∗This work was supported by the Engineering and Physical Sciences Research Council [EP/K009907/1].
منابع مشابه
ar X iv : 1 50 2 . 05 87 3 v 2 [ cs . F L ] 2 5 Fe b 20 15 Annotated Stack Trees ∗
Annotated pushdown automata provide an automaton model of higher-order recursion schemes, which may in turn be used to model higher-order programs for the purposes of verification. We study Ground Annotated Stack Tree Rewrite Systems – a tree rewrite system where each node is labelled by the configuration of an annotated pushdown automaton. This allows the modelling of fork and join constructs ...
متن کاملStack Sorting, Trees, and Pattern Avoidance
The subject of pattern avoiding permutations has its roots in computer science, namely in the problem of sorting a permutation through a stack. A formula for the number of permutations of length n that can be sorted by passing it twice through a stack (where the letters on the stack have to be in increasing order) was conjectured by West, and later proved by Zeilberger. Goulden and West found a...
متن کاملDecompositions and Statistics for Β(1, 0)-trees and Nonseparable Permutations
The subject of pattern avoiding permutations has its roots in computer science, namely in the problem of sorting a permutation through a stack. A formula for the number of permutations of length n that can be sorted by passing it twice through a stack (where the letters on the stack have to be in increasing order) was conjectured by West, and later proved by Zeilberger. Goulden and West found a...
متن کاملA New Encoding for Labeled Trees Employing a Stack and a Queue
A novel algorithm for encoding finite labeled trees is proposed in this paper. The algorithm establishes a one-to-one mapping between trees of order n and (n – 2)-tuples of the node labels. This encoding is similar to those proposed by Prüfer [8] and Neville [6], except that our encoding scheme has additional properties (not present in earlier codes), which allows us to efficiently determine th...
متن کاملA Gold Standard for Emotion Annotation in Stack Overflow
Software developers experience and share a wide range of emotions throughout a rich ecosystem of communication channels. A recent trend that has emerged in empirical software engineering studies is leveraging sentiment analysis of developers’ communication traces. We release a dataset of 4,800 questions, answers, and comments from Stack Overflow, manually annotated for emotions. Our dataset con...
متن کاملذخیره در منابع من
با ذخیره ی این منبع در منابع من، دسترسی به آن را برای استفاده های بعدی آسان تر کنید
عنوان ژورنال:
- CoRR
دوره abs/1502.05873 شماره
صفحات -
تاریخ انتشار 2015