Open Yewzir opened 1 week ago
pysearch has been changed significantly since that example was written, we probably need a better example.
The number of expressions are the cached expressions, notice MAX_CACHE_LENGTH
is set to 10, so after that pysearch is in DFS mode, and it no longer cache expressions nor track how many expressions were evaluated.
Having to abort really quickly is because pysearch is now significantly faster.
1-n//2%3
is not found because 1-n%6//2
is equivalent, pysearch doesn't keep both n%6//2
and n//2%3
, because these two expressions has the same output, depending on the execution order it could choose either.
All this time I figured I was one of the few who couldn't get it to work but it does actually. Well, sort of.
After cloning the repository for another attempt and prior to running
cargo run --release
, I checked the contents of theparams.rs
file in order to verify if the search parameters are still identical to your example. They are, and so I ran it just like that to see what would happen this time.Eventually it terminates successfully with the following results and although it actually processed 6,758 expressions, it appears as if it spent twenty seconds on nothing.
Going all the way up to the results of length 13, I noticed how it already knew how many expressions it'd process in total. Uh, I cannot understand how. Am I possibly missing something important in all of this?
Everything looks normal prior to processing lengths 11-14 and the results of length 10 already show a current total of 7,694,843 expressions.
Regarding the expressions it finds, I'm not succeeding in obtaining the following example output.
I have to abort execution really quick in order to see the shortest results and that's when I noticed that it does find your example.
After modifying the search parameters and aborting execution really quick to see if it finds the second expression, it appears to have found three expressions of the same length and although all of them seem valid, the example of yours,
1-n//2%3
, is nowhere to be found.Would you be so kind to shed some light on everything that's going on here, please? Thank you.