Expand description

Semantic analysis.

This module primarily contains the type environment and term environment.

The type environment is constructed by analyzing an input AST. The type environment records the types used in the input source and the types of our various rules and symbols. ISLE’s type system is intentionally easy to check, only requires a single pass over the AST, and doesn’t require any unification or anything like that.

The term environment is constructed from both the AST and type envionment. It is sort of a typed and reorganized AST that more directly reflects ISLE semantics than the input ISLE source code (where as the AST is the opposite).

Structs

An external function signature.

A field of a Variant.

The id of a field inside a variant.

An if-let clause with a subpattern match on an expr after the main LHS matches.

A term rewrite rule.

The id of an interned rule inside the TermEnv.

The id of an interned symbol.

A term.

The term environment.

The id of an interned term inside the TermEnv.

The type environment.

The id of an interned type inside the TypeEnv.

The id of a bound variable inside a Bindings.

A variant of an enum.

The id of a variant inside an enum.

Enums

The kind of a constructor for a term.

A right-hand side expression of some rule.

The kind of an extractor for a term.

A left-hand side pattern of some rule.

The kind of a term.

A type.