6 releases (breaking)
Uses new Rust 2024
| 0.7.0 | Apr 15, 2026 |
|---|---|
| 0.5.0 | Mar 9, 2026 |
| 0.4.0 | Feb 27, 2026 |
| 0.3.0 | Feb 27, 2026 |
| 0.1.0 | Jun 11, 2024 |
#434 in Math
Used in 7 crates
(5 directly)
330KB
7K
SLoC
mangle_analysis
This package is part of the Mangle logic programming language. It contains code related to semantic analysis (name resolution, type inference and type-checking).
See https://codeberg.org/TauCeti/mangle-rs for more information about Mangle.
lib.rs:
Analysis and Transformation Pipeline for Mangle.
This crate provides the core analysis passes and transformations that turn a parsed Mangle AST into an executable plan.
Transformation Stages
-
Program Structure: The raw AST is wrapped in a
Programabstraction which distinguishes between extensional (data) and intensional (rules) predicates. -
Stratification: The program is analyzed for dependencies and stratified to handle negation correctly. This produces a
StratifiedProgram, where predicates are grouped into layers (strata) that can be evaluated sequentially. -
Lowering: The AST (or stratified program parts) is lowered into the Intermediate Representation (IR). See
LoweringContext. -
Type Checking: The IR is checked for type consistency and safety. See
BoundsChecker. -
Planning: The Logical IR rules are transformed into Physical Operations (like nested-loop joins) ready for execution or codegen. See
Planner.
Dependencies
~3–4.5MB
~80K SLoC