This might be a newbie question:
From the doc, it says that signals are part of the circuit while variables are similar to variables in other programming language. But for verifiable computation, I'd assume that the computations done on variables would also be verified and therefore be part of the circuit. In this sense, can I see signals as the interface of the template while the variables as the internal states? If so, what are the differences between internal signals and variables?
Or when should one use variable and when should one use signal?
I have the same questions for functions v.s. templates. Why do we need both instead of one? When should one use function and when should one use template?
My fundamental confusion is that I thought circom would produce a circuit encapsulating everything defined in the circom files. But the language defined two types of constructs (variable/function vs signal/template) with one being more restrictive than the other, and it cites "being part of the circuit" as the reason for signal/template to be more restrictive, making it sounds like variables/functions are not part of the circuit.
Thanks!