Function length of stack x
get the length of stack x
Format:
length of stack x
Input:
Output:
Properties that reference this function:
Conditional properties that reference this function:
if the following are true:
- Expression Stack at time t = [ [ ], [ [ Python list elements, ys ], rest ] ]
- Value Stack at time t = [ values, [ next_level, other_levels ] ]
then Value Stack at time (t + 1) = [ [ Python reference (length of stack (Python Object Store at time t)), next_level ], other_levels ]
(link)if the following are true:
- Value Stack at time t = [ [ Python reference idx, [ ] ], [ next_level, other_levels ] ]
- Expression Stack at time t = [ [ ], [ [ function call with name: "len" and arguments: args, ys ], rest ] ]
- the element at index idx of stack (Python Object Store at time t) = Python list entries
then Value Stack at time (t + 1) = [ [ length of stack entries, next_level ], other_levels ]
(link)if the following are true:
- Expression Stack at time t = [ [ ], [ [ Python dictionary entries, ys ], rest ] ]
- Value Stack at time t = [ values, [ next_level, other_levels ] ]
then Value Stack at time (t + 1) = [ [ Python reference (length of stack (Python Object Store at time t)), next_level ], other_levels ]
(link)if the following are true:
- Expression Stack at time t = [ [ ], [ [ Python constructor with name: class_name and arguments: args, ys ], rest ] ]
- Function Variables Map at time t = [ ]
- Parameters List at time t = [ self, p_rest ]
then Function Variables Map at time (t + 1) = [ entry self: (Python reference (length of stack (Python Object Store at time t))), [ ] ]
(link)if the following are true:
- expression state at time t = "call_function_begin"
- Value Stack at time t = [ values, stack ]
- the expression at time t = Python list elements
then Return Value at time (t + 1) = Python reference (length of stack (Python Object Store at time t))
(link)if the following are true:
- expression state at time t = "call_function_begin"
- Value Stack at time t = [ [ Python reference idx, [ ] ], stack ]
- the expression at time t = function call with name: "len" and arguments: args
- the element at index idx of stack (Python Object Store at time t) = Python list entries
then Return Value at time (t + 1) = length of stack entries
(link)if the following are true:
- expression state at time t = "call_function_begin"
- Value Stack at time t = [ values, stack ]
- the expression at time t = Python dictionary elements
then Return Value at time (t + 1) = Python reference (length of stack (Python Object Store at time t))
(link)if the following are true:
- expression state at time t = "call_build_args"
- the expression at time t = Python constructor with name: class_name and arguments: args
- Function Variables Map at time t = [ ]
- Parameters List at time t = [ self, p_rest ]
then Function Variables Map at time (t + 1) = [ entry self: (Python reference (length of stack (Python Object Store at time t))), [ ] ]
(link)if (length of stack xs) % 2 = 0, then length of xs is even
(link)if (length of stack xs) % 2 = 1, then length of xs is odd
(link)if the following are true:
- the element at index src of stack towers = src_tower
- get subtowersrc_tower = sub_tower
- length of sub_tower is even
then towers of hanoi towers = towers of hanoi top disks towers
(link)if the following are true:
- the element at index src of stack towers = src_tower
- get subtowersrc_tower = sub_tower
- length of sub_tower is odd
then towers of hanoi towers = towers of hanoi top disks towers
(link)if the following are true:
- val < a
- the element at index i of stack tree = node (a, (-1), right)
then output of the bst_insert function where input tree is tree, value is val and index is i = result of storing (node (a, (length of stack tree), right)) at index i of stack (result of appending (node (val, (-1), (-1))) to tree)
(link)if the following are true:
- val > a
- the element at index i of stack tree = node (a, left, (-1))
then output of the bst_insert function where input tree is tree, value is val and index is i = result of storing (node (a, left, (length of stack tree))) at index i of stack (result of appending (node (val, (-1), (-1))) to tree)
(link)if the following are true:
- ((length of stack tree) - 1) - index = back_i
- the element at index back_i of stack tree = node (value, cs)
then children of the node at backwards index index of tree tree in graph graph = output of the find_neighbors function where the input graph is graph, node is value, and children are [ ]
(link)if the following are true:
- ((length of stack tree) - 1) - index = back_i
- the element at index back_i of stack tree = node (value, cs)
- elements of numbers that are not in tree tree = new_elements
- result of storing (node (value, new_elements)) at index back_i of stack tree = updated
then result of adding numbers to tree tree as children of the node at backwards index index = result of pushing values new_elements to tree updated
(link)if i = (length of stack tree) - 1, then output of the spanning_tree function where the input graph is graph, backwards index is i, and the spanning tree is tree = tree
(link)if the following are true:
- ((length of stack tree) - 1) - index = back_i
- the element at index back_i of stack tree = node (value, distance, previous)
then children of the node at backwards index index of tree tree in graph graph = output of the find_neighbors function where the input graph is graph, node is value, and children are [ ]
(link)if the following are true:
- ((length of stack tree) - 1) - index = back_i
- the element at index back_i of stack tree = node (value, distance, previous)
- result of splitting pairs into nodes that exist in the tree tree and new nodes = pair (exists, new)
- result of updating nodes exists in tree tree with parent index index and parent distance distance = updated
then result of adding or updating children pairs of the node at backwards index index in tree tree = result of pushing nodes new into tree updated where parent is index and parent distance is distance
(link)if i = length of stack tree, then output of the shortest_path function where the input graph is graph, backwards index is i, and tree is tree = tree
(link)
Comments
Please log in to add comments