Package org.clafer.ir

This package provides the IR used as in intermediate language during compilation.

See: Description

Package org.clafer.ir Description

This package provides the IR used as in intermediate language during compilation.
AST -> IR -> Choco

It resembles the Choco API except for two facts.

  1. Boolean expressions in the IR unify Choco Constraints, BoolVars, and LogOps. The IR will try to optimally compile to whichever Choco construct is most efficient.
  2. Expressions can be nested. In Choco, expressions cannot be nested. This simplifies compiling the AST since expressions are Clafer are nested. Having expressions nested makes optimization easier, before it is flattened into Choco.

The IR is designed to make optimization easy at the expense of being harder to use. The IR is internal, and most use cases should not use this package. Use the org.clafer.compiler package to go straight from AST to IR.

The IR has 3 types: booleans, integers, and sets of integers. Each variable and expression typed.

Author:
jimmy

Copyright © 2013. All Rights Reserved.