List

List

new List()

Description:
  • Implements a macroscopic ersatz of a VSA chained list.

    • A chained list is created inserting current-value/next-value pairs of symbol.
    • It is implemented via Bundling and Binding, without using a C++ std::list.

    Extends: AssociativeMap, with all public methods available.

Methods

add(current, value)

Description:
  • Inserts a new symbol to the container.

    • Adding twice the same current-value/next-value pair corresponds to adding their belief level tau.
Parameters:
Name Type Description
current uint

The symbol after which the value is inserted.

value Symbol

The symbol value to insert.

erase(current, value)

Description:
  • Erases a symbol in the chained.

    • Without key argument erases all keys, it is a synonym for clear().
    • Adding twice the same current-value/next-value pair corresponds to adding their belief level tau.
Parameters:
Name Type Description
current Symbol

The symbol after which the value is inserted.

value Symbol

The symbol value to insert.

getNext(current) → {Symbol}

Description:
  • Returns the next element after a given symbol.

    • It is a simple synonym of the get() function.
Parameters:
Name Type Description
current uint

The symbol current value next which element is to return.

Returns:

value A reference to the stored value, available until program end.

Type
Symbol

getPrevious(current) → {Symbol}

Description:
  • Returns the previous element before a given symbol.

    • This function is of O(list size), for this implementation, since it must scan the list.
Parameters:
Name Type Description
current uint

The symbol current value next which element is to returnb.

Returns:

value A reference to the stored value, available until program end.

Type
Symbol