First, I'm mostly experienced with Math, which I hope won't be too inconvenient.
I saw Operational Calculus on Programming Spaces by Sajovic and Vuk, which seemed very interesting to me (for a "short summary" of the paper, the Wikipedia article on Automatic Differentiation may be helpful). I had a few questions about how they defined their "memory space of the program". The relevant section is below:
We will model computer programs as maps on a vector space. If we only focus on the real valued variables (of type
float
ordouble
), the state of the virtual memory can be seen as a high dimensional vector. A set of all the possible states of the program’s memory, can be modeled by a finite dimensional real vector space $\mathcal{V} \equiv \mathbb{R}^n$. We will call $\mathcal{V}$ the memory space of the program. The effect of a computer program on its memory space $\mathcal{V}$, can be described by a map $$P : \mathcal{V} \to \mathcal{V}$$ A programming space is a space of maps $\mathcal{V} \to \mathcal{V}$ that can be implemented as a program in specific programming language.
I understand how $\mathcal{V}$ should be some finite object - I don't understand why this should specifically be a vector space. One analogy that may be useful for this is the following. $C(\mathbb{R})$ denotes the set of all continuous functions $f:\mathbb{R}\to\mathbb{R}$. While continuous functions themselves aren't linear, we can define addition of continuous functions and scalar multiplication of continuous functions in a linear way by defining: $$(f+g)(x) \stackrel{def}{=} f(x) + g(x)$$ $$k\cdot f(x) \stackrel{def}{=} (kf(x))$$ Something similar to this undoubtedly works for programs on $\mathcal{V}$ - for a given state $s$, define $p_1 + p_2$ evaluated on $s$ as $p_1(s) + p_2(s)$. While this (likely) leaves us with a Banach space, I'm unsure if it's the correct interpretation.
This would give us that the sum of two programs $p_1,p_2$ applied to some state $s$ is just $p_1(s) + p_2(s)$. So, looking at a single component of $p_1(s) + p_2(s)$, we have that the action of $p_1 + p_2$, as a program, is just the sum of the individual actions of $p_1$ and $p_2$ on the initial state. This seems like an odd interpretation for me - for whatever reason it'd seem much more natural to have the way to combine programs to be function composition, but this would lead to problems like $+$ not being commutative, and scalar multiplication being harder to define.
In this paper, what's the correct interpretation of addition here? The "usual" addition seems to lead to the correct mathematical construct, but I'm having a hard time understanding what the "program sum" is supposed to model in real life.
Edit: This Reddit Post seems to have some commentary on it which may help others.