pub struct SetDomain<E: Ord + Clone>(_);
Expand description

Implements a set domain.

Implementations

Create a constant address from concrete address a

Create a footprint address from access path ap

Create a footprint address read from formal temp_index

Return true if self is a constant

Return true if self consists only of statically known constants

Substitute all occurences of Footprint(ap) in self by resolving the accesss path ap in sub_map

Return a new abstract address by adding the offset mid::sid<types> to each element of self

Return a new abstract address by adding the offset offset to each element of self

Produce a new version of self with prefix prepended to each footprint value

return an iterator over the footprint paths in self

Return an iterator over the concrete addresses in self

Return a wrapper of self that implements Display using env

Implements set difference, which is not following standard APIs for rust sets in OrdSet

Implements is_disjoint which is not available in OrdSet

Methods from Deref<Target = OrdSet<E>>

Test whether a set is empty.

Time: O(1)

Examples
assert!(
  !ordset![1, 2, 3].is_empty()
);
assert!(
  OrdSet::<i32>::new().is_empty()
);

Get the size of a set.

Time: O(1)

Examples
assert_eq!(3, ordset![1, 2, 3].len());

Test whether two sets refer to the same content in memory.

This is true if the two sides are references to the same set, or if the two sets refer to the same root node.

This would return true if you’re comparing a set to itself, or if you’re comparing a set to a fresh clone of itself.

Time: O(1)

Discard all elements from the set.

This leaves you with an empty set, and all elements that were previously inside it are dropped.

Time: O(n)

Examples
let mut set = ordset![1, 2, 3];
set.clear();
assert!(set.is_empty());

Get the smallest value in a set.

If the set is empty, returns None.

Time: O(log n)

Get the largest value in a set.

If the set is empty, returns None.

Time: O(log n)

Create an iterator over the contents of the set.

Create an iterator over a range inside the set.

Get an iterator over the differences between this set and another, i.e. the set of entries to add or remove to this set in order to make it equal to the other set.

This function will avoid visiting nodes which are shared between the two sets, meaning that even very large sets can be compared quickly if most of their structure is shared.

Time: O(n) (where n is the number of unique elements across the two sets, minus the number of elements belonging to nodes shared between them)

Test if a value is part of a set.

Time: O(log n)

Examples
let mut set = ordset!{1, 2, 3};
assert!(set.contains(&1));
assert!(!set.contains(&4));

Get the closest smaller value in a set to a given value.

If the set contains the given value, this is returned. Otherwise, the closest value in the set smaller than the given value is returned. If the smallest value in the set is larger than the given value, None is returned.

Examples
let set = ordset![1, 3, 5, 7, 9];
assert_eq!(Some(&5), set.get_prev(&6));

Get the closest larger value in a set to a given value.

If the set contains the given value, this is returned. Otherwise, the closest value in the set larger than the given value is returned. If the largest value in the set is smaller than the given value, None is returned.

Examples
let set = ordset![1, 3, 5, 7, 9];
assert_eq!(Some(&5), set.get_next(&4));

Test whether a set is a subset of another set, meaning that all values in our set must also be in the other set.

Time: O(n log m) where m is the size of the other set

Test whether a set is a proper subset of another set, meaning that all values in our set must also be in the other set. A proper subset must also be smaller than the other set.

Time: O(n log m) where m is the size of the other set

Insert a value into a set.

Time: O(log n)

Examples
let mut set = ordset!{};
set.insert(123);
set.insert(456);
assert_eq!(
  set,
  ordset![123, 456]
);

Remove a value from a set.

Time: O(log n)

Remove the smallest value from a set.

Time: O(log n)

Remove the largest value from a set.

Time: O(log n)

Construct a new set from the current set with the given value added.

Time: O(log n)

Examples
let set = ordset![456];
assert_eq!(
  set.update(123),
  ordset![123, 456]
);

Construct a new set with the given value removed if it’s in the set.

Time: O(log n)

Remove the smallest value from a set, and return that value as well as the updated set.

Time: O(log n)

Remove the largest value from a set, and return that value as well as the updated set.

Time: O(log n)

Construct a set with only the n smallest values from a given set.

Time: O(n)

Construct a set with the n smallest values removed from a given set.

Time: O(n)

Trait Implementations

Converts this type into a shared reference of the (usually inferred) input type.

Immutably borrows from an owned value. Read more

Returns a copy of the value. Read more

Performs copy-assignment from source. Read more

Formats the value using the given formatter. Read more

Returns the “default value” for a type. Read more

The resulting type after dereferencing.

Dereferences the value.

Mutably dereferences the value.

Converts to this type from the input type.

Converts to this type from the input type.

Creates a value from an iterator. Read more

The type of the elements being iterated over.

Which kind of iterator are we turning this into?

Creates an iterator from a value. Read more

This method returns an Ordering between self and other. Read more

Compares and returns the maximum of two values. Read more

Compares and returns the minimum of two values. Read more

Restrict a value to a certain interval. Read more

This method tests for self and other values to be equal, and is used by ==. Read more

This method tests for !=. The default implementation is almost always sufficient, and should not be overridden without very good reason. Read more

This method returns an ordering between self and other values if one exists. Read more

This method tests less than (for self and other) and is used by the < operator. Read more

This method tests less than or equal to (for self and other) and is used by the <= operator. Read more

This method tests greater than (for self and other) and is used by the > operator. Read more

This method tests greater than or equal to (for self and other) and is used by the >= operator. Read more

Auto Trait Implementations

Blanket Implementations

Gets the TypeId of self. Read more

Immutably borrows from an owned value. Read more

Mutably borrows from an owned value. Read more

Compare self to key and return true if they are equal.

Returns the argument unchanged.

Calls U::from(self).

That is, this conversion is whatever the implementation of From<T> for U chooses to do.

Should always be Self

The resulting type after obtaining ownership.

Creates owned data from borrowed data, usually by cloning. Read more

Uses borrowed data to replace owned data, usually by cloning. Read more

The type returned in the event of a conversion error.

Performs the conversion.

The type returned in the event of a conversion error.

Performs the conversion.