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).
Equations
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.
Equations
Instances For
Replace the nth element of s with a.
Equations
Instances For
Remove the nth element of s.
Equations
Instances For
Map the elements of s over f, removing any values that yield none.
Equations
Instances For
Select the elements of s that satisfy p.
Equations
Instances For
Get the first element of s satisfying p.
Equations
Instances For
Zip two weak sequences into a single sequence of pairs
Equations
Instances For
Get the list of indexes of elements of s satisfying p
Equations
Instances For
Get the index of the first element of s satisfying p
Equations
Instances For
Get the index of the first occurrence of a in s
Equations
Instances For
Get the indexes of occurrences of a in s
Equations
Instances For
union s1 s2 is a weak sequence which interleaves s1 and s2 in
some order (nondeterministically).
Equations
Instances For
Returns true if s is nil and false if s has an element
Equations
Instances For
Calculate one step of computation
Equations
Instances For
Get the first n elements of a weak sequence
Equations
Instances For
Split the sequence at position n into a finite initial segment
and the weak sequence tail
Equations
Instances For
Returns true if any element of s satisfies p
Equations
Instances For
Returns true if every element of s satisfies p
Equations
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.)
Equations
Instances For
Get the weak sequence of initial segments of the input sequence
Equations
Instances For
Like take, but does not wait for a result. Calculates n steps of
computation and returns the sequence computed so far