15 research outputs found
Automating Method Naming with Context-Aware Prompt-Tuning
Method names are crucial to program comprehension and maintenance. Recently,
many approaches have been proposed to automatically recommend method names and
detect inconsistent names. Despite promising, their results are still
sub-optimal considering the three following drawbacks: 1) These models are
mostly trained from scratch, learning two different objectives simultaneously.
The misalignment between two objectives will negatively affect training
efficiency and model performance. 2) The enclosing class context is not fully
exploited, making it difficult to learn the abstract function of the method. 3)
Current method name consistency checking methods follow a generate-then-compare
process, which restricts the accuracy as they highly rely on the quality of
generated names and face difficulty measuring the semantic consistency.
In this paper, we propose an approach named AUMENA to AUtomate MEthod NAming
tasks with context-aware prompt-tuning. Unlike existing deep learning based
approaches, our model first learns the contextualized representation(i.e.,
class attributes) of PL and NL through the pre-training model, then fully
exploits the capacity and knowledge of large language model with prompt-tuning
to precisely detect inconsistent method names and recommend more accurate
names. To better identify semantically consistent names, we model the method
name consistency checking task as a two-class classification problem, avoiding
the limitation of previous similarity-based consistency checking approaches.
The experimental results reflect that AUMENA scores 68.6%, 72.0%, 73.6%, 84.7%
on four datasets of method name recommendation, surpassing the state-of-the-art
baseline by 8.5%, 18.4%, 11.0%, 12.0%, respectively. And our approach scores
80.8% accuracy on method name consistency checking, reaching an 5.5%
outperformance. All data and trained models are publicly available.Comment: Accepted by ICPC-202
RustHorn: CHC-based Verification for Rust Programs (full version)
Reduction to the satisfiability problem for constrained Horn clauses (CHCs)
is a widely studied approach to automated program verification. The current
CHC-based methods for pointer-manipulating programs, however, are not very
scalable. This paper proposes a novel translation of pointer-manipulating Rust
programs into CHCs, which clears away pointers and memories by leveraging
ownership. We formalize the translation for a simplified core of Rust and prove
its correctness. We have implemented a prototype verifier for a subset of Rust
and confirmed the effectiveness of our method.Comment: Full version of the same-titled paper in ESOP202
flap: A Deterministic Parser with Fused Lexing
Lexers and parsers are typically defined separately and connected by a token
stream. This separate definition is important for modularity and reduces the
potential for parsing ambiguity. However, materializing tokens as data
structures and case-switching on tokens comes with a cost. We show how to fuse
separately-defined lexers and parsers, drastically improving performance
without compromising modularity or increasing ambiguity. We propose a
deterministic variant of Greibach Normal Form that ensures deterministic
parsing with a single token of lookahead and makes fusion strikingly simple,
and prove that normalizing context free expressions into the deterministic
normal form is semantics-preserving. Our staged parser combinator library,
flap, provides a standard interface, but generates specialized token-free code
that runs two to six times faster than ocamlyacc on a range of benchmarks.Comment: PLDI 2023 with appendi
Programming Languages and Systems
This open access book constitutes the proceedings of the 30th European Symposium on Programming, ESOP 2021, which was held during March 27 until April 1, 2021, as part of the European Joint Conferences on Theory and Practice of Software, ETAPS 2021. The conference was planned to take place in Luxembourg and changed to an online format due to the COVID-19 pandemic. The 24 papers included in this volume were carefully reviewed and selected from 79 submissions. They deal with fundamental issues in the specification, design, analysis, and implementation of programming languages and systems
Programming Languages and Systems
This open access book constitutes the proceedings of the 29th European Symposium on Programming, ESOP 2020, which was planned to take place in Dublin, Ireland, in April 2020, as Part of the European Joint Conferences on Theory and Practice of Software, ETAPS 2020. The actual ETAPS 2020 meeting was postponed due to the Corona pandemic. The papers deal with fundamental issues in the specification, design, analysis, and implementation of programming languages and systems