Skip to content

[theories/modules] law of total probability#968

Open
alleystoughton wants to merge 6 commits intomainfrom
total-probability
Open

[theories/modules] law of total probability#968
alleystoughton wants to merge 6 commits intomainfrom
total-probability

Conversation

@alleystoughton
Copy link
Copy Markdown
Member

Add module-based law of total probability for distributions with finite support.
Put it in theories/modules as it uses event partitioning.

@alleystoughton alleystoughton requested a review from fdupress April 6, 2026 15:46
@alleystoughton
Copy link
Copy Markdown
Member Author

I don't understand why the EC library checking failed.

@alleystoughton
Copy link
Copy Markdown
Member Author

I made the distribution a parameter to the procedure of the Rand module, instead of a theory parameter, and force pushed.

@alleystoughton
Copy link
Copy Markdown
Member Author

I don't understand why the EC library checking failed.

I see, it's because I checked it with Alt-Ergo. Will fix this.

@alleystoughton
Copy link
Copy Markdown
Member Author

I don't understand why the EC library checking failed.

It checked for me with Z3 (4.15.4) and CVC5 (1.3.2). Fixed to check with just Z3.

@fdupress
Copy link
Copy Markdown
Member

fdupress commented Apr 6, 2026

Using make check before committing or pushing to the EC repo (but after moving your file to the EC working directory) should make use of the easycrypt.project we serve, which should ensure that the CI reproduces successes (barring regressions in SMT solvers, which are mostly rare now that we do not use Alt-Ergo).

I'll do a proper review + local edits when it's not a bank holiday, but wanted to guide your workflow to avoid you having to figure out why CI is failing in the future!

@strub
Copy link
Copy Markdown
Member

strub commented Apr 13, 2026

I asked Claude to play the game and to fix the comments.

@fdupress
Copy link
Copy Markdown
Member

In passing, and while doing my own pass (because I can't pay for Claude), I also noticed that the first non-module parameter to total_prob should be its after its second. In left-to-right rewriting, the distribution and additional input can be inferred, but the range cannot. I'll stack on a commit correcting that.

@fdupress fdupress requested review from fdupress and oskgo April 13, 2026 14:43
@strub strub force-pushed the total-probability branch from 7d0b83d to b24c56c Compare April 13, 2026 15:00
Copy link
Copy Markdown
Contributor

@oskgo oskgo left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Looks good to me.

Thank you for the contribution!

@fdupress Merging is blocked on your change requests (which all seem to have been addressed).

@fdupress fdupress dismissed their stale review April 13, 2026 15:24

addressed

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

4 participants