Skip to content

Add recognition-relative denotational semantics - #905

Merged
godofecht merged 7 commits into
mainfrom
feature/recognition-semantics
Sep 20, 2026
Merged

godofecht merged 7 commits into
mainfrom
feature/recognition-semantics

Conversation

@godofecht

Copy link
Copy Markdown
Contributor

Implements recognition dynamics as a first-class semantic contract for flow declarations.

This adds contextual recognize { ... } syntax with five initial domains: numerical, realtime, causal, safety, and memory.

The new src/flow/recognition.py defines a representation-independent FlowDenotation, observer-relative projections, canonical signatures/manifests, drift comparison, and assert_recognition_preserved for transformation validation. Flow lowering retains both the original FlowDecl and its recognition manifest on the synthesized struct so later IR/optimization passes do not have to treat the lowered representation as the semantics itself.

The tests cover contextual parsing, contract validation, manifest retention, deterministic signatures, and the key recognition-dynamics property: a derivative rewrite is visible under numerical recognition while remaining equivalent under memory recognition.

This is deliberately the semantic-contract layer only. It does not yet claim machine-code proof, WCET analysis, floating-point tolerance semantics, or automatic enforcement across every optimizer pass; those can be wired to the comparison API incrementally.

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