Skip to content

Fail Boole lowering when global type cannot be translated to Core - #31

Merged
kondylidou merged 2 commits into
strata-org:mainfrom
yashmehta00:fix/unsupported-globals
Nov 18, 2026
Merged

kondylidou merged 2 commits into
strata-org:mainfrom
yashmehta00:fix/unsupported-globals

Conversation

@yashmehta00

@yashmehta00 yashmehta00 commented Nov 17, 2026 •

Copy link
Copy Markdown
Contributor

Fix legacy globals problem
Issue: This issue was found while trying to prove denote semantics against Boole-to-Core lowering. If the global has a type that is unsupported by Core's translator toCoreMonoType , such as real, then it is omitted from the globalVarTypes table, which has consequences as it decides the following during lowering:
1. determines the parameters to be added in every procedure header and arguments at each call, as Strata handles globals by adding them to every procedure interface.
2. tells the lowerer which expressions not to treat as function calls. That is, the globals in globalVarTypes are the exception to that rule.
3. an expression g in the clause modifies g must be in globalVarTypes

Fix: Until Core supports those types, the best fix is for lowering to fail when globals are unsupported. This is consistent with how local variables are already dealt with -- if we have inside a procedure an unsupported expression e.g. var x : real, the whole lowering fails. This is done by allowing the error to propogate rather than catching it in toCoreProgram so we get an "Unsupported Boole type" error. Two tests in StrataBooleTest/unsupported_global.lean show this behavior clearly.

Note: Some types are unsupported by the Core translation, (toCoreMonoType) yet supported by Core, like real. However adding support for other types in translation would affect both global and local variables and belongs in a separate PR.

@kondylidou
kondylidou self-requested a review November 18, 2026 10:42

@kondylidou kondylidou left a comment

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

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

LGTM

@kondylidou
kondylidou merged commit 760b036 into strata-org:main Nov 18, 2026
2 checks passed
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.

2 participants