Comments (3)
Not an author of the PLUR paper, but can help answer:
...; a repair task can use a pointer to point at a particular input node, and a token output to replace that input node.
Can the output handle the occurrence of multiple errors in an input node i.e. can it produce multiple tokens to handle the errors? or is it limited to a single token per node only? Can you highlight this point?
If I understood your question: yes – though not explicitly shown in the PLUR paper, the Tocopo (token-copy-pointer) formulation is flexible and can support multiple output tokens per output pointer. For example, the INSERT_BEFORE
Tocopo actino has the following format: INSERT_BEFORE <pointer> token_0 ... token_n
.
Figure 1 shows an example RENAME
Tocopo action. The payload of the RENAME
action is shown as just "x"
, but could actually be multiple tokens (e.g. from a subtokenized vocbulary).
Learning to Fix Build Errors with Graph2Diff Neural Networks (cited by the PLUR paper) introduced the idea of Tocopo and goes into more detail about what Tocopo sequences look like: see figures 3 and 6.
from plur.
@dan-zheng, I think the question asks what would happen if the model's output needs to represent multiple edits. Let's say:
Buggy Code: foo(a, b)
Correct Code: foo(a, c, d)
For this example, instead of b
we can output c, d
, which would be allowed by the Tocopo
grammar.
However, what would happen if the edit is in multiple locations? The syntax would not support multi-location edits. Could we extend the model for multi-statement (i.e. multi-hunk) repair?
To summarize:
- single location, multiple edits: supported by the model.
- multi-location repair: not supported.
from plur.
@nashid Thanks for clarifying the question!
Multiple edit locations are supported via multiple INSERT
actions.
# Input code:
foo(a, b)
# Tokens (enumerated):
[(0, 'foo'), (1, '('), (2, 'a'), (3, ','), (4, ' '), (5, 'b'), (6, ')')]
# Target code:
foo(a, HelloWorld, d)
# Example Tocopo repair:
INSERT_BEFORE POINTER(5) 'Hello' 'World' ','
RENAME POINTER(5) 'd'
DONE
In general, Tocopo sequences (i.e. "Tocopo scripts" or "Tocopo repairs") are keyword-prefixed actions (INSERT_BEFORE
, DELETE
, etc) whose arguments are an action-specific and action-defined mix of tokens, copies, and pointers. The specific Tocopo actions can be designed per task.
Does this help answer your question?
from plur.
Related Issues (8)
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from plur.