Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
This PR provides an implementation of “A Surprisingly Competitive Conditional Operator”.
As I mentioned in this comment, there's an interesting avenue to explore regarding cross-
cond
-branch states, and I've included an example via the relationcondpseq
.Currently,
condpseq
sequentially overwrites the state (i.e. substitutions dictionary) as it goes through thecond
branches in order, and passes that state along to the branch-specific suggestion functions.It might be better to provide the separate branch-specific states to the suggestion functions. For instance, a branch suggestion function could be given a map of branch-labels to variables reified according the the state produced by each branch. That opens up other considerations, though.
In the aforementioned scenario, how do we provide those branch-reifications across branches without evaluating every branch? Do we sequentially process and use the branch suggestions and return
None
for skipped branch entries in the suggestion function branch-map argument? Some sort of topo-sort on branch suggestion function requirements (e.g. evaluate the first and third branch before the second, because its suggestion function requests the latter two reifications)?Also, it would be good to understand how cross-branch state suggestions affect relational properties, especially since it seems like
condpseq
could be used to implementconda
andcondu
.