Module math

Source
Expand description

Math stage is responsible for most if not all of the optimizations the compiler does. It’s at this point where rules are analyzed, expressions normalized, patterns that can be optimized optimized. It’s the final and most important stage of compilation.

Structs§

Adjusted
The adjusted (optimized) part of IR.
Build
Used explicitly for figure IR building.
Entity
An entity along with some metadata.
Expand
A context struct for loading unrolled data.
Expr
An expression with some metadata and a type.
Flags
Compiler flags.
IndexMap
Constructs a map between two sets of numbers A -> B.
Intermediate
The full Math IR, the ultimate result of the entire compiler
Math
A math stage context used across the whole compilation process.
Merge
A utility iterator for merging two sorted iterators.
Optimizations
The optimizations flag group. Currently empty. Has nothing to do with the [optimizations] module.
ReconstructCtx
A context for the recosntruction process.
Rule
A rule along if its aggregated information. Note that entities is not filled until the final steps of compilation.

Enums§

EntityKind
The kind of an entity.
ExprKind
A mathematical expression with a flattened memory model.
ExprType
The primitive type of an expression.
RuleKind
Represents a rule of the figure. Rules are normalized iff:

Traits§

DeepClone
Deep clone a mathematical expression. This is different from Clone in that it works with the math stage’s flattened memory model and deep clones all of an expression’s dependencies (subexpressions).
FromUnrolled
Helper trait for converting unrolled expressions into math expressions.
GetMathType
Helper trait for getting the type of the expression.
Reconstruct
The main actor in reconstruction process.
Reindex
Helper trait for reindexing process.

Functions§

load_script
Loads a GeoScript script and compiles it into Math IR. Encapsulates the entire compiler’s work.