====== Connections ======
There are two categories of variables in ACT: parameter variables (e.g. ''pint'', ''pbool'', etc.) that are used
during expansion/elaboration time to build a circuit, and circuit component/wire variables. While parameter
variables are more like normal variables in a programming language with the caveat that in some contexts they are [[language:connections#simple_connections|immutable]], circuit component variables behave differently.
one_place_buffer b;
In the ACT above, the statement ''one_place_buffer b;'' creates the variable ''b'' that is used to refer to all the elements of the circuit component defined by a new ''one_place_buffer'' process. Similarly, the fragment:
one_place_buffer b2;
creates a new circuit component ''b2'' that is also a one-place buffer. So far one can understand this using a conventional programming language view: ''one_place_buffer'' is a type that happens to correspond to a circuit
component, and ''b'' and ''b2'' are variables that refer to those components.
However, where ACT departs from standard programming languages is that you can //connect// ''b'' and ''b2'' as follows:
b = b2;
At this point, ''b'' and ''b2'' refer to the //same circuit component//. In fact, by connecting the two, the overall circuit
only has //one// circuit component of type ''one_place_buffer'' that is referred to by ''b'' and by ''b2''. There is no
disconnect operation in ACT, so this operation cannot be undone.
Connecting two variables makes them refer to the same circuit element. Connecting two processes makes the two variables correspond to one process (as above), and connecting two channels makes them the same channel. The
earlier [[intro_example:chp_fifo|examples]] used channel connections to connect the output of one process to the input of another.
The two connected variables can be viewed as aliases, i.e. different ways to refer to the same process. ACT provides flexible syntax to support different ways to connect variables.