I am trying to model some set operations which are only well-defined if one is a subset of the other. The way the sets are constructed, I'll have a series of constraints of the form $x \subseteq y$, including the two sets in question and some other ones too. I won't know anything about individual element membership, so need to operate at the set level, and would like to be able to determine whether $a \subseteq b$ is implied by the given constraints.
This sounds like the sort of thing that's been studied before (e.g., for SMT solvers or linear programming), but I can't seem to hit the right keywords to search on. Are there known efficient representations/algorithms for this sort of problem?
Here's what I've roughly thought of doing:
type Set = Symbol;
type Bound = {kind: 'upper' | 'lower', arg: Set};
type Constraint = {kind: 'lt' | 'gt', arg: Bound};
const max = (b1: Bound, b2: Bound): Bound => ...;
const min = (b1: Bound, b2: Bound): Bound => ...;
const checker = (a: Constraint, b: Constraint): bool => ...;
My idea would be to build two Constraint
s, one for $a$ and one for $b$. $a$ would have a lt
constraint and $b$ would have a gt
constraint. I suspect Bound
forms an algebra with max
and min
, which would allow me to put two Bound
s in quasi-canonical form and break things down that way.
I'm not certain this will work, so before I spend several hours fleshing this out figured I'd ask if this had been solved before!