Resources for modelling data structures with set notation

35 Views Asked by At

I am working on my thesis and have a software program defined in terms of data structures, i.e. nested structs with fields and methods etc. I would like to formalize things such as

For a graph $G = (V, E)$, $V$ being the set of vertices and $E$ being the set of edges between vertices, each vertex $v_i$ has a corresponding string and a set of lists. Each element of these lists is the index of one of its children in the graph.

I have formalized the string part as a mapping $str(v_i) \in \Sigma^+$, where $\Sigma$ is an alphabet. but I have issues with the set of lists. Specifically I want each of the lists to have a corresponding identifier, which need not be an ordered index. However the lists are ordered and may only contain indices of children of $v_i$. I have tried to formalize it like this:

let $I_V$ and $I_P$ be index sets of all vertices and all lists (partitions) respectively. $$ parts(v_i) = \{ p_x \}_{x \in I_P }\\ pattern(p_k) = (v_x)_{x \in I_V } $$ but this doesn't capture the fact that every $v_x$ in every $pattern(p_k)$ in $parts(v_i)$ has to be a child of $v_i$ in the graph $G$.

Maybe someone can help me specifically but to make the question more general, maybe there are resources giving examples for describing complex nested data structures using math notation?