tweag / pirouette

Language-generic workbench for building static analysis
MIT License
47 stars 2 forks source link

Introduce our own TreeT monad #115

Closed serras closed 2 years ago

serras commented 2 years ago

This PR completely removes WeightedList in favor of our own TreeT. This data type has been engineering to completely fit our purposes:

serras commented 2 years ago

I've rebased this PR on top of the latest changes in dev, so it merges cleanly.

serras commented 2 years ago

A few comments before merging this:

lucaspena commented 2 years ago

On my end, the O'Hearn Peano test successfully terminates in 60-75 seconds (I ran it a few times). So it seems the tree is making the test take much longer, but it looks like it is terminating at least.

VictorCMiraldo commented 2 years ago

I just noticed the existence of the gr/unstate branch from @0xd34df00d. How does the work in these two branches relate? It's good to communicate to make sure we're not overlapping work.

lucaspena commented 2 years ago

I did some investigation on the runtime of this problematic O'Hearn Peano test in this branch and in dev. I tested it with varying bounds for sestConsumedFuel, both with the wrong triple (where the test should terminate more quickly after finding a counterexample) and with the correct triple (where the test will only terminate once the bound is reached). The numbers are below, 13 is the lowest number where the counterexample is found so that's the lowest bound checked.

So my original hypothesis that the treet branch was exploring until the fuel threshold is reached appears to be false. Still, when forced to explore that much, the treet branch takes no longer than the dev branch. It's unclear why with the wrong triple, the treet branch takes so much longer. Perhaps it is exploring some additional states (though not all) before checking if the triple is violated? Regardless, since exploring up to the fuel threshold results in similar times on both branches, it doesn't appear that the changes in the treet branch can improve runtime (but ideally it also should not lose time either, assuming this bug can be fixed).

VictorCMiraldo commented 2 years ago

Great stuff @lucaspena, thank you! Besides having empirical evidence that the treet branch is doing additional work, it reinforces the idea that currently, in dev we are returning the first counterexample we find and looking no further! (#97)

VictorCMiraldo commented 2 years ago

The work of #137 will supersede this; this PR is stale and we decided not to move forward with it.