-
Notifications
You must be signed in to change notification settings - Fork 52
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
New strategy randomization #486
Conversation
… value (to avoid confusing warnings when)
- promoted two extensionality resolution sub-options to be samplable (have short names) - a few updates and cleanups in samplerFOL.txt - samplerSMT.txt as a clone of samplerFOL.txt that adds theory stuff (however, this is unfinished, see the end of the file)
793d81e
to
bd9b32c
Compare
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This is cool! I guess this supports spidering/snaking and other such randomised runs, right?
I've asked a few questions here or there, otherwise looks good to me. The nice documentation you wrote up for this merge - could it go as a comment in a suitable file or as part of the wiki?
Michael, thank you for your careful review! I sometimes disagreed with your suggestions, but hopefully with a good justification. To make Options.cpp a bit smaller again, I don't mind the other randomization mechanism to scheduled for removal. (However, it actually implements something the one does not, and that's taking property into account when sampling. We can have a longer discussion about it elsewhere.) |
Absolutely! I fully expect to be wrong, you're the expert. :-)
Good. We can discuss at some point, if we don't turn out to have a use for the other thing then let's remove it. Merging. |
A new option for getting a randomly sampled strategy (
--sample_strategy
), which expects a filename for describing a distribution on the option space to sample from. This is similar in function to and arguably subsumes the two related--mode random_strategy
and--random_strategy on/sat/nocheck
, which could be scheduled for removal after this is approved. The PR also cleans up a bit in Options.cpp and reorganises things there a bit (e.g., new OptionTag for INDUCTION and THEORIES options).Three example files for option space sampling are provided: samplerFOL.txt, samplerFNT.txt, samplerSMT.txt. The first two roughly correspond to the FOL and FNT divisions of CASC, the last should include theory reasoning, but is at this moment incomplete (as documented there). (Ahmed's new branch on HOL, which won CASC HOL this year, already contains most this PR's commits and a file samplerHOL.txt there.)
The format of the sampler files should be easy to understand. It describes a sequence of sampling rules (one on each line, barring empty lines and comment lines starting with a
#
), which are executed in order, and each rule (provided its preconditions are satisfied) triggers sampling of a value for a particular option from a specified distribution. The most common sampler is for the categorical distribution (~cat), which is specified by a list of values with corresponding integer frequencies. Other samplers include ratios, uniform floats and integers, and a (shifted) geometric distribution for potentially unbounded integers. A notable feature is the ability to sample also virtual (non-existent) options, by convention prefixed by a$
sign, whose value can later be reference in the conditions.Example:
First samples a virtual option
$nm
with either a valueZ
(1 out of 6) orNz
(5 out of 6).Then, if
$nm
is set toZ
sample the (actual) naming option with value0
(nm ~cat 0:1
is simply an assignment to the effect ofnm := 0
), and if$nm
is set toNZ
, we sample from a shifted geometric distribution withp=0.07
and ashift=2
. (So2
gets selected with a probabilityp
,3
with a probabilityp(1-p)
, ... and2+i
with a probabilityp(1-p)^i
).