Convert Strata/DL/ files to Lean modules#523
Merged
joehendrix merged 2 commits intomainfrom Mar 6, 2026
Merged
Conversation
f8b7ee8 to
1d1de33
Compare
Convert 65 of 66 files under Strata/DL/ (plus 10 supporting files outside DL) to Lean modules. This is the first step toward making Strata.SimpleAPI fully modular. - Each converted file wraps its declarations in public section/end so importers see them. Imports that appear in public signatures become public import; internal-only imports stay private. - Type aliases use @[expose] so the underlying type is visible to importers. Definitions used in pattern matching use @[expose, match_pattern]. - When a proof needs to simp/unfold a private definition from another module, import all is added alongside the regular import. - Files with elab or macro definitions use public meta import for Lean metaprogramming libraries. Meta helpers called by elab macros cannot be private because downstream non-module files would not see them. - 6 files under Backends/CBMC/GOTO/ were also converted because Imperative/ToCProverGOTO imports them. Target changed from a def with manual instances to @[expose] abbrev Target := Nat. - Lambda/TestGen.lean is excluded because it depends on Plausible (not yet a module). Only test files import it. Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
1d1de33 to
4e7b158
Compare
Contributor
|
How practical is the use of |
aqjune-aws
approved these changes
Mar 6, 2026
MikaelMayer
added a commit
that referenced
this pull request
Mar 6, 2026
Resolve conflicts with module conversion (#523) and GOTO backend (#289): - Convert TypeConstructor.lean to module with public section - Fix namespace resolution for TypeConstructor across module boundaries - Add typeDecl case to ToCProverGOTO - Remove unused mkParamName, deduplicate typeConArgsToCST - Address PR review comments
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
Convert 65 of 66 files under
Strata/DL/(plus 10 supporting files outsideDL) to Lean modules. This is the first step toward making
Strata.SimpleAPIfully modular.
Details
public section/endso importers see them. Imports that appear inpublic signatures become
public import; internal-only imports stayprivate.
library namespaces (e.g.
BitVec.width,List.dedup) stay private bydefault so Strata does not conflict with Batteries or Mathlib.
Consumers that need these use
import allto opt in explicitly.@[expose]. Lean's module system requires@[expose]onabbrevdefinitions whose underlying type must bevisible to importers (e.g.
abbrev Map α β := List (α × β)).Without it, compilation fails with a "type differs" error.
@[expose, match_pattern]. Definitionsused in pattern matching (e.g.
LMonoTy.bool,LExpr.boolConst)must be both exposed and marked as match patterns.
needs to
simp/unfolda private definition from module B, we addimport all Balongside the regular import. This is used forCounter,StringGen,Init.Data.Repr, and several Lambda modules.elabormacrodefinitions usepublic meta importfor Lean metaprogramming libraries. Meta helperfunctions called by
elabmacros cannot beprivatebecausedownstream non-module files would not see them.
Imperative/ToCProverGOTOimportsGOTO backend types, so 6 files under
Backends/CBMC/GOTO/were alsoconverted.
Targetchanged from adefwith manual instances to@[expose] abbrev Target := Nat, which removes boilerplate and makesthe type transparent.
InstToJsondrops the now-unnecessary.toNatcall.Lambda/TestGen.leandepends on Plausible(not yet a module) and is left unconverted. Only test files import it.
By submitting this pull request, I confirm that you can use, modify,
copy, and redistribute this contribution, under the terms of your choice.