[][src]Module libslide::partial_evaluator

libslide's heavy-lifting optimizer, applying simplification rules on the libslide IR.

Re-exports

pub use errors::PartialEvaluatorErrors;

Modules

compare

Module compare compares expressions for equality.

errors

Diagnostic errors produced by the partial evaluator.

flatten

This module tries to flatten expressions as far as possible without the intervention of more complex evaluation rules. Flattening might be used as a "first pass" to normalize an expression, or by a more complex rule for the same reason.

validate

Validates that evaluated slide programs are well-formed. In some sense, validations are post-evaluator linters.

variable_expand

This module expands variables in expressions to their definition form.

Structs

EvaluationResult

Describes the result of a slide program evaluation.

Functions

build_rules

Given an evaluator context, builds a set of evaluator rules to be used in partial evaluation.

evaluate

Evaluates a list of statements to as simplified a form as possible for each. The evaluation may be partial, as some values (like variables) may be unknown.

evaluate_expr

Evaluates an expression to as simplified a form as possible. The evaluation may be partial, as some values (like variables) may be unknown. The returned expression is normalized.