Parameter ranges: declare bounds for parameters (e.g. p in [0, 1]) so parametric inputs and invariants can be proven

Open
#303 3 comments 0 reactions 0 assignees View on GitHub

Maintainers usually reply within 1 day

Nobody has claimed this yet.

Assessment

Difficulty
5/5
Estimated time
Over a week
Newbie friendliness
35/100
Issue type
Feature
Clarity
Mostly clear
Activity status
Active
Tech stack
python
Domain
backend

Research direction

Read docs/source/language.md and trace how .ppy and .pgcl parameter declarations reach input validation and the positivity heuristics used by all three engines. Identify where range assumptions would be passed through those paths. Done means declared ranges prove the stated input and invariant properties across all three engines, no-range behavior is unchanged, and the language documentation is updated.

Written by the indexing model from the issue text.

Description

area: analysis area: language enhancement priority: medium topic: loop strategies

Found in #300 and #301. Exists on main (completeness, not soundness).

Parameters (rparam, nparam) have no declared range, so their sign is unknown:

  • Since #300, every parametric input distribution whose coefficients depend on a parameter (e.g. p*x + 1 - p with p meant as a probability) is refused, because its non-negativity cannot be proven. Before, such inputs were accepted unchecked.
  • Since #301, parametric EVT invariants such as (1 + (1-p)*t)/(1-p*x) stay undecided, although the program uses p as a probability.
  • nparam is typed as a non-negative integer only where the caller does so (input distributions); the EVT heuristics get invariants as strings and treat nparam as real.

Idea

  • A declared range for parameters, e.g. p: rparam in [0, 1] in .ppy (and an equivalent in .pgcl), passed to the positivity heuristics and the input validation as assumptions; or results that state the range they hold for.
  • Possibly infer 0 ≤ p ≤ 1 where p is used as a probability, but only as a stated assumption.

Done when

  • A parametric program with a declared range gets its proven guarantees (input accepted, invariant non-negative) on all three engines; without a range nothing changes.
  • Docs in docs/source/language.md.

🤖 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.