Expand description
Re-export of analysis utilities from the compile crate.
Useful for tooling that needs to analyze LOGOS source without performing a full build. Compile-time analysis passes for the LOGOS compilation pipeline.
This module provides static analysis that runs after parsing but before code generation. These passes detect errors that would otherwise manifest as confusing Rust borrow checker errors.
§Analysis Passes
| Pass | Module | Description |
|---|---|---|
| Escape | escape | Detects zone-local values escaping their scope |
| Ownership | ownership | Linear type enforcement (use-after-move) |
| Discovery | discover_with_imports | Multi-file type discovery |
§Pass Ordering
Parser Output (AST)
│
▼
┌──────────────┐
│ Escape Check │ ← Catches zone violations (fast, simple)
└──────────────┘
│
▼
┌─────────────────┐
│ Ownership Check │ ← Catches use-after-move (control-flow aware)
└─────────────────┘
│
▼
Code Generation§Re-exports
This module re-exports types from logicaffeine_language::analysis for
convenience, including:
TypeRegistry,TypeDef,FieldDef- Type definitionsPolicyRegistry,PredicateDef,CapabilityDef- Security policiesDiscoveryPass- Token-level type discovery
Modules§
- callgraph
- check
- Bidirectional type checker for the LOGOS compilation pipeline.
- dependencies
- escape
- Escape analysis for zone safety.
- liveness
- ownership
- Native ownership analysis for use-after-move detection.
- policy
- readonly
- registry
- types
- Type inference pass for the LOGOS compilation pipeline.
- unify
- Unification engine for the bidirectional type checker.
Structs§
- Capability
Def - A capability definition:
A User can publish the Document if... - Dependency
- A dependency declaration found in the document’s abstract.
- Discovery
Pass - Discovery pass that scans tokens before main parsing to build a TypeRegistry.
- Discovery
Result - Result of running the discovery pass
- Escape
Checker - Tracks the “zone depth” of variables for escape analysis
- Escape
Error - Error type for escape violations
- Field
Def - Field definition within a struct
- FnSig
- Function signature for tracked functions.
- Ownership
Checker - Ownership checker - tracks variable states through control flow
- Ownership
Error - Error type for ownership violations
- Policy
Registry - Registry for security policies defined in
## Policyblocks. - Predicate
Def - A predicate definition:
A User is admin if the user's role equals "admin". - Rust
Names - Centralized name resolution for Rust identifier output.
- TypeEnv
- Type environment built by a forward pass over the AST.
- Type
Registry - Variant
Def - Phase 33: Variant definition for sum types
Enums§
- Escape
Error Kind - Field
Type - Type reference for struct fields (avoids circular deps with ast::TypeExpr)
- Logos
Type - Structured type representation for LOGOS values.
- Ownership
Error Kind - Policy
Condition - Condition in a policy definition. Represents the predicate logic for security rules.
- TypeDef
- VarState
- Ownership state for a variable
Functions§
- check_
program - Check a LOGOS program and return a typed
TypeEnvfor codegen. - discover_
with_ imports - Recursive discovery with module imports.
- scan_
dependencies - Scans the first paragraph (Abstract) of a LOGOS file for
[Alias](URI)links.