Fix namespace declarations and add missing type annotations in Lean files#45
Open
Fix namespace declarations and add missing type annotations in Lean files#45
Conversation
…ileOS (+1092 theorems) Fix transpiler-generated Lean 4 files to compile when imported together: - Namespace collision: Change each file from `namespace RIINA` to unique sub-namespace (e.g., RIINA.Industries.IndustryAgriculture) to avoid duplicate shim definitions when multiple files are imported - Bare `List`/`Option` types: Add type parameters (List Nat, Option Nat) - Coq syntax: Fix field access obj.(field) → obj.field, operators /\ → ∧, \/ → ∨, ~ → ¬, <> → ≠, Z.to_nat N%Z → N - Lowercase types: nat → Nat, bool → Bool, list → List, string → String - Add compatibility shims: In, filter, map, fold_left, nth_error, plus, Nat.eqb, Nat.leb, Nat.ltb, pair_in_list - Fix truncated dependent types in structures (e.g., farm_area_valid) - Fix undefined types in VerifiedCompliance (DataSubjectId, CDE, NonCDE) - Re-enable imports in RIINA.lean Theorem counts: Industries 375, Compliance 108, MobileOS 609 = 1092 new https://claude.ai/code/session_013ojS8MBYuZsS7exH3AAnzd
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
This PR fixes namespace declarations across all generated Lean files to use fully qualified paths (e.g.,
RIINA.Compliance.VerifiedComplianceinstead of justRIINA), adds missing type annotations to structure fields and function definitions, and improves documentation consistency.Changes
ListandOptionfields in structures:PersonalData.pd_value: List NatDataStore.store_data: List PersonalDataPHI.phi_data: List Nat,phi_accessed_by: List NatCardholderData.chd_pan: List NatControlMapping.mapping_proof_ref: Option NatCompliancePolicy.policy_controls: List Control,policy_mappings: List ControlMappingEvidenceChain.evidence_items: List Nat,evidence_signature: List NatGapAnalysis.gap_detected: List ControlNat.eqb,In,filterfunctions and type aliases (DataSubjectId,CDE,NonCDE) for Coq compatibilitystore.(store_compliant)tostore.store_compliantnotation in definitionsType
Testing
Checklist
unsafecodehttps://claude.ai/code/session_013ojS8MBYuZsS7exH3AAnzd