Commit Graph

25 Commits

Author SHA1 Message Date
Kamil Śliwak
2f67302ffc [yul-phaser] main: Add --seed option 2020-02-16 02:18:21 +01:00
Kamil Śliwak
f29d3655f7 [yul-phaser] SimulationRNG: Add bernoulliTrial() 2020-02-16 02:18:21 +01:00
Kamil Śliwak
db140a667a [yul-phaser] SimulationRNG: Use a single, shared and seedable generator 2020-02-16 02:18:21 +01:00
Kamil Śliwak
342a4e5dee [yul-phaser] Rename Random to SimulationRNG (fix references) 2020-02-16 02:18:21 +01:00
Kamil Śliwak
0d28d5a287 [yul-phaser] Rename Random to SimulationRNG (file move) 2020-02-16 02:18:21 +01:00
Kamil Śliwak
b01766c4db [yul-phaser] Gather functions from Random into SimulationRNG class 2020-02-16 02:18:21 +01:00
Kamil Śliwak
4ee9174454 [yul-phaser] Chromosome: Make randomOptimisationStep() public
- And add tests now that it's public.
2020-02-16 02:18:21 +01:00
chriseth
f0ebb26f29
Merge pull request #8223 from imapp-pl/yul-phaser-program-reuse
[yul-phaser] Program reuse
2020-02-06 13:29:44 +01:00
Daniel Kirchner
9b8e3800bb Fix upgrade tool build on windows. 2020-02-06 10:49:15 +01:00
cameel
e4c7b73897 [yul-phaser] Store already loaded program in Population and make copies when computing fitness
- Until now the source code was being parsed during every fitness computation. Now the parsed program is reused and only the optimisation steps are applied each time.
2020-02-06 09:01:10 +01:00
cameel
57fb64d467 [yul-phaser] Make Program copyable by doing a deep copy of the AST in the copy constructor 2020-02-06 09:01:10 +01:00
cameel
a189c8b6e2 [yul-phaser] Pass unique_ptr rather than a mutable reference to Program::applyOptimisationSteps()
- Giving the function ownership of an object and then receiving back another object is better than letting it implicitly modify data passed in an argument.
2020-02-06 09:01:10 +01:00
cameel
785f65d0f5 [yul-phaser] Make Program and Population classes accept source code rather than file path
- I need some sample .yul files for testing but I see that existing tests generally have source code hard-coded in them rather than in standalone .yul files. There are lots of .yul files but they seem to be automatically processed by a special test case rather loaded ad-hoc by manually created tests.
- Program and Population required a file name until now. I'm making them accept loaded source code to be able to give them data hard-coded in a test.
2020-02-05 18:13:30 +01:00
cameel
7b7c88ae95 [yul-phaser] Add Population class 2020-02-05 18:13:30 +01:00
cameel
f0fb046038 [yul-phaser] Remove Chromosome::allStepNamesExcept() 2020-02-05 18:13:30 +01:00
cameel
f6d955db0b [yul-phaser] Add Chromosome class 2020-02-05 18:13:30 +01:00
cameel
57ab8922cd [yul-phaser] Add random number generators using Mersenne Twister from boost 2020-02-05 18:13:30 +01:00
cameel
21a2b69f74 [yul-phaser] Create OptimiserStepContext on demand instead of storing it in Program class
- This also lets us get rid of the static s_externallyUsedIdentifiers.
2020-02-05 18:13:30 +01:00
cameel
3baa191b94 [yul-phaser] Printing and JSON conversion for the Program class 2020-02-05 18:13:30 +01:00
cameel
2aa42b32e5 [yul-phaser] Make Program noncopyable
- Copying worked but resulted in OptimiserStepContext having a reference to NameDispenser instance of the other object.
2020-02-05 18:13:30 +01:00
cameel
14d726ff01 [yul-phaser] Program: Use unique_ptr rather than shared_ptr to hold a pointer to the AST root
- The class never shares the instance so unique_ptr makes more sense.
2020-02-05 18:13:30 +01:00
cameel
513d41c315 [yul-phaser] Add Program class 2020-02-05 18:13:30 +01:00
cameel
b75370d93e [yul-phaser] Printing help and accepting input file on the command line 2020-02-05 18:13:30 +01:00
cameel
e7d204383d [yul-phaser] An empty command-line application for the new tool 2020-02-05 18:13:29 +01:00
Erik Kundt
f2701db0aa Adds documentation for Solidity source upgrader. 2020-02-05 16:52:54 +01:00