Notation for a function/process that generates a set with unknown members?

35 Views Asked by At

Aside from some basic training in middle and high school many years ago, I'm new to sets (coming from the world of programming) and I'm trying to model a debugging process. I'm specifically trying to find a good way to describe the following idea:

The combined set of weighted failures corresponding to each weighted failure site in the set of weighted failure sites.

"Failure sites" are areas of my code that are failing.

"Weighted failure sites" are integers, each of which represents the subjective importance (high, medium or low) of its corresponding failure site.

"Failures" are something that can be identified through a non-mathematical, manual checking process where one looks at a "failure site" and identifies failures. Each failure site has one or more failures.

"Weighted failures" are numbers, each of which represents some kind of subjective judgement of the difficulty of understanding its corresponding failure (hard or easy).

So far, my best attempt to model these concepts looks like this:

$\text{Weighted high-importance failure sites: }S_h = \{4s_h \mid s_h \in \text{???}\}$

$\text{Weighted medium-importance failure sites: }S_m = \{2s_m \mid s_m \in \text{???}\}$

$\text{Weighted low-importance failure sites: }S_l = \{s_l \mid s_l \in \text{???}\}$

$\text{Weighted failure sites (all): } S = S_h \bigcup S_m \bigcup S_l$

$\text{Weighted hard failures: } F_h(s) = \{ f_h \mid f_h \in \text{???} \}$

$\text{Weighted easy failures: } F_e(s) = \{ 0.5f_e \mid f_e \in \text{???} \}$

$\text{Weighted failures (all): } \forall S; s \in S; F = (F_h(s_1) \bigcup F_e(s_1)) \bigcup (F_h(s_2) \bigcup F_e(s_2)) \bigcup \dots (F_h(s_n) \bigcup F_e(s_n))$

How can I finish my model and/or simplify it? Does any of this make sense? Am I totally off?

UPDATE: I've discovered that 1) sets can't have duplicate elements and 2) that multisets are a thing. Here's a better way, I think, to represent weighted failure sites:

$S_{hw} = \{\!\{ 4^{|S_h|} \}\!\}$

$S_{mw} = \{\!\{ 2^{|S_m|} \}\!\}$

$S_{lw} = \{\!\{ 1^{|S_l|} \}\!\}$

$S_w = S_{hw} \uplus S_{mw} \uplus S_{lw}$

Where $S_h$, $S_m$ and $S_l$ are sets or multisets (doesn't matter here, as long as there is one element per failure site) representing the failure sites and $S_w$ is a multiset of all the weighted failure sites (or rather, failure site weights). I guess it's OK to just leave those undefined since their use is merely symbolic...?

But now, I don't know how to generate multisets of weighted failures from my weighted failure sites multiset.