set/not-element-of

Usage

Description

Input

Output

Examples

True — element is not in the set

False — element is in the set

Symbols or strings

Details

Errors

set/not-element-of

Membership exclusion test (element not in set)

Usage

R:=set/not-element-of(x, S)R:=xS

Description

Determines whether an element x is not a member of set S.

This function returns a boolean value indicating whether x is absent from the set.

It wraps Rust’s IndexSet membership check and returns the negated result.

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.

Output

Result:

  • R : boolean — true if x is not an element of S, otherwise false.

Examples

True — element is not in the set

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

False — element is in the set

x:=5S:={1, 2, 3, 4}R:=xS

Symbols or strings

x:=appleS:={banana, pear, grape}R:=set/not-element-of(x, S)

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 does not exist in the set.

Symbolic shorthand:

  • x ∉ S is equivalent to set/not_element_of(x, S).

Performance:

  • Average O(1) time per lookup using hashing.

Determinism:

  • Results are deterministic across runs and platforms.

Errors

  • Incorrect number of arguments (expects two).

  • Unsupported element type (not hashable or comparable).

  • Type mismatch between x and elements of S.