set/element-of
===============================================================================

%% Membership inclusion test (element in set)

1. Usage
-------------------------------------------------------------------------------

```mech:disabled
R := set/element-of(x, S)
R := x ∈ S
```

2. Description
-------------------------------------------------------------------------------

Determines whether an element `x` is a **member** of set `S`.  
This function returns a boolean value indicating whether `x` exists within the set.

It wraps Rust's `IndexSet` membership check, returning true if the element is found.

3. Input
-------------------------------------------------------------------------------

Arguments:
- x : T — the element being tested for membership.
- S : set of T — the set to test against.

Element type constraints:
- `T` must be hashable and comparable for equality (`Eq` + `Hash` in Rust).
- Common scalar kinds: integers, strings, symbols, booleans.

4. Output
-------------------------------------------------------------------------------

Result:
- R : boolean — true if `x` is an element of `S`, otherwise false.

5. Examples
-------------------------------------------------------------------------------

(5.1) True — element is in the set

```mech:ex1
x := "b"
S := {"a", "b", "c"}
R := set/element-of(x, S)
```

(5.2) False — element not in the set

```mech:ex2
x := 5
S := {1, 2, 3, 4}
R := x ∈ S
```

(5.3) Symbols or strings

```mech:ex3
x := pear
S := {apple, pear, banana}
R := set/element-of(x, S)
```

6. Details
-------------------------------------------------------------------------------

Set semantics:
- The set treats elements as unique based on hash and equality.
- Duplicates are ignored in the set.

Relation logic:
- Returns true if the element exists in the set.

Symbolic shorthand:
- `x ∈ S` is equivalent to `set/element-of(x, S)`.

Performance:
- Average O(1) time per lookup using hashing.

Determinism:
- Results are deterministic across runs and platforms.

7. Errors
-------------------------------------------------------------------------------

- Incorrect number of arguments (expects two).
- Unsupported element type (not hashable or comparable).
- Type mismatch between `x` and elements of `S`.
