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.

Methods

add(current, value) → {List}

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.

Returns:

A reference to this associative map, allowing to chain add methods.

Type
List

erase(current, value) → {List}

Description:
  • Erases a symbol in the chained.

    • 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.

Returns:

A reference to this associative map, allowing to chain add methods.

Type
List

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 returnb.

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