Expand description
Remove global variables from the program by translating them into functions with no arguments. This requires type information, so it is done after type checking. Primitives are translated into functions with a primitive output. When a globally-bound primitive value is used in the actions of a rule, we add a new variable to the query bound to the primitive value.