Skip to content

Navigation Menu

Sign in
Appearance settings

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Sign up
Appearance settings

Reduce #1

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Open
cristianoc wants to merge 20 commits into main
base: main
Choose a base branch
Loading
from reduce
Open

Reduce #1

cristianoc wants to merge 20 commits into main from reduce

Conversation

@cristianoc
Copy link
Contributor

@cristianoc cristianoc commented Nov 28, 2025
edited
Loading

Summary

This PR adds a formal semantics for Skip's reactive reduce combinator, including a paper and a Lean formalization.

What's Included

  • Paper (reduce.tex): Formal semantics for Skip's reduce combinator with correctness proofs
  • Lean formalization (lean-formalisation/): Machine-checked proofs of the main theorems

Key Contributions

  1. Formal semantics: Denotational semantics for reduce as a derived view over collections
  2. Correctness characterization: Theorem proving that incremental correctness holds if and only if the reducer is well-formed (i.e., is the inverse of )
  3. Complexity contract: Well-formed reducers admit O(1) per-key updates, while partial reducers fall back to recomputation
  4. User-facing specification: Provides developers with a precise condition for writing correct custom reducers

Main Results

  • Theorem (Equivalence): Incremental updates are correct if and only if the reducer is well-formed
  • Well-formedness condition: (fold_⊕(ι, M) ⊕ v) ⊖ v = fold_⊕(ι, M) for all reachable accumulator states
  • Examples: Formal treatment of sum, count, and min reducers, with complexity analysis

What Distinguishes This Work

Unlike related systems (Flink, Kafka Streams, FRP frameworks), Skip exposes reducers as:

  • First-class combinators (not callbacks tied to engine contexts)
  • User-facing inverses (explicit operation, not hidden internally)
  • Formally specified (precise correctness condition for users to verify)

The Lean formalization provides machine-checked verification of the main correctness theorem and supporting lemmas.

- Move 'Partial Reducers' remark to after Theorem 4 (was prematurely placed)
- Add proper definition of algebraic aggregates in Section 3.2
- Remove incoherent 'partial average reducer' paragraph - you cannot maintain
 average incrementally with only the average value (need count too)
- Clarify min reducer as canonical example of non-invertible aggregate
- Explain Skip's strategies for handling partial reducers
- Rewrite abstract to emphasize first-class combinators vs callbacks
- Contrast with Flink, Kafka Streams, FRP, and incremental computation frameworks
- Add 'What distinguishes Skip's design' paragraph with 3 key differentiators
- Qualify claims about formal correctness to acknowledge DBSP/differential dataflow foundations
- Add 'Reactive JS and FRP streams' paragraph to related work
Copy link

@chatgpt-codex-connector chatgpt-codex-connector bot left a comment

Choose a reason for hiding this comment

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

💡 Codex Review

Here are some automated review suggestions for this pull request.

i️ About Codex in GitHub

Your team has set up Codex to review pull requests in this repo. Reviews are triggered when you

  • Open a pull request for review
  • Mark a draft as ready
  • Comment "@codex review".

If Codex has suggestions, it will comment; otherwise it will react with 👍.

Codex can also answer questions or update the PR. Try commenting "@codex address that feedback".

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

Reviewers

@chatgpt-codex-connector chatgpt-codex-connector[bot] chatgpt-codex-connector[bot] left review comments

Assignees

No one assigned

Labels

None yet

Projects

None yet

Milestone

No milestone

Development

Successfully merging this pull request may close these issues.

2 participants

AltStyle によって変換されたページ (->オリジナル) /