Skip to content

Set logic

Relational classifications in Minyu operate on sets of rows, not on individual values.
Set logic defines how multiple result sets are combined, filtered, or compared to produce a final outcome.

In Minyu, all set operations work on row identity. Attribute values are not compared directly.

What a set is

A set is a collection of row identities (id) originating from the same table.

  • Each row can appear at most once in a set.
  • Sets do not preserve order.
  • All operations are type-safe: sets must originate from the same table.

Sets are produced by relation traversal, classification evaluation, and filtering.

Core properties

All set operations in Minyu share these properties:

  • No duplicates
    Membership is based on row identity. A row cannot appear more than once.

  • Type safety
    Set operations are only valid between sets from the same table.
    Cross-table combinations are not allowed.

These constraints are enforced by the system.

Union (A ∪ B)

The union contains all rows that exist in either set A or set B.

  • Minyu meaning: rows that match Classification A OR Classification B.
Set Result
Set A {1, 2, 3, 4}
Set B {3, 4, 5, 6}
Union (A ∪ B) {1, 2, 3, 4, 5, 6}

If a row appears in both sets, it still appears only once in the result.

Intersection (A ∩ B)

The intersection contains only rows that exist in both sets.

  • Minyu meaning: rows that match Classification A AND Classification B.
Set Result
Set A {1, 2, 3, 4}
Set B {3, 4, 5, 6}
Intersection (A ∩ B) {3, 4}

If either input set is empty, the result is empty.

Difference (A − B and B − A)

The difference contains rows that exist in one set but not the other.

  • Minyu meaning: exclusion-based filtering.

This operation is directional.

Operation Result
Difference (A − B) {1, 2}
Difference (B − A) {5, 6}

Reversing the operands changes the result.

Identity selection (single-set selection)

Identity selection is not a mathematical set operation.

It represents selecting exactly one set without combining it with another.
This exists because Minyu allows selecting a single region in the set-selection model.

  • Minyu meaning: pass-through of one classification result set without modification.
Selection Result
All in A {1, 2, 3, 4}
All in B {3, 4, 5, 6}

No filtering or comparison occurs.

Symmetric difference (A Δ B)

The symmetric difference contains rows that exist in either A or B, but not both.

  • Minyu meaning: exclusive classification matching.
Operation Result
Symmetric difference (A Δ B) {1, 2, 5, 6}

Rows present in both sets are excluded.

Usage in Minyu

Set operations are used when combining results from:

  • relational classifications
  • logical classifications
  • multi-path evaluations

They determine how multiple classification result sets are merged into a final evaluated set.
Evaluation always operates on row identity, ensuring stable behavior even when attribute values change.