AML14 / tratto

2 stars 1 forks source link

Create mapping between oracles so far and next legal tokens #28

Open AML14 opened 1 year ago

AML14 commented 1 year ago

This is necessary for the token-reverting functionality. If at any time no more tokens are possible, we need to remove the last token and select a different one from the previous iteration. I propose to do this by keeping track of a map like the following:

{
    "": [["this", 0.934], ["(", 0.853], ["arg1", 0.578], ["SomeClass", 0.294]],
    "this": [[".", 0.832], ["==", 0.310], ["!=", 0.162]],
    "this.": [["someField1", 0.826], ["someField2", 0.512], ["someMethod1", 0.327]]
}

As illustrated, this map keeps the relation between partial oracles at any iteration (keys) and possible next tokens with their confidence score, in order (values).