Guards and observe: split conditions by cases like get_probability_of

Open
#533 0 comments 0 reactions 0 assignees View on GitHub

Maintainers usually reply within 1 day

Nobody has claimed this yet.

Assessment

Difficulty
4/5
Estimated time
3-5 days
Newbie friendliness
43/100
Issue type
Feature
Clarity
Mostly clear
Activity status
Active
Tech stack
python
Domain
backend, testing

Research direction

Start by reading the shared PGF logic where filter and CASE_SPLIT_LIMIT are defined, then compare it with Distribution.get_probability_of and the guard and observe analysis paths. Add conformance coverage for both engines, including conditions beyond the limit, and run the relevant tests plus guard fuzzing. Done means eligible conditions are analysed exactly through shared case analysis, while over-limit conditions still raise “not implemented” naming the condition.

Written by the indexing model from the issue text.

Description

area: engines enhancement priority: low

Found in #532 (P4d). Distribution.get_probability_of splits a condition by cases when filter cannot compute it directly (e.g. x + y < 2 with y of infinite range but x of finite range). Guards of if and while and observe conditions use filter directly, which raises "not implemented" for the same conditions.

Making filter itself split by cases (with the same CASE_SPLIT_LIMIT and the same order of cases, in the shared PGF logic) would let the analysis handle more programs. This is a feature, not part of the behaviour-preserving v0.7.0 milestone.

Done when

  • Guards and observe conditions that get_probability_of can decide by cases are analysed exactly on both engines, through one shared case analysis (no copy per engine).
  • Conditions beyond the limit still end with "not implemented" naming the condition.
  • Conformance tests on both engines; fuzzing covers guards of this shape.

🤖 Generated with Claude Code

Dominant language
Python
Stars
6
Forks
2
Avg merge
1h 52m
Merged PRs (30d)
187

Getting set up

  • Ships a Dockerfile or Docker Compose file
  • No pull request template
  • No contributing guide

First steps

  1. Read the whole issue, then the project's contributing guide.
  2. Comment on the issue to say you are picking it up — it saves two people doing the same work.
  3. Fork the repository and make your change on a branch.
  4. Open a pull request that references the issue number.

More from LKlinke/Prodigy

All issues in LKlinke/Prodigy

Similar issues

More Python issues

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.