1.1 programs as functions

Ultimately, a program maps an input (it may be empty) to some output. Therefore a program is a function, but note that not all functions can be 'sensible' programs (i.e. they're not computable in finite amounts of time), and not all programs can be 'total' functions (i.e. they cannot take in arbitrary input and have a well defined output for all of them). Similarly, we say functions/programs are equal if their input/output pairs are the same (even if they take different times to run).