- Notifications
You must be signed in to change notification settings - Fork34
Active learning of RegEx with existing samples#53
-
Hi! Suppose I want to learn the following regex The string "infinity" is fairly long and hard to bruteforce. I know that it's accepted by the regex I want to learn though, and I would like to pass this information to the regex learner. I've tried to pass it via the I'd appreciate your suggestions very much. On a side note, is there a recommended way to convert the learned DFA to a RegEx? Currently I am using the Python Best regards, |
BetaWas this translation helpful?Give feedback.
All reactions
Hi,
another alternative is to useProvidedSequencesOracleWrapper:
https://github.com/DES-Lab/AALpy/blob/master/aalpy/oracles/ProvidedSequencesOracleWrapper.py
You just wrap one oracle and this counterexample in this one, and pass it to the learning algorithm.
samples parameter adds samples to the cache, therefore making learning more efficient, but those are not included in the EqOracle.
Replies: 3 comments 3 replies
-
You could create a custom oracle that checks whether the model conforms to your domain knowledge in addition to using some other strategy. The code below should do the trick. As for the conversion between DFAs and RegEx: I'm afraid I can't help you with this one since I'm not really a DFA person... |
BetaWas this translation helpful?Give feedback.
All reactions
-
Hi, another alternative is to use You just wrap one oracle and this counterexample in this one, and pass it to the learning algorithm.
|
BetaWas this translation helpful?Give feedback.
All reactions
-
Hi, Thanks for your quick replies! I am now using ProvidedSequencesOracleWrapper as@emuskardin suggested, and it works. I have a follow-up question. Suppose I want to learn the regex Thanks! |
BetaWas this translation helpful?Give feedback.
All reactions
Uh oh!
There was an error while loading.Please reload this page.
Uh oh!
There was an error while loading.Please reload this page.
-
I am not sure if I get what you mean a 100%, but "ainfinity" would then be a new long and hard to randomly sample cex. Inifinityb is still long and hard, especially with such big input alphabet, but it is basically a new state reached after reaching infinity, so state coverage oracles can find it (with sufficient testing). It seems to me, that if you are learning this kind of languages, a extension to the EqOracle would be needed. Something whete you take elements of characterization set (see randomWEqOracle) or previous counterexamples, and make explicit tests with those. If you paste your code, I can take a closer look on Mon/Tue :) |
BetaWas this translation helpful?Give feedback.
All reactions
Uh oh!
There was an error while loading.Please reload this page.
Uh oh!
There was an error while loading.Please reload this page.
-
Hi, Please find my code below. I've included a Thanks for your help! |
BetaWas this translation helpful?Give feedback.
All reactions
-
You get this If yes, replace |
BetaWas this translation helpful?Give feedback.
All reactions
This discussion was converted from issue #52 on November 03, 2023 16:19.