Skip to content

compiler: integrate static, denotational, dynamic and residual semantics - #1026

Merged
godofecht merged 17 commits into
mainfrom
feature/semantic-stack
Sep 30, 2026
Merged

godofecht merged 17 commits into
mainfrom
feature/semantic-stack

Conversation

@godofecht

@godofecht godofecht commented Sep 29, 2026 •

Copy link
Copy Markdown
Contributor

Supersedes #1024 and turns the separate semantic experiments into one Flow-native compiler stack.

Adds:

  • semantic_facts.flow: shared evidence model with provenance, status and recognition domains
  • static_semantics.flow: bridge from existing static semantics into PROVEN facts
  • denotation.flow: Flow-native structural denotation for parsed flow declarations
  • recognition.flow: recognition contracts and observer-relative projections
  • dynamic_invariants.flow: online invariant discovery emitting OBSERVED semantic facts
  • residual.flow: representation-relative residual extraction plus persistence/predictivity tracking
  • semantic_pipeline.flow: allocation-free ledger/projection/residual orchestration

The authority boundary is explicit: observed or structured-residual facts never become unconditional optimisation facts. Only static proof or a runtime guard promotes them to an optimisation-usable status.

tests/lang/test_semantic_stack.flow runs the full path and checks a concrete case where range/sign/alignment are already represented while an observed modular relation remains as the residual.

Rebased onto main after #1072, #1076 and #1077. All Flow, no Python. The new modules are not imported by compiler/src/main.flow, so the flowc bundle and the bootstrap C are unchanged (bootstrap_from_c.sh --verify passes against the checked-in C). Two doc sentences were reworded for the repository prose hook.

Local gates on this head: ./flow test-lang for both new tests, fmt_check.sh --check, parse_coverage.sh --check, check_doc_links.sh, check_doc_coverage.sh, check_doc_examples.sh --check-ledger, python_ratchet.sh, check_tool_layout.sh, bootstrap_from_c.sh --verify.

@godofecht
godofecht marked this pull request as ready for review September 30, 2026 13:38
@godofecht
godofecht merged commit e0e8b6d into main Sep 30, 2026
32 checks passed
@godofecht
godofecht deleted the feature/semantic-stack branch October 1, 2026 12:49
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant