> For the complete documentation index, see [llms.txt](https://docs.hylo-lang.org/hylo-ir/llms.txt). Markdown versions of documentation pages are available by appending `.md` to page URLs; this page is available as [Markdown](https://docs.hylo-lang.org/hylo-ir/concepts/lowering.md).

# Lowering

The process of transforming high-level source code to its equivalent intermediate representation is called *lowering*.

Lowering is takes place over multiple translation phases, each of which resulting in IR code at a different *stage*:

1. High-level source code is translated to *raw IR*.
2. Raw IR is translated to *legal IR*.
3. Legal IR is translated to *canonical IR*.

A program in raw IR may contain incomplete deinitialization and flow-sensitive type errors. A program in legal or canonical IR shall not violate any of the static semantic rules of the Hylo programming language.
