Miscellaneous definitions concerning weak sequences #
These definitions, as well as those in Mathlib/Data/WSeq/Productive.lean, are not needed for the
development of Mathlib/Data/Seq/Parallel.lean.
Get the length of s (if it is finite and completes in finite time).
Instances For
A weak sequence is finite if toList s terminates. Equivalently,
it is a finite number of think and cons applied to nil.
- out : s.toList.Terminates
Instances
Get the list corresponding to a finite weak sequence.
Instances For
Replace the nth element of s with a.
Instances For
Remove the nth element of s.
Instances For
Map the elements of s over f, removing any values that yield none.
Instances For
Select the elements of s that satisfy p.
Instances For
Get the first element of s satisfying p.
Instances For
Zip two weak sequences into a single sequence of pairs
Instances For
Get the list of indexes of elements of s satisfying p
Instances For
Get the index of the first element of s satisfying p
Instances For
Get the index of the first occurrence of a in s
Instances For
Get the indexes of occurrences of a in s
Instances For
union s1 s2 is a weak sequence which interleaves s1 and s2 in
some order (nondeterministically).
Instances For
Returns true if s is nil and false if s has an element
Instances For
Calculate one step of computation
Instances For
Get the first n elements of a weak sequence
Instances For
Split the sequence at position n into a finite initial segment
and the weak sequence tail
Instances For
Returns true if any element of s satisfies p
Instances For
Returns true if every element of s satisfies p
Instances For
Apply a function to the elements of the sequence to produce a sequence
of partial results. (There is no scanr because this would require
working from the end of the sequence, which may not exist.)
Instances For
Get the weak sequence of initial segments of the input sequence
Instances For
Like take, but does not wait for a result. Calculates n steps of
computation and returns the sequence computed so far