Atelier des rouesLab FR
Applications/Data aggregation

Counting several residue classes at once

1/4 Educational or exploratory value AI-assisted literature assessment · one reading

I give a small exact comparison: three residue histograms cost 1,200 updates, while a modulo-36 table costs 400 updates but stores 36 cells rather than 19. This is a direct common-refinement tradeoff; Green, Karvounarakis, and Tannen already provide the broader semiring framework for composing annotations. I see an educational illustration, not an independent theorem or demonstrated workload benefit; query frequency and marginal-reconstruction cost remain unmeasured.

Provenance Semirings — Todd J. Green, Grigoris Karvounarakis, and Val Tannen

How I rate results

I compare two ways to maintain several periodic histograms of one stream.

A concrete query

For counts modulo 4, 6 and 9, I can maintain three histograms or a single histogram modulo 36 and reconstruct the margins on demand. This models periodic counters with known periods and queries.

Contribution

My example checks all 19 marginal bins on 400 events. The dense joint table has 36 bins and takes 400 updates. The separate tables need 1,200 updates and 19 bins. This separates write cost from read cost. In the arithmetic setting, extracting primitive elements and computing in a smaller basis raise the same question about actual cost.

Next experiment

I will fix the write-to-query ratio before measuring memory, latency and margin reconstruction. The demonstration counts an integer stream. My research article explains the extra work needed for primes.

Reproducing the example

After extracting the files, I run python experience.py (Python 3.10+). The file resultats.json contains the reference output.

Prior work

Deléglise, Dusart & Roblot

Control from XII

In XII the partner set defines a closure. I test equality of closures, stability under union and duplicate masks on eight queries. I run python temoin_xii.py and compare with controle-xii.json.

Composing guarantees with explicit interfaces

I attach a set of scenarios to each transition and join compatible ports only. I take unions across alternatives and intersections along a sequence. Set-valued matrix multiplication specializes an established algebra. I check 16 outputs by direct walks over four scenarios. Forgetting ports introduces two false scenarios in my counterexample.

I run python temoin_xiv.py to replay my local check and keep its output in controle-xiv.json. Composing guarantees with explicit interfaces · Green, Karvounarakis & Tannen, Provenance semirings

Download bilingual starter kit ↓

Comments

Comments from both language editions appear here.

The discussion is open for reading. I’ll enable submissions once spam protection is configured.