Abstract.We perform static analysis of Java programs to answer a simple question: which values may occur as results of string expressions? The answers are summarized for each expression by a regular language that is guaranteed to contain all possible values. We present several applications of this analysis, including statically checking the syntax of dynamically generated expressions, such as SQL queries. Our analysis constructs flow graphs from class files and generates a context-free grammar with a nonterminal for each string expression. The language of this grammar is then widened into a regular language through a variant of an algorithm previously used for speech recognition. The collection of resulting regular languages is compactly represented as a special kind of multi-level automaton from which individual answers may be extracted. If a program error is detected, examples of invalid strings are automatically produced. We present extensive benchmarks demonstrating that the analysis is efficient and produces results of useful precision.
We perform static analysis of Java programs to answer a simple question: which values may occur as results of string expressions? The answers are summarized for each expression by a regular language that is guaranteed to contain all possible values. We present several applications of this analysis, including statically checking the syntax of dynamically generated expressions, such as SQL queries. Our analysis constructs flow graphs from class files and generates a context-free grammar with a nonterminal for each string expression. The language of this grammar is then widened into a regular language through a variant of an algorithm previously used for speech recognition. The collection of resulting regular languages is compactly represented as a special kind of multi-level automaton from which individual answers may be extracted. If a program error is detected, examples of invalid strings are automatically produced. We present extensive benchmarks demonstrating that the analysis is efficient and produces results of useful precision. public void printAddresses(int id) throws SQLException { Connection con = DriverManager.getConnection("students.db"); String q = "SELECT * FROM address";
We incorporate innovations from the
AspectJ, an aspect-oriented extension of Java, is becoming increasingly popular. However, not much work has been directed at optimising compilers for AspectJ. Optimising AOP languages provides many new and interesting challenges for compiler writers, and this paper identifies and addresses three such challenges.First, compiling around advice efficiently is particularly challenging. We provide a new code generation strategy for around advice, which (unlike previous implementations) both avoids the use of excessive inlining and the use of closures. We show it leads to more compact code, and can also improve run-time performance. Second, woven code sometimes includes run-time tests to determine whether advice should execute. One important case is the cflow pointcut which uses information about the dynamic calling context. Previous techniques for cflow were very costly in terms of both time and space. We present new techniques to minimise or eliminate the overhead of cflow using both intra- and inter-procedural analyses. Third, we have addressed the general problem of how to structure an optimising compiler so that traditional analyses can be easily adapted to the AOP setting.We have implemented all of the techniques in this paper in abc , our AspectBench Compiler for AspectJ, and we demonstrate significant speedups with empirical results. Some of our techniques have already been integrated into the production AspectJ compiler, ajc 1.2.1.
Andersen, B. S., Ulrich, C., Eigaard, O. R., and Christensen, A-S. 2012. Short-term choice behaviour in a mixed fishery: investigating métier selection in the Danish gillnet fishery. – ICES Journal of Marine Science, 69: 131–143. The study presents a short-term effort allocation modelling approach based on a discrete choice random utility model combined with a survey questionnaire to examine the selection of métiers (a combination of fishing area and target species) in the Danish North Sea gillnet fishery. Key decision variables were identified from the survey questionnaire, and relevant proxies for the decision function were identified based on available landings and effort information. Additional variables from the survey questionnaire were further used to validate and verify the outcome of the choice model. Commercial fishers in a mixed fishery make use of a number of decision variables used previously in the literature, but also a number of decision parameters rarely explicitly accounted for, such as price, weather, and management regulation. The seasonal availability of individual target species and within-year changes in monthly catch ration were the main explanatory drivers, but gillnetters were also responsive to information on the whole fishery, fish prices, and distance travelled to fishing grounds. Heterogeneous responses were evident from geographic differences in home harbour, which underpins the need to understand alternative fishing strategies among individual gillnetters better.
scite is a Brooklyn-based organization that helps researchers better discover and understand research articles through Smart Citations–citations that display the context of the citation and describe whether the article provides supporting or contrasting evidence. scite is used by students and researchers from around the world and is funded in part by the National Science Foundation and the National Institute on Drug Abuse of the National Institutes of Health.
hi@scite.ai
10624 S. Eastern Ave., Ste. A-614
Henderson, NV 89052, USA
Copyright © 2024 scite LLC. All rights reserved.
Made with 💙 for researchers
Part of the Research Solutions Family.