Worklist

class Worklist<K : Any, N : Any, V>

A worklist. Essentially, it stores mappings of nodes to the states which are available there and determines which nodes have to be analyzed.

Constructors

Link copied to clipboard
constructor(globalState: IdentityHashMap<K, State<N, V>> = IdentityHashMap<K, State<N, V>>())
constructor()

Properties

Link copied to clipboard

A mapping of nodes to the state which is currently available there.

Functions

Link copied to clipboard
fun hasAlreadySeen(currentNode: K): Boolean

Checks if currentNode has already been visited before.

Link copied to clipboard

Determines if there are no more elements to analyze

Link copied to clipboard

Determines if there are still elements to analyze

Link copied to clipboard
fun mop(): State<N, V>?

Computes the meet over paths for all the states in globalState.

Link copied to clipboard
fun pop(): Pair<K, State<N, V>>

Removes a Node from the worklist and returns the Node together with its State

Link copied to clipboard
fun push(newNode: K, state: State<N, V>): Boolean

Pushes newNode and the state to the worklist or updates the currently available entry for the node. Returns true if there was a change which means that the node has to be analyzed. If it returns false, the newNode wasn't added to the worklist as the state didn't change.

Link copied to clipboard
fun update(newNode: K, state: State<N, V>): Boolean

Adds newNode and the state to the globalState (i.e., computes the State.lub of the current state there and state). Returns true if there was an update.