Sound numeric representation: finite weight tables with intervals

Open
#573 0 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
25/100
Issue type
Feature
Clarity
Needs clarification
Activity status
Active
Tech stack
python
Domain
backend

Research direction

Read prodigy/analysis/loops/invariants/bounds/explicit.py and the Measure/GeneratingFunction design in issue #572 first. The issue raises open questions about representation, interval semantics for observe, and how bounds relate to Kleene iteration, so the implementation scope and completion criteria need to be decided before work can start.

Written by the indexing model from the issue text.

Description

area: engines enhancement priority: low

Idea

prodigy/analysis/loops/invariants/bounds/explicit.py runs loops on finite weight tables in floating point. Today it only explores loops and plans template parameters; it proposes, it proves nothing. Decided for v0.7.0 (#572): it stays a planner and its type is renamed WeightTable.

A sound numeric representation behind the Measure interface could give fast bounds for every program, also outside the closed-form and product-form fragments:

  • Truncation gives lower bounds. A finite table of a non-negative measure misses mass but never adds any, so it is a lower bound, and the missing mass is known exactly.
  • Rounding needs directed rounding or interval arithmetic. Each weight is kept as an interval (or rounded down for lower and up for upper bounds), so the reported bound stays proven. egcalc already has directed_decimal.

The results would be lower bounds, or two-sided bounds where an upper bound on the missing mass is available. They would never be reported as exact.

Open questions

  • Is this a representation of Measure (a "table" next to the generating functions) or only a source of candidates and bounds for the loop rules?
  • What are the interval semantics of observe (normalisation divides by an interval)?
  • How does it relate to Kleene iteration (lower bounds by unrolling), which already gives lower bounds?

Depends on: the Measure/GeneratingFunction design of #572.

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.